33int COI_CALLCONV
QP_ReadMatrix(
double LOWER[],
double CURR[],
double UPPER[],
int VSTA[],
int TYPE[],
double RHS[],
34 int ESTA[],
int COLSTA[],
int ROWNO[],
double VALUE[],
35 int NLFLAG[],
int NUMVAR,
int NUMCON,
int NUMNZ,
void* USRMEM )
45 for ( i=0; i<
NN; i++ )
80 for ( i=0; i<
NN; i++ ) {
99int COI_CALLCONV
QP_FDEval(
const double X[],
double* G,
double JAC[],
int ROWNO,
const int JACNUM[],
int MODE,
100 int IGNERR,
int* ERRCNT,
int NUMVAR,
int NUMJAC,
int THREAD,
void* USRMEM )
112 if ( MODE == 1 || MODE == 3 ) {
114 for ( k=0; k<
NQ; k++ ) {
126 if ( MODE == 2 || MODE == 3 ) {
127 for ( i=0; i<
NN; i++ )
129 for ( k=0; k<
NQ; k++ ) {
132 JAC[i] +=
Q[k]*(X[i]-
Target[i]);
134 JAC[i] +=
Q[k]*(X[j]-
Target[j]);
135 JAC[j] +=
Q[k]*(X[i]-
Target[i]);
152int COI_CALLCONV
QP_2DDir(
const double X[],
const double* DX,
double D2G[],
int ROWNO,
153 const int JACNUM[],
int* NODRV,
int NUMVAR,
int NUMJAC,
int THREAD,
void* USRMEM )
161 for ( i=0; i<
NN; i++ )
163 for ( k=0; k<
NQ; k++ ) {
166 D2G[i] +=
Q[k]*DX[i];
168 D2G[i] +=
Q[k]*DX[j];
169 D2G[j] +=
Q[k]*DX[i];
182 int NUMVAR,
int NUMCON,
int NHESS,
void* USRMEM )
185 for ( k=0; k<
NQ; k++ ) {
197int COI_CALLCONV
QP_2DLagrVal(
const double X[],
const double U[],
const int HSRW[],
const int HSCL[],
198 double HSVL[],
int* NODRV,
int NUMVAR,
int NUMCON,
int NHESS,
void* USRMEM )
202 for ( k=0; k<
NQ; k++ )
220 for ( i=0; i<
NN; i++ ) {
258#if defined(LICENSE_INT_1) && defined(LICENSE_INT_2) && defined(LICENSE_INT_3) && defined(LICENSE_TEXT)
263 printf(
"Skipping COI_Solve due to setup errors. COI_Error = %d\n",
COI_Error);
266 printf(
"After solving. COI_Error =%d\n",
COI_Error);
270 c_log(
"Status or Solution routine was not called", -1); }
272 c_log(
"Incorrect Model or Solver Status", -1); }
273 else if ( fabs(
OBJ-59978.000 ) > 0.001 ) {
274 c_log(
"Incorrect objective returned", -1); };
275 c_log(
"Successful Solve",
OK );
int COI_CALLCONV COIDEF_ReadMatrix(coiHandle_t cntvect, COI_READMATRIX_t coi_readmatrix)
define callback routine for providing the matrix data to CONOPT.
int COI_CALLCONV COIDEF_Message(coiHandle_t cntvect, COI_MESSAGE_t coi_message)
define callback routine for handling messages returned during the solution process.
int COI_CALLCONV COIDEF_Solution(coiHandle_t cntvect, COI_SOLUTION_t coi_solution)
define callback routine for returning the final solution values.
int COI_CALLCONV COIDEF_Status(coiHandle_t cntvect, COI_STATUS_t coi_status)
define callback routine for returning the completion status.
int COI_CALLCONV COIDEF_ErrMsg(coiHandle_t cntvect, COI_ERRMSG_t coi_errmsg)
define callback routine for returning error messages for row, column or Jacobian elements.
int COI_CALLCONV COIDEF_FDEval(coiHandle_t cntvect, COI_FDEVAL_t coi_fdeval)
define callback routine for performing function and derivative evaluations.
int COI_CALLCONV COIDEF_2DLagrVal(coiHandle_t cntvect, COI_2DLAGRVAL_t coi_2dlagrval)
define callback routine for computing the values of the second derivatives of the Lagrangian.
int COI_CALLCONV COIDEF_2DDir(coiHandle_t cntvect, COI_2DDIR_t coi_2ddir)
define callback routine for computing the second derivative for a constraint in a direction.
int COI_CALLCONV COIDEF_2DLagrStr(coiHandle_t cntvect, COI_2DLAGRSTR_t coi_2dlagrstr)
define callback routine for providing the structure of the second derivatives of the Lagrangian.
int COI_CALLCONV COIDEF_DebugFV(coiHandle_t cntvect, int debugfv)
turn Debugging of FDEval on and off.
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_StdOut(coiHandle_t cntvect, int tostdout)
allow output to StdOut.
int COI_CALLCONV COIDEF_NumHess(coiHandle_t cntvect, int numhess)
defines the Number of Hessian Nonzeros.
int COI_CALLCONV COIDEF_ObjCon(coiHandle_t cntvect, int objcon)
defines the Objective Constraint.
int COI_CALLCONV COIDEF_NumVar(coiHandle_t cntvect, int numvar)
defines the number of variables in the model.
int COI_CALLCONV COIDEF_NumNz(coiHandle_t cntvect, int numnz)
defines the number of nonzero elements in the Jacobian.
int COI_CALLCONV COIDEF_NumCon(coiHandle_t cntvect, int numcon)
defines the number of constraints in the model.
int COI_CALLCONV COIDEF_OptDir(coiHandle_t cntvect, int optdir)
defines the Optimization Direction.
int COI_CALLCONV COIDEF_NumNlNz(coiHandle_t cntvect, int numnlnz)
defines the Number of Nonlinear Nonzeros.
int COI_CALLCONV COI_Solve(coiHandle_t cntvect)
method for starting the solving process of CONOPT.
int COI_CALLCONV QP_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, void *USRMEM)
Compute nonlinear terms and non-constant Jacobian elements.
int COI_CALLCONV QP_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, void *USRMEM)
Define information about the model.
int COI_CALLCONV QP_2DDir(const double X[], const double DX[], double D2G[], int ROWNO, const int JACNUM[], int *NODRV, int NUMVAR, int NUMJAC, int THREAD, void *USRMEM)
Computes the second derivative of a constraint in a direction.
int COI_CALLCONV QP_2DLagrStr(int HSRW[], int HSCL[], int *NODRV, int NUMVAR, int NUMCON, int NHESS, void *USRMEM)
Specify the structure of the Lagrangian of the Hessian.
int COI_CALLCONV QP_2DLagrVal(const double X[], const double U[], const int HSRW[], const int HSCL[], double HSVL[], int *NODRV, int NUMVAR, int NUMCON, int NHESS, void *USRMEM)
Compute the Lagrangian of the Hessian.
int main(int argc, char **argv)
Main program. A simple setup and call of CONOPT.
int COI_CALLCONV QP_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, void *USRMEM)
Compute nonlinear terms and non-constant Jacobian elements.
int COI_CALLCONV QP_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, void *USRMEM)
Define information about the model.
int COI_CALLCONV QP_2DLagrStr(int HSRW[], int HSCL[], int *NODRV, int NUMVAR, int NUMCON, int NHESS, void *USRMEM)
Specify the structure of the Lagrangian of the Hessian.
int COI_CALLCONV QP_2DLagrVal(const double X[], const double U[], const int HSRW[], const int HSCL[], double HSVL[], int *NODRV, int NUMVAR, int NUMCON, int NHESS, void *USRMEM)
Compute the Lagrangian of the Hessian.
int COI_CALLCONV QP_2DDir(const double X[], const double *DX, double D2G[], int ROWNO, const int JACNUM[], int *NODRV, int NUMVAR, int NUMJAC, int THREAD, void *USRMEM)
Computes the second derivative of a constraint in a direction.
int COI_CALLCONV Std_Status(int MODSTA, int SOLSTA, int ITER, double OBJVAL, void *USRMEM)
int COI_CALLCONV Std_Message(int SMSG, int DMSG, int NMSG, char *MSGV[], void *USRMEM)
void c_log(char *msgt, int code)
int COI_CALLCONV Std_ErrMsg(int ROWNO, int COLNO, int POSNO, const char *MSG, void *USRMEM)
int COI_CALLCONV Std_Solution(const double XVAL[], const double XMAR[], const int XBAS[], const int XSTA[], const double YVAL[], const double YMAR[], const int YBAS[], const int YSTA[], int NUMVAR, int NUMCON, void *USRMEM)