diff options
author | Tim King <taking@cs.nyu.edu> | 2012-12-05 21:45:12 +0000 |
---|---|---|
committer | Tim King <taking@cs.nyu.edu> | 2012-12-05 21:45:12 +0000 |
commit | bd0a6c39c56c6ad2bf12e7b9fd41db1772fed9cd (patch) | |
tree | 51f4bc5994a0716e6f4cfeed136360954ce505ac /src/theory/arith/matrix.cpp | |
parent | 356a8b6e5ea2622d0fef5cf209159caf08ba5297 (diff) |
Improved garbage collection for TheoryArith. The merges all of the code over from branches/arithmetic/converge except for the new code for simplex.
Diffstat (limited to 'src/theory/arith/matrix.cpp')
-rw-r--r-- | src/theory/arith/matrix.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/theory/arith/matrix.cpp b/src/theory/arith/matrix.cpp index 8e7fe7894..cd7a8a9aa 100644 --- a/src/theory/arith/matrix.cpp +++ b/src/theory/arith/matrix.cpp @@ -247,7 +247,7 @@ void Tableau::rowPivot(ArithVar basicOld, ArithVar basicNew){ d_basic2RowIndex.remove(basicOld); d_basic2RowIndex.set(basicNew, rid); - d_rowIndex2basic[rid] = basicNew; + d_rowIndex2basic.set(rid, basicNew); } // void Tableau::addEntry(ArithVar row, ArithVar col, const Rational& coeff){ @@ -397,10 +397,11 @@ void Tableau::addRow(ArithVar basic, RowIndex newRow = Matrix<Rational>::addRow(coefficients, variables); addEntry(newRow, basic, Rational(-1)); - Assert(d_rowIndex2basic.size() == newRow); + Assert(!d_basic2RowIndex.isKey(basic)); + Assert(!d_rowIndex2basic.isKey(newRow)); d_basic2RowIndex.set(basic, newRow); - d_rowIndex2basic.push_back(basic); + d_rowIndex2basic.set(newRow, basic); if(Debug.isOn("matrix")){ printMatrix(); } @@ -558,6 +559,15 @@ void ReducedRowVector::enqueueNonBasicVariablesAndCoefficients(std::vector< Arit // return newId; // } +void Tableau::removeBasicRow(ArithVar basic){ + RowIndex rid = basicToRowIndex(basic); + + removeRow(rid); + d_basic2RowIndex.remove(basic); + d_rowIndex2basic.remove(rid); + +} + }/* CVC4::theory::arith namespace */ }/* CVC4::theory namespace */ |