CONOPT
|
Functions | |
int COI_CALLCONV | COIDEF_License (coiHandle_t cntvect, int licint1, int licint2, int licint3, const char *licstring) |
define the License Information. | |
int COI_CALLCONV | COIDEF_Base (coiHandle_t cntvect, int base) |
define the Base index for vectors. | |
int COI_CALLCONV | COIDEF_Fortran (coiHandle_t cntvect) |
define Fortran Conventions for Argument Passing. | |
int COI_CALLCONV | COIDEF_C (coiHandle_t cntvect) |
define C Conventions for Argument Passing. | |
int COI_CALLCONV | COIDEF_ItLim (coiHandle_t cntvect, int itlim) |
define the Iteration Limit. | |
int COI_CALLCONV | COIDEF_ErrLim (coiHandle_t cntvect, int errlim) |
define the Error Limit. | |
int COI_CALLCONV | COIDEF_ResLim (coiHandle_t cntvect, double reslim) |
define resource limit. | |
int COI_CALLCONV | COIDEF_MaxHeap (coiHandle_t cntvect, double maxheap) |
define Limit on Heap Memory. "" | |
int COI_CALLCONV | COIDEF_IniStat (coiHandle_t cntvect, int inistat) |
handling of the initial status values. | |
int COI_CALLCONV | COIDEF_FVincLin (coiHandle_t cntvect, int fvinclin) |
include the linear terms in function evaluations. | |
int COI_CALLCONV | COIDEF_FVforAll (coiHandle_t cntvect, int fvforall) |
call the FDEval for all constraints, including linear constraints. | |
int COI_CALLCONV | COIDEF_MaxSup (coiHandle_t cntvect, int maxsup) |
limit on superbasics. | |
int COI_CALLCONV | COIDEF_Square (coiHandle_t cntvect, int square) |
square models. | |
int COI_CALLCONV | COIDEF_EmptyRow (coiHandle_t cntvect, int emptyrow) |
allow empty rows. | |
int COI_CALLCONV | COIDEF_EmptyCol (coiHandle_t cntvect, int emptycol) |
allow empty columns. | |
int COI_CALLCONV | COIDEF_DisCont (coiHandle_t cntvect, int discont) |
allow discontinuous functions and derivatives. | |
int COI_CALLCONV | COIDEF_HessFac (coiHandle_t cntvect, double hessfac) |
factor for Hessian density relative to Jacobian density HessFac. | |
int COI_CALLCONV | COIDEF_DebugFV (coiHandle_t cntvect, int debugfv) |
turn Debugging of FDEval on and off. | |
int COI_CALLCONV | COIDEF_Debug2D (coiHandle_t cntvect, int debug2d) |
turn debugging of 2nd derivatives on and off. | |
int COI_CALLCONV | COIDEF_ClearM (coiHandle_t cntvect, int clearm) |
ClearM. | |
int COI_CALLCONV | COIDEF_ThreadS (coiHandle_t cntvect, int threads) |
number of threads allowed internally in CONOPT. | |
int COI_CALLCONV | COIDEF_ThreadF (coiHandle_t cntvect, int threadf) |
number of threads allowed for simultaneous FDEval calls. | |
int COI_CALLCONV | COIDEF_Thread2D (coiHandle_t cntvect, int thread2d) |
number of threads allowed for simultaneous 2DDir calls. | |
int COI_CALLCONV | COIDEF_ThreadC (coiHandle_t cntvect, int threadc) |
check for thread compatibility. | |
int COI_CALLCONV | COIDEF_StdOut (coiHandle_t cntvect, int tostdout) |
allow output to StdOut. | |
Options that modify the macro behaviour of CONOPT.
These cover conventions for indexes COIDEF_Base() and argument passing COIDEF_Fortran() and COIDEF_C(). They also cover limits on the algorithms, such as iteration limits COIDEF_ItLim() and error limits COIDEF_ErrLim(). These options must be specified before the CONOPT solving is started, i.e before a call to COI_Solve().
int COI_CALLCONV COIDEF_License | ( | coiHandle_t | cntvect, |
int | licint1, | ||
int | licint2, | ||
int | licint3, | ||
const char * | licstring ) |
define the License Information.
The license consists of three integer codes and a string that defines the user. If the license is not defined or if it is incorrect then CONOPT will run in small-scale demo mode and it will only be able to solve small models.
licint1 | the first license integer code |
licint2 | the second license integer code |
licint3 | the third license integer code |
licstring | the license string |
cntvect | the control vector |
int COI_CALLCONV COIDEF_Base | ( | coiHandle_t | cntvect, |
int | base ) |
define the Base index for vectors.
Some of the vectors that are passed between CONOPT and the callback routines point to other vectors. Examples are Row Indices and Start of Column pointers. You must define to CONOPT if you use Fortran conventions with 1 as the first element or C conventions with 0. The base will also determine how the index of the objective is interpreted.
cntvect | the control vector |
base | the base index for vectors |
int COI_CALLCONV COIDEF_Fortran | ( | coiHandle_t | cntvect | ) |
define Fortran Conventions for Argument Passing.
This is equivalent to calling coidef_base(1) in Fortran or COIDEF_Base(1) in C.
cntvect | the control vector |
int COI_CALLCONV COIDEF_C | ( | coiHandle_t | cntvect | ) |
define C Conventions for Argument Passing.
This is equivalent to calling coidef_base(0) in Fortran or COIDEF_Base(0) in C.
cntvect | the control vector |
int COI_CALLCONV COIDEF_ItLim | ( | coiHandle_t | cntvect, |
int | itlim ) |
define the Iteration Limit.
By default CONOPT uses an iteration limit of 1 million iterations. This method can be used to set a new iteration limit.
The call is optional.
itlim | the iteration limit |
cntvect | the control vector |
int COI_CALLCONV COIDEF_ErrLim | ( | coiHandle_t | cntvect, |
int | errlim ) |
define the Error Limit.
The nonlinear functions may not be defined in all points, and the user written callback routine FDEval
has an argument for telling CONOPT if a point is “bad”. CONOPT may try other points to avoid “bad” points up to a defined error limit (as specified by a call to this method). The default error limit is zero, i.e. CONOPT will by default stop if a “bad” point is encountered.
The call is optional.
errlim | the error limit |
cntvect | the control vector |
int COI_CALLCONV COIDEF_ResLim | ( | coiHandle_t | cntvect, |
double | reslim ) |
define resource limit.
CONOPT will by default allow the optimization to run for 1 million seconds. A new limit can be set by a call to this method.
ResLim
is a double precision number.reslim | the solve time limit in seconds |
cntvect | the control vector |
int COI_CALLCONV COIDEF_MaxHeap | ( | coiHandle_t | cntvect, |
double | maxheap ) |
define Limit on Heap Memory. ""
By default CONOPT will allocate the memory it needs from the computers heap memory using Allocate
or malloc
calls. For very large models CONOPT may try to allocate more than the available physical memory and the responsiveness of the computer may suffer. This may not be acceptable in certain server environments. This method is used to define a limit on the amount of heap memory that CONOPT will allocate. If CONOPT reaches a point where it needs more memory than allowed it will try to continue without extra memory (if this is possible) or it will stop with an out of memory message and the sovle will return the value 113 or 114.
MaxHeap
is measured in MegaBytes. A positive MaxHeap
value indicates a limit while Maxheap = 0.0
indicates that the limit is set by the physical memory or the virtual memory system on the machine. After you have solved a model you can query the amount of memory actually used with the coiget_maxheapused() or COIGET_MaxHeapUsed().
The call is optional.
maxheap | the limit on heap memory "" |
cntvect | the control vector |
int COI_CALLCONV COIDEF_IniStat | ( | coiHandle_t | cntvect, |
int | inistat ) |
handling of the initial status values.
CONOPT can take advantage of initial ‘Status’ information about the variables and constraints. This is information of the type: Variable number \(i\) is basic, variable \(j\) is superbasic, variable \(k\) is at lower bound etc.
cntvect | the control vector |
inistat | the initial status |
int COI_CALLCONV COIDEF_FVincLin | ( | coiHandle_t | cntvect, |
int | fvinclin ) |
include the linear terms in function evaluations.
CONOPT assumes that the function values returned by the user defined callback routine FDEval
only include nonlinear terms, i.e. terms that correspond to variables that appear nonlinearly in the particular constraint.
If you prefer your FDEval
routine to return function values as the sum of both linear and nonlinear terms then you must inform CONOPT by calling this method with FVincLin = 1
. FVincLin = 0
will return CONOPT to the default behavior.
fvinclin | the linear terms in functions |
cntvect | the control vector |
int COI_CALLCONV COIDEF_FVforAll | ( | coiHandle_t | cntvect, |
int | fvforall ) |
call the FDEval for all constraints, including linear constraints.
CONOPT will usually only call the user provided FDEval
routine for nonlinear constraints. However, some models may have constant terms included in FDEval
instead of in the right hand side, also for linear constraints.
FDEval
routine is programmed this way you must tell CONOPT to call FDEval
for all constraints, linear as well as nonlinear, by calling this method with FVforAll = 1
. Calling again with FVforAll = 0
will return CONOPT to its default behavior.fvforall | the linear constraints in functions |
cntvect | the control vector |
int COI_CALLCONV COIDEF_MaxSup | ( | coiHandle_t | cntvect, |
int | maxsup ) |
limit on superbasics.
CONOPT uses a reduced gradient algorithm and performs its optimization in a space of “Superbasic” variables. It needs a square matrix of size the number of superbasic variables for estimated second order information. Since this matrix can be fairly large, CONOPT places a limit that by default is at least 500 rows and columns. For larger models CONOPT reserves around 25% of the memory needed for other purposes to this matrix. If you have a model with many superbasic variables it may be advantageous to increase this limit.
2DLagr
, 2DDir
, or 2DDirLag
routines, then it is usually not worth while to increase MaxSup
.The limit can also be defined in an options file or options routine by setting LFNSUP
.
maxsup | the limit on superbasics |
cntvect | the control vector |
int COI_CALLCONV COIDEF_Square | ( | coiHandle_t | cntvect, |
int | square ) |
square models.
CONOPT has a special routine for solve square sets of equations without an objective function.
square | Square = 1 informs CONOPT that the model is Square. Square = 0 is the default used for an ordinary optimization model. |
cntvect | the control vector |
int COI_CALLCONV COIDEF_EmptyRow | ( | coiHandle_t | cntvect, |
int | emptyrow ) |
allow empty rows.
CONOPT performs many tests on the input data and by default it does not allow empty rows, i.e. constraints that do not depend on any variables. In some modeling systems environments it can be useful to allow empty rows.
emptyrow | 1 allows empty rows, 0 is the default behavior. |
cntvect | the control vector |
int COI_CALLCONV COIDEF_EmptyCol | ( | coiHandle_t | cntvect, |
int | emptycol ) |
allow empty columns.
CONOPT performs many tests on the input data and by default it does not allow empty columns, i.e. variables that do not appear in any constraints. In some modeling systems environments it can be useful to allow empty columns. To bypass the usual tests you must inform CONOPT that empty columns should be allowed.
emptycol | 1 allows empty columns, 0 is the default behaviour. |
cntvect | the control vector |
int COI_CALLCONV COIDEF_DisCont | ( | coiHandle_t | cntvect, |
int | discont ) |
allow discontinuous functions and derivatives.
CONOPT assumes that all functions are smooth with smooth derivatives and that these functions and derivatives can be computed with a noise level close to the machine precision. CONOPT can also be used on models with non-smooth derivatives, e.g. models with ABS
or MIN
or MAX
functions, but the algorithm will still work as if all functions and derivatives are smooth. A few internal tests may fail for a model with discontinuous derivatives. The call will only turn the tests off or on; it will not alter the optimization behavior.
discont | 1 allows discontinuous functions and derivatives, 0 is the default behaviour. |
cntvect | the control vector |
int COI_CALLCONV COIDEF_HessFac | ( | coiHandle_t | cntvect, |
double | hessfac ) |
factor for Hessian density relative to Jacobian density HessFac.
CONOPT will not use the Hessian of the Lagrangian if it is too dense. The limit on the number of nonzero Hessian elements (on an below the diagonal) is set to HessFac
times the number of nonlinear Jacobian elements,:vertical resize 120 and the default value of HessFac
is 10. The assumption is that computations involving a dense Hessian will be too expensive.
The Hessian factor can also be defined by defining the option RVHESS
.
cntvect | the control vector |
hessfac | the threshold factor for Hessian density relative to Jacobian density |
int COI_CALLCONV COIDEF_DebugFV | ( | coiHandle_t | cntvect, |
int | debugfv ) |
turn Debugging of FDEval on and off.
CONOPT has a Function and Derivative Debugger that can check if the function values and derivatives computed by FDEval
seem to be consistent and the derivatives are consistent with the sparsity pattern of the Jacobian.
The interpretation of DebugFV
is:
The value can also be defined in an options file or options routine be setting LKDEBG
. Error messages and error return codes are described in Error Return Codes.
debugfv | the flag to enable debugging of function evaluations |
cntvect | the control vector |
int COI_CALLCONV COIDEF_Debug2D | ( | coiHandle_t | cntvect, |
int | debug2d ) |
turn debugging of 2nd derivatives on and off.
CONOPT has a rudimentary routine for checking if the 2nd derivatives computed by 2DLagr
, 2DDir
, or 2DDirLag
seem to be consistent with the derivatives computed by FDEval
.
The interpretation of Debug2D
is:
The value can also be defined in an options file or options routine be setting LKDEB2
. Error return codes and examples of messages can be found in Error Return Codes.
debug2d | the flag to enable the debugging of the second derivative evaulations |
cntvect | the control vector |
int COI_CALLCONV COIDEF_ClearM | ( | coiHandle_t | cntvect, |
int | clearm ) |
ClearM.
clearm | |
cntvect | the control vector |
int COI_CALLCONV COIDEF_ThreadS | ( | coiHandle_t | cntvect, |
int | threads ) |
number of threads allowed internally in CONOPT.
As discussed in Multi Threading CONOPT can use multiple threads using the OpenMP
standard. The multi-threading capability is divided into three areas: (1) Internally in CONOPT, (2) during function and derivative calls using the FDEval
callback routine, and (3) during directional 2nd derivative calls using the 2DDir callback routine.
This method is used to define how many threads can be used internally in CONOPT. The argument ThreadS
is interpreted as follows:
MaxThread
threads, as many as the OpenMP
system will allocate,min(ThreadS,MaxThread)
threads.threads | the number of threads allowed internally |
cntvect | the control vector |
int COI_CALLCONV COIDEF_ThreadF | ( | coiHandle_t | cntvect, |
int | threadf ) |
number of threads allowed for simultaneous FDEval
calls.
This method can be used to define how many threads can be used for simultaneous FDEval
calls. The argument ThreadF
is interpreted as follows:
min(ThreadS,ThreadF)
threads.threadf | the number of threads for simultaneous FDEval calls |
cntvect | the control vector |
int COI_CALLCONV COIDEF_Thread2D | ( | coiHandle_t | cntvect, |
int | thread2d ) |
number of threads allowed for simultaneous 2DDir
calls.
This method can be used to define how many threads can be used for simultaneous 2DDir
calls. The argument Thread2D
is interpreted as follows:
min(Thread2D,ThreadF)
threads.thread2d | the number of threads for simultaneous 2DDir calls |
cntvect | the control vector |
int COI_CALLCONV COIDEF_ThreadC | ( | coiHandle_t | cntvect, |
int | threadc ) |
check for thread compatibility.
When using multiple threads, the result of the execution is in most cases independent of the number of threads. However, a few operations mostly related to summations can create slightly different results depending on the number of threads, and therefore the results may depend on the number of threads. ThreadC
can be used to force reproducible results. The execution is done as if there were ThreadC
threads independent of the actual number of ThreadS
(ThreadS
> ThreadC
).
This method can be used to define how many threads CONOPT should simulate. The argument ThreadC
is interpreted as follows:
ThreadS
defined above,ThreadC > ThreadS
threads.The upper bound on ThreadC
is currently 8.
threadc | the number of threads CONOPT should simulate |
cntvect | the control vector |
int COI_CALLCONV COIDEF_StdOut | ( | coiHandle_t | cntvect, |
int | tostdout ) |
allow output to StdOut.
CONOPT will by default not write to Standard Output or Fortran Write(,) to avoid problems in certain Windowing environments. All communication goes via callback routines. If there are errors during the initial setup of communication it can sometimes be difficult to locate these errors. If you allow output to Standard Output then CONOPT may provide some extra debugging information.
cntvect | the control vector |
tostdout | 1 to output to Standard Output, 0 to silence the output. |