28#pragma warning( push )
30#pragma warning( disable: 1744 )
44 ConoptVariable(
int idx,
double low,
double up,
double cur = 0,
int varstat = -1)
80 return consindex_[a] < consindex_[b];
169 virtual int readMatrix(
double lower[],
double curr[],
double upper[],
int vsta[],
int type[],
double rhs[],
170 int esta[],
int colsta[],
int rowno[],
double value[],
int nlflag[],
int numvar,
int numcon,
int numnz);
182 unsigned int numcons,
206 const std::vector<int>& varindex,
207 const std::vector<double>& value,
208 const std::vector<int>& nlflag,
232 const std::vector<int>& consindex,
233 const std::vector<double>& value,
234 const std::vector<int>& nlflag,
332 const std::vector<int>& rownum,
333 const std::vector<int>& colnum
355 virtual int FDEval(
const double x[],
double* g,
double jac[],
int rowno,
const int jacnum[],
int mode,
int ignerr,
356 int* errcnt,
int numvar,
int numjac,
int thread)
375 virtual int FDEvalIni(
const double x[],
const int rowlist[],
int mode,
int listsize,
int numthread,
int ignerr,
376 int* errcnt,
int numvar)
406 virtual int FDInterval(
const double xmin[],
const double xmax[],
double* gmin,
double* gmax,
double jmin[],
407 double jamx[],
int rowno,
const int jacnum[],
int mode,
double pinf,
int numvar,
int numjac)
417 virtual int SDLagrSize(
int* nodrv,
int numvar,
int numcon,
int* nhess,
int maxhess)
432 virtual int SDLagrVal(
const double x[],
const double u[],
const int hsrw[],
const int hscl[],
double hsvl[],
433 int* nodrv,
int numvar,
int numcon,
int nhess)
445 virtual int SDDirLagr(
const double x[],
const double dx[],
const double u[],
double d2g[],
int newpt,
int* nodrv,
446 int numvar,
int numcon)
458 virtual int SDDir(
const double x[],
const double dx[],
double d2g[],
int rowno,
const int jacnum[],
int* nodrv,
459 int numvar,
int numjac,
int thread)
473 virtual int SDDirIni(
const double x[],
const double dx[],
const int rowlist[],
int listsize,
int numthread,
474 int newpt,
int* nodrv,
int numvar)
503 constraints_.clear();
520 unsigned int numvar_;
521 unsigned int numcons_;
523 unsigned int numnlnz_;
534 std::vector<ConoptVariable> variables_;
535 std::vector<ConoptConstraint> constraints_;
537 std::vector<int> hessrownum_;
538 std::vector<int> hesscolnum_;
542#pragma warning( pop )
const std::vector< int > & getSDLagrangianColumnNumbers() const
returns the column numbers in the second derivative of the lagrangian structure
const std::vector< int > & getSDLagrangianRowNumbers() const
returns the row numbers in the second derivative of the lagrangian structure
virtual ~ConoptModelData()
ConoptObjectiveElement
the element that is used for the objective function
int addVariable(double lower, double upper, double curr=0, int varstatus=-1)
adds a variable to the model. The non-zero coefficients are added later.
int addVariable(double lower, double upper, const std::vector< int > &consindex, const std::vector< double > &value, const std::vector< int > &nlflag, double curr=0, int varstatus=-1)
adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
ConoptSense
the objective sense
void setObjectiveElement(ConoptObjectiveElement elem, int elemindex)
sets the index for the objective variable or constraint
int addConstraint(ConoptConstraintType constype, double rhs, int slackstatus=-1)
adds a constraint to the problem. The non-zero coefficients are added later
ConoptConstraintType
the constraint type
int addConstraint(ConoptConstraintType constype, double rhs, const std::vector< int > &varindex, const std::vector< double > &value, const std::vector< int > &nlflag, int slackstatus=-1)
adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
void setOptimizationSense(ConoptSense sense)
sets the optimisation direction.
virtual int readMatrix(double lower[], double curr[], double upper[], int vsta[], int type[], double rhs[], int esta[], int colsta[], int rowno[], double value[], int nlflag[], int numvar, int numcon, int numnz)
loads the structure of the model into CONOPT.
void setProblemDimension(unsigned int numvar, unsigned int numcons, unsigned int numnz, unsigned int numnlnz)
sets the problem dimension. This is called if the user wants to implement a custom readMatrix() metho...
void setInitialStatusOption(int inistat)
the setting to indicate how the initial status of the variables and slack variables will be handled.
void setSDLagrangianStructure(const std::vector< int > &rownum, const std::vector< int > &colnum)
sets the structure of the second derivatives of the Lagrangian
void setSDEvaluationType(ConoptSDEvaluationType sdevaltype)
informs CONOPT of the method for evaluating the second derivative
ConoptSDEvaluationType
the evaluation type for the directional second derivatives
virtual int SDDirLagr(const double x[], const double dx[], const double u[], double d2g[], int newpt, int *nodrv, int numvar, int numcon)
computes the directional second derivative for the Lagrangian
virtual int SDDir(const double x[], const double dx[], double d2g[], int rowno, const int jacnum[], int *nodrv, int numvar, int numjac, int thread)
computes the directional second derivative for a single constraint
virtual int SDDirIni(const double x[], const double dx[], const int rowlist[], int listsize, int numthread, int newpt, int *nodrv, int numvar)
called by CONOPT before a sequence of 2DDir calls each time either the point or the direction changes...
virtual int SDDirEnd(int *nodrv)
called by CONOPT after a sequence of 2DDir calls each time either the point or the direction changes.
virtual int SDLagrVal(const double x[], const double u[], const int hsrw[], const int hscl[], double hsvl[], int *nodrv, int numvar, int numcon, int nhess)
Computes and returns the numerical values of the Hessian.
virtual int FDEval(const double x[], double *g, double jac[], int rowno, const int jacnum[], int mode, int ignerr, int *errcnt, int numvar, int numjac, int thread)
defines the nonlinearities of the model by returning numerical values.
virtual int FDEvalEnd(int ignerr, int *errcnt)
an optional function that will be called at the end of the function evaluation stage.
virtual int FDEvalIni(const double x[], const int rowlist[], int mode, int listsize, int numthread, int ignerr, int *errcnt, int numvar)
an optional function that can be used to improve the efficiency of the function evaulations.
virtual int FDInterval(const double xmin[], const double xmax[], double *gmin, double *gmax, double jmin[], double jamx[], int rowno, const int jacnum[], int mode, double pinf, int numvar, int numjac)
defines intervals for the nonlinearities of the model, again by returning numerical values.
int numCons() const
returns the number of constraints in the model
int numVar() const
returns the number of variables in the model
int numHessianNonzeros() const
returns the number of non-zeros in the Hessian
const ConoptConstraint & getConstraint(int index) const
returns a reference to the constraint object
const ConoptVariable & getVariable(int index) const
returns a reference to the variable object
ConoptConstraintType constype
ConoptConstraint(int idx, ConoptConstraintType type, double bound, int slackstat)
std::vector< int > sortorder_
void addNonzero(int conindex, double value, int nlflag)
adds a non-zero to the variable data
std::vector< int > consindex_
void sortNonzeros()
sorts the non-zeros by constraint index.
ConoptVariable(int idx, double low, double up, double cur=0, int varstat=-1)
std::vector< int > nlflag_
std::vector< double > value_