117 double x_L_violation[],
118 double x_U_violation[],
123 double nlp_constraint_violation[],
200 if( System.getProperty(
"os.name").toLowerCase().indexOf(
"win") >= 0 )
207 final String[] candidates = {
"ipopt-3",
"ipopt-0",
"libipopt-3",
"libipopt-0",
"ipopt",
"libipopt" };
208 boolean loadedlib =
false;
209 for( String c : candidates )
213 System.loadLibrary(c);
217 catch( UnsatisfiedLinkError e )
222 throw new UnsatisfiedLinkError(
"Could not load Ipopt library. Check your java.library.path.");
234 System.loadLibrary(
"ipopt");
248 System.loadLibrary(DLL);
262 File file =
new File(path, System.mapLibraryName(DLL));
263 System.load(file.getAbsolutePath());
342 abstract protected boolean eval_f(
377 abstract protected boolean eval_g(
456 abstract protected boolean eval_h(
535 return ipopt == 0 ? false :
true;
658 return this.
GetCurrIterate(ipopt, ip_data, ip_cq, scaled, n,
x, z_L, z_U, m,
g, lambda);
699 double x_L_violation[],
700 double x_U_violation[],
705 double nlp_constraint_violation[],
709 return this.
GetCurrViolations(ipopt, ip_data, ip_cq, scaled, n, x_L_violation, x_U_violation, compl_x_L, compl_x_U, grad_lag_x, m, nlp_constraint_violation, compl_g);
802 double regularization_size,
827 double[] obj_scaling,
832 boolean[] use_x_g_scaling)
855 int[] pos_nonlin_vars)
Ipopt()
Creates a new NLP Solver using a default as the DLL name.
void getVersion(int[] version)
Get version of Ipopt library.
native void FreeIpoptProblem(long ipopt)
static final int RESTORATIONPHASEMODE
abstract boolean get_bounds_info(int n, double[] x_l, double[] x_u, int m, double[] g_l, double[] g_u)
Method to request bounds on the variables and constraints.
double mult_x_L[]
Final multipliers for lower variable bounds.
static final int INSUFFICIENT_MEMORY
static final int DIVERGING_ITERATES
int get_number_of_nonlinear_variables()
When LBFGS hessian approximation is used, this method should be overloaded.
static final int NOT_ENOUGH_DEGREES_OF_FRE
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[])
double [] getUpperBoundMultipliers()
Gives dual multipliers for variable upper bounds in final point.
static final int USER_REQUESTED_STOP
double getObjectiveValue()
Gives objective function value at final point.
static final int INVALID_OPTION
static final int INTERNAL_ERROR
static final int ITERATION_EXCEEDED
int status
Status returned by the solver.
static final int INFEASIBLE_PROBLEM
static final int FORTRAN_STYLE
Use FORTRAN index style for iRow and jCol vectors.
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)
Method to request the starting point before iterating.
static final int UNRECOVERABLE_EXCEPTION
double mult_x_U[]
Final multipliers for upper variable bounds.
native long CreateIpoptProblem(int n, int m, int nele_jac, int nele_hess, int index_style)
static final int WALLTIME_EXCEEDED
This file contains a base class for all exceptions and a set of macros to help with exceptions...
double [] getLowerBoundMultipliers()
Gives dual multipliers for variable lower bounds in final point.
double [] getConstraintValues()
Gives constraint function values at final point.
double obj_val[]
Final value of objective function.
static final int RESTORATION_FAILED
boolean get_curr_iterate(long ip_data, long ip_cq, boolean scaled, int n, double x[], double z_L[], double z_U[], int m, double g[], double lambda[])
Get primal and dual variable values of the current iterate.
boolean setIntegerOption(String keyword, int val)
Function for setting an integer option.
boolean setStringOption(String keyword, String val)
Function for setting a string option.
static final int CPUTIME_EXCEEDED
boolean setNumericOption(String keyword, double val)
Function for setting a number option.
boolean intermediate_callback(int algorithmmode, int iter, double obj_value, double inf_pr, double inf_du, double mu, double d_norm, double regularization_size, double alpha_du, double alpha_pr, int ls_trials, long ip_data, long ip_cq)
Intermediate Callback method for the user.
abstract boolean eval_g(int n, double[] x, boolean new_x, int m, double[] g)
Method to request the constraint values.
Ipopt(String DLL)
Creates a NLP Solver for the given DLL file.
boolean create(int n, int m, int nele_jac, int nele_hess, int index_style)
Create a new problem.
static final int NON_IPOPT_EXCEPTION
static final int ERROR_IN_STEP_COMPUTATION
native boolean AddIpoptStrOption(long ipopt, String keyword, String val)
Ipopt(String path, String DLL)
Creates a NLP Solver for the given DLL file and path.
double callback_grad_f[]
Callback arguments.
native boolean AddIpoptIntOption(long ipopt, String keyword, int val)
static final int SEARCH_DIRECTION_TOO_SMALL
abstract boolean eval_jac_g(int n, double[] x, boolean new_x, int m, int nele_jac, int[] iRow, int[] jCol, double[] values)
Method to request either the sparsity structure or the values of the Jacobian of the constraints...
double x[]
Final value of variable values.
native boolean GetCurrIterate(long ipopt, long ip_data, long ip_cq, boolean scaled, int n, double x[], double z_L[], double z_U[], int m, double g[], double lambda[])
static final int INVALID_NUMBER_DETECTED
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, this method should be overloaded.
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)
Method to request either the sparsity structure or the values of the Hessian of the Lagrangian...
native boolean GetCurrViolations(long ipopt, long ip_data, long ip_cq, boolean scaled, int n, double x_L_violation[], double x_U_violation[], double compl_x_L[], double compl_x_U[], double grad_lag_x[], int m, double nlp_constraint_violation[], double compl_g[])
double g[]
Values of constraint at final point.
int OptimizeNLP()
This function actually solve the problem.
double [] getVariableValues()
Gives primal variable values at final point.
long ipopt
Pointer to the native optimization object.
double [] getConstraintMultipliers()
Gives constraint dual multipliers in final point.
static final int ACCEPTABLE_LEVEL
abstract boolean eval_grad_f(int n, double[] x, boolean new_x, double[] grad_f)
Method to request the gradient of the objective function.
double mult_g[]
Final multipliers for constraints.
int getStatus()
Gives Ipopt status of last OptimizeNLP call.
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.
static final int C_STYLE
Use C index style for iRow and jCol vectors.
native boolean AddIpoptNumOption(long ipopt, String keyword, double val)
static final int REGULARMODE
void dispose()
Dispose of the natively allocated memory.
native void GetVersion(int version[])
boolean get_curr_violations(long ip_data, long ip_cq, boolean scaled, int n, double x_L_violation[], double x_U_violation[], double compl_x_L[], double compl_x_U[], double grad_lag_x[], int m, double nlp_constraint_violation[], double compl_g[])
Get primal and dual infeasibility of the current iterate.
abstract boolean eval_f(int n, double[] x, boolean new_x, double[] obj_value)
Method to request the value of the objective function.
static final int SOLVE_SUCCEEDED
static final int INVALID_PROBLEM_DEFINITION