Ignore:
Timestamp:
Aug 23, 2014 12:31:35 PM (5 years ago)
Author:
tkr
Message:

Merging r20009 r2010 r2016 r2019 r2020 r2021 r2026 r2032 r2033 r2036 r2037 r2038 r2039 r2047 r2052 r2053 r2054 to move C interface into stable

Location:
stable/2.8/Cbc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/2.8/Cbc

  • stable/2.8/Cbc/src/Cbc_C_Interface.h

    r1902 r2059  
    1111/* include all defines and ugly stuff */
    1212#include "Coin_C_defines.h"
    13 
    14 /** This is a first "C" interface to Cbc.
    15     It is mostly similar to the "C" interface to Clp and
    16     was contributed by Bob Entriken.
     13#include <stddef.h>
     14
     15/*
     16 * Original verison contributed by Bob Entriken,
     17 * significantly updated by Miles Lubin.
    1718*/
     19
    1820
    1921#ifdef __cplusplus
     
    2224
    2325    /**@name Constructors and destructor
    24        These do not have an exact analogue in C++.
    25        The user does not need to know structure of Cbc_Model.
    26 
    27        For all functions outside this group there is an exact C++
    28        analogue created by taking the first parameter out, removing the Cbc_
    29        from name and applying the method to an object of type ClpSimplex.
    30     */
    31     /*@{*/
    32 
    33     /** Version */
    34     COINLIBAPI double COINLINKAGE Cbc_getVersion()
    35     ;
     26      This is a "C" interface to Cbc.
     27      The user does not need to know structure of Cbc_Model.
     28    */
     29    /*@{*/
     30
    3631    /** Default Cbc_Model constructor */
    3732    COINLIBAPI Cbc_Model * COINLINKAGE
    38     Cbc_newModel()
     33    Cbc_newModel(void)
    3934    ;
    4035    /** Cbc_Model Destructor */
     
    4237    Cbc_deleteModel(Cbc_Model * model)
    4338    ;
    44     /*@}*/
    45 
    46     /**@name Load model - loads some stuff and initializes others */
    47     /*@{*/
    48     /* Loads a problem (the constraints on the
     39    /** Current version of Cbc */
     40    COINLIBAPI const char* COINLINKAGE Cbc_getVersion(void)
     41    ;
     42    /*@}*/
     43
     44    /**@name Getting and setting model data
     45     Note that problem access and modification methods,
     46       such as getColLower and setColLower,
     47       are *not valid* after calling Cbc_solve().
     48       Therefore it is not recommended to reuse a Cbc_Model
     49       object for multiple solves. A workaround is to call Cbc_clone()
     50       before solving.
     51     * */
     52    /*@{*/
     53    /** Loads a problem (the constraints on the
    4954        rows are given by lower and upper bounds). If a pointer is NULL then the
    5055        following values are the default:
     
    5762        </ul>
    5863
    59      Just like the other loadProblem() method except that the matrix is
    60      given in a standard column major ordered format (without gaps).
     64     The constraint matrix is
     65     given in standard compressed sparse column (without gaps).
     66     <ul>
     67     <li> <code>start[i]</code> stores the starting index of the ith column
     68     <li> <code>index[k]</code> stores the row index of the kth nonzero element
     69     <li> <code>value[k]</code> stores the coefficient of the kth nonzero element
     70     </ul>
    6171    */
    6272    COINLIBAPI void COINLINKAGE
     
    7686    Cbc_writeMps(Cbc_Model * model, const char *filename)
    7787    ;
    78     /** Integer information */
    79     COINLIBAPI char * COINLINKAGE
    80     Cbc_integerInformation(Cbc_Model * model)
    81     ;
    82     /** Copy in integer information */
    83     COINLIBAPI void COINLINKAGE
    84     Cbc_copyInIntegerInformation(Cbc_Model * model, const char * information)
    85     ;
    86     /** Drop integer informations */
    87     COINLIBAPI void COINLINKAGE
    88     Cbc_deleteIntegerInformation(Cbc_Model * model)
    89     ;
    90     /** Resizes rim part of model  */
    91     COINLIBAPI void COINLINKAGE
    92     Cbc_resize (Cbc_Model * model, int newNumberRows, int newNumberColumns)
    93     ;
    94     /** Deletes rows */
    95     COINLIBAPI void COINLINKAGE
    96     Cbc_deleteRows(Cbc_Model * model, int number, const int * which)
    97     ;
    98     /** Add rows */
    99     COINLIBAPI void COINLINKAGE
    100     Cbc_addRows(Cbc_Model * model, const int number, const double * rowLower,
    101                 const double * rowUpper,
    102                 const int * rowStarts, const int * columns,
    103                 const double * elements)
    104     ;
    105 
    106     /** Deletes columns */
    107     COINLIBAPI void COINLINKAGE
    108     Cbc_deleteColumns(Cbc_Model * model, int number, const int * which)
    109     ;
    110     /** Add columns */
    111     COINLIBAPI void COINLINKAGE
    112     Cbc_addColumns(Cbc_Model * model, int number, const double * columnLower,
    113                    const double * columnUpper,
    114                    const double * objective,
    115                    const int * columnStarts, const int * rows,
    116                    const double * elements);
    117     /** Drops names - makes lengthnames 0 and names empty */
    118     COINLIBAPI void COINLINKAGE
    119     Cbc_dropNames(Cbc_Model * model)
    120     ;
    121     /** Copies in names */
    122     COINLIBAPI void COINLINKAGE
    123     Cbc_copyNames(Cbc_Model * model, const char * const * rowNamesIn,
    124                   const char * const * columnNamesIn)
    125     ;
    126 
    127     /*@}*/
    128     /**@name gets and sets - you will find some synonyms at the end of this file */
    129     /*@{*/
    130     /** Number of rows */
    131     COINLIBAPI int COINLINKAGE
    132     Cbc_numberRows(Cbc_Model * model)
    133     ;
    134     /** Number of columns */
    135     COINLIBAPI int COINLINKAGE
    136     Cbc_numberColumns(Cbc_Model * model)
    137     ;
    138     /** Primal tolerance to use */
    139     COINLIBAPI double COINLINKAGE
    140     Cbc_primalTolerance(Cbc_Model * model)
    141     ;
    142     COINLIBAPI void COINLINKAGE
    143     Cbc_setPrimalTolerance(Cbc_Model * model,  double value)
    144     ;
    145     /** Dual tolerance to use */
    146     COINLIBAPI double COINLINKAGE
    147     Cbc_dualTolerance(Cbc_Model * model)
    148     ;
    149     COINLIBAPI void COINLINKAGE
    150     Cbc_setDualTolerance(Cbc_Model * model,  double value)
    151     ;
    152     /* Integer tolerance to use */
    153     COINLIBAPI double COINLINKAGE
    154     Cbc_integerTolerance(Cbc_Model * model)
    155     ;
    156     COINLIBAPI void COINLINKAGE
    157     Cbc_setIntegerTolerance(Cbc_Model * model,  double value)
    158     ;
    159     /** Dual objective limit */
    160     COINLIBAPI double COINLINKAGE
    161     Cbc_dualObjectiveLimit(Cbc_Model * model)
    162     ;
    163     COINLIBAPI void COINLINKAGE
    164     Cbc_setDualObjectiveLimit(Cbc_Model * model, double value)
    165     ;
    166     /** Objective offset */
    167     COINLIBAPI double COINLINKAGE
    168     Cbc_objectiveOffset(Cbc_Model * model)
    169     ;
    170     COINLIBAPI void COINLINKAGE
    171     Cbc_setObjectiveOffset(Cbc_Model * model, double value)
     88    /** Provide an initial feasible solution to accelerate branch-and-bound
     89     Note that feasibility of the solution is *not* verified.
     90    */
     91    COINLIBAPI void COINLINKAGE
     92    Cbc_setInitialSolution(Cbc_Model *model, const double * sol)
    17293    ;
    17394    /** Fills in array with problem name  */
     
    180101    */
    181102    COINLIBAPI int COINLINKAGE
    182     Cbc_setProblemName(Cbc_Model * model, int maxNumberCharacters, char * array)
    183     ;
    184     /** Number of iterations */
    185     COINLIBAPI int COINLINKAGE
    186     Cbc_numberIterations(Cbc_Model * model)
    187     ;
    188     COINLIBAPI void COINLINKAGE
    189     Cbc_setNumberIterations(Cbc_Model * model, int numberIterations)
    190     ;
    191     /** Maximum number of iterations */
    192     COINLIBAPI int COINLINKAGE
    193     Cbc_maximumIterations(Cbc_Model * model)
    194     ;
    195     COINLIBAPI void COINLINKAGE
    196     Cbc_setMaximumIterations(Cbc_Model * model, int value)
    197     ;
    198     /** Maximum number of nodes */
    199     COINLIBAPI int COINLINKAGE
    200     Cbc_maxNumNode(Cbc_Model * model)
    201     ;
    202     COINLIBAPI void COINLINKAGE
    203     Cbc_setMaxNumNode(Cbc_Model * model, int value)
    204     ;
    205     /* Maximum number of solutions */
    206     COINLIBAPI int COINLINKAGE
    207     Cbc_maxNumSol(Cbc_Model * model)
    208     ;
    209     COINLIBAPI void COINLINKAGE
    210     Cbc_setMaxNumSol(Cbc_Model * model, int value)
    211     ;
    212     /** Maximum time in seconds (from when set called) */
    213     COINLIBAPI double COINLINKAGE
    214     Cbc_maximumSeconds(Cbc_Model * model)
    215     ;
    216     COINLIBAPI void COINLINKAGE
    217     Cbc_setMaximumSeconds(Cbc_Model * model, double value)
    218     ;
    219     /** Returns true if hit maximum iterations (or time) */
    220     COINLIBAPI int COINLINKAGE
    221     Cbc_hitMaximumIterations(Cbc_Model * model)
    222     ;
    223     /** Status of problem:
    224         0 - optimal
    225         1 - primal infeasible
    226         2 - dual infeasible
    227         3 - stopped on iterations etc
    228         4 - stopped due to errors
    229     */
    230     COINLIBAPI int COINLINKAGE
    231     Cbc_status(Cbc_Model * model)
    232     ;
    233     /** Set problem status */
    234     COINLIBAPI void COINLINKAGE
    235     Cbc_setProblemStatus(Cbc_Model * model, int problemStatus)
    236     ;
    237     /** Secondary status of problem - may get extended
    238         0 - none
    239         1 - primal infeasible because dual limit reached
    240         2 - scaled problem optimal - unscaled has primal infeasibilities
    241         3 - scaled problem optimal - unscaled has dual infeasibilities
    242         4 - scaled problem optimal - unscaled has both dual and primal infeasibilities
    243     */
    244     COINLIBAPI int COINLINKAGE
    245     Cbc_secondaryStatus(Cbc_Model * model)
    246     ;
    247     COINLIBAPI void COINLINKAGE
    248     Cbc_setSecondaryStatus(Cbc_Model * model, int status)
    249     ;
    250     /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    251     COINLIBAPI double COINLINKAGE
    252     Cbc_optimizationDirection(Cbc_Model * model)
    253     ;
    254     COINLIBAPI void COINLINKAGE
    255     Cbc_setOptimizationDirection(Cbc_Model * model, double value)
    256     ;
    257     /** Primal row solution */
    258     COINLIBAPI double * COINLINKAGE
    259     Cbc_primalRowSolution(Cbc_Model * model)
    260     ;
    261     /** Primal column solution */
    262     COINLIBAPI double * COINLINKAGE
    263     Cbc_primalColumnSolution(Cbc_Model * model)
    264     ;
    265     /** Dual row solution */
    266     COINLIBAPI double * COINLINKAGE
    267     Cbc_dualRowSolution(Cbc_Model * model)
    268     ;
    269     /** Reduced costs */
    270     COINLIBAPI double * COINLINKAGE
    271     Cbc_dualColumnSolution(Cbc_Model * model)
    272     ;
    273     /** Row lower */
    274     COINLIBAPI double* COINLINKAGE
    275     Cbc_rowLower(Cbc_Model * model)
    276     ;
    277     /** Row upper  */
    278     COINLIBAPI double* COINLINKAGE
    279     Cbc_rowUpper(Cbc_Model * model)
    280     ;
    281     /** Objective */
    282     COINLIBAPI double * COINLINKAGE
    283     Cbc_objective(Cbc_Model * model)
    284     ;
    285     /** Column Lower */
    286     COINLIBAPI double * COINLINKAGE
    287     Cbc_columnLower(Cbc_Model * model)
    288     ;
    289     /** Column Upper */
    290     COINLIBAPI double * COINLINKAGE
    291     Cbc_columnUpper(Cbc_Model * model)
    292     ;
    293     /** Number of elements in matrix */
     103    Cbc_setProblemName(Cbc_Model * model, const char * array)
     104    ;
     105
     106    /** Number of nonzero elements in constraint matrix */
    294107    COINLIBAPI int COINLINKAGE
    295108    Cbc_getNumElements(Cbc_Model * model)
    296109    ;
    297     /** Column starts in matrix */
     110    /** "Column start" vector of constraint matrix. Same format as Cbc_loadProblem() */
    298111    COINLIBAPI const CoinBigIndex * COINLINKAGE
    299112    Cbc_getVectorStarts(Cbc_Model * model)
    300113    ;
    301     /** Row indices in matrix */
     114    /** "Row index" vector of constraint matrix */
    302115    COINLIBAPI const int * COINLINKAGE
    303116    Cbc_getIndices(Cbc_Model * model)
    304117    ;
    305     /** Column vector lengths in matrix */
    306     COINLIBAPI const int * COINLINKAGE
    307     Cbc_getVectorLengths(Cbc_Model * model)
    308     ;
    309     /** Element values in matrix */
     118    /** Coefficient vector of constraint matrix */
    310119    COINLIBAPI const double * COINLINKAGE
    311120    Cbc_getElements(Cbc_Model * model)
    312121    ;
    313     /** Objective value */
     122
     123    /** Maximum lenght of a row or column name */
     124    COINLIBAPI size_t COINLINKAGE
     125    Cbc_maxNameLength(Cbc_Model * model)
     126    ;
     127    /** Fill in first maxLength bytes of name array with a row name */
     128    COINLIBAPI void COINLINKAGE
     129    Cbc_getRowName(Cbc_Model * model, int iRow, char * name, size_t maxLength)
     130    ;
     131    /** Fill in first maxLength bytes of name array with a column name */
     132    COINLIBAPI void COINLINKAGE
     133    Cbc_getColName(Cbc_Model * model, int iColumn, char * name, size_t maxLength)
     134    ;
     135    /** Set the name of a column */
     136    COINLIBAPI void COINLINKAGE
     137    Cbc_setColName(Cbc_Model * model, int iColumn, const char * name)
     138    ;
     139    /** Set the name of a row */
     140    COINLIBAPI void COINLINKAGE
     141    Cbc_setRowName(Cbc_Model * model, int iRow, const char * name)
     142    ;
     143    /** Number of constraints in the model */
     144    COINLIBAPI int COINLINKAGE
     145    Cbc_getNumRows(Cbc_Model * model)
     146    ;
     147    /** Number of variables in the model */
     148    COINLIBAPI int COINLINKAGE
     149    Cbc_getNumCols(Cbc_Model * model)
     150    ;
     151    /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore) */
     152    COINLIBAPI void COINLINKAGE
     153    Cbc_setObjSense(Cbc_Model * model, double sense)
     154    ;
     155    /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore) */
    314156    COINLIBAPI double COINLINKAGE
    315     Cbc_objectiveValue(Cbc_Model * model)
    316     ;
    317     /** Infeasibility/unbounded ray (NULL returned if none/wrong)
    318         Up to user to use delete [] on these arrays.  */
    319     COINLIBAPI double * COINLINKAGE
    320     Cbc_infeasibilityRay(Cbc_Model * model)
    321     ;
    322     COINLIBAPI double * COINLINKAGE
    323     Cbc_unboundedRay(Cbc_Model * model)
    324     ;
    325     /** See if status array exists (partly for OsiClp) */
    326     COINLIBAPI int COINLINKAGE
    327     Cbc_statusExists(Cbc_Model * model)
    328     ;
    329     /** Return address of status array (char[numberRows+numberColumns]) */
     157    Cbc_getObjSense(Cbc_Model * model)
     158    ;
     159    /** Constraint lower bounds */
     160    COINLIBAPI const double* COINLINKAGE
     161    Cbc_getRowLower(Cbc_Model * model)
     162    ;
     163    /** Set the lower bound of a single constraint */
     164    COINLIBAPI void COINLINKAGE
     165    Cbc_setRowLower(Cbc_Model * model, int index, double value)
     166    ;
     167    /** Constraint upper bounds */
     168    COINLIBAPI const double* COINLINKAGE
     169    Cbc_getRowUpper(Cbc_Model * model)
     170    ;
     171    /** Set the upper bound of a single constraint */
     172    COINLIBAPI void COINLINKAGE
     173    Cbc_setRowUpper(Cbc_Model * model, int index, double value)
     174    ;
     175    /** Objective vector */
     176    COINLIBAPI const double * COINLINKAGE
     177    Cbc_getObjCoefficients(Cbc_Model * model)
     178    ;
     179    /** Set the objective coefficient of a single variable */
     180    COINLIBAPI void COINLINKAGE
     181    Cbc_setObjCoeff(Cbc_Model * model, int index, double value)
     182    ;
     183    /** Variable lower bounds */
     184    COINLIBAPI const double * COINLINKAGE
     185    Cbc_getColLower(Cbc_Model * model)
     186    ;
     187    /** Set the lower bound of a single variable */
     188    COINLIBAPI void COINLINKAGE
     189    Cbc_setColLower(Cbc_Model * model, int index, double value)
     190    ;
     191    /** Variable upper bounds */
     192    COINLIBAPI const double * COINLINKAGE
     193    Cbc_getColUpper(Cbc_Model * model)
     194    ;
     195    /** Set the upper bound of a single variable */
     196    COINLIBAPI void COINLINKAGE
     197    Cbc_setColUpper(Cbc_Model * model, int index, double value)
     198    ;
     199    /** Determine whether the ith variable is integer restricted */
     200    COINLIBAPI int COINLINKAGE
     201    Cbc_isInteger(Cbc_Model * model, int i)
     202    ;
     203    /** Set this variable to be continuous */
     204    COINLIBAPI void COINLINKAGE
     205    Cbc_setContinuous(Cbc_Model * model, int iColumn)
     206    ;
     207    /** Set this variable to be integer */
     208    COINLIBAPI void COINLINKAGE
     209    Cbc_setInteger(Cbc_Model * model, int iColumn)
     210    ;
     211    /** Add SOS constraints to the model using row-order matrix
     212     * Unable to confirm that this function is working. */
    330213    COINLIBAPI void  COINLINKAGE
    331     Cbc_getBasisStatus(Cbc_Model * model, int * cstat, int * rstat)
    332     ;
    333     /** Copy in status vector */
    334     COINLIBAPI void COINLINKAGE
    335     Cbc_setBasisStatus(Cbc_Model * model, int * cstat, int * rstat)
    336     ;
    337 
    338     /** User pointer for whatever reason */
    339     COINLIBAPI void COINLINKAGE
    340     Cbc_setUserPointer (Cbc_Model * model, void * pointer)
    341     ;
    342     COINLIBAPI void * COINLINKAGE
    343     Cbc_getUserPointer (Cbc_Model * model)
    344     ;
     214    Cbc_addSOS(Cbc_Model * model, int numRows, const int * rowStarts,
     215               const int * colIndices, const double * weights, const int type)
     216    ;
     217    /** Print the model */
     218    COINLIBAPI void COINLINKAGE
     219    Cbc_printModel(Cbc_Model * model, const char * argPrefix)
     220    ;
     221    /** Return a copy of this model */
     222    COINLIBAPI Cbc_Model * COINLINKAGE
     223    Cbc_clone(Cbc_Model * model)
     224    ;
     225    /*@}*/
     226    /**@name Solver parameters */
     227    /*@{*/
     228    /** Set parameter "name" to value "value". Note that this
     229     * translates directly to using "-name value" as a
     230     * command-line argument to Cbc.*/
     231    COINLIBAPI void COINLINKAGE
     232    Cbc_setParameter(Cbc_Model * model, const char * name, const char * value)
     233    ;
     234
     235   
    345236    /*@}*/
    346237    /**@name Message handling.  Call backs are handled by ONE function */
     
    356247    Cbc_clearCallBack(Cbc_Model * model)
    357248    ;
    358     /** Amount of print out:
    359         0 - none
    360         1 - just final
    361         2 - just factorizations
    362         3 - as 2 plus a bit more
    363         4 - verbose
    364         above that 8,16,32 etc just for selective debug
    365     */
    366     COINLIBAPI void COINLINKAGE
    367     Cbc_setLogLevel(Cbc_Model * model, int value)
    368     ;
    369     COINLIBAPI int COINLINKAGE
    370     Cbc_logLevel(Cbc_Model * model)
    371     ;
    372     /** length of names (0 means no names0 */
    373     COINLIBAPI int COINLINKAGE
    374     Cbc_lengthNames(Cbc_Model * model)
    375     ;
    376     /** Fill in array (at least lengthNames+1 long) with a row name */
    377     COINLIBAPI void COINLINKAGE
    378     Cbc_rowName(Cbc_Model * model, int iRow, char * name)
    379     ;
    380     /** Fill in array (at least lengthNames+1 long) with a column name */
    381     COINLIBAPI void COINLINKAGE
    382     Cbc_columnName(Cbc_Model * model, int iColumn, char * name)
    383     ;
    384 
    385     /*@}*/
    386 
    387 
    388     /**@name Functions most useful to user */
    389     /*@{*/
    390     /** General solve algorithm which can do presolve.
    391         See  ClpSolve.hpp for options
    392      */
    393     COINLIBAPI int COINLINKAGE
    394     Cbc_initialSolve(Cbc_Model * model)
    395     ;
    396     /* General solve algorithm which can do presolve.
    397        See  CbcModel.hpp for options
    398     */
    399     COINLIBAPI int COINLINKAGE
    400     Cbc_branchAndBound(Cbc_Model * model)
    401     ;
    402     /** Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later) */
    403     COINLIBAPI void COINLINKAGE
    404     Cbc_scaling(Cbc_Model * model, int mode)
    405     ;
    406     /** Gets scalingFlag */
    407     COINLIBAPI int COINLINKAGE
    408     Cbc_scalingFlag(Cbc_Model * model)
    409     ;
    410     /** Crash - at present just aimed at dual, returns
    411         -2 if dual preferred and crash basis created
    412         -1 if dual preferred and all slack basis preferred
    413          0 if basis going in was not all slack
    414          1 if primal preferred and all slack basis preferred
    415          2 if primal preferred and crash basis created.
    416 
    417          if gap between bounds <="gap" variables can be flipped
    418 
    419          If "pivot" is
    420          0 No pivoting (so will just be choice of algorithm)
    421          1 Simple pivoting e.g. gub
    422          2 Mini iterations
    423     */
    424     COINLIBAPI int COINLINKAGE
    425     Cbc_crash(Cbc_Model * model, double gap, int pivot)
    426     ;
    427     /*@}*/
    428 
    429 
    430     /**@name most useful gets and sets */
    431     /*@{*/
    432     /** If problem is primal feasible */
    433     COINLIBAPI int COINLINKAGE
    434     Cbc_primalFeasible(Cbc_Model * model)
    435     ;
    436     /** If problem is dual feasible */
    437     COINLIBAPI int COINLINKAGE
    438     Cbc_dualFeasible(Cbc_Model * model)
    439     ;
    440     /** Dual bound */
    441     COINLIBAPI double COINLINKAGE
    442     Cbc_dualBound(Cbc_Model * model)
    443     ;
    444     COINLIBAPI void COINLINKAGE
    445     Cbc_setDualBound(Cbc_Model * model, double value)
    446     ;
    447     /** Infeasibility cost */
    448     COINLIBAPI double COINLINKAGE
    449     Cbc_infeasibilityCost(Cbc_Model * model)
    450     ;
    451     COINLIBAPI void COINLINKAGE
    452     Cbc_setInfeasibilityCost(Cbc_Model * model, double value)
    453     ;
    454     /** Perturbation:
    455         50  - switch on perturbation
    456         100 - auto perturb if takes too long (1.0e-6 largest nonzero)
    457         101 - we are perturbed
    458         102 - don't try perturbing again
    459         default is 100
    460         others are for playing
    461     */
    462     COINLIBAPI int COINLINKAGE
    463     Cbc_perturbation(Cbc_Model * model)
    464     ;
    465     COINLIBAPI void COINLINKAGE
    466     Cbc_setPerturbation(Cbc_Model * model, int value)
    467     ;
    468     /** Current (or last) algorithm */
    469     COINLIBAPI int COINLINKAGE
    470     Cbc_algorithm(Cbc_Model * model)
    471     ;
    472     /** Set algorithm */
    473     COINLIBAPI void COINLINKAGE
    474     Cbc_setAlgorithm(Cbc_Model * model, int value)
    475     ;
    476     /** Sum of dual infeasibilities */
    477     COINLIBAPI double COINLINKAGE
    478     Cbc_sumDualInfeasibilities(Cbc_Model * model)
    479     ;
    480     /** Number of dual infeasibilities */
    481     COINLIBAPI int COINLINKAGE
    482     Cbc_numberDualInfeasibilities(Cbc_Model * model)
    483     ;
     249
     250    /*@}*/
     251
     252
     253    /**@name Solving the model */
     254    /*@{*/
     255    /* Solve the model with Cbc (using CbcMain1).
     256    */
     257    COINLIBAPI int COINLINKAGE
     258    Cbc_solve(Cbc_Model * model)
     259    ;
     260    /*@}*/
     261
     262
     263    /**@name Accessing the solution and solution status */
     264    /*@{*/
     265
    484266    /** Sum of primal infeasibilities */
    485267    COINLIBAPI double COINLINKAGE
     
    490272    Cbc_numberPrimalInfeasibilities(Cbc_Model * model)
    491273    ;
    492     /** Save model to file, returns 0 if success.  This is designed for
    493         use outside algorithms so does not save iterating arrays etc.
    494     It does not save any messaging information.
    495     Does not save scaling values.
    496     It does not know about all types of virtual functions.
    497     */
    498     COINLIBAPI int COINLINKAGE
    499     Cbc_saveModel(Cbc_Model * model, const char * fileName)
    500     ;
    501     /** Restore model from file, returns 0 if success,
    502         deletes current model */
    503     COINLIBAPI int COINLINKAGE
    504     Cbc_restoreModel(Cbc_Model * model, const char * fileName)
    505     ;
    506274
    507275    /** Just check solution (for external use) - sets sum of
     
    510278    Cbc_checkSolution(Cbc_Model * model)
    511279    ;
    512     /*@}*/
    513 
    514     /******************** End of most useful part **************/
    515     /**@name gets and sets - some synonyms */
    516     /*@{*/
    517     /** Number of rows */
    518     COINLIBAPI int COINLINKAGE
    519     Cbc_getNumRows(Cbc_Model * model)
    520     ;
    521     /** Number of columns */
    522     COINLIBAPI int COINLINKAGE
    523     Cbc_getNumCols(Cbc_Model * model)
    524     ;
     280
    525281    /** Number of iterations */
    526282    COINLIBAPI int COINLINKAGE
     
    535291    Cbc_isProvenOptimal(Cbc_Model * model)
    536292    ;
    537     /** Is primal infeasiblity proven? */
    538     COINLIBAPI int COINLINKAGE
    539     Cbc_isProvenPrimalInfeasible(Cbc_Model * model)
    540     ;
    541     /** Is dual infeasiblity proven? */
    542     COINLIBAPI int COINLINKAGE
    543     Cbc_isProvenDualInfeasible(Cbc_Model * model)
    544     ;
    545     /** Is the given primal objective limit reached? */
    546     COINLIBAPI int COINLINKAGE
    547     Cbc_isPrimalObjectiveLimitReached(Cbc_Model * model)
    548     ;
    549     /** Is the given dual objective limit reached? */
    550     COINLIBAPI int COINLINKAGE
    551     Cbc_isDualObjectiveLimitReached(Cbc_Model * model)
    552     ;
    553     /** Iteration limit reached? */
    554     COINLIBAPI int COINLINKAGE
    555     Cbc_isIterationLimitReached(Cbc_Model * model)
    556     ;
    557     /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    558     COINLIBAPI double COINLINKAGE
    559     Cbc_getObjSense(Cbc_Model * model)
    560     ;
    561     /** Primal row solution */
     293    /** Is infeasiblity proven (or none better than cutoff)? */
     294    COINLIBAPI int COINLINKAGE
     295    Cbc_isProvenInfeasible(Cbc_Model * model)
     296    ;
     297    /** Was continuous solution unbounded? */
     298    COINLIBAPI int COINLINKAGE
     299    Cbc_isContinuousUnbounded(Cbc_Model * model)
     300    ;
     301    /** Node limit reached? */
     302    COINLIBAPI int COINLINKAGE
     303    Cbc_isNodeLimitReached(Cbc_Model * model)
     304    ;
     305    /** Time limit reached? */
     306    COINLIBAPI int COINLINKAGE
     307    Cbc_isSecondsLimitReached(Cbc_Model * model)
     308    ;
     309    /** Solution limit reached? */
     310    COINLIBAPI int COINLINKAGE
     311    Cbc_isSolutionLimitReached(Cbc_Model * model)
     312    ;
     313    /** Are there numerical difficulties (for initialSolve) ? */
     314    COINLIBAPI int COINLINKAGE
     315    Cbc_isInitialSolveAbandoned(Cbc_Model * model)
     316    ;
     317    /** Is optimality proven (for initialSolve) ? */
     318    COINLIBAPI int COINLINKAGE
     319    Cbc_isInitialSolveProvenOptimal(Cbc_Model * model)
     320    ;
     321    /** Is primal infeasiblity proven (for initialSolve) ? */
     322    COINLIBAPI int COINLINKAGE
     323    Cbc_isInitialSolveProvenPrimalInfeasible(Cbc_Model * model)
     324    ;
     325    /** "row" solution
     326     *  This is the vector A*x, where A is the constraint matrix
     327     *  and x is the current solution. */
    562328    COINLIBAPI const double * COINLINKAGE
    563329    Cbc_getRowActivity(Cbc_Model * model)
    564330    ;
    565     /** Primal column solution */
     331    /** Best feasible solution vector */
    566332    COINLIBAPI const double * COINLINKAGE
    567333    Cbc_getColSolution(Cbc_Model * model)
    568334    ;
    569     COINLIBAPI void COINLINKAGE
    570     Cbc_setColSolution(Cbc_Model * model, const double * input)
    571     ;
    572     /** Dual row solution */
    573     COINLIBAPI const double * COINLINKAGE
    574     Cbc_getRowPrice(Cbc_Model * model)
    575     ;
    576     /** Reduced costs */
    577     COINLIBAPI const double * COINLINKAGE
    578     Cbc_getReducedCost(Cbc_Model * model)
    579     ;
    580     /** Row lower */
    581     COINLIBAPI const double* COINLINKAGE
    582     Cbc_getRowLower(Cbc_Model * model)
    583     ;
    584     /** Row upper  */
    585     COINLIBAPI const double* COINLINKAGE
    586     Cbc_getRowUpper(Cbc_Model * model)
    587     ;
    588     /** Objective */
    589     COINLIBAPI const double * COINLINKAGE
    590     Cbc_getObjCoefficients(Cbc_Model * model)
    591     ;
    592     /** Column Lower */
    593     COINLIBAPI const double * COINLINKAGE
    594     Cbc_getColLower(Cbc_Model * model)
    595     ;
    596     /** Column Upper */
    597     COINLIBAPI const double * COINLINKAGE
    598     Cbc_getColUpper(Cbc_Model * model)
    599     ;
    600     /** Objective value */
     335    /** Objective value of best feasible solution */
    601336    COINLIBAPI double COINLINKAGE
    602337    Cbc_getObjValue(Cbc_Model * model)
    603338    ;
    604     /** Print the model */
    605     COINLIBAPI void COINLINKAGE
    606     Cbc_printModel(Cbc_Model * model, const char * argPrefix)
    607     ;
    608     /** Determine whether the variable at location i is integer restricted */
    609     COINLIBAPI int COINLINKAGE
    610     Cbc_isInteger(Cbc_Model * model, int i)
    611     ;
    612     /** Return CPU time */
     339    /** Best known bound on the optimal objective value */
    613340    COINLIBAPI double COINLINKAGE
    614     Cbc_cpuTime(Cbc_Model * model)
     341    Cbc_getBestPossibleObjValue(Cbc_Model * model)
    615342    ;
    616343    /** Number of nodes explored in B&B tree */
    617344    COINLIBAPI int COINLINKAGE
    618345    Cbc_getNodeCount(Cbc_Model * model)
    619     ;
    620     /** Return a copy of this model */
    621     COINLIBAPI Cbc_Model * COINLINKAGE
    622     Cbc_clone(Cbc_Model * model)
    623     ;
    624     /** Set this the variable to be continuous */
    625     COINLIBAPI Cbc_Model * COINLINKAGE
    626     Cbc_setContinuous(Cbc_Model * model, int iColumn)
    627     ;
    628     /** Add SOS constraints to the model using dense matrix */
    629     COINLIBAPI void  COINLINKAGE
    630     Cbc_addSOS_Dense(Cbc_Model * model, int numObjects, const int * len,
    631                      const int * const * which, const double * weights, const int type)
    632     ;
    633     /** Add SOS constraints to the model using row-order matrix */
    634     COINLIBAPI void  COINLINKAGE
    635     Cbc_addSOS_Sparse(Cbc_Model * model, const int * rowStarts,
    636                       const int * rowIndices, const double * weights, const int type)
    637     ;
    638     /** Delete all object information */
    639     COINLIBAPI void  COINLINKAGE
    640     Cbc_deleteObjects(Cbc_Model * model)
    641346    ;
    642347    /** Print the solution */
     
    644349    Cbc_printSolution(Cbc_Model * model)
    645350    ;
    646     /** Dual initial solve */
    647     COINLIBAPI int COINLINKAGE
    648     Cbc_initialDualSolve(Cbc_Model * model)
    649     ;
    650     /** Primal initial solve */
    651     COINLIBAPI int COINLINKAGE
    652     Cbc_initialPrimalSolve(Cbc_Model * model)
    653     ;
    654     /** Dual algorithm - see ClpSimplexDual.hpp for method */
    655     COINLIBAPI int COINLINKAGE
    656     Cbc_dual(Cbc_Model * model, int ifValuesPass)
    657     ;
    658     /** Primal algorithm - see ClpSimplexPrimal.hpp for method */
    659     COINLIBAPI int COINLINKAGE
    660     Cbc_primal(Cbc_Model * model, int ifValuesPass)
     351    /** Final status of problem
     352        Some of these can be found out by is...... functions
     353        -1 before branchAndBound
     354        0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found
     355        (or check value of best solution)
     356        1 stopped - on maxnodes, maxsols, maxtime
     357        2 difficulties so run was abandoned
     358        (5 event user programmed event occurred)
     359    */
     360    COINLIBAPI int COINLINKAGE
     361    Cbc_status(Cbc_Model * model)
     362    ;
     363    /** Secondary status of problem
     364        -1 unset (status_ will also be -1)
     365        0 search completed with solution
     366        1 linear relaxation not feasible (or worse than cutoff)
     367        2 stopped on gap
     368        3 stopped on nodes
     369        4 stopped on time
     370        5 stopped on user event
     371        6 stopped on solutions
     372        7 linear relaxation unbounded
     373        8 stopped on iteration limit
     374    */
     375    COINLIBAPI int COINLINKAGE
     376    Cbc_secondaryStatus(Cbc_Model * model)
    661377    ;
    662378    /*@}*/
Note: See TracChangeset for help on using the changeset viewer.