From 138a1efd26b08cc0f55f497509433528b9e3cab3 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 17 Aug 2018 14:42:44 -0700 Subject: [PATCH] revert Hamed's changes to encoding graph --- src/ASTAnalyses/Encoding/encodinggraph.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ASTAnalyses/Encoding/encodinggraph.cc b/src/ASTAnalyses/Encoding/encodinggraph.cc index 6bd28e2..ebb8a96 100644 --- a/src/ASTAnalyses/Encoding/encodinggraph.cc +++ b/src/ASTAnalyses/Encoding/encodinggraph.cc @@ -78,8 +78,7 @@ void EncodingGraph::encode() { } else if (encodetype == BINARYINDEX) { EncodingSubGraph *subgraph = graphMap.get(n); DEBUG("graphMap.get(subgraph=%p, n=%p)\n", subgraph, n); - if (subgraph == NULL){ - encoding->encodingArrayInitialization(); + if (subgraph == NULL) { continue; } uint encodingSize = subgraph->getEncodingMaxVal(n) + 1; @@ -168,9 +167,9 @@ void EncodingGraph::mergeNodes(EncodingNode *first, EncodingNode *second) { delete graph2; } else { ASSERT(graph1 != NULL && graph2 == NULL); - graph1->addNode(first); + graph1->addNode(second); DEBUG("graphMap.put(first=%p, graph1=%p)\n", first, graph1); - graphMap.put(first, graph1); + graphMap.put(second, graph1); } } @@ -292,7 +291,7 @@ void EncodingGraph::decideEdges() { (newSize - rightSize) * rightGraph->numElements; } double conversionfactor = 0.5; - if (leftGraph != rightGraph && (totalCost * conversionfactor) < eeValue) { + if ((totalCost * conversionfactor) < eeValue) { //add the edge mergeNodes(left, right); } -- 2.34.1