summaryrefslogtreecommitdiff
path: root/src/theory/arith/tableau.h
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2011-03-07 19:10:16 +0000
committerTim King <taking@cs.nyu.edu>2011-03-07 19:10:16 +0000
commit423dafb4b4a34d0c99274a7619b062997342179a (patch)
tree409ac25256c64fb90c0e867f611ce495107bc940 /src/theory/arith/tableau.h
parentc01318241e5082478090cba15ff71f82b3f6da6a (diff)
Merges branches/arithmetic/tableau-reset into the trunk. The tableau is now heuristically reset to its initial state during restarts.
Diffstat (limited to 'src/theory/arith/tableau.h')
-rw-r--r--src/theory/arith/tableau.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/theory/arith/tableau.h b/src/theory/arith/tableau.h
index dad4bb2f5..31f7cfa5a 100644
--- a/src/theory/arith/tableau.h
+++ b/src/theory/arith/tableau.h
@@ -156,7 +156,37 @@ public:
ReducedRowVector* removeRow(ArithVar basic);
+ /**
+ * Let s = numNonZeroEntries(), n = getNumRows(), and m = d_columnMatrix.size().
+ * When n >= 1,
+ * densityMeasure() := s / (n*m - n**2 + n)
+ * := s / (n *(m - n + 1))
+ * When n = 0, densityMeasure() := 1
+ */
+ double densityMeasure() const{
+ Assert(numNonZeroEntriesByRow() == numNonZeroEntries());
+ uint32_t n = getNumRows();
+ if(n == 0){
+ return 1.0;
+ }else {
+ uint32_t s = numNonZeroEntries();
+ uint32_t m = d_columnMatrix.size();
+ uint32_t divisor = (n *(m - n + 1));
+
+ Assert(n >= 1);
+ Assert(m >= n);
+ Assert(divisor > 0);
+ Assert(divisor >= s);
+
+ return (double(s)) / divisor;
+ }
+ }
+
private:
+
+ uint32_t numNonZeroEntries() const;
+ uint32_t numNonZeroEntriesByRow() const;
+
/** Copies the datastructures in tab to this.*/
void internalCopy(const Tableau& tab);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback