Cbc  2.8.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Cbc_C_Interface.h File Reference
#include "Coin_C_defines.h"
+ Include dependency graph for Cbc_C_Interface.h:

Go to the source code of this file.

Functions

Load model - loads some stuff and initializes others
COINLIBAPI void COINLINKAGE Cbc_loadProblem (Cbc_Model *model, const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
 
COINLIBAPI void COINLINKAGE Cbc_addRows (Cbc_Model *model, const int number, const double *rowLower, const double *rowUpper, const int *rowStarts, const int *columns, const double *elements)
 Add rows. More...
 
COINLIBAPI void COINLINKAGE Cbc_addColumns (Cbc_Model *model, int number, const double *columnLower, const double *columnUpper, const double *objective, const int *columnStarts, const int *rows, const double *elements)
 Add columns. More...
 
COINLIBAPI void COINLINKAGE Cbc_copyNames (Cbc_Model *model, const char *const *rowNamesIn, const char *const *columnNamesIn)
 Copies in names. More...
 
Message handling. Call backs are handled by ONE function
COINLIBAPI void COINLINKAGE Cbc_registerCallBack (Cbc_Model *model, cbc_callback userCallBack)
 Pass in Callback function. More...
 
gets and sets - some synonyms
COINLIBAPI void COINLINKAGE Cbc_addSOS_Dense (Cbc_Model *model, int numObjects, const int *len, const int *const *which, const double *weights, const int type)
 Add SOS constraints to the model using dense matrix. More...
 
COINLIBAPI void COINLINKAGE Cbc_addSOS_Sparse (Cbc_Model *model, const int *rowStarts, const int *rowIndices, const double *weights, const int type)
 Add SOS constraints to the model using row-order matrix. More...
 

Constructors and destructor

This is a first "C" interface to Cbc.

It is mostly similar to the "C" interface to Clp and was contributed by Bob Entriken. These do not have an exact analogue in C++. The user does not need to know structure of Cbc_Model.

For all functions outside this group there is an exact C++ analogue created by taking the first parameter out, removing the Cbc_ from name and applying the method to an object of type ClpSimplex.

COINLIBAPI Cbc_Model * COINLINKAGE
 Default Cbc_Model constructor. More...
 
COINLIBAPI double COINLINKAGE Cbc_getVersion ()
 Version. More...
 

Function Documentation

COINLIBAPI double COINLINKAGE Cbc_getVersion ( )

Version.

COINLIBAPI void COINLINKAGE Cbc_loadProblem ( Cbc_Model *  model,
const int  numcols,
const int  numrows,
const CoinBigIndex *  start,
const int *  index,
const double *  value,
const double *  collb,
const double *  colub,
const double *  obj,
const double *  rowlb,
const double *  rowub 
)
COINLIBAPI void COINLINKAGE Cbc_addRows ( Cbc_Model *  model,
const int  number,
const double *  rowLower,
const double *  rowUpper,
const int *  rowStarts,
const int *  columns,
const double *  elements 
)

Add rows.

COINLIBAPI void COINLINKAGE Cbc_addColumns ( Cbc_Model *  model,
int  number,
const double *  columnLower,
const double *  columnUpper,
const double *  objective,
const int *  columnStarts,
const int *  rows,
const double *  elements 
)

Add columns.

COINLIBAPI void COINLINKAGE Cbc_copyNames ( Cbc_Model *  model,
const char *const *  rowNamesIn,
const char *const *  columnNamesIn 
)

Copies in names.

COINLIBAPI void COINLINKAGE Cbc_registerCallBack ( Cbc_Model *  model,
cbc_callback  userCallBack 
)

Pass in Callback function.

Message numbers up to 1000000 are Clp, Coin ones have 1000000 added

COINLIBAPI void COINLINKAGE Cbc_addSOS_Dense ( Cbc_Model *  model,
int  numObjects,
const int *  len,
const int *const *  which,
const double *  weights,
const int  type 
)

Add SOS constraints to the model using dense matrix.

COINLIBAPI void COINLINKAGE Cbc_addSOS_Sparse ( Cbc_Model *  model,
const int *  rowStarts,
const int *  rowIndices,
const double *  weights,
const int  type 
)

Add SOS constraints to the model using row-order matrix.

Variable Documentation

COINLIBAPI int COINLINKAGE

Default Cbc_Model constructor.

Primal algorithm - see ClpSimplexPrimal.hpp for method.

Dual algorithm - see ClpSimplexDual.hpp for method.

Primal initial solve.

Dual initial solve.

Print the solution.

Delete all object information.

Set this the variable to be continuous.

Return a copy of this model.

Number of nodes explored in B&B tree.

Return CPU time.

Determine whether the variable at location i is integer restricted.

Print the model.

Iteration limit reached?

Is the given dual objective limit reached?

Is the given primal objective limit reached?

Is dual infeasiblity proven?

Is primal infeasiblity proven?

Is optimality proven?

Are there a numerical difficulties?

Just check solution (for external use) - sets sum of infeasibilities etc.

Restore model from file, returns 0 if success, deletes current model.

Save model to file, returns 0 if success.

Number of primal infeasibilities.

Sum of primal infeasibilities.

Number of dual infeasibilities.

Sum of dual infeasibilities.

Set algorithm.

Current (or last) algorithm.

Perturbation: 50 - switch on perturbation 100 - auto perturb if takes too long (1.0e-6 largest nonzero) 101 - we are perturbed 102 - don't try perturbing again default is 100 others are for playing.

Infeasibility cost.

Dual bound.

If problem is dual feasible.

If problem is primal feasible.

Crash - at present just aimed at dual, returns -2 if dual preferred and crash basis created -1 if dual preferred and all slack basis preferred 0 if basis going in was not all slack 1 if primal preferred and all slack basis preferred 2 if primal preferred and crash basis created.

Gets scalingFlag.

Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later)

General solve algorithm which can do presolve.

Fill in array (at least lengthNames+1 long) with a column name.

Fill in array (at least lengthNames+1 long) with a row name.

length of names (0 means no names0

Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - verbose above that 8,16,32 etc just for selective debug.

Unset Callback function.

User pointer for whatever reason.

Copy in status vector.

Return address of status array (char[numberRows+numberColumns])

See if status array exists (partly for OsiClp)

Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays.

Objective value.

Element values in matrix.

Column vector lengths in matrix.

Row indices in matrix.

Column starts in matrix.

Number of elements in matrix.

Column Upper.

Column Lower.

Objective.

Row upper.

Row lower.

Reduced costs.

Dual row solution.

Primal column solution.

Primal row solution.

Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.

Secondary status of problem - may get extended 0 - none 1 - primal infeasible because dual limit reached 2 - scaled problem optimal - unscaled has primal infeasibilities 3 - scaled problem optimal - unscaled has dual infeasibilities 4 - scaled problem optimal - unscaled has both dual and primal infeasibilities.

Set problem status.

Status of problem: 0 - optimal 1 - primal infeasible 2 - dual infeasible 3 - stopped on iterations etc 4 - stopped due to errors.

Returns true if hit maximum iterations (or time)

Maximum time in seconds (from when set called)

Maximum number of nodes.

Maximum number of iterations.

Number of iterations.

Sets problem name.

Fills in array with problem name.

Objective offset.

Dual objective limit.

Dual tolerance to use.

Primal tolerance to use.

Number of columns.

Number of rows.

Drops names - makes lengthnames 0 and names empty.

Deletes columns.

Deletes rows.

Resizes rim part of model.

Drop integer informations.

Copy in integer information.

Integer information.

Write an mps file from the given filename.

Read an mps file from the given filename.

Cbc_Model Destructor.

array must be a null-terminated string.

See ClpSolve.hpp for options

if gap between bounds <="gap" variables can be flipped

If "pivot" is 0 No pivoting (so will just be choice of algorithm) 1 Simple pivoting e.g. gub 2 Mini iterations

This is designed for use outside algorithms so does not save iterating arrays etc. It does not save any messaging information. Does not save scaling values. It does not know about all types of virtual functions.

Definition at line 39 of file Cbc_C_Interface.h.