protected:
void addEntry(RowIndex row, ArithVar col, const T& coeff){
+ Debug("tableau") << "addEntry(" << row << "," << col <<"," << coeff << ")" << std::endl;
+
Assert(coeff != 0);
+ Assert(row < d_rows.size());
+ Assert(col < d_columns.size());
EntryID newId = d_entries.newEntry();
Entry& newEntry = d_entries.get(newId);
Assert(newEntry.getCoefficient() != 0);
- Debug("tableau") << "addEntry(" << row << "," << col <<"," << coeff << ")" << std::endl;
++d_entriesInUse;
entry.markBlank();
d_entries.freeEntry(id);
-}
+ }
public:
for(; varsIter != varsEnd; ++coeffIter, ++varsIter){
const Rational& coeff = *coeffIter;
ArithVar var_i = *varsIter;
+ Assert(var_i < getNumColumns());
addEntry(ridx, var_i, coeff);
}
d_diosolver(c),
d_pbSubstitutions(u),
d_restartsCounter(0),
- d_rowHasBeenAdded(false),
+ d_tableauSizeHasBeenModified(false),
d_tableauResetDensity(1.6),
d_tableauResetPeriod(10),
d_conflicts(c),
}
if(polyNode.getKind() == PLUS){
- d_rowHasBeenAdded = true;
+ d_tableauSizeHasBeenModified = true;
vector<ArithVar> variables;
vector<Rational> coefficients;
d_arithvarNodeMap.setArithVar(x,varX);
d_tableau.increaseSize();
+ d_tableauSizeHasBeenModified = true;
d_constraintDatabase.addVariable(varX);
++d_restartsCounter;
- static const bool debugResetPolicy = false;
-
uint32_t currSize = d_tableau.size();
uint32_t copySize = d_smallTableauCopy.size();
- if(debugResetPolicy){
- cout << "curr " << currSize << " copy " << copySize << endl;
- }
- if(d_rowHasBeenAdded){
- if(debugResetPolicy){
- cout << "row has been added must copy " << d_restartsCounter << endl;
- }
- d_smallTableauCopy = d_tableau;
- d_rowHasBeenAdded = false;
- }
+ Debug("arith::reset") << "curr " << currSize << " copy " << copySize << endl;
+ Debug("arith::reset") << "tableauSizeHasBeenModified " << d_tableauSizeHasBeenModified << endl;
- if(!d_rowHasBeenAdded && d_restartsCounter >= RESET_START){
+ if(d_tableauSizeHasBeenModified){
+ Debug("arith::reset") << "row has been added must copy " << d_restartsCounter << endl;
+ d_smallTableauCopy = d_tableau;
+ d_tableauSizeHasBeenModified = false;
+ }else if( d_restartsCounter >= RESET_START){
if(copySize >= currSize * 1.1 ){
++d_statistics.d_smallerSetToCurr;
d_smallTableauCopy = d_tableau;
* If d >= s_TABLEAU_RESET_DENSITY * d_initialDensity, the tableau
* is set to d_initialTableau.
*/
- bool d_rowHasBeenAdded;
+ bool d_tableauSizeHasBeenModified;
double d_tableauResetDensity;
uint32_t d_tableauResetPeriod;
static const uint32_t s_TABLEAU_RESET_INCREMENT = 5;