From: bdemsky Date: Fri, 17 Aug 2018 21:42:54 +0000 (-0700) Subject: Merge branch 'hamed' of ssh://plrg.eecs.uci.edu/home/git/constraint_compiler into... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b6548cbf08f020e5d28e3d816ca1b5cc0be5cb2a;hp=8948c9f91441673b06722feee277ad35838ef401;p=satune.git Merge branch 'hamed' of ssh://plrg.eecs.uci.edu/home/git/constraint_compiler into hamed --- 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); }