CONOPT
|
The Model Data class. More...
Public Member Functions | |
__init__ (self) | |
Constructor. | |
readMatrix (self, lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, numvar, numcon, numnz) | |
loads the structure of the model into CONOPT. | |
setProblemDimension (self, numvar, numcons, numnz, numnlnz) | |
sets the problem dimension. | |
addConstraint (self, *args) | |
Overload 1: adds a constraint to the problem. | |
addVariable (self, *args) | |
Overload 1: adds a variable to the model. | |
setObjectiveElement (self, elem, elemindex) | |
sets the index for the objective variable or constraint | |
setOptimizationSense (self, sense) | |
sets the optimisation direction. | |
setInitialStatusOption (self, inistat) | |
the setting to indicate how the initial status of the variables and slack variables will be handled. | |
numVar (self) | |
returns the number of variables in the model | |
numCons (self) | |
returns the number of constraints in the model | |
numHessianNonzeros (self) | |
returns the number of non-zeros in the Hessian | |
getVariable (self, index) | |
returns a reference to the variable object | |
getConstraint (self, index) | |
returns a reference to the constraint object | |
setSDEvaluationType (self, sdevaltype) | |
informs CONOPT of the method for evaluating the second derivative | |
setSDLagrangianStructure (self, rownum, colnum) | |
sets the structure of the second derivatives of the Lagrangian | |
getSDLagrangianRowNumbers (self) | |
returns the row numbers in the second derivative of the lagrangian structure | |
getSDLagrangianColumnNumbers (self) | |
returns the column numbers in the second derivative of the lagrangian structure | |
__disown__ (self) | |
Properties | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
The Model Data class.
Definition at line 1951 of file pyconopt.py.
pyconopt.ConoptModelData.__init__ | ( | self | ) |
Constructor.
Definition at line 1957 of file pyconopt.py.
pyconopt.ConoptModelData.readMatrix | ( | self, | |
lower, | |||
curr, | |||
upper, | |||
vsta, | |||
type, | |||
rhs, | |||
esta, | |||
colsta, | |||
rowno, | |||
value, | |||
nlflag, | |||
numvar, | |||
numcon, | |||
numnz ) |
loads the structure of the model into CONOPT.
Using the C++ interface, there are two ways to load the model into CONOPT. The first method follows the process used for the Fortran and C interfaces. This involves:
The second method makes use of the convenience functions included in the C++ interface. Within the ConoptModelData the methods addConstraint() and addVariable() are provided. As such, to load the model into CONOPT, you must:
Definition at line 1966 of file pyconopt.py.
pyconopt.ConoptModelData.setProblemDimension | ( | self, | |
numvar, | |||
numcons, | |||
numnz, | |||
numnlnz ) |
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.
numvar | the number of variables in the problem |
numcons | the number of constraints in the problem |
numnz | the number of non-zeros in the constraint matrix |
numnlnz | the number of nonlinear non-zeros in the constraint matrix |
Reimplemented in pyconopt.ModelData.
Definition at line 1995 of file pyconopt.py.
pyconopt.ConoptModelData.addConstraint | ( | self, | |
* | args ) |
Overload 1: adds a constraint to the problem.
The non-zero coefficients are added later
constype | the type of constraint, 0: ==, 1: >=, 2: <=, 3: free |
rhs | the right hand side |
slackstatus | initial status of the slack variables, see IniStat |
|
Overload 2: adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
constype | the type of constraint, 0: ==, 1: >=, 2: <=, 3: free |
rhs | the right hand side |
varindex | the variables this constraint has non-zero coefficients |
value | the non-zero of the variable |
nlflag | flag to set whether the variable belongs to a non-linear term |
slackstatus | initial status of the slack variables, see IniStat |
|
Overload 3: adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
constype | the type of constraint, 0: ==, 1: >=, 2: <=, 3: free |
rhs | the right hand side |
varindex | the variables this constraint has non-zero coefficients |
value | the non-zero of the variable |
nlflag | flag to set whether the variable belongs to a non-linear term |
slackstatus | initial status of the slack variables, see IniStat |
Reimplemented in pyconopt.ModelData.
Definition at line 2011 of file pyconopt.py.
pyconopt.ConoptModelData.addVariable | ( | self, | |
* | args ) |
Overload 1: adds a variable to the model.
The non-zero coefficients are added later.
lower | lower bound for the variable |
upper | upper bound for the variable |
curr | initial value of the variable, can be set to 0 |
varstatus | initial status of the variable, see IniStat |
|
Overload 2: adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
lower | lower bound for the variable |
upper | upper bound for the variable |
consindex | the constraints this variable has non-zero coefficients |
value | the non-zero of the variable |
nlflag | flag to set whether the variable belongs to a non-linear term |
curr | initial value of the variable, can be set to 0 |
varstatus | initial status of the variable, see IniStat |
|
Overload 3: adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
lower | lower bound for the variable |
upper | upper bound for the variable |
consindex | the constraints this variable has non-zero coefficients |
value | the non-zero of the variable |
nlflag | flag to set whether the variable belongs to a non-linear term |
curr | initial value of the variable, can be set to 0 |
varstatus | initial status of the variable, see IniStat |
|
Overload 4: adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
lower | lower bound for the variable |
upper | upper bound for the variable |
consindex | the constraints this variable has non-zero coefficients |
value | the non-zero of the variable |
nlflag | flag to set whether the variable belongs to a non-linear term |
curr | initial value of the variable, can be set to 0 |
varstatus | initial status of the variable, see IniStat |
Reimplemented in pyconopt.ModelData.
Definition at line 2052 of file pyconopt.py.
pyconopt.ConoptModelData.setObjectiveElement | ( | self, | |
elem, | |||
elemindex ) |
sets the index for the objective variable or constraint
Reimplemented in pyconopt.ModelData.
Definition at line 2111 of file pyconopt.py.
pyconopt.ConoptModelData.setOptimizationSense | ( | self, | |
sense ) |
sets the optimisation direction.
Reimplemented in pyconopt.ModelData.
Definition at line 2119 of file pyconopt.py.
pyconopt.ConoptModelData.setInitialStatusOption | ( | self, | |
inistat ) |
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:
If inistat == 2: The variable status has the following behaviour:
Reimplemented in pyconopt.ModelData.
Definition at line 2127 of file pyconopt.py.
pyconopt.ConoptModelData.numVar | ( | self | ) |
returns the number of variables in the model
Reimplemented in pyconopt.ModelData.
Definition at line 2159 of file pyconopt.py.
pyconopt.ConoptModelData.numCons | ( | self | ) |
returns the number of constraints in the model
Reimplemented in pyconopt.ModelData.
Definition at line 2167 of file pyconopt.py.
pyconopt.ConoptModelData.numHessianNonzeros | ( | self | ) |
returns the number of non-zeros in the Hessian
Reimplemented in pyconopt.ModelData.
Definition at line 2175 of file pyconopt.py.
pyconopt.ConoptModelData.getVariable | ( | self, | |
index ) |
returns a reference to the variable object
Reimplemented in pyconopt.ModelData.
Definition at line 2183 of file pyconopt.py.
pyconopt.ConoptModelData.getConstraint | ( | self, | |
index ) |
returns a reference to the constraint object
Reimplemented in pyconopt.ModelData.
Definition at line 2191 of file pyconopt.py.
pyconopt.ConoptModelData.setSDEvaluationType | ( | self, | |
sdevaltype ) |
informs CONOPT of the method for evaluating the second derivative
Reimplemented in pyconopt.ModelData.
Definition at line 2199 of file pyconopt.py.
pyconopt.ConoptModelData.setSDLagrangianStructure | ( | self, | |
rownum, | |||
colnum ) |
sets the structure of the second derivatives of the Lagrangian
rownum | Vector of row numbers of the lower triangular part of the Hessian. |
colnum | Vector of column numbers of the lower triangular part of the Hessian. |
Reimplemented in pyconopt.ModelData.
Definition at line 2207 of file pyconopt.py.
pyconopt.ConoptModelData.getSDLagrangianRowNumbers | ( | self | ) |
returns the row numbers in the second derivative of the lagrangian structure
Definition at line 2218 of file pyconopt.py.
pyconopt.ConoptModelData.getSDLagrangianColumnNumbers | ( | self | ) |
returns the column numbers in the second derivative of the lagrangian structure
Definition at line 2222 of file pyconopt.py.
pyconopt.ConoptModelData.__disown__ | ( | self | ) |
Definition at line 2225 of file pyconopt.py.
|
static |
Definition at line 1954 of file pyconopt.py.