Changeset 96


Ignore:
Timestamp:
Aug 4, 2008 11:35:48 PM (11 years ago)
Author:
bjarni
Message:

Moved optimalValue into SolveProblem? routines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CoinMP/test/unitTest.cpp

    r73 r96  
    3737
    3838
    39 void RunTestProblem(char *problemName, double optimalValue, double objectConst,
     39void RunTestProblem(char *problemName, double optimalValue,
    4040          int colCount, int rowCount, int nonZeroCount, int rangeCount, int objectSense,
    41       double *objectCoeffs, double *rhsValues, double *rangeValues, char *columnType,
     41      double *objectCoeffs, double objectConst, double *rhsValues, double *rangeValues, char *columnType,
    4242          char *rowType, int *matrixBegin, int *matrixCount, int *matrixIndex, double *matrixValues,
    4343          double *lowerBounds, double *upperBounds, double *initValues, char **colNames, char **rowNames)
     
    7272*************************************************************************/
    7373
    74 void SolveCoinTestProblem(double optimalValue)
     74void SolveProblemCoinTest(void)
    7575{
    7676        char *problemName = "CoinTest";
     
    9999    char * rowNames[5] = { "r1", "r2", "r3", "r4", "r5" } ;
    100100   
    101         RunTestProblem(problemName, optimalValue, objectConst,
     101        double optimalValue = 1428729.2857143;
     102
     103        RunTestProblem(problemName, optimalValue,
    102104          colCount, rowCount, nonZeroCount, rangeCount,
    103       objectSense, objectCoeffs, rhsValues, NULL,
     105      objectSense, objectCoeffs, objectConst, rhsValues, NULL,
    104106          NULL, rowType, matrixBegin, matrixCount, matrixIndex,
    105107          matrixValues, lowerBounds, upperBounds, initValues,
     
    108110
    109111
    110 void SolveBakeryProblem(double optimalValue)
     112void SolveProblemBakery(void)
    111113{
    112114        char *problemName = "Bakery";
     
    133135    char * rowNames[3] = { "c1", "c2", "c3" } ;
    134136   
    135         RunTestProblem(problemName, optimalValue, objectConst,
     137        double optimalValue = 506.66666667;
     138
     139        RunTestProblem(problemName, optimalValue,
    136140          colCount, rowCount, nonZeroCount, rangeCount, objectSense,
    137       objectCoeffs, rhsValues, NULL, NULL, rowType,
     141      objectCoeffs, objectConst, rhsValues, NULL, NULL, rowType,
    138142      matrixBegin, matrixCount, matrixIndex, matrixValues,
    139143          lowerBounds, upperBounds, NULL, colNames, rowNames);
     
    141145
    142146
    143 void SolveAfiroProblem(double optimalValue)
     147void SolveProblemAfiro(void)
    144148{
    145149        char *probname = "Afiro";
     
    198202                "X43", "X45", "X46", "X47", "X48", "X49", "X50", "X51"};
    199203
    200         RunTestProblem(probname, optimalValue, objconst,
    201           ncol, nrow, nels, nrng, objsens, dobj, drhs, NULL,
     204        double optimalValue = -464.753142857;
     205
     206        RunTestProblem(probname, optimalValue,
     207          ncol, nrow, nels, nrng, objsens, dobj, objconst, drhs, NULL,
    202208      NULL, rtyp, mbeg, mcnt, midx, mval, dclo, dcup,
    203209          NULL, colname, rowname);
     
    205211
    206212
    207 void SolveP0033Problem(double optimalValue)
     213void SolveProblemP0033(void)
    208214{
    209215        char *probname = "P0033";
     
    266272                'B', 'B', 'B', 'B', 'B', 'B' };
    267273
    268         RunTestProblem(probname, optimalValue, objconst,
    269           ncol, nrow, nels, nrng, objsens, dobj, drhs, NULL,
     274        double optimalValue = 3089.0;
     275
     276        RunTestProblem(probname, optimalValue,
     277          ncol, nrow, nels, nrng, objsens, dobj, objconst, drhs, NULL,
    270278      ctyp, rtyp, mbeg, mcnt, midx, mval, dclo, dcup,
    271279          NULL, colname, rowname);
     
    273281
    274282
    275 void SolveExmip1Problem(double optimalValue)
     283void SolveProblemExmip1(void)
    276284{
    277285        char *probname = "Exmip1";
     
    303311        char ctyp[8] = { 'C', 'C', 'B', 'B', 'C', 'C', 'C', 'C'};
    304312
    305         RunTestProblem(probname, optimalValue, objconst,
    306           ncol, nrow, nels, nrng, objsens, dobj, drhs, drng,
     313        double optimalValue = 3.23684210526;
     314
     315        RunTestProblem(probname, optimalValue,
     316          ncol, nrow, nels, nrng, objsens, dobj, objconst, drhs, drng,
    307317      ctyp, rtyp, mbeg, mcnt, midx, mval, dclo, dcup,
    308318          NULL, colname, rowname);
     
    314324{
    315325    CoinInitSolver("");
    316         SolveCoinTestProblem(1428729.2857143);
    317         SolveBakeryProblem(506.66666667);
    318         SolveAfiroProblem(-464.753142857);
    319         SolveP0033Problem(3089.0);
    320         SolveExmip1Problem(3.23684210526);
     326        SolveProblemCoinTest();
     327        SolveProblemBakery();
     328        SolveProblemAfiro();
     329        SolveProblemP0033();
     330        SolveProblemExmip1();
    321331        fprintf(stdout, "All tests completed successfully\n" );
    322332    CoinFreeSolver();
Note: See TracChangeset for help on using the changeset viewer.