Changeset 360


Ignore:
Timestamp:
Nov 16, 2009 7:39:00 AM (10 years ago)
Author:
bjarni
Message:

Move SemiLower? to CoinCbc? and name it storeLowerBound

Location:
trunk/CoinMP/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CoinMP/src/CoinCbc.cpp

    r356 r360  
    705705int CbcLoadAllSolverObjects(HCBC hCbc, PPROBLEM pProblem)
    706706{
     707        PCBC pCbc = (PCBC)hCbc;
    707708        int i, col;
    708709        int result;
    709         PCBC pCbc = (PCBC)hCbc;
     710        double* storeLowerBound;
    710711
    711712        if (pProblem->SemiCount > 0) {
    712                 memcpy(pProblem->SemiLower, pProblem->LowerBounds, pProblem->ColCount * sizeof(double));
     713                storeLowerBound = (double *)malloc(pProblem->ColCount * sizeof(double));
     714                if (!storeLowerBound) {
     715                        return CBC_CALL_FAILED;
     716                }
     717                memcpy(storeLowerBound, pProblem->LowerBounds, pProblem->ColCount * sizeof(double));
    713718                for (i = 0; i < pProblem->SemiCount; i++) {
    714719                        col = pProblem->SemiIndex[i];
     
    722727                                                        pProblem->RowLower, pProblem->RowUpper);
    723728        if (pProblem->SemiCount > 0) {
    724                 memcpy(pProblem->LowerBounds, pProblem->SemiLower, pProblem->ColCount * sizeof(double));
     729                memcpy(pProblem->LowerBounds, storeLowerBound, pProblem->ColCount * sizeof(double));
     730                free(storeLowerBound);
    725731        }
    726732        CbcCopyNamesList(hCbc, pProblem);
  • trunk/CoinMP/src/CoinMP.cpp

    r358 r360  
    406406        pProblem->SemiCount = SemiCount;
    407407        pProblem->SemiIndex = (int* )malloc(pProblem->SemiCount * sizeof(int));
    408         pProblem->SemiLower = (double *)malloc(pProblem->ColCount * sizeof(double));
    409         if (!pProblem->SemiIndex || !pProblem->SemiLower) {
     408        if (!pProblem->SemiIndex) {
    410409                return SOLV_CALL_FAILED;
    411410        }
  • trunk/CoinMP/src/CoinProblem.c

    r350 r360  
    125125
    126126        if (pProblem->SemiIndex)        free(pProblem->SemiIndex);
    127         if (pProblem->SemiLower)        free(pProblem->SemiLower);
    128127
    129128        if (pProblem->SosType)          free(pProblem->SosType);
  • trunk/CoinMP/src/CoinProblem.h

    r350 r360  
    6565                                int SemiCount;
    6666                                int* SemiIndex;
    67                                 double* SemiLower;
    6867
    6968                                } PROBLEMINFO, *PPROBLEM;
Note: See TracChangeset for help on using the changeset viewer.