Changeset 2216


Ignore:
Timestamp:
Feb 22, 2019 7:01:42 PM (20 months ago)
Author:
tkr
Message:

Removing non-sensical test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp

    r2208 r2216  
    40034003    OSIUNITTEST_ASSERT_ERROR(eq(objCoef[7], -1.0), {}, *exmip1Si, "problem read correctly: objective coefficients");
    40044004
    4005     // make sure col solution is something reasonable,
    4006     // that is between upper and lower bounds
    4007     const double *cs = exmip1Si->getColSolution();
    4008     int c;
    4009     bool okColSol = true;
    4010     //double inf = exmip1Si->getInfinity();
    4011     for (c = 0; c < nc; c++) {
    4012       // if colSol is not between column bounds then
    4013       // colSol is unreasonable.
    4014       if (!(cl[c] <= cs[c] && cs[c] <= cu[c]))
    4015         okColSol = false;
    4016       // if at least one column bound is not infinite,
    4017       // then it is unreasonable to have colSol as infinite
    4018       // FIXME: temporarily commented out pending some group thought on the
    4019       //        semantics of this test. -- lh, 03.04.29 --
    4020       // if ( (cl[c]<inf || cu[c]<inf) && cs[c]>=inf ) okColSol=false;
    4021     }
    4022     OSIUNITTEST_ASSERT_WARNING(okColSol, {}, *exmip1Si, "column solution before solve");
    4023 
    4024     // Test that objective value is correct
    4025     // FIXME: the test checks the primal value. vol fails this, because vol
    4026     // considers the dual value to be the objective value
    4027     /*
    4028        gurobi fails this, because gurobi does not have a solution before a
    4029        model is solved (which makes sense, I (SV) think)
    4030 
    4031        Eh, well, you can argue the point, but the current OSI spec requires
    4032        that there be a valid solution from the point that the problem is
    4033        loaded. Nothing says it needs to be a good solution. -- lh, 100826 --
    4034     */
    4035     double correctObjValue = CoinPackedVector(nc, objCoef).dotProduct(cs);
    4036     double siObjValue = exmip1Si->getObjValue();
    4037     OSIUNITTEST_ASSERT_SEVERITY_EXPECTED(eq(correctObjValue, siObjValue), {}, *exmip1Si, "solution value before solve", TestOutcome::WARNING, solverName == "Vol");
    40384005  }
    40394006
     
    41424109    OSIUNITTEST_ASSERT_ERROR(eq(ru[4], 15.), {}, solverName, "problem cloned: rows upper bounds");
    41434110
    4144     const double *objCoef = exmip1Si->getObjCoefficients();
     4111    const double *objCoef = si2->getObjCoefficients();
    41454112    OSIUNITTEST_ASSERT_ERROR(eq(objCoef[0], 1.0), {}, solverName, "problem cloned: objective coefficients");
    41464113    OSIUNITTEST_ASSERT_ERROR(eq(objCoef[1], 0.0), {}, solverName, "problem cloned: objective coefficients");
     
    41514118    OSIUNITTEST_ASSERT_ERROR(eq(objCoef[6], 0.0), {}, solverName, "problem cloned: objective coefficients");
    41524119    OSIUNITTEST_ASSERT_ERROR(eq(objCoef[7], -1.0), {}, solverName, "problem cloned: objective coefficients");
    4153 
    4154     // make sure col solution is something reasonable,
    4155     // that is between upper and lower bounds
    4156     const double *cs = exmip1Si->getColSolution();
    4157     int c;
    4158     bool okColSol = true;
    4159     //double inf = exmip1Si->getInfinity();
    4160     for (c = 0; c < nc; c++) {
    4161       // if colSol is not between column bounds then
    4162       // colSol is unreasonable.
    4163       if (!(cl[c] <= cs[c] && cs[c] <= cu[c]))
    4164         okColSol = false;
    4165       // if at least one column bound is not infinite,
    4166       // then it is unreasonable to have colSol as infinite
    4167       // FIXME: temporarily commented out pending some group thought on the
    4168       //        semantics of this test. -- lh, 03.04.29 --
    4169       // if ( (cl[c]<inf || cu[c]<inf) && cs[c]>=inf ) okColSol=false;
    4170     }
    4171     OSIUNITTEST_ASSERT_WARNING(okColSol, {}, solverName, "problem cloned: column solution before solve");
    41724120
    41734121    // Test getting of objective offset
Note: See TracChangeset for help on using the changeset viewer.