Changeset 330


Ignore:
Timestamp:
Nov 11, 2009 5:06:06 PM (10 years ago)
Author:
bjarni
Message:

Update unitTest.cpp by removing LoadNamesType?, add optimalValue in printout, and test for sosCount == 0 in trunk

File:
1 edited

Legend:

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

    r326 r330  
    8787          double* lowerBounds, double* upperBounds, char* rowType, double* rhsValues, double* rangeValues,
    8888          int* matrixBegin, int* matrixCount, int* matrixIndex, double* matrixValues, char** colNames,
    89           char** rowNames, char* objectName, double* initValues, char* columnType, int LoadNamesType)
     89          char** rowNames, char* objectName, double* initValues, char* columnType)
    9090{
    9191        HPROB hProb;
     
    9393        char filename[260];
    9494   
    95         fprintf(stdout, "Solve Problem: %s\n", problemName);
     95        fprintf(stdout, "Solve Problem: %s (obj=%lg)\n", problemName, optimalValue);
    9696        hProb = CoinCreateProblem(problemName); 
    97         if (LoadNamesType > 0) {
    98                 result = CoinSetLoadNamesType(hProb, LoadNamesType);
    99         }
    10097        result = CoinLoadProblem(hProb, colCount, rowCount, nonZeroCount, rangeCount,
    10198                                        objectSense, objectConst, objectCoeffs, lowerBounds, upperBounds,
     
    110107        }
    111108        //result = CoinSetMsgLogCallback(hProb, &MsgLogCallback);
    112         if (!columnType)
     109        if (columnType == NULL)
    113110                result = CoinSetIterCallback(hProb, &IterCallback);
    114111        else {
     
    134131        char filename[260];
    135132   
    136         fprintf(stdout, "Solve Problem: %s\n", problemName);
     133        fprintf(stdout, "Solve Problem: %s (obj=%lg)\n", problemName, optimalValue);
    137134        hProb = CoinCreateProblem(problemName); 
    138135        result = CoinLoadProblemBuf(hProb, colCount, rowCount, nonZeroCount, rangeCount,
     
    148145        }
    149146        //result = CoinSetMsgLogCallback(hProb, &MsgLogCallback);
    150         if (!columnType)
     147        if (columnType == NULL)
    151148                result = CoinSetIterCallback(hProb, &IterCallback);
    152149        else {
     
    166163          double* lowerBounds, double* upperBounds, char* rowType, double* rhsValues, double* rangeValues,
    167164          int* matrixBegin, int* matrixCount, int* matrixIndex, double* matrixValues, char** colNames,
    168           char** rowNames, char* objectName, double* initValues, char* columnType, int LoadNamesType,
    169           int sosCount, int sosNZCount, int* sosType, int* sosPrior, int* sosBegin, int* sosIndex, double* sosRef)
     165          char** rowNames, char* objectName, double* initValues, char* columnType, int sosCount,
     166          int sosNZCount, int* sosType, int* sosPrior, int* sosBegin, int* sosIndex, double* sosRef)
    170167{
    171168        HPROB hProb;
     
    173170        char filename[260];
    174171   
    175         fprintf(stdout, "Solve Problem: %s\n", problemName);
     172        fprintf(stdout, "Solve Problem: %s (obj=%lg)\n", problemName, optimalValue);
    176173        hProb = CoinCreateProblem(problemName);
    177174        result = CoinLoadProblem(hProb, colCount, rowCount, nonZeroCount, rangeCount,
     
    188185        }
    189186        //result = CoinSetMsgLogCallback(hProb, &MsgLogCallback);
    190         if (!columnType)
     187        if ((columnType == NULL) && (sosCount == 0))
    191188                result = CoinSetIterCallback(hProb, &IterCallback);
    192189        else {
     
    252249          lowerBounds, upperBounds, rowType, rhsValues, NULL,
    253250          matrixBegin, matrixCount, matrixIndex, matrixValues,
    254           colNames, rowNames, objectName, initValues, NULL, 0);
     251          colNames, rowNames, objectName, initValues, NULL);
    255252}
    256253
     
    292289          lowerBounds, upperBounds, rowType, rhsValues, NULL,
    293290          matrixBegin, matrixCount, matrixIndex, matrixValues,
    294           colNames, rowNames, objectName, NULL, NULL, 0);
     291          colNames, rowNames, objectName, NULL, NULL);
    295292}
    296293
     
    366363        RunTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    367364          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, NULL, mbeg,
    368           mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL, 0);
     365          mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL);
    369366}
    370367
     
    443440        RunTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    444441          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, NULL, mbeg,
    445           mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp, 0);
     442          mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp);
    446443}
    447444
     
    486483        RunTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    487484          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, drng, mbeg,
    488           mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp, 0);
     485          mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp);
    489486}
    490487
     
    532529        RunSosTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    533530          objsens, objconst, dobj, dclo, dcup, NULL, drlo, drup, mbeg,
    534           mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL, 0,
     531          mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL,
    535532          sosCount, sosNZCount, sosType, NULL, sosBegin, sosIndex, NULL);
    536533}
     
    577574        RunSosTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    578575          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, NULL, mbeg,
    579           mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL, 0,
     576          mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL,
    580577          sosCount, sosNZCount, sosType, NULL, sosBegin, sosIndex, NULL);
    581578}
Note: See TracChangeset for help on using the changeset viewer.