14 #ifndef LLVM_CODEGEN_PBQP_SOLUTION_H
15 #define LLVM_CODEGEN_PBQP_SOLUTION_H
30 typedef std::map<GraphBase::NodeId, unsigned> SelectionsMap;
31 SelectionsMap selections;
33 unsigned r0Reductions, r1Reductions, r2Reductions, rNReductions;
39 : r0Reductions(0), r1Reductions(0), r2Reductions(0), rNReductions(0) {}
43 unsigned numNodes()
const {
return selections.size(); }
77 selections[nodeId] = selection;
84 SelectionsMap::const_iterator sItr = selections.find(nodeId);
85 assert(sItr != selections.end() &&
"No selection for node.");
94 #endif // LLVM_CODEGEN_PBQP_SOLUTION_H
Represents a solution to a PBQP problem.
unsigned getSelection(GraphBase::NodeId nodeId) const
Get a node's selection.
unsigned numR1Reductions() const
Returns the number of R1 reductions applied to solve the problem.
void recordRN()
Records a reduction via the RN rule.
Solution()
Initialise an empty solution.
void recordR0()
Records a reduction via the R0 rule.
void recordR1()
Records a reduction via the R1 rule.
void recordR2()
Records a reduction via the R2 rule.
unsigned numR2Reductions() const
Returns the number of R2 reductions applied to solve the problem.
unsigned numNodes() const
Number of nodes for which selections have been made.
unsigned numR0Reductions() const
Returns the number of R0 reductions applied to solve the problem.
unsigned numRNReductions() const
Returns the number of RN reductions applied to solve the problem.
void setSelection(GraphBase::NodeId nodeId, unsigned selection)
Set the selection for a given node.