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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/1.4/CoinMP/test/unitTest.cpp

    r328 r329  
    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) {
     97        /*if (LoadNamesType > 0) {
    9898                result = CoinSetLoadNamesType(hProb, LoadNamesType);
    99         }
     99        }*/
    100100        result = CoinLoadProblem(hProb, colCount, rowCount, nonZeroCount, rangeCount,
    101101                                        objectSense, objectConst, objectCoeffs, lowerBounds, upperBounds,
     
    110110        }
    111111        //result = CoinSetMsgLogCallback(hProb, &MsgLogCallback);
    112         if (!columnType)
     112        if (columnType == NULL)
    113113                result = CoinSetIterCallback(hProb, &IterCallback);
    114114        else {
     
    134134        char filename[260];
    135135   
    136         fprintf(stdout, "Solve Problem: %s\n", problemName);
     136        fprintf(stdout, "Solve Problem: %s (obj=%lg)\n", problemName, optimalValue);
    137137        hProb = CoinCreateProblem(problemName); 
    138138        result = CoinLoadProblemBuf(hProb, colCount, rowCount, nonZeroCount, rangeCount,
     
    148148        }
    149149        //result = CoinSetMsgLogCallback(hProb, &MsgLogCallback);
    150         if (!columnType)
     150        if (columnType == NULL)
    151151                result = CoinSetIterCallback(hProb, &IterCallback);
    152152        else {
     
    166166          double* lowerBounds, double* upperBounds, char* rowType, double* rhsValues, double* rangeValues,
    167167          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)
     168          char** rowNames, char* objectName, double* initValues, char* columnType, int sosCount,
     169          int sosNZCount, int* sosType, int* sosPrior, int* sosBegin, int* sosIndex, double* sosRef)
    170170{
    171171        HPROB hProb;
     
    173173        char filename[260];
    174174   
    175         fprintf(stdout, "Solve Problem: %s\n", problemName);
     175        fprintf(stdout, "Solve Problem: %s (obj=%lg)\n", problemName, optimalValue);
    176176        hProb = CoinCreateProblem(problemName);
    177177        result = CoinLoadProblem(hProb, colCount, rowCount, nonZeroCount, rangeCount,
     
    188188        }
    189189        //result = CoinSetMsgLogCallback(hProb, &MsgLogCallback);
    190         if (!columnType)
     190        if ((columnType == NULL) && (sosCount == 0))
    191191                result = CoinSetIterCallback(hProb, &IterCallback);
    192192        else {
     
    252252          lowerBounds, upperBounds, rowType, rhsValues, NULL,
    253253          matrixBegin, matrixCount, matrixIndex, matrixValues,
    254           colNames, rowNames, objectName, initValues, NULL, 0);
     254          colNames, rowNames, objectName, initValues, NULL);
    255255}
    256256
     
    292292          lowerBounds, upperBounds, rowType, rhsValues, NULL,
    293293          matrixBegin, matrixCount, matrixIndex, matrixValues,
    294           colNames, rowNames, objectName, NULL, NULL, 0);
     294          colNames, rowNames, objectName, NULL, NULL);
    295295}
    296296
     
    366366        RunTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    367367          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, NULL, mbeg,
    368           mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL, 0);
     368          mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL);
    369369}
    370370
     
    443443        RunTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    444444          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, NULL, mbeg,
    445           mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp, 0);
     445          mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp);
    446446}
    447447
     
    486486        RunTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    487487          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, drng, mbeg,
    488           mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp, 0);
     488          mcnt, midx, mval, colnames, rownames, objectname, NULL, ctyp);
    489489}
    490490
     
    532532        RunSosTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    533533          objsens, objconst, dobj, dclo, dcup, NULL, drlo, drup, mbeg,
    534           mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL, 0,
     534          mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL,
    535535          sosCount, sosNZCount, sosType, NULL, sosBegin, sosIndex, NULL);
    536536}
     
    577577        RunSosTestProblem(probname, optimalValue, ncol, nrow, nels, nrng,
    578578          objsens, objconst, dobj, dclo, dcup, rtyp, drhs, NULL, mbeg,
    579           mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL, 0,
     579          mcnt, midx, mval, colnames, rownames, objectname, NULL, NULL,
    580580          sosCount, sosNZCount, sosType, NULL, sosBegin, sosIndex, NULL);
    581581}
Note: See TracChangeset for help on using the changeset viewer.