X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2FASTAnalyses%2FEncoding%2Fsubgraph.h;h=88a129129a8c3de1e8b005469727ba1656218e61;hp=4f19eb147bbccaa6ec4903080231a8f069139c3f;hb=457ee300c637089a095444672c9d4628faf901e7;hpb=5f41b2b031712790013f031bedcf815c668b5768 diff --git a/src/ASTAnalyses/Encoding/subgraph.h b/src/ASTAnalyses/Encoding/subgraph.h index 4f19eb1..88a1291 100644 --- a/src/ASTAnalyses/Encoding/subgraph.h +++ b/src/ASTAnalyses/Encoding/subgraph.h @@ -5,8 +5,8 @@ #include "graphstructs.h" class NodeValuePair { - public: - NodeValuePair(EncodingNode *n, uint64_t val) : node(n), value(val) {} +public: + NodeValuePair(EncodingNode *n, uint64_t val) : node(n), value(val) {} EncodingNode *node; uint64_t value; }; @@ -17,8 +17,8 @@ typedef Hashset HashsetEncodingValue; typedef SetIterator SetIteratorEncodingValue; class EncodingValue { - public: - EncodingValue(uint64_t _val) : value(_val), encoding(0), inComparison(false), assigned(false) {} +public: + EncodingValue(uint64_t _val) : value(_val), encoding(0), inComparison(false), assigned(false) {} void merge(EncodingValue *value); uint64_t value; uint encoding; @@ -35,14 +35,17 @@ bool equalsNodeValuePair(NodeValuePair *nvp1, NodeValuePair *nvp2); typedef Hashtable NVPMap; class EncodingSubGraph { - public: +public: EncodingSubGraph(); + ~EncodingSubGraph(); void addNode(EncodingNode *n); - SetIteratorEncodingNode * nodeIterator(); + SetIteratorEncodingNode *nodeIterator(); void encode(); - + uint getEncoding(EncodingNode *n, uint64_t val); + uint getEncodingMaxVal(EncodingNode *n) { return maxEncodingVal;} + CMEMALLOC; - private: +private: uint estimateNewSize(EncodingNode *n); uint estimateNewSize(EncodingSubGraph *sg); void traverseValue(EncodingNode *node, uint64_t value); @@ -60,6 +63,7 @@ class EncodingSubGraph { NVPMap map; uint encodingSize; uint numElements; + uint maxEncodingVal; friend class EncodingGraph; };