77 int FDEval(
const double x[],
double *g,
double jac[],
int rowno,
const int jacnum[],
int mode,
78 int ignerr,
int *errcnt,
int numvar,
int numjac,
int thread)
override
95 if (mode == 1 || mode == 3)
100 if (mode == 2 || mode == 3)
114 if (mode == 1 || mode == 3)
119 if (mode == 2 || mode == 3)
148 conopt.setMessageHandler(msghandler);
154 conopt.loadModel(modeldata);
159#if defined(CONOPT_LICENSE_INT_1) && defined(CONOPT_LICENSE_INT_2) && \
160 defined(CONOPT_LICENSE_INT_3) && defined(CONOPT_LICENSE_TEXT)
161 std::string license = CONOPT_LICENSE_TEXT;
163 CONOPT_LICENSE_INT_1, CONOPT_LICENSE_INT_2, CONOPT_LICENSE_INT_3, license);
169 "Skipping COI_Solve due to license error. COI_Error = " + std::to_string(
COI_Error));
181 else if (
conopt.solutionStatus() != 1 ||
conopt.modelStatus() < 4 ||
conopt.modelStatus() > 5)
183 cpp_log(
conopt,
"Solver or Model status not as expected (1,4) or (1,5)");
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)
std::string getProgramName(char *execname)