CONOPT
Loading...
Searching...
No Matches

Data Structures

class  jconopt.ConstraintType
 
class  jconopt.ObjectiveElement
 
class  jconopt.Sense
 

Functions

void jconopt.ModelData.setProblemDimension (long numvar, long numcons, long numnz, long numnlnz)
 
int jconopt.ModelData.addConstraint (ConstraintType constype, double rhs, int slackstatus)
 
int jconopt.ModelData.addConstraint (ConstraintType constype, double rhs)
 
int jconopt.ModelData.addConstraint (ConstraintType constype, double rhs, int[] varindex, double[] value, int[] nlflag, int slackstatus)
 
int jconopt.ModelData.addConstraint (ConstraintType constype, double rhs, int[] varindex, double[] value, int[] nlflag)
 
int jconopt.ModelData.addVariable (double lower, double upper, double curr, int varstatus)
 
int jconopt.ModelData.addVariable (double lower, double upper, double curr)
 
int jconopt.ModelData.addVariable (double lower, double upper)
 
int jconopt.ModelData.addVariable (double lower, double upper, int[] consindex, double[] value, int[] nlflag, double curr, int varstatus)
 
int jconopt.ModelData.addVariable (double lower, double upper, int[] consindex, double[] value, int[] nlflag, double curr)
 
int jconopt.ModelData.addVariable (double lower, double upper, int[] consindex, double[] value, int[] nlflag)
 
void jconopt.ModelData.setObjectiveElement (ObjectiveElement elem, int elemindex)
 
void jconopt.ModelData.setOptimizationSense (Sense sense)
 
void jconopt.ModelData.setInitialStatusOption (int inistat)
 

Detailed Description

Methods that are used to define the model to be solved by CONOPT.

The model is defined by iteratively adding variables and constraints using the jconopt.ModeData.addConstraint and jconopt.ModeData.addVariable methods.

Function Documentation

◆ setProblemDimension()

void jconopt.ModelData.setProblemDimension ( long numvar,
long numcons,
long numnz,
long numnlnz )
inline

sets the problem dimension. This is called if the user wants to implement a custom readMatrix() method.

NOTE: it is not possible to call setProblemDimension() and addConstraint() or addVariable(). The latter functions can only be used if the problem dimension is not set and the default readMatrix() method is used.

Parameters
numvarthe number of variables in the problem
numconsthe number of constraints in the problem
numnzthe number of non-zeros in the constraint matrix
numnlnzthe number of nonlinear non-zeros in the constraint matrix

Reimplemented from jconopt.ConoptModelData.

Definition at line 275 of file ModelData.java.

◆ addConstraint() [1/4]

int jconopt.ModelData.addConstraint ( ConstraintType constype,
double rhs,
int slackstatus )
inline

adds a constraint to the problem. The non-zero coefficients are added later

Parameters
constypethe type of constraint, 0: ==, 1: >=, 2: <=, 3: free
rhsthe right hand side
slackstatusinitial status of the slack variables, see IniStat

Reimplemented from jconopt.ConoptModelData.

Definition at line 289 of file ModelData.java.

◆ addConstraint() [2/4]

int jconopt.ModelData.addConstraint ( ConstraintType constype,
double rhs )
inline

adds a constraint to the problem. The non-zero coefficients are added later

Parameters
constypethe type of constraint, 0: ==, 1: >=, 2: <=, 3: free
rhsthe right hand side

Reimplemented from jconopt.ConoptModelData.

Definition at line 303 of file ModelData.java.

◆ addConstraint() [3/4]

int jconopt.ModelData.addConstraint ( ConstraintType constype,
double rhs,
int[] varindex,
double[] value,
int[] nlflag,
int slackstatus )
inline

adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables

Parameters
constypethe type of constraint, 0: ==, 1: >=, 2: <=, 3: free
rhsthe right hand side
varindexthe variables this constraint has non-zero coefficients
valuethe non-zero of the variable
nlflagflag to set whether the variable belongs to a non-linear term
slackstatusinitial status of the slack variables, see IniStat

Reimplemented from jconopt.ConoptModelData.

Definition at line 320 of file ModelData.java.

◆ addConstraint() [4/4]

int jconopt.ModelData.addConstraint ( ConstraintType constype,
double rhs,
int[] varindex,
double[] value,
int[] nlflag )
inline

adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables

Parameters
constypethe type of constraint, 0: ==, 1: >=, 2: <=, 3: free
rhsthe right hand side
varindexthe variables this constraint has non-zero coefficients
valuethe non-zero of the variable
nlflagflag to set whether the variable belongs to a non-linear term

Reimplemented from jconopt.ConoptModelData.

Definition at line 337 of file ModelData.java.

◆ addVariable() [1/6]

int jconopt.ModelData.addVariable ( double lower,
double upper,
double curr,
int varstatus )
inline

adds a variable to the model. The non-zero coefficients are added later.

Parameters
lowerlower bound for the variable
upperupper bound for the variable
currinitial value of the variable, can be set to 0
varstatusinitial status of the variable, see IniStat

Reimplemented from jconopt.ConoptModelData.

Definition at line 352 of file ModelData.java.

◆ addVariable() [2/6]

int jconopt.ModelData.addVariable ( double lower,
double upper,
double curr )
inline

adds a variable to the model. The non-zero coefficients are added later.

Parameters
lowerlower bound for the variable
upperupper bound for the variable
currinitial value of the variable, can be set to 0

Reimplemented from jconopt.ConoptModelData.

Definition at line 367 of file ModelData.java.

◆ addVariable() [3/6]

int jconopt.ModelData.addVariable ( double lower,
double upper )
inline

adds a variable to the model. The non-zero coefficients are added later.

Parameters
lowerlower bound for the variable
upperupper bound for the variable

Reimplemented from jconopt.ConoptModelData.

Definition at line 381 of file ModelData.java.

◆ addVariable() [4/6]

int jconopt.ModelData.addVariable ( double lower,
double upper,
int[] consindex,
double[] value,
int[] nlflag,
double curr,
int varstatus )
inline

adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.

Parameters
lowerlower bound for the variable
upperupper bound for the variable
consindexthe constraints this variable has non-zero coefficients
valuethe non-zero of the variable
nlflagflag to set whether the variable belongs to a non-linear term
currinitial value of the variable, can be set to 0
varstatusinitial status of the variable, see IniStat

Reimplemented from jconopt.ConoptModelData.

Definition at line 399 of file ModelData.java.

◆ addVariable() [5/6]

int jconopt.ModelData.addVariable ( double lower,
double upper,
int[] consindex,
double[] value,
int[] nlflag,
double curr )
inline

adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.

Parameters
lowerlower bound for the variable
upperupper bound for the variable
consindexthe constraints this variable has non-zero coefficients
valuethe non-zero of the variable
nlflagflag to set whether the variable belongs to a non-linear term
currinitial value of the variable, can be set to 0

Reimplemented from jconopt.ConoptModelData.

Definition at line 417 of file ModelData.java.

◆ addVariable() [6/6]

int jconopt.ModelData.addVariable ( double lower,
double upper,
int[] consindex,
double[] value,
int[] nlflag )
inline

adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.

Parameters
lowerlower bound for the variable
upperupper bound for the variable
consindexthe constraints this variable has non-zero coefficients
valuethe non-zero of the variable
nlflagflag to set whether the variable belongs to a non-linear term

Reimplemented from jconopt.ConoptModelData.

Definition at line 434 of file ModelData.java.

◆ setObjectiveElement()

void jconopt.ModelData.setObjectiveElement ( ObjectiveElement elem,
int elemindex )
inline

sets the index for the objective variable or constraint

Reimplemented from jconopt.ConoptModelData.

Definition at line 444 of file ModelData.java.

◆ setOptimizationSense()

void jconopt.ModelData.setOptimizationSense ( Sense sense)
inline

sets the optimisation direction.

Reimplemented from jconopt.ConoptModelData.

Definition at line 454 of file ModelData.java.

◆ setInitialStatusOption()

void jconopt.ModelData.setInitialStatusOption ( int inistat)
inline

the setting to indicate how the initial status of the variables and slack variables will be handled.

The initial status is set in the addVariable() and addConstraint() methods, or in the readMatrix() method if the classical model input approach is used. By default, the value of inistat is 0, which means that the variable and slack status is ignored.

If inistat == 1: The variable status has the following behaviour:

  • 0: The variable is initialized non-basic (if curr = lower or curr = upper) or super-basic, and
  • 1: The variable is initialized basic The slack status has the following behaviour:
  • 0: The slack is initialized non-basic (if the constraint is binding in the initial point) or super-basic,
  • 1: The slack is initialized basic

If inistat == 2: The variable status has the following behaviour:

  • 0: The variable is initialized at lower bound
  • 1: The variable is initialized at upper bound
  • 2: The variable is initialized basic, and
  • 3: The variable is initialized superbasic. The slack status has the following behaviour:
  • 0: The slack is initialized at lower bound.
  • 1: The slack is initialized at upper bound.
  • 2: The slack is initialized basic, and
  • 3: The slack is initialized superbasic.

Reimplemented from jconopt.ConoptModelData.

Definition at line 488 of file ModelData.java.