modopt.CUTEstProblem
- class modopt.CUTEstProblem(**kwargs)[source]
Class that wraps pyCUTEst problems for modOpt.
General functionality pyCUTEst provides:
find_problems(): Find problems that satisfy given criteria as per CUTEst classification scheme.
problem_properties(): Get properties of a given problem.
print_available_sif_params(): Print available optional input parameters for a given problem.
import_problem(): Import a given problem with optional parameters. Returns a
pycutest.CUTEstProblemobject.
Examples
Import a CUTEst problem named ‘ROSENBR’ and solve it using modOpt
>>> import pycutest >>> cutest_problem = pycutest.import_problem('ROSENBR') >>> import modopt as mo >>> problem = mo.CUTEstProblem(cutest_problem=cutest_problem) >>> optimizer = mo.SLSQP(problem, solver_options={'maxiter':100}) >>> optimizer.solve()
Methods
- _compute_all(x, force_rerun=False, check_failure=False)[source]
Compute and return the objective, constraints, objective gradient, and constraint Jacobian for the given design variable vector.
- Parameters
- x: np.ndarray
Vector of design variable values.
- Returns
- self.ffloat
Objective value.
- self.cnp.ndarray
Constraint vector.
- self.gnp.ndarray
Objective gradient vector.
- self.jnp.ndarray
Constraint Jacobian vector.
- _compute_constraint_jacobian(x, force_rerun=False, check_failure=False)[source]
Compute and return the constraint Jacobian ‘j’ for the given design variable vector ‘x’.
- _compute_constraint_jvp(x, v)[source]
Compute and return the Jacobian-vector product ‘jvp’ for the given design variable vector ‘x’ and vector ‘v’.
- _compute_constraint_vjp(x, v)[source]
Compute and return the vector-Jacobian product ‘vjp’ for the given design variable vector ‘x’ and vector ‘v’.
- _compute_constraints(x, force_rerun=False, check_failure=False)[source]
Compute and return the constraints ‘c’ for the given design variable vector ‘x’.
- _compute_lagrangian(x, mu)[source]
Compute and return the Lagrangian ‘l’ for the given design variable vector ‘x’ and Lagrange multipliers ‘mu’.
- _compute_lagrangian_gradient(x, mu)[source]
Compute and return the Lagrangian gradient ‘lg’ for the given design variable vector ‘x’ and Lagrange multipliers ‘mu’.
- _compute_lagrangian_hessian(x, mu)[source]
Compute and return the Lagrangian Hessian ‘lh’ for the given design variable vector ‘x’ and Lagrange multipliers ‘mu’.
- _compute_lagrangian_hvp(x, mu, v)[source]
Compute and return the Lagrangian Hessian-vector product ‘lhvp’ for the given design variable vector ‘x’, Lagrange multipliers ‘mu’, and vector ‘v’. Only works for CONSTRAINED problems. (v=mu must be specified for constrained problems)
- _compute_objective(x, force_rerun=False, check_failure=False)[source]
Compute and return the objective ‘f’ for the given design variable vector ‘x’.
- _compute_objective_gradient(x, force_rerun=False, check_failure=False)[source]
Compute and return the objective gradient ‘g’ for the given design variable vector ‘x’.