67 double x[],
double g[],
73 public static final String
DLLNAME =
"jipopt";
75 public static final String
DLLPATH =
"lib";
148 public Ipopt(String path, String DLL)
151 File file =
new File(path, System.mapLibraryName(DLL));
152 System.load(file.getAbsolutePath());
157 int m,
double[] g_l,
double[] g_u);
161 boolean init_z,
double[] z_L,
double[] z_U,
162 int m,
boolean init_lambda,
double[] lambda);
165 abstract protected boolean eval_f(
int n,
double[]
x,
boolean new_x,
double[] obj_value);
168 abstract protected boolean eval_grad_f(
int n,
double[]
x,
boolean new_x,
double[] grad_f);
171 abstract protected boolean eval_g(
int n,
double[]
x,
boolean new_x,
int m,
double[]
g);
174 abstract protected boolean eval_jac_g(
int n,
double[]
x,
boolean new_x,
175 int m,
int nele_jac,
int[] iRow,
int[] jCol,
double[] values);
178 abstract protected boolean eval_h(
int n,
double[]
x,
boolean new_x,
double obj_factor,
179 int m,
double[] lambda,
boolean new_lambda,
238 return ipopt == 0 ? false :
true;
374 boolean[] use_x_g_scaling)
396 int[] pos_nonlin_vars)
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
Number Number * x_scaling
Number Number Number * g_scaling
Number Number Index m
Number of constraints.
Number Number Index Number Number Index Index Index index_style
indexing style for iRow & jCol, 0 for C style, 1 for Fortran style
double[] getVariableValues()
Gives primal variable values at final point.
abstract boolean eval_g(int n, double[] x, boolean new_x, int m, double[] g)
Callback function for the constraints.
static final int SOLVE_SUCCEEDED
The possible Ipopt status return codes: should be kept in sync with Ipopt return codes.
boolean setStringOption(String keyword, String val)
Function for setting a string option.
double[] getConstraintMultipliers()
Gives constraint dual multipliers in final point.
static final int DIVERGING_ITERATES
static final int INFEASIBLE_PROBLEM
abstract boolean get_starting_point(int n, boolean init_x, double[] x, boolean init_z, double[] z_L, double[] z_U, int m, boolean init_lambda, double[] lambda)
Callback function for retrieving a starting point.
boolean get_scaling_parameters(double[] obj_scaling, int n, double[] x_scaling, int m, double[] g_scaling, boolean[] use_x_g_scaling)
If you using_scaling_parameters = true, please overload this method,.
abstract boolean eval_jac_g(int n, double[] x, boolean new_x, int m, int nele_jac, int[] iRow, int[] jCol, double[] values)
Callback function for the constraints Jacobian.
native boolean AddIpoptIntOption(long ipopt, String keyword, int val)
Native function should not be used directly.
static final String DLLPATH
The relative path where the native DLL is found.
Ipopt(String path, String DLL)
Creates a NLP Solver for the given DLL file.
static final int UNRECOVERABLE_EXCEPTION
double mult_x_U[]
Final multipliers for upper variable bounds.
static final int C_STYLE
Use C index style for iRow and jCol vectors.
double g[]
Values of constraint at final point.
double x[]
Final value of variable values.
native int OptimizeTNLP(long ipopt, double x[], double g[], double obj_val[], double mult_g[], double mult_x_L[], double mult_x_U[], double callback_grad_f[], double callback_jac_g[], double callback_hess[])
Native function should not be used directly.
native void FreeIpoptProblem(long ipopt)
Native function should not be used directly.
int status
Status returned by the solver.
static final int INSUFFICIENT_MEMORY
static final int NOT_ENOUGH_DEGREES_OF_FRE
double[] getConstraintValues()
Gives constraint function values at final point.
static final int INVALID_PROBLEM_DEFINITION
double getObjectiveValue()
Gives objective function value at final point.
void dispose()
Dispose of the natively allocated memory.
static final int SEARCH_DIRECTION_TOO_SMALL
abstract boolean eval_grad_f(int n, double[] x, boolean new_x, double[] grad_f)
Callback function for the objective function gradient.
boolean setIntegerOption(String keyword, int val)
Function for setting an integer option.
static final int ITERATION_EXCEEDED
double[] getUpperBoundMultipliers()
Gives dual multipliers for variable upper bounds in final point.
abstract boolean eval_f(int n, double[] x, boolean new_x, double[] obj_value)
Callback function for the objective function.
abstract boolean eval_h(int n, double[] x, boolean new_x, double obj_factor, int m, double[] lambda, boolean new_lambda, int nele_hess, int[] iRow, int[] jCol, double[] values)
Callback function for the hessian.
native boolean AddIpoptStrOption(long ipopt, String keyword, String val)
Native function should not be used directly.
static final int INVALID_NUMBER_DETECTED
boolean create(int n, int m, int nele_jac, int nele_hess, int index_style)
Create a new problem.
boolean get_list_of_nonlinear_variables(int num_nonlin_vars, int[] pos_nonlin_vars)
When LBFGS hessian approximation is used, this method should be overloaded.
double obj_val[]
Final value of objective function.
int getStatus()
Gives Ipopt status of last OptimizeNLP call.
static final int INVALID_OPTION
double[] getLowerBoundMultipliers()
Gives dual multipliers for variable lower bounds in final point.
static final int ACCEPTABLE_LEVEL
long ipopt
Pointer to the native optimization object.
double mult_g[]
Final multipliers for constraints.
Ipopt()
Creates a new NLP Solver using {@value DLLPATH} as path and {@value DLLNAME} as the DLL name.
double mult_x_L[]
Final multipliers for lower variable bounds.
static final int ERROR_IN_STEP_COMPUTATION
static final int USER_REQUESTED_STOP
native boolean AddIpoptNumOption(long ipopt, String keyword, double val)
Native function should not be used directly.
static final int NON_IPOPT_EXCEPTION
static final String DLLNAME
The default DLL name of the native implementation (without any platform dependent prefixes or suffixe...
boolean setNumericOption(String keyword, double val)
Function for setting a number option.
static final int RESTORATION_FAILED
abstract boolean get_bounds_info(int n, double[] x_l, double[] x_u, int m, double[] g_l, double[] g_u)
Callback function for the variable bounds and constraint sides.
static final int FORTRAN_STYLE
Use FORTRAN index style for iRow and jCol vectors.
native long CreateIpoptProblem(int n, int m, int nele_jac, int nele_hess, int index_style)
Native function should not be used directly.
int OptimizeNLP()
This function actually solve the problem.
int get_number_of_nonlinear_variables()
When LBFGS hessian approximation is used, this method should be overloaded.
double callback_grad_f[]
Callback arguments.
static final int CPUTIME_EXCEEDED
static final int INTERNAL_ERROR