Changeset 364


Ignore:
Timestamp:
Nov 16, 2009 11:36:25 AM (10 years ago)
Author:
bjarni
Message:

Add new GetOption? routines for OptionID and fix some older ones

Location:
trunk/CoinMP/src
Files:
3 edited

Legend:

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

    r363 r364  
    195195                return SOLV_CALL_FAILED;
    196196        }
     197        return SOLV_CALL_SUCCESS;
    197198}
    198199
     
    334335        return SOLV_CALL_SUCCESS;
    335336}
    336 
    337337
    338338
     
    772772}
    773773
     774SOLVAPI int    SOLVCALL CoinLocateOptionID(HPROB hProb, int OptionID)
     775{
     776        PCOIN pCoin = (PCOIN)hProb;
     777
     778        return coinLocateOptionID(pCoin->pSolver, OptionID);
     779}
     780
     781
     782SOLVAPI int    SOLVCALL CoinLocateOptionName(HPROB hProb, char* OptionName)
     783{
     784        PCOIN pCoin = (PCOIN)hProb;
     785
     786        return coinLocateOptionName(pCoin->pSolver, OptionName);
     787}
     788
     789
     790
    774791SOLVAPI int SOLVCALL CoinGetOptionID(HPROB hProb, int OptionNr)
    775792{
     
    777794
    778795        return coinGetOptionID(pCoin->pSolver, OptionNr);
    779 }
    780 
    781 SOLVAPI int    SOLVCALL CoinLocateOptionID(HPROB hProb, int OptionID)
    782 {
    783         PCOIN pCoin = (PCOIN)hProb;
    784 
    785         return coinLocateOptionID(pCoin->pSolver, OptionID);
    786796}
    787797
     
    800810
    801811
    802 
    803 SOLVAPI int SOLVCALL CoinGetOptionType(HPROB hProb, int OptionID)
    804 {
    805         PCOIN pCoin = (PCOIN)hProb;
    806 
    807         return coinGetOptionType(pCoin->pSolver, OptionID);
    808 }
    809 
    810 
    811 SOLVAPI int SOLVCALL CoinGetOptionGroup(HPROB hProb, int OptionID)
    812 {
    813         PCOIN pCoin = (PCOIN)hProb;
    814 
    815         return coinGetOptionGroup(pCoin->pSolver, OptionID);
    816 }
    817 
    818 
    819 SOLVAPI int    SOLVCALL CoinLocateOptionName(HPROB hProb, char* OptionName)
    820 {
    821         PCOIN pCoin = (PCOIN)hProb;
    822 
    823         return coinLocateOptionName(pCoin->pSolver, OptionName);
    824 }
    825 
    826 
    827 SOLVAPI const char* SOLVCALL CoinGetOptionName(HPROB hProb, int OptionNr)
    828 {
    829         PCOIN pCoin = (PCOIN)hProb;
    830         int optionID;
    831 
    832         optionID = coinGetOptionID(pCoin->pSolver, OptionNr);
    833         return coinGetOptionName(pCoin->pSolver, optionID);
    834 }
    835 
    836 
    837 SOLVAPI int SOLVCALL CoinGetOptionNameBuf(HPROB hProb, int OptionNr, char* OptionName, int buflen)
    838 {
    839         PCOIN pCoin = (PCOIN)hProb;
    840         int optionID;
    841 
    842         optionID = coinGetOptionID(pCoin->pSolver, OptionNr);
    843         return coinGetOptionNameBuf(pCoin->pSolver, optionID, OptionName, buflen);
    844 }
    845 
    846 
    847 SOLVAPI const char* SOLVCALL CoinGetOptionShortName(HPROB hProb, int OptionNr)
    848 {
    849         PCOIN pCoin = (PCOIN)hProb;
    850         int optionID;
    851 
    852         optionID = coinGetOptionID(pCoin->pSolver, OptionNr);
    853         return coinGetOptionShortName(pCoin->pSolver, optionID);
    854 }
    855 
    856 
    857 SOLVAPI int SOLVCALL CoinGetOptionShortNameBuf(HPROB hProb, int OptionNr, char* ShortName, int buflen)
    858 {
    859         PCOIN pCoin = (PCOIN)hProb;
    860         int optionID;
    861 
    862         optionID = coinGetOptionID(pCoin->pSolver, OptionNr);
    863         return coinGetOptionShortNameBuf(pCoin->pSolver, optionID, ShortName, buflen);
    864 }
    865 
    866 
    867812SOLVAPI int SOLVCALL CoinGetIntOptionMinMax(HPROB hProb, int OptionNr, int* MinValue, int* MaxValue)
    868813{
     
    889834
    890835
     836SOLVAPI int SOLVCALL CoinGetOptionNamesBuf(HPROB hProb, int OptionNr, char* OptionName,
     837                                                                                                char* ShortName, int buflen)
     838{
     839        PCOIN pCoin = (PCOIN)hProb;
     840        int optionID;
     841
     842        optionID = coinGetOptionID(pCoin->pSolver, OptionNr);
     843        if (OptionName) coinGetOptionNameBuf(pCoin->pSolver, optionID, OptionName, buflen);
     844        if (ShortName) coinGetOptionShortNameBuf(pCoin->pSolver, optionID, ShortName, buflen);
     845        return SOLV_CALL_SUCCESS;
     846}
     847
     848
     849
     850
     851
     852SOLVAPI int SOLVCALL CoinGetOptionGroup(HPROB hProb, int OptionID)
     853{
     854        PCOIN pCoin = (PCOIN)hProb;
     855
     856        return coinGetOptionGroup(pCoin->pSolver, OptionID);
     857}
     858
     859
     860SOLVAPI int SOLVCALL CoinGetOptionType(HPROB hProb, int OptionID)
     861{
     862        PCOIN pCoin = (PCOIN)hProb;
     863
     864        return coinGetOptionType(pCoin->pSolver, OptionID);
     865}
     866
     867
     868
     869
    891870SOLVAPI int    SOLVCALL CoinGetIntOptionDefaultValue(HPROB hProb, int OptionID)
    892871{
     
    935914
    936915        return coinGetRealOptionMaxValue(pCoin->pSolver, OptionID);
     916}
     917
     918
     919
     920
     921SOLVAPI const char* SOLVCALL CoinGetOptionName(HPROB hProb, int OptionID)
     922{
     923        PCOIN pCoin = (PCOIN)hProb;
     924
     925        return coinGetOptionName(pCoin->pSolver, OptionID);
     926}
     927
     928
     929SOLVAPI int SOLVCALL CoinGetOptionNameBuf(HPROB hProb, int OptionID, char* OptionName, int buflen)
     930{
     931        PCOIN pCoin = (PCOIN)hProb;
     932
     933        return coinGetOptionNameBuf(pCoin->pSolver, OptionID, OptionName, buflen);
     934}
     935
     936
     937SOLVAPI const char* SOLVCALL CoinGetOptionShortName(HPROB hProb, int OptionID)
     938{
     939        PCOIN pCoin = (PCOIN)hProb;
     940
     941        return coinGetOptionShortName(pCoin->pSolver, OptionID);
     942}
     943
     944
     945SOLVAPI int SOLVCALL CoinGetOptionShortNameBuf(HPROB hProb, int OptionID, char* ShortName, int buflen)
     946{
     947        PCOIN pCoin = (PCOIN)hProb;
     948
     949        return coinGetOptionShortNameBuf(pCoin->pSolver, OptionID, ShortName, buflen);
    937950}
    938951
     
    952965        PCOIN pCoin = (PCOIN)hProb;
    953966
    954 //      if (pCoin)
    955                 return coinGetIntOption(pCoin->pSolver, OptionID);
    956 //      else {
    957 //              return CbcGetIntOption(OptionID);
    958 //      }
     967        return coinGetIntOption(pCoin->pSolver, OptionID);
    959968}
    960969       
  • trunk/CoinMP/src/CoinMP.def

    r363 r364  
    5555        CoinCloseLogFile
    5656        CoinGetOptionCount
     57        CoinLocateOptionID
     58        CoinLocateOptionName
     59        CoinGetOptionID
    5760        CoinGetOptionInfo
     61        CoinGetIntOptionMinMax
     62        CoinGetRealOptionMinMax
     63        CoinGetOptionNamesBuf
     64        CoinGetOptionGroup
     65        CoinGetOptionType
     66        CoinGetIntOptionDefaultValue
     67        CoinGetIntOptionMinValue
     68        CoinGetIntOptionMaxValue
     69        CoinGetRealOptionDefaultValue
     70        CoinGetRealOptionMinValue
     71        CoinGetRealOptionMaxValue
    5872        CoinGetOptionName
    5973        CoinGetOptionNameBuf
    6074        CoinGetOptionShortName
    6175        CoinGetOptionShortNameBuf
    62         CoinGetIntOptionMinMax
    63         CoinGetRealOptionMinMax
    6476        CoinGetOptionChanged
    6577        CoinGetIntOption
  • trunk/CoinMP/src/CoinMP.h

    r363 r364  
    199199SOLVAPI int    SOLVCALL CoinCheckProblem(HPROB hProb);
    200200
    201 // Depreciated, use CoinLoadProblemBuf instead
     201// Depreciated, use CoinLoadNamesBuf instead
    202202//SOLVAPI int    SOLVCALL CoinSetLoadNamesType(HPROB hProb, int LoadNamesType);
    203203
     
    236236SOLVAPI int    SOLVCALL CoinGetSolutionBasis(HPROB hProb, int* ColStatus, double* RowStatus);
    237237
     238
     239
    238240SOLVAPI int    SOLVCALL CoinReadFile(HPROB hProb, int FileType, const char* ReadFilename);
    239241SOLVAPI int    SOLVCALL CoinWriteFile(HPROB hProb, int FileType, const char* WriteFilename);
     
    242244SOLVAPI int    SOLVCALL CoinCloseLogFile(HPROB hProb);
    243245
     246
     247
    244248SOLVAPI int    SOLVCALL CoinGetOptionCount(HPROB hProb);
     249SOLVAPI int    SOLVCALL CoinLocateOptionID(HPROB hProb, int OptionID);
     250SOLVAPI int    SOLVCALL CoinLocateOptionName(HPROB hProb, const char* OptionName);
     251
     252SOLVAPI int        SOLVCALL CoinGetOptionID(HPROB hProb, int OptionNr);
    245253SOLVAPI int    SOLVCALL CoinGetOptionInfo(HPROB hProb, int OptionNr, int* OptionID, int* GroupType, int* OptionType);
    246 
    247 SOLVAPI const char*  SOLVCALL CoinGetOptionName(HPROB hProb, int OptionNr);
    248 SOLVAPI int    SOLVCALL CoinGetOptionNameBuf(HPROB hProb, int OptionNr, char* OptionName, int buflen);
    249 
    250 SOLVAPI const char*  SOLVCALL CoinGetOptionShortName(HPROB hProb, int OptionNr);
    251 SOLVAPI int    SOLVCALL CoinGetOptionShortNameBuf(HPROB hProb, int OptionNr, char* ShortName, int buflen);
    252 
    253254SOLVAPI int    SOLVCALL CoinGetIntOptionMinMax(HPROB hProb, int OptionNr, int* MinValue, int* MaxValue);
    254255SOLVAPI int    SOLVCALL CoinGetRealOptionMinMax(HPROB hProb, int OptionNr, double* MinValue, double* MaxValue);
     256SOLVAPI int    SOLVCALL CoinGetOptionNamesBuf(HPROB hProb, int OptionNr, char* OptionName, char* ShortName, int buflen);
     257
     258
     259SOLVAPI int        SOLVCALL CoinGetOptionGroup(HPROB hProb, int OptionID);
     260SOLVAPI int    SOLVCALL CoinGetOptionType(HPROB hProb, int OptionID);
     261
     262SOLVAPI int    SOLVCALL CoinGetIntOptionDefaultValue(HPROB hProb, int OptionID);
     263SOLVAPI int    SOLVCALL CoinGetIntOptionMinValue(HPROB hProb, int OptionID);
     264SOLVAPI int    SOLVCALL CoinGetIntOptionMaxValue(HPROB hProb, int OptionID);
     265
     266SOLVAPI double SOLVCALL CoinGetRealOptionDefaultValue(HPROB hProb, int OptionID);
     267SOLVAPI double SOLVCALL CoinGetRealOptionMinValue(HPROB hProb, int OptionID);
     268SOLVAPI double SOLVCALL CoinGetRealOptionMaxValue(HPROB hProb, int OptionID);
     269
     270SOLVAPI const char*  SOLVCALL CoinGetOptionName(HPROB hProb, int OptionID);
     271SOLVAPI int    SOLVCALL CoinGetOptionNameBuf(HPROB hProb, int OptionID, char* OptionName, int buflen);
     272SOLVAPI const char*  SOLVCALL CoinGetOptionShortName(HPROB hProb, int OptionID);
     273SOLVAPI int    SOLVCALL CoinGetOptionShortNameBuf(HPROB hProb, int OptionID, char* ShortName, int buflen);
     274
    255275
    256276SOLVAPI int    SOLVCALL CoinGetOptionChanged(HPROB hProb, int OptionID);
     
    286306HPROB  (SOLVCALL *CoinCreateProblem)(const char* ProblemName);
    287307
     308int    (SOLVCALL *CoinLoadMatrix)(HPROB hProb,
     309                                int ColCount, int RowCount, int NZCount, int RangeCount,
     310                                int ObjectSense, double ObjectConst, double* ObjectCoeffs,
     311                                double* LowerBounds, double* UpperBounds, char* RowType,
     312                                double* RHSValues, double* RangeValues, int* MatrixBegin,
     313                                int* MatrixCount, int* MatrixIndex, double* MatrixValues);
     314
     315int    (SOLVCALL *CoinLoadNames)(HPROB hProb, char** ColNamesList,
     316                                char** RowNamesList, char* ObjectName);
     317
     318int    (SOLVCALL *CoinLoadNamesBuf)(HPROB hProb, char* ColNamesBuf,
     319                                char* RowNamesBuf, char* ObjectName);
     320
    288321int    (SOLVCALL *CoinLoadProblem)(HPROB hProb,
    289322                                                                   int ColCount, int RowCount, int NonZeroCount, int RangeCount,
     
    292325                                                                   double* RHSValues, double* RangeValues, int* MatrixBegin,
    293326                                                                   int* MatrixCount, int* MatrixIndex, double* MatrixValues,   
    294                                                                    char** ColNames, char** RowNames, char* objName);
     327                                                                   char** ColNamesList, char** RowNamesList, char* objName);
    295328
    296329int    (SOLVCALL *CoinLoadProblemBuf)(HPROB hProb,
     
    309342                                                                                                int* PriorValues, int* PriorBranch);
    310343
    311 int    (SOLVCALL *CoinLoadSemiCont)(HPROB hProb, int SemiCount, int* SemiIndex);
    312 
    313344int    (SOLVCALL *CoinLoadSos)(HPROB hProb, int SosCount, int SosNZCount,
    314345                                                                                 int* SosType, int* SosPrior, int* SosBegin,   
    315346                                                                                 int* SosIndex, double* SosRef);
     347
     348int    (SOLVCALL *CoinLoadSemiCont)(HPROB hProb, int SemiCount, int* SemiIndex);
    316349
    317350int    (SOLVCALL *CoinLoadQuadratic)(HPROB hProb, int* QuadBegin, int* QuadCount,
     
    329362//int    (SOLVCALL *CoinSetLoadNamesType)(HPROB hProb, int LoadNamesType);
    330363
    331 void   (SOLVCALL *CoinSetMsgLogCallback)(HPROB hProb, MSGLOGCALLBACK MsgLogCallback);
    332 void   (SOLVCALL *CoinSetIterCallback)(HPROB hProb, ITERCALLBACK IterCallback);
    333 void   (SOLVCALL *CoinSetMipNodeCallback)(HPROB hProb, MIPNODECALLBACK MipNodeCallback);
    334 
    335 int    (SOLVCALL *CoinOptimizeProblem)(HPROB hProb, int Method);
    336 
    337364const char*  (SOLVCALL *CoinGetProblemName)(HPROB hProb);
    338365int    (SOLVCALL *CoinGetProblemNameBuf)(HPROB hProb, char* ProblemName, int buflen);
     
    345372const char*  (SOLVCALL *CoinGetRowName)(HPROB hProb, int row);
    346373int    (SOLVCALL *CoinGetRowNameBuf)(HPROB hProb, int row, char* RowName, int buflen);
     374
     375void   (SOLVCALL *CoinSetMsgLogCallback)(HPROB hProb, MSGLOGCALLBACK MsgLogCallback);
     376void   (SOLVCALL *CoinSetIterCallback)(HPROB hProb, ITERCALLBACK IterCallback);
     377void   (SOLVCALL *CoinSetMipNodeCallback)(HPROB hProb, MIPNODECALLBACK MipNodeCallback);
     378
     379int    (SOLVCALL *CoinOptimizeProblem)(HPROB hProb, int Method);
    347380
    348381int    (SOLVCALL *CoinGetSolutionStatus)(HPROB hProb);
     
    362395int    (SOLVCALL *CoinGetSolutionBasis)(HPROB hProb, int* ColStatus, double* RowStatus);
    363396
     397
    364398void   (SOLVCALL *CoinReadFile)(HPROB hProb, int FileType, const char* ReadFilename);
    365399void   (SOLVCALL *CoinWriteFile)(HPROB hProb, int FileType, const char* WriteFilename);
     
    368402void   (SOLVCALL *CoinCloseLogFile)(HPROB hProb);
    369403
     404
    370405int    (SOLVCALL *CoinGetOptionCount)(HPROB hProb);
     406int    (SOLVCALL *CoinLocateOptionID)(HPROB hProb, int OptionID);
     407int    (SOLVCALL *CoinLocateOptionName)(HPROB hProb, const char* OptionName);
     408
     409int        (SOLVCALL *CoinGetOptionID)(HPROB hProb, int OptionNr);
    371410int    (SOLVCALL *CoinGetOptionInfo)(HPROB hProb, int OptionNr, int* OptionID, int* GroupType, int* OptionType);
    372 
    373 const char*  (SOLVCALL *CoinGetOptionName)(HPROB hProb, int OptionNr);
    374 int    (SOLVCALL *CoinGetOptionNameBuf)(HPROB hProb, int OptionNr, char* OptionName, int buflen);
    375 const char*  (SOLVCALL *CoinGetOptionShortName)(HPROB hProb, int OptionNr);
    376 int    (SOLVCALL *CoinGetOptionShortNameBuf)(HPROB hProb, int OptionNr, char* ShortName, int buflen);
    377 
    378411int    (SOLVCALL *CoinGetIntOptionMinMax)(HPROB hProb, int OptionNr, int* MinValue, int* MaxValue);
    379412int    (SOLVCALL *CoinGetRealOptionMinMax)(HPROB hProb, int OptionNr, double* MinValue, double* MaxValue);
     413int    (SOLVCALL *CoinGetOptionNames)(HPROB hProb, int OptionNr, char* OptionName, char* ShortName, int buflen);
     414
     415
     416int    (SOLVCALL *CoinGetOptionGroup)(HPROB hProb, int OptionID);
     417int    (SOLVCALL *CoinGetOptionType)(HPROB hProb, int OptionID);
     418
     419int    (SOLVCALL *CoinGetIntOptionDefaultValue)(HPROB hProb, int OptionID);
     420int    (SOLVCALL *CoinGetIntOptionMinValue)(HPROB hProb, int OptionID);
     421int    (SOLVCALL *CoinGetIntOptionMaxValue)(HPROB hProb, int OptionID);
     422
     423double (SOLVCALL *CoinGetRealOptionDefaultValue)(HPROB hProb, int OptionID);
     424double (SOLVCALL *CoinGetRealOptionMinValue)(HPROB hProb, int OptionID);
     425double (SOLVCALL *CoinGetRealOptionMaxValue)(HPROB hProb, int OptionID);
     426
     427const char*  (SOLVCALL *CoinGetOptionName)(HPROB hProb, int OptionID);
     428int    (SOLVCALL *CoinGetOptionNameBuf)(HPROB hProb, int OptionID, char* OptionName, int buflen);
     429const char*  (SOLVCALL *CoinGetOptionShortName)(HPROB hProb, int OptionID);
     430int    (SOLVCALL *CoinGetOptionShortNameBuf)(HPROB hProb, int OptionID, char* ShortName, int buflen);
     431
    380432
    381433int    (SOLVCALL *CoinGetOptionChanged)(HPROB hProb, int OptionID);
Note: See TracChangeset for help on using the changeset viewer.