76 int FDEval(
const double x[],
double *g,
double jac[],
int rowno,
const int jacnum[],
int mode,
77 int ignerr,
int *errcnt,
int numvar,
int numjac,
int thread)
override
94 if (mode == 1 || mode == 3)
99 if (mode == 2 || mode == 3)
113 if (mode == 1 || mode == 3)
118 if (mode == 2 || mode == 3)
147 conopt.setMessageHandler(msghandler);
153 conopt.loadModel(modeldata);
158#if defined(CONOPT_LICENSE_INT_1) && defined(CONOPT_LICENSE_INT_2) && defined(CONOPT_LICENSE_INT_3) && defined(CONOPT_LICENSE_TEXT)
159 std::string license = CONOPT_LICENSE_TEXT;
160 COI_Error +=
conopt.setLicense(CONOPT_LICENSE_INT_1, CONOPT_LICENSE_INT_2, CONOPT_LICENSE_INT_3, license);
174 else if (
conopt.solutionStatus() != 1 ||
conopt.modelStatus() < 4 ||
conopt.modelStatus() > 5)
176 cpp_log(
conopt,
"Solver or Model status not as expected (1,4) or (1,5)", -1);
static constexpr double Infinity
CONOPT C++ interface header file. This is the main object for the CONOPT C++ interface.
int main(int argc, char **argv)
Main program. A simple setup and call of CONOPT.
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) override
defines the nonlinearities of the model by returning numerical values.
void buildModel()
adds the variables and constraints for the problem
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 addConstraint(ConoptConstraintType constype, double rhs, int slackstatus=-1)
adds a constraint to the problem. The non-zero coefficients are added later
void cpp_log(Conopt &conopt, std::string msg, int code)
std::string getProgramName(char *execname)