#ifndef LLVM_CODEGEN_PBQP_SOLUTION_H
#define LLVM_CODEGEN_PBQP_SOLUTION_H
#include "llvm/CodeGen/PBQP/Graph.h"
#include <cassert>
#include <map>
namespace llvm {
namespace PBQP {
class Solution {
private:
using SelectionsMap = std::map<GraphBase::NodeId, unsigned>;
SelectionsMap selections;
public:
Solution() = default;
void setSelection(GraphBase::NodeId nodeId, unsigned selection) {
selections[nodeId] = selection;
}
unsigned getSelection(GraphBase::NodeId nodeId) const {
SelectionsMap::const_iterator sItr = selections.find(nodeId);
assert(sItr != selections.end() && "No selection for node.");
return sItr->second;
}
};
} }
#endif