ApproxGLPK(const ArithVariables& v, TreeLog& l, ApproximateStatistics& s);
~ApproxGLPK();
- LinResult solveRelaxation();
+ LinResult solveRelaxation() override;
Solution extractRelaxation() const override { return extractSolution(false); }
ArithRatPairVec heuristicOptCoeffs() const override;
Solution extractMIP() const override { return extractSolution(true); }
void setOptCoeffs(const ArithRatPairVec& ref) override;
std::vector<const CutInfo*> getValidCuts(const NodeLog& nodes) override;
- ArithVar getBranchVar(const NodeLog& con) const;
+ ArithVar getBranchVar(const NodeLog& con) const override;
static void printGLPKStatus(int status, std::ostream& out);
bool replaceSlacksOnCuts();
bool loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound& tmp);
-
- double sumInfeasibilities(bool mip) const{
+ double sumInfeasibilities(bool mip) const override
+ {
return sumInfeasibilities(mip? d_mipProb : d_realProb);
}
double sumInfeasibilities(glp_prob* prob, bool mip) const;
namespace theory {
namespace arith {
+#ifdef CVC4_ASSERTIONS
static CutInfoKlass fromGlpkClass(int klass){
switch(klass){
case GLP_RF_GMI: return GmiCutKlass;
default: return UnknownKlass;
}
}
+#endif
-ApproxGLPK::ApproxGLPK(const ArithVariables& v, TreeLog& l, ApproximateStatistics& s)
- : ApproximateSimplex(v, l, s)
- , d_inputProb(NULL)
- , d_realProb(NULL)
- , d_mipProb(NULL)
- , d_solvedRelaxation(false)
- , d_solvedMIP(false)
+ApproxGLPK::ApproxGLPK(const ArithVariables& var,
+ TreeLog& l,
+ ApproximateStatistics& s)
+ : ApproximateSimplex(var, l, s),
+ d_inputProb(nullptr),
+ d_realProb(nullptr),
+ d_mipProb(nullptr),
+ d_solvedRelaxation(false),
+ d_solvedMIP(false)
{
static int instance = 0;
++instance;
for(DenseMap<int>::const_iterator i = d_rowIndices.begin(), i_end = d_rowIndices.end(); i != i_end; ++i){
ArithVar v = *i;
Polynomial p = Polynomial::parsePolynomial(d_vars.asNode(v));
- for(Polynomial::iterator i = p.begin(), end = p.end(); i != end; ++i){
+ for (Polynomial::iterator j = p.begin(), end = p.end(); j != end; ++j)
+ {
++numEntries;
}
}
Polynomial p = Polynomial::parsePolynomial(d_vars.asNode(v));
- for(Polynomial::iterator i = p.begin(), end = p.end(); i != end; ++i){
-
- const Monomial& mono = *i;
+ for (Polynomial::iterator j = p.begin(), end = p.end(); j != end; ++j)
+ {
+ const Monomial& mono = *j;
const Constant& constant = mono.getConstant();
const VarList& variable = mono.getVarList();
double rowLengthReq = (maxRowLength * .9);
- if(guessARowCandidate){
- for(DenseMap<uint32_t>::const_iterator i = d_rowCandidates.begin(), iend =d_rowCandidates.end(); i != iend; ++i ){
- ArithVar r = *i;
+ if (guessARowCandidate)
+ {
+ for (ArithVar r : d_rowCandidates)
+ {
uint32_t len = d_rowCandidates[r];
int dir = guessDir(r);
// Attempt columns
bool guessAColCandidate = maxCount >= 4;
- if(guessAColCandidate){
- for(DenseMap<BoundCounts>::const_iterator i = d_colCandidates.begin(), iend = d_colCandidates.end(); i != iend; ++i ){
- ArithVar c = *i;
+ if (guessAColCandidate)
+ {
+ for (ArithVar c : d_colCandidates)
+ {
BoundCounts bc = d_colCandidates[c];
int dir = guessDir(c);
}
}
-
return ret;
}
Matrix<Rational> A;
A.increaseSizeTo(d_vars.getNumberOfVariables());
std::vector< std::pair<RowIndex, ArithVar> > rows;
- set<ArithVar>::const_iterator i, iend;
// load the rows for auxiliary variables into A
- for(i=onrow.begin(), iend=onrow.end(); i!=iend; ++i){
- ArithVar v = *i;
+ for (ArithVar v : onrow)
+ {
if(d_vars.isAuxiliary(v)){
Assert(d_vars.hasNode(v));