Re-apply r194300 with fixes for warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames
2013-11-09 03:08:56 +00:00
parent 95830221bd
commit a91d7b170b
7 changed files with 448 additions and 436 deletions

View File

@ -26,8 +26,7 @@ namespace PBQP {
class Solution {
private:
typedef std::map<Graph::ConstNodeItr, unsigned,
NodeItrComparator> SelectionsMap;
typedef std::map<Graph::NodeId, unsigned> SelectionsMap;
SelectionsMap selections;
unsigned r0Reductions, r1Reductions, r2Reductions, rNReductions;
@ -73,15 +72,15 @@ namespace PBQP {
/// \brief Set the selection for a given node.
/// @param nItr Node iterator.
/// @param selection Selection for nItr.
void setSelection(Graph::NodeItr nItr, unsigned selection) {
selections[nItr] = selection;
void setSelection(Graph::NodeId nodeId, unsigned selection) {
selections[nodeId] = selection;
}
/// \brief Get a node's selection.
/// @param nItr Node iterator.
/// @return The selection for nItr;
unsigned getSelection(Graph::ConstNodeItr nItr) const {
SelectionsMap::const_iterator sItr = selections.find(nItr);
unsigned getSelection(Graph::NodeId nodeId) const {
SelectionsMap::const_iterator sItr = selections.find(nodeId);
assert(sItr != selections.end() && "No selection for node.");
return sItr->second;
}