CONOPT
Loading...
Searching...
No Matches

A class that can be extended to build and solve a model using Conopt. More...

Public Member Functions

 __init__ (self)
 init(ModelData self) -> ModelData
 
 evaluateNonlinearTerm (self, x, rowno, ignerr, thread)
 callback method for evaluating the nonlinear terms in a given row
 
 evaluateNonlinearJacobian (self, x, rowno, jacnum, ignerr, thread)
 callback method for evaluating the jacobian for the nonlinear terms in a given row
 
 initFDEvaluation (self, x, rowlist, mode, numthread, ignerr)
 callback method for initialising the first derivative evaluation.
 
 endFDEvaluation (self, ignerr)
 Optional function, if defined, it will be called at the end of the function evaluation stage.
 
 evaluateSDLagrangian (self, x, u, hessianrow, hessiancol)
 Computes and returns the numerical values of the Lagrangian of the Hessian.
 
 evaluateSDDirLagrangian (self, x, dx, u, newpoint)
 computes the directional second derivative for the Lagrangian
 
 evaluateDirectionalSD (self, x, dx, rowno, jacnum, thread)
 computes the directional second derivative for a single constraint
 
 initDirectionalSDEval (self, x, dx, rowlist, numthread, newpoint)
 a callback for the initialisation of the second derivative evaluation.
 
 endDirectionalSDEval (self)
 called by CONOPT after a sequence of evaluateDirectionalSD() calls each time either the point or the direction changes.
 
 errorInEvaluation (self)
 reports that an error occurred in the evaluation.
 
 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, *args)
 Overload 1: returns a reference to the variable object
 
 getConstraint (self, *args)
 Overload 1: 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
 
 __disown__ (self)
 
synchronized void delete ()
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
 ModelData ()
 
double evaluateNonlinearTerm (double[] x, int rowno, boolean ignerr, int thread)
 callback method for evaluating the nonlinear terms in a given row
 
void evaluateNonlinearJacobian (double[] x, double[] jac, int rowno, int[] jacnum, boolean ignerr, int thread)
 callback method for evaluating the jacobian for the nonlinear terms in a given row
 
void initFDEvaluation (double[] x, int[] rowlist, EvaluationMode mode, int numthread, boolean ignerr)
 callback method for initialising the first derivative evaluation.
 
void endFDEvaluation (boolean ignerr)
 Optional function, if defined, it will be called at the end of the function evaluation stage. This can be used to clean up any user data generated, such as in FDEvalIni, that was used to improve the efficiency of the function and derivative evaluation.
 
void evaluateSDLagrangian (double[] x, double[] u, int[] hessianrow, int[] hessiancol, double[] hessianval)
 Computes and returns the numerical values of the Lagrangian of the Hessian.
 
void evaluateSDDirLagrangian (double[] x, double[] dx, double[] u, double[] d2g, boolean newpoint)
 computes the directional second derivative for the Lagrangian
 
void evaluateDirectionalSD (double[] x, double[] dx, double[] d2g, int rowno, int[] jacnum, int thread)
 computes the directional second derivative for a single constraint
 
void initDirectionalSDEval (double[] x, double[] dx, int[] rowlist, int numthread, boolean newpoint)
 a callback for the initialisation of the second derivative evaluation.
 
void endDirectionalSDEval ()
 called by CONOPT after a sequence of evaluateDirectionalSD() calls each time either the point or the direction changes.
 
void errorInEvaluation ()
 reports that an error occurred in the evaluation.
 
void setProblemDimension (long numvar, long numcons, long numnz, long numnlnz)
 
int addConstraint (ConstraintType constype, double rhs, int slackstatus)
 
int addConstraint (ConstraintType constype, double rhs)
 
int addConstraint (ConstraintType constype, double rhs, int[] varindex, double[] value, int[] nlflag, int slackstatus)
 
int addConstraint (ConstraintType constype, double rhs, int[] varindex, double[] value, int[] nlflag)
 
int addVariable (double lower, double upper, double curr, int varstatus)
 
int addVariable (double lower, double upper, double curr)
 
int addVariable (double lower, double upper)
 
int addVariable (double lower, double upper, int[] consindex, double[] value, int[] nlflag, double curr, int varstatus)
 
int addVariable (double lower, double upper, int[] consindex, double[] value, int[] nlflag, double curr)
 
int addVariable (double lower, double upper, int[] consindex, double[] value, int[] nlflag)
 
void setObjectiveElement (ObjectiveElement elem, int elemindex)
 
void setOptimizationSense (Sense sense)
 
void setInitialStatusOption (int inistat)
 
int numVar ()
 
int numCons ()
 
int numHessianNonzeros ()
 
Variable getVariable (int index)
 
Constraint getConstraint (int index)
 
void setSDEvaluationType (SDEvaluationType sdevaltype)
 
void setSDLagrangianStructure (int[] rownum, int[] colnum)
 
- Public Member Functions inherited from conopt.ConoptModelData
 __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.
 
 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)
 
 ConoptModelData ()
 
int readMatrix (SWIGTYPE_p_double lower, SWIGTYPE_p_double curr, SWIGTYPE_p_double upper, SWIGTYPE_p_int vsta, SWIGTYPE_p_int type, SWIGTYPE_p_double rhs, SWIGTYPE_p_int esta, SWIGTYPE_p_int colsta, SWIGTYPE_p_int rowno, SWIGTYPE_p_double value, SWIGTYPE_p_int nlflag, int numvar, int numcon, int numnz)
 
int[] getSDLagrangianRowNumbers ()
 
int[] getSDLagrangianColumnNumbers ()
 

Protected Member Functions

 ModelData (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
void swigDirectorDisconnect ()
 
- Protected Member Functions inherited from conopt.ConoptModelData
 ConoptModelData (long cPtr, boolean cMemoryOwn)
 

Static Protected Member Functions

static long getCPtr (ModelData obj)
 
static long swigRelease (ModelData obj)
 
- Static Protected Member Functions inherited from conopt.ConoptModelData
static long getCPtr (ConoptModelData obj)
 
static long swigRelease (ConoptModelData obj)
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
- Properties inherited from conopt.ConoptModelData
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Additional Inherited Members

- Protected Attributes inherited from conopt.ConoptModelData
transient boolean swigCMemOwn
 

Detailed Description

A class that can be extended to build and solve a model using Conopt.

This class is the base class that is used for the extended interfaces for Conopt, namely Python and Java. The virtual methods included in this class can be redefined in the native languages.

Definition at line 2407 of file conopt.py.

Constructor & Destructor Documentation

◆ __init__()

conopt.ModelData.__init__ ( self)

init(ModelData self) -> ModelData

Parameters

self: PyObject *

Definition at line 2420 of file conopt.py.

◆ ModelData() [1/2]

conopt.ModelData.ModelData ( long cPtr,
boolean cMemoryOwn )
inlineprotected

Definition at line 26 of file ModelData.java.

◆ ModelData() [2/2]

conopt.ModelData.ModelData ( )
inline

Definition at line 78 of file ModelData.java.

Member Function Documentation

◆ initFDEvaluation()

conopt.ModelData.initFDEvaluation ( self,
x,
rowlist,
mode,
numthread,
ignerr )

callback method for initialising the first derivative evaluation.

If defined, this method will be called each time the point of interest has changed, and it will define the coming point and tell which constraints CONOPT will need during the following calls to evaluateNonlinearTerm and evaluateNonlinearJacobian.

Parameters
xthe solution vector that needs to be evaluated.
rowlistthe list of rows that will be evaluated for the given point.
modethe evaluation mode for the current iteration. This is either TermsOnly, JacobianOnly or Both. See EvaluationMode for more details.
numthreadthe number of threads that will be used for the following FDEval calls.
ignerra boolean to indicate whether the current point is safe or unsafe.

Notes: an error in the evaluation is reported by calling errorInEvaluation()

Definition at line 2471 of file conopt.py.

◆ initDirectionalSDEval()

conopt.ModelData.initDirectionalSDEval ( self,
x,
dx,
rowlist,
numthread,
newpoint )

a callback for the initialisation of the second derivative evaluation.

This method is called before a sequence of calls to evaluateDirectionalSD(). The user can utilise this method for evaluating common terms and storing important information.

Parameters
xthe solution vector that needs to be evaluated.
dxvector with the direction in which the directional second derivatives should be computed.
rowlistthe list of rows that will be evaluated for the given point.
numthreadthe number of threads that will be used for the following FDEval calls.
newpointa boolean to indicate whether x has changed. If newpoint is false, the values of dx may have changed.

Notes: an error in the evaluation is reported by calling errorInEvaluation()

Definition at line 2559 of file conopt.py.

◆ errorInEvaluation() [1/2]

conopt.ModelData.errorInEvaluation ( self)

reports that an error occurred in the evaluation.

When executing evaluateNonlinearTerm() or evaluateNonlinearJacobian() the number of errors are counted and then if an error limit is exceeded, CONOPT will terminate.

When evaluating second derivative information, any errors reported will inform CONOPT that it is unable to use second order methods for the current point.

Definition at line 2592 of file conopt.py.

◆ __disown__()

conopt.ModelData.__disown__ ( self)

Definition at line 2900 of file conopt.py.

◆ getCPtr()

static long conopt.ModelData.getCPtr ( ModelData obj)
inlinestaticprotected

Definition at line 31 of file ModelData.java.

◆ swigRelease()

static long conopt.ModelData.swigRelease ( ModelData obj)
inlinestaticprotected

Definition at line 35 of file ModelData.java.

◆ finalize()

void conopt.ModelData.finalize ( )
inlineprotected

Reimplemented from conopt.ConoptModelData.

Definition at line 48 of file ModelData.java.

◆ delete()

synchronized void conopt.ModelData.delete ( )
inline

Reimplemented from conopt.ConoptModelData.

Definition at line 52 of file ModelData.java.

◆ swigDirectorDisconnect()

void conopt.ModelData.swigDirectorDisconnect ( )
inlineprotected

Reimplemented from conopt.ConoptModelData.

Definition at line 63 of file ModelData.java.

◆ swigReleaseOwnership()

void conopt.ModelData.swigReleaseOwnership ( )
inline

Reimplemented from conopt.ConoptModelData.

Definition at line 68 of file ModelData.java.

◆ swigTakeOwnership()

void conopt.ModelData.swigTakeOwnership ( )
inline

Reimplemented from conopt.ConoptModelData.

Definition at line 73 of file ModelData.java.

◆ errorInEvaluation() [2/2]

void conopt.ModelData.errorInEvaluation ( )
inline

reports that an error occurred in the evaluation.

When executing evaluateNonlinearTerm() or evaluateNonlinearJacobian() the number of errors are counted and then if an error limit is exceeded, CONOPT will terminate.

When evaluating second derivative information, any errors reported will inform CONOPT that it is unable to use second order methods for the current point.

Definition at line 257 of file ModelData.java.

Property Documentation

◆ thisown

conopt.ModelData.thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static

Definition at line 2417 of file conopt.py.


The documentation for this class was generated from the following files: