15 public static void main(String argv[]) {
16 System.loadLibrary(
"conoptjni4");
18 String
name =
"largeres2";
21 LrgRes2ModelData
model =
new LrgRes2ModelData();
39 int license_int_1 = Integer.parseInt(System.getenv(
"CONOPT_LICENSE_INT_1"));
40 int license_int_2 = Integer.parseInt(System.getenv(
"CONOPT_LICENSE_INT_2"));
41 int license_int_3 = Integer.parseInt(System.getenv(
"CONOPT_LICENSE_INT_3"));
42 String
license_text = System.getenv(
"CONOPT_LICENSE_TEXT");
46 }
catch (Exception e) {
47 System.out.println(
"Unable to set license: " + e.getMessage());
72 public LrgRes2ModelData() {
88 int[] index = {varidx};
109 if (rowno == considx) {
110 g = Math.exp(x[varidx]);
121 assert x.length == jac.length;
123 if (rowno == considx) {
124 jac[varidx] = Math.exp(x[varidx]);
static final ConstraintType Eq
A class that can be extended to build and solve a model using Conopt.
static final ObjectiveElement Variable
static final Sense Maximize
static void main(String argv[])
static void java_log(final String name, final String message)
addConstraint(self, *args)
Overload 1: adds a constraint to the problem.
setObjectiveElement(self, elem, elemindex)
sets the index for the objective variable or constraint
addVariable(self, *args)
Overload 1: adds a variable to the model.
setOptimizationSense(self, sense)
sets the optimisation direction.
void buildModel()
adds variables and constraints to the model
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