Python API Reference¶
Inner PANOC solver¶
- class panocpy._panocpy.PANOCSolver
C++ documentation:
pa::PANOCSolver
- __call__(self: panocpy._panocpy.PANOCSolver, problem: panocpy._panocpy.Problem, Σ: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict]
Solve.
- Parameters
problem – Problem to solve
Σ – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g(x) - z\)
Statistics
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: panocpy._panocpy.PANOCSolver) -> None
__init__(self: panocpy._panocpy.PANOCSolver, panoc_params: panocpy._panocpy.PANOCParams, lbfgs_direction: panocpy._panocpy.LBFGSDirection) -> None
__init__(self: panocpy._panocpy.PANOCSolver, panoc_params: panocpy._panocpy.PANOCParams, lbfgs_params: panocpy._panocpy.LBFGSParams) -> None
__init__(self: panocpy._panocpy.PANOCSolver, panoc_params: panocpy._panocpy.PANOCParams, direction: panocpy._panocpy.PANOCDirection) -> None
- set_progress_callback(self: panocpy._panocpy.PANOCSolver, callback: Callable[[panocpy._panocpy.PANOCProgressInfo], None]) None
Attach a callback that is called on each iteration of the solver.
- property direction
- property params
- class panocpy._panocpy.PANOCParams
C++ documentation:
pa::PANOCParams
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: panocpy._panocpy.PANOCParams) -> None
__init__(self: panocpy._panocpy.PANOCParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.PANOCParams) dict
- property L_max
- property L_min
- property Lipschitz
- property alternative_linesearch_cond
- property lbfgs_stepsize
- property max_iter
- property max_no_progress
- property max_time
- property print_interval
- property quadratic_upperbound_tolerance_factor
- property update_lipschitz_in_linesearch
- property τ_min
- class panocpy._panocpy.LBFGSParams
C++ documentation:
pa::LBFGSParams
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: panocpy._panocpy.LBFGSParams) -> None
__init__(self: panocpy._panocpy.LBFGSParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.LBFGSParams) dict
- property cbfgs
- property memory
- property rescale_when_γ_changes
Inner Structured PANOC solver¶
- class panocpy._panocpy.StructuredPANOCLBFGSSolver
C++ documentation:
pa::StructuredPANOCLBFGSSolver
- __call__(self: panocpy._panocpy.StructuredPANOCLBFGSSolver, problem: panocpy._panocpy.Problem, Σ: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict]
Solve.
- Parameters
problem – Problem to solve
Σ – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g(x) - z\)
Statistics
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: panocpy._panocpy.StructuredPANOCLBFGSSolver) -> None
__init__(self: panocpy._panocpy.StructuredPANOCLBFGSSolver, panoc_params: panocpy._panocpy.StructuredPANOCLBFGSParams, lbfgs_params: panocpy._panocpy.LBFGSParams) -> None
- set_progress_callback(self: panocpy._panocpy.StructuredPANOCLBFGSSolver, callback: Callable[[panocpy._panocpy.StructuredPANOCLBFGSProgressInfo], None]) None
Attach a callback that is called on each iteration of the solver.
- property params
- class panocpy._panocpy.StructuredPANOCLBFGSParams
C++ documentation:
pa::StructuredPANOCLBFGSParams
- __init__(self: panocpy._panocpy.StructuredPANOCLBFGSParams, **kwargs) None
- to_dict(self: panocpy._panocpy.StructuredPANOCLBFGSParams) dict
- property L_max
- property L_min
- property Lipschitz
- property alternative_linesearch_cond
- property full_augmented_hessian
- property hessian_vec_finited_differences
- property lbfgs_stepsize
- property max_iter
- property max_no_progress
- property max_time
- property nonmonotone_linesearch
- property print_interval
- property quadratic_upperbound_tolerance_factor
- property stop_crit
- property update_lipschitz_in_linesearch
- property τ_min
Outer ALM solver¶
- class panocpy._panocpy.ALMSolver
Main augmented Lagrangian solver.
C++ documentation:
pa::ALMSolver
- __call__(self: panocpy._panocpy.ALMSolver, problem: panocpy._panocpy.Problem, x: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None, y: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict]
Solve.
- Parameters
problem – Problem to solve.
y – Initial guess for Lagrange multipliers \(y\)
x – Initial guess for decision variables \(x\)
- Returns
Lagrange multipliers \(y\) at the solution
Solution \(x\)
Statistics
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: panocpy._panocpy.ALMSolver) -> None
Build an ALM solver using Structured PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, panoc_solver: panocpy._panocpy.PANOCSolver) -> None
Build an ALM solver using PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, pga_solver: panocpy._panocpy.PGASolver) -> None
Build an ALM solver using the projected gradient algorithm as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, structuredpanoc_solver: panocpy._panocpy.StructuredPANOCLBFGSSolver) -> None
Build an ALM solver using Structured PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, inner_solver: panocpy._panocpy.InnerSolver) -> None
Build an ALM solver using a custom inner solver.
__init__(self: panocpy._panocpy.ALMSolver, panoc_solver: panocpy._panocpy.PANOCSolver) -> None
Build an ALM solver using PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, pga_solver: panocpy._panocpy.PGASolver) -> None
Build an ALM solver using the projected gradient algorithm as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, structuredpanoc_solver: panocpy._panocpy.StructuredPANOCLBFGSSolver) -> None
Build an ALM solver using Structured PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, inner_solver: panocpy._panocpy.InnerSolver) -> None
Build an ALM solver using a custom inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams) -> None
Build an ALM solver using Structured PANOC as inner solver.
- property inner_solver
- property params
- class panocpy._panocpy.ALMParams
C++ documentation:
pa::ALMParams
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: panocpy._panocpy.ALMParams) -> None
__init__(self: panocpy._panocpy.ALMParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.ALMParams) dict
- property M
- property max_iter
- property max_num_initial_retries
- property max_num_retries
- property max_time
- property max_total_num_retries
- property preconditioning
- property print_interval
- property single_penalty_factor
- property Δ
- property Δ_lower
- property Σ_0
- property Σ_0_lower
- property Σ_max
- property Σ_min
- property δ
- property ε
- property ε_0
- property ε_0_increase
- property θ
- property ρ
- property ρ_increase
- property σ_0
Problem formulation¶
- class panocpy._panocpy.Problem
C++ documentation:
pa::Problem
- __init__(self: panocpy._panocpy.Problem, n: int, m: int) None
- Parameters
n – Number of unknowns
m – Number of constraints
- property C
Box constraints on \(x\)
- property D
Box constraints on \(g(x)\)
- property f
Objective funcion, \(f(x)\)
- property g
Constraint function, \(g(x)\)
- property grad_f
Gradient of the objective function, \(\nabla f(x)\)
- property grad_g_prod
Gradient of constraint function times vector, \(\nabla g(x)\, v\)
- property grad_gi
Gradient vector of the \(i\)-th component of the constriant function, \(\nabla g_i(x)\)
- property hess_L
Hessian of the Lagrangian function, \(\nabla^2_{xx} L(x,y)\)
- property hess_L_prod
Hessian of the Lagrangian function times vector, \(\nabla^2_{xx} L(x,y)\, v\)
- property m
Number of general constraints, dimension of \(g(x)\)
- property n
Number of unknowns, dimension of \(x\)
- class panocpy._panocpy.ProblemWithParam
C++ documentation:
pa::ProblemWithParam
See
panocpy._panocpy.Problem
for the full documentation.- __init__(self: panocpy._panocpy.ProblemWithParam, n: int, m: int) None
- property C
- property D
- property f
- property g
- property grad_f
- property grad_g_prod
- property grad_gi
- property hess_L
- property hess_L_prod
- property m
- property n
- property param
Parameter vector \(p\) of the problem
CasADi Interface¶
- panocpy.casadi_problem.compile_and_load_problem(cgen: casadi.casadi.CodeGenerator, n: int, m: int, p: int, name: str = 'PANOC_ALM_problem') Union[panocpy._panocpy.Problem, panocpy._panocpy.ProblemWithParam] [source]
Compile the C-code using the given code-generator and load it as a panocpy Problem.
- Parameters
cgen – Code generator to generate C-code for the costs and the constraints with.
n – Dimensions of the decision variables (primal dimension).
m – Number of nonlinear constraints (dual dimension).
p – Number of parameters.
name – Optional string description of the problem (used for filename).
- Returns
Problem specification that can be passed to the solvers.
- panocpy.casadi_problem.compile_and_load_problem_full(cgen: casadi.casadi.CodeGenerator, n: int, m1: int, m2: int, p: int, name: str = 'PANOC_full_problem') Union[panocpy._panocpy.ProblemFull, panocpy._panocpy.ProblemFullWithParam] [source]
Compile the C-code using the given code-generator and load it as a panocpy ProblemFull.
- Parameters
cgen – Code generator to generate C-code for the costs and the constraints with.
n – Dimensions of the decision variables (primal dimension).
m1 – Number of ALM constraints (dual dimension 1).
m2 – Number of quadratic penalty constraints (dual dimension 2).
p – Number of parameters.
name – Optional string description of the problem (used for filename).
- Returns
ProblemFull specification that can be passed to the solvers.
- panocpy.casadi_problem.generate_and_compile_casadi_problem(f: casadi.casadi.Function, g: casadi.casadi.Function, second_order: bool = False, name: str = 'PANOC_ALM_problem') Union[panocpy._panocpy.Problem, panocpy._panocpy.ProblemWithParam] [source]
Compile the objective and constraint functions into a panocpy Problem.
- Parameters
f – Objective function.
g – Constraint function.
second_order – Whether to generate functions for evaluating Hessians.
name – Optional string description of the problem (used for filename).
- Returns
Problem specification that can be passed to the solvers.
- panocpy.casadi_problem.generate_casadi_problem(f: casadi.casadi.Function, g: casadi.casadi.Function, second_order: bool = False, name: str = 'PANOC_ALM_problem') Tuple[casadi.casadi.CodeGenerator, int, int, int] [source]
Convert the objective and constraint functions into a CasADi code generator.
- Parameters
f – Objective function.
g – Constraint function.
second_order – Whether to generate functions for evaluating Hessians.
name – Optional string description of the problem (used for filename).
- Returns
Code generator that generates the functions and derivatives used by the solvers.
Dimensions of the decision variables (primal dimension).
Number of nonlinear constraints (dual dimension).
Number of parameters.
- panocpy.casadi_problem.generate_casadi_problem_full(f: casadi.casadi.Function, g1: casadi.casadi.Function, g2: casadi.casadi.Function, second_order: bool = False, name: str = 'PANOC_ALM_problem') Tuple[casadi.casadi.CodeGenerator, int, int, int] [source]
Convert the objective and constraint functions into a CasADi code generator.
- Parameters
f – Objective function.
g1 – ALM constraint function.
g2 – Quadratic penalty constraint function.
second_order – Whether to generate functions for evaluating Hessians.
name – Optional string description of the problem (used for filename).
- Returns
Code generator that generates the functions and derivatives used by the solvers.
Dimensions of the decision variables (primal dimension).
Number of nonlinear constraints (dual dimension).
Number of parameters.
All¶
PANOC+ALM solvers
- class panocpy._panocpy.ALMParams¶
C++ documentation:
pa::ALMParams
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.ALMParams) -> None
__init__(self: panocpy._panocpy.ALMParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.ALMParams) dict ¶
- property M¶
- property max_iter¶
- property max_num_initial_retries¶
- property max_num_retries¶
- property max_time¶
- property max_total_num_retries¶
- property preconditioning¶
- property print_interval¶
- property single_penalty_factor¶
- property Δ¶
- property Δ_lower¶
- property Σ_0¶
- property Σ_0_lower¶
- property Σ_max¶
- property Σ_min¶
- property δ¶
- property ε¶
- property ε_0¶
- property ε_0_increase¶
- property θ¶
- property ρ¶
- property ρ_increase¶
- property σ_0¶
- class panocpy._panocpy.ALMSolver¶
Main augmented Lagrangian solver.
C++ documentation:
pa::ALMSolver
- __call__(self: panocpy._panocpy.ALMSolver, problem: panocpy._panocpy.Problem, x: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None, y: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve.
y – Initial guess for Lagrange multipliers \(y\)
x – Initial guess for decision variables \(x\)
- Returns
Lagrange multipliers \(y\) at the solution
Solution \(x\)
Statistics
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.ALMSolver) -> None
Build an ALM solver using Structured PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, panoc_solver: panocpy._panocpy.PANOCSolver) -> None
Build an ALM solver using PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, pga_solver: panocpy._panocpy.PGASolver) -> None
Build an ALM solver using the projected gradient algorithm as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, structuredpanoc_solver: panocpy._panocpy.StructuredPANOCLBFGSSolver) -> None
Build an ALM solver using Structured PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams, inner_solver: panocpy._panocpy.InnerSolver) -> None
Build an ALM solver using a custom inner solver.
__init__(self: panocpy._panocpy.ALMSolver, panoc_solver: panocpy._panocpy.PANOCSolver) -> None
Build an ALM solver using PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, pga_solver: panocpy._panocpy.PGASolver) -> None
Build an ALM solver using the projected gradient algorithm as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, structuredpanoc_solver: panocpy._panocpy.StructuredPANOCLBFGSSolver) -> None
Build an ALM solver using Structured PANOC as inner solver.
__init__(self: panocpy._panocpy.ALMSolver, inner_solver: panocpy._panocpy.InnerSolver) -> None
Build an ALM solver using a custom inner solver.
__init__(self: panocpy._panocpy.ALMSolver, alm_params: panocpy._panocpy.ALMParams) -> None
Build an ALM solver using Structured PANOC as inner solver.
- property inner_solver¶
- property params¶
- class panocpy._panocpy.ALMSolverFull¶
Main augmented Lagrangian solver.
C++ documentation:
pa::ALMSolverFull
- __call__(self: panocpy._panocpy.ALMSolverFull, problem: panocpy._panocpy.ProblemFull, x: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None, y: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve.
y – Initial guess for Lagrange multipliers \(y\)
x – Initial guess for decision variables \(x\)
- Returns
Lagrange multipliers \(y\) at the solution
Solution \(x\)
Statistics
- __init__(self: panocpy._panocpy.ALMSolverFull, arg0: panocpy._panocpy.ALMParams, arg1: panocpy._panocpy.PANOCSolverFull) None ¶
Build an ALM solver using Structured PANOC as inner solver.
- property params¶
- class panocpy._panocpy.Box¶
C++ documentation:
pa::Box
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.Box, n: int) -> None
Create an \(n\)-dimensional box at with bounds at \(\pm\infty\) (no constraints).
__init__(self: panocpy._panocpy.Box, ub: numpy.ndarray[numpy.float64[m, 1]], lb: numpy.ndarray[numpy.float64[m, 1]]) -> None
Create a box with the given bounds.
- property lowerbound¶
- property upperbound¶
- class panocpy._panocpy.GAAPGAParams¶
C++ documentation:
pa::GAAPGAParams
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.GAAPGAParams) -> None
__init__(self: panocpy._panocpy.GAAPGAParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.GAAPGAParams) dict ¶
- property L_max¶
- property L_min¶
- property Lipschitz¶
- property full_flush_on_γ_change¶
- property limitedqr_mem¶
- property max_iter¶
- property max_no_progress¶
- property max_time¶
- property print_interval¶
- property quadratic_upperbound_tolerance_factor¶
- property stop_crit¶
- class panocpy._panocpy.GAAPGAProgressInfo¶
C++ documentation:
pa::GAAPGAProgressInfo
- __init__(*args, **kwargs)¶
- property L¶
- property fpr¶
- property grad_ψ¶
- property grad_ψ_hat¶
- property k¶
- property norm_sq_p¶
- property p¶
- property x¶
- property x_hat¶
- property y¶
- property Σ¶
- property γ¶
- property ε¶
- property ψ¶
- property ψ_hat¶
- class panocpy._panocpy.GAAPGASolver¶
C++ documentation:
pa::GAAPGASolver
- __call__(self: panocpy._panocpy.GAAPGASolver, problem: panocpy._panocpy.Problem, Σ: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve
Σ – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g(x) - z\)
Statistics
- __init__(self: panocpy._panocpy.GAAPGASolver, arg0: panocpy._panocpy.GAAPGAParams) None ¶
- set_progress_callback(self: panocpy._panocpy.GAAPGASolver, callback: Callable[[panocpy._panocpy.GAAPGAProgressInfo], None]) None ¶
Attach a callback that is called on each iteration of the solver.
- property params¶
- class panocpy._panocpy.InnerSolver¶
- __call__(self: panocpy._panocpy.InnerSolver, arg0: panocpy._panocpy.Problem, arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: float, arg3: bool, arg4: numpy.ndarray[numpy.float64[m, 1], flags.writeable], arg5: numpy.ndarray[numpy.float64[m, 1], flags.writeable], arg6: numpy.ndarray[numpy.float64[m, 1], flags.writeable]) panocpy._panocpy.InnerSolverStats ¶
- __init__(self: panocpy._panocpy.InnerSolver) None ¶
- get_name(self: panocpy._panocpy.InnerSolver) str ¶
- get_params(self: panocpy._panocpy.InnerSolver) object ¶
- stop(self: panocpy._panocpy.InnerSolver) None ¶
- class panocpy._panocpy.InnerSolverStats¶
- __init__(self: panocpy._panocpy.InnerSolverStats, arg0: dict) None ¶
- class panocpy._panocpy.LBFGSDirection¶
C++ documentation:
pa::LBFGSDirection
- __init__(self: panocpy._panocpy.LBFGSDirection, params: pa::LBFGSParams) None ¶
- apply(self: panocpy._panocpy.LBFGSDirection, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: numpy.ndarray[numpy.float64[m, 1]], arg3: float) numpy.ndarray[numpy.float64[m, 1]] ¶
- changed_γ(self: panocpy._panocpy.LBFGSDirection, arg0: float, arg1: float) None ¶
- get_name(self: panocpy._panocpy.LBFGSDirection) str ¶
- initialize(self: panocpy._panocpy.LBFGSDirection, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: numpy.ndarray[numpy.float64[m, 1]], arg3: numpy.ndarray[numpy.float64[m, 1]]) None ¶
- reset(self: panocpy._panocpy.LBFGSDirection) None ¶
- update(self: panocpy._panocpy.LBFGSDirection, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: numpy.ndarray[numpy.float64[m, 1]], arg3: numpy.ndarray[numpy.float64[m, 1]], arg4: numpy.ndarray[numpy.float64[m, 1]], arg5: panocpy._panocpy.Box, arg6: float) bool ¶
- property params¶
- class panocpy._panocpy.LBFGSParams¶
C++ documentation:
pa::LBFGSParams
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.LBFGSParams) -> None
__init__(self: panocpy._panocpy.LBFGSParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.LBFGSParams) dict ¶
- property cbfgs¶
- property memory¶
- property rescale_when_γ_changes¶
- class panocpy._panocpy.LBFGSParamsCBFGS¶
C++ documentation:
pa::LBFGSParams::cbfgs
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.LBFGSParamsCBFGS) -> None
__init__(self: panocpy._panocpy.LBFGSParamsCBFGS, **kwargs) -> None
- to_dict(self: panocpy._panocpy.LBFGSParamsCBFGS) dict ¶
- property α¶
- property ϵ¶
- class panocpy._panocpy.LBFGSStepsize¶
C++ documentation:
pa::LBFGSStepSize
Members:
BasedOnGradientStepSize
BasedOnCurvature
- __init__(self: panocpy._panocpy.LBFGSStepsize, value: int) None ¶
- BasedOnCurvature = <LBFGSStepsize.BasedOnCurvature: 1>¶
- BasedOnGradientStepSize = <LBFGSStepsize.BasedOnGradientStepSize: 0>¶
- property name¶
- property value¶
- class panocpy._panocpy.LipschitzEstimateParams¶
C++ documentation:
pa::LipschitzEstimateParams
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.LipschitzEstimateParams) -> None
__init__(self: panocpy._panocpy.LipschitzEstimateParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.LipschitzEstimateParams) dict ¶
- property L_0¶
- property Lγ_factor¶
- property δ¶
- property ε¶
- class panocpy._panocpy.PANOCDirection¶
Class that provides fast directions for the PANOC algorithm (e.g. L-BFGS)
- __init__(self: panocpy._panocpy.PANOCDirection) None ¶
- apply(self: panocpy._panocpy.PANOCDirection, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: numpy.ndarray[numpy.float64[m, 1]], arg3: float) numpy.ndarray[numpy.float64[m, 1]] ¶
- changed_γ(self: panocpy._panocpy.PANOCDirection, arg0: float, arg1: float) None ¶
- get_name(self: panocpy._panocpy.PANOCDirection) str ¶
- initialize(self: panocpy._panocpy.PANOCDirection, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: numpy.ndarray[numpy.float64[m, 1]], arg3: numpy.ndarray[numpy.float64[m, 1]]) None ¶
- reset(self: panocpy._panocpy.PANOCDirection) None ¶
- update(self: panocpy._panocpy.PANOCDirection, arg0: numpy.ndarray[numpy.float64[m, 1]], arg1: numpy.ndarray[numpy.float64[m, 1]], arg2: numpy.ndarray[numpy.float64[m, 1]], arg3: numpy.ndarray[numpy.float64[m, 1]], arg4: numpy.ndarray[numpy.float64[m, 1]], arg5: panocpy._panocpy.Box, arg6: float) bool ¶
- class panocpy._panocpy.PANOCParams¶
C++ documentation:
pa::PANOCParams
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.PANOCParams) -> None
__init__(self: panocpy._panocpy.PANOCParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.PANOCParams) dict ¶
- property L_max¶
- property L_min¶
- property Lipschitz¶
- property alternative_linesearch_cond¶
- property lbfgs_stepsize¶
- property max_iter¶
- property max_no_progress¶
- property max_time¶
- property print_interval¶
- property quadratic_upperbound_tolerance_factor¶
- property update_lipschitz_in_linesearch¶
- property τ_min¶
- class panocpy._panocpy.PANOCProgressInfo¶
Data passed to the PANOC progress callback.
C++ documentation:
pa::PANOCProgressInfo
- __init__(*args, **kwargs)¶
- property L¶
Estimate of Lipschitz constant of objective \(L\)
- property fpr¶
Fixed-point residual \(\left\|p\right\| / \gamma\)
- property grad_ψ¶
Gradient of objective \(\nabla\psi(x)\)
- property grad_ψ_hat¶
- property k¶
Iteration
- property norm_sq_p¶
\(\left\|p\right\|^2\)
- property p¶
Projected gradient step \(p\)
- property x¶
Decision variable \(x\)
- property x_hat¶
Decision variable after projected gradient step \(\hat x\)
- property y¶
Lagrange multipliers \(y\)
- property Σ¶
Penalty factor \(\Sigma\)
- property γ¶
Step size \(\gamma\)
- property ε¶
Tolerance reached \(\varepsilon_k\)
- property τ¶
Line search parameter \(\tau\)
- property φγ¶
Forward-backward envelope \(\varphi_\gamma(x)\)
- property ψ¶
Objective value \(\psi(x)\)
- property ψ_hat¶
- class panocpy._panocpy.PANOCSolver¶
C++ documentation:
pa::PANOCSolver
- __call__(self: panocpy._panocpy.PANOCSolver, problem: panocpy._panocpy.Problem, Σ: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve
Σ – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g(x) - z\)
Statistics
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.PANOCSolver) -> None
__init__(self: panocpy._panocpy.PANOCSolver, panoc_params: panocpy._panocpy.PANOCParams, lbfgs_direction: panocpy._panocpy.LBFGSDirection) -> None
__init__(self: panocpy._panocpy.PANOCSolver, panoc_params: panocpy._panocpy.PANOCParams, lbfgs_params: panocpy._panocpy.LBFGSParams) -> None
__init__(self: panocpy._panocpy.PANOCSolver, panoc_params: panocpy._panocpy.PANOCParams, direction: panocpy._panocpy.PANOCDirection) -> None
- set_progress_callback(self: panocpy._panocpy.PANOCSolver, callback: Callable[[panocpy._panocpy.PANOCProgressInfo], None]) None ¶
Attach a callback that is called on each iteration of the solver.
- property direction¶
- property params¶
- class panocpy._panocpy.PANOCSolverFull¶
C++ documentation:
pa::PANOCSolverFull
- __call__(self: panocpy._panocpy.PANOCSolverFull, problem: panocpy._panocpy.ProblemFull, Σ1: numpy.ndarray[numpy.float64[m, 1]], Σ2: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve
Σ1 – Penalty factor
Σ2 – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g1(x) - z\)
Slack variable error \(g2(x) - z\)
Statistics
- __init__(self: panocpy._panocpy.PANOCSolverFull, arg0: panocpy._panocpy.PANOCParams, arg1: panocpy._panocpy.LBFGSParams) None ¶
- set_progress_callback(self: panocpy._panocpy.PANOCSolverFull, callback: Callable[[pa::PANOCFullProgressInfo], None]) panocpy._panocpy.PANOCSolverFull ¶
Attach a callback that is called on each iteration of the solver.
- property direction¶
- property params¶
- class panocpy._panocpy.PANOCStopCrit¶
C++ documentation:
pa::PANOCStopCrit
Members:
ApproxKKT
ProjGradNorm
ProjGradUnitNorm
FPRNorm
- __init__(self: panocpy._panocpy.PANOCStopCrit, value: int) None ¶
- ApproxKKT = <PANOCStopCrit.ApproxKKT: 0>¶
- FPRNorm = <PANOCStopCrit.FPRNorm: 3>¶
- ProjGradNorm = <PANOCStopCrit.ProjGradNorm: 1>¶
- ProjGradUnitNorm = <PANOCStopCrit.ProjGradUnitNorm: 2>¶
- property name¶
- property value¶
- class panocpy._panocpy.PGAParams¶
C++ documentation:
pa::PGAParams
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.PGAParams) -> None
__init__(self: panocpy._panocpy.PGAParams, **kwargs) -> None
- to_dict(self: panocpy._panocpy.PGAParams) dict ¶
- property L_max¶
- property L_min¶
- property Lipschitz¶
- property max_iter¶
- property max_time¶
- property print_interval¶
- property quadratic_upperbound_tolerance_factor¶
- property stop_crit¶
- class panocpy._panocpy.PGAProgressInfo¶
C++ documentation:
pa::PGAProgressInfo
- __init__(*args, **kwargs)¶
- property L¶
- property fpr¶
- property grad_ψ¶
- property grad_ψ_hat¶
- property k¶
- property norm_sq_p¶
- property p¶
- property x¶
- property x_hat¶
- property y¶
- property Σ¶
- property γ¶
- property ε¶
- property ψ¶
- property ψ_hat¶
- class panocpy._panocpy.PGASolver¶
C++ documentation:
pa::PGASolver
- __call__(self: panocpy._panocpy.PGASolver, problem: panocpy._panocpy.Problem, Σ: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve
Σ – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g(x) - z\)
Statistics
- __init__(self: panocpy._panocpy.PGASolver, arg0: panocpy._panocpy.PGAParams) None ¶
- set_progress_callback(self: panocpy._panocpy.PGASolver, callback: Callable[[panocpy._panocpy.PGAProgressInfo], None]) None ¶
Attach a callback that is called on each iteration of the solver.
- property params¶
- class panocpy._panocpy.Problem¶
C++ documentation:
pa::Problem
- __init__(self: panocpy._panocpy.Problem, n: int, m: int) None ¶
- Parameters
n – Number of unknowns
m – Number of constraints
- property C¶
Box constraints on \(x\)
- property D¶
Box constraints on \(g(x)\)
- property f¶
Objective funcion, \(f(x)\)
- property g¶
Constraint function, \(g(x)\)
- property grad_f¶
Gradient of the objective function, \(\nabla f(x)\)
- property grad_g_prod¶
Gradient of constraint function times vector, \(\nabla g(x)\, v\)
- property grad_gi¶
Gradient vector of the \(i\)-th component of the constriant function, \(\nabla g_i(x)\)
- property hess_L¶
Hessian of the Lagrangian function, \(\nabla^2_{xx} L(x,y)\)
- property hess_L_prod¶
Hessian of the Lagrangian function times vector, \(\nabla^2_{xx} L(x,y)\, v\)
- property m¶
Number of general constraints, dimension of \(g(x)\)
- property n¶
Number of unknowns, dimension of \(x\)
- class panocpy._panocpy.ProblemFull¶
C++ documentation:
pa::ProblemFull
- __init__(self: panocpy._panocpy.ProblemFull, n: int, m1: int, m2: int) None ¶
- Parameters
n – Number of unknowns
m1 – Number of ALM constraints
m2 – Number of quadratic penalty constraints
- property C¶
Box constraints on \(x\)
- property D1¶
Box constraints on \(g1(x)\)
- property D2¶
Box constraints on \(g2(x)\)
- property f¶
Objective funcion, \(f(x)\)
- property g1¶
Constraint function, \(g1(x)\)
- property g2¶
Constraint function, \(g2(x)\)
- property grad_f¶
Gradient of the objective function, \(\nabla f(x)\)
- property grad_g1_prod¶
Gradient of constraint function times vector, \(\nabla g1(x)\, v\)
- property grad_g1i¶
Gradient vector of the \(i\)-th component of the constraint function, \(\nabla g1_i(x)\)
- property grad_g2_prod¶
Gradient of constraint function times vector, \(\nabla g2(x)\, v\)
- property grad_g2i¶
Gradient vector of the \(i\)-th component of the constraint function, \(\nabla g2_i(x)\)
- property hess_L¶
Hessian of the Lagrangian function, \(\nabla^2_{xx} L(x,y)\)
- property hess_L_prod¶
Hessian of the Lagrangian function times vector, \(\nabla^2_{xx} L(x,y)\, v\)
- property m1¶
Number of general constraints, dimension of \(g1(x)\)
- property m2¶
Number of general constraints, dimension of \(g2(x)\)
- property n¶
Number of unknowns, dimension of \(x\)
- class panocpy._panocpy.ProblemFullWithParam¶
C++ documentation:
pa::ProblemFullWithParam
- __init__(self: panocpy._panocpy.ProblemFullWithParam, n: int, m1: int, m2: int) None ¶
- Parameters
n – Number of unknowns
m1 – Number of ALM constraints
m2 – Number of quadratic penalty constraints
- property C¶
Box constraints on \(x\)
- property D1¶
Box constraints on \(g1(x)\)
- property D2¶
Box constraints on \(g2(x)\)
- property f¶
Objective funcion, \(f(x)\)
- property g1¶
Constraint function, \(g1(x)\)
- property g2¶
Constraint function, \(g2(x)\)
- property grad_f¶
Gradient of the objective function, \(\nabla f(x)\)
- property grad_g1_prod¶
Gradient of constraint function times vector, \(\nabla g1(x)\, v\)
- property grad_g1i¶
Gradient vector of the \(i\)-th component of the constraint function, \(\nabla g1_i(x)\)
- property grad_g2_prod¶
Gradient of constraint function times vector, \(\nabla g2(x)\, v\)
- property grad_g2i¶
Gradient vector of the \(i\)-th component of the constraint function, \(\nabla g2_i(x)\)
- property hess_L¶
Hessian of the Lagrangian function, \(\nabla^2_{xx} L(x,y)\)
- property hess_L_prod¶
Hessian of the Lagrangian function times vector, \(\nabla^2_{xx} L(x,y)\, v\)
- property m1¶
Number of general constraints, dimension of \(g1(x)\)
- property m2¶
Number of general constraints, dimension of \(g2(x)\)
- property n¶
Number of unknowns, dimension of \(x\)
- property param¶
Parameter vector \(p\) of the problem
- class panocpy._panocpy.ProblemWithParam¶
C++ documentation:
pa::ProblemWithParam
See
panocpy._panocpy.Problem
for the full documentation.- __init__(self: panocpy._panocpy.ProblemWithParam, n: int, m: int) None ¶
- property C¶
- property D¶
- property f¶
- property g¶
- property grad_f¶
- property grad_g_prod¶
- property grad_gi¶
- property hess_L¶
- property hess_L_prod¶
- property m¶
- property n¶
- property param¶
Parameter vector \(p\) of the problem
- class panocpy._panocpy.SolverStatus¶
C++ documentation:
pa::SolverStatus
Members:
Unknown : Initial value
Converged : Converged and reached given tolerance
MaxTime : Maximum allowed execution time exceeded
MaxIter : Maximum number of iterations exceeded
NotFinite : Intermediate results were infinite or not-a-number
NoProgress : No progress was made in the last iteration
Interrupted : Solver was interrupted by the user
- __init__(self: panocpy._panocpy.SolverStatus, value: int) None ¶
- Converged = <SolverStatus.Converged: 1>¶
- Interrupted = <SolverStatus.Interrupted: 6>¶
- MaxIter = <SolverStatus.MaxIter: 3>¶
- MaxTime = <SolverStatus.MaxTime: 2>¶
- NoProgress = <SolverStatus.NoProgress: 5>¶
- NotFinite = <SolverStatus.NotFinite: 4>¶
- Unknown = <SolverStatus.Unknown: 0>¶
- property name¶
- property value¶
- class panocpy._panocpy.StructuredPANOCLBFGSParams¶
C++ documentation:
pa::StructuredPANOCLBFGSParams
- __init__(self: panocpy._panocpy.StructuredPANOCLBFGSParams, **kwargs) None ¶
- to_dict(self: panocpy._panocpy.StructuredPANOCLBFGSParams) dict ¶
- property L_max¶
- property L_min¶
- property Lipschitz¶
- property alternative_linesearch_cond¶
- property full_augmented_hessian¶
- property hessian_vec_finited_differences¶
- property lbfgs_stepsize¶
- property max_iter¶
- property max_no_progress¶
- property max_time¶
- property nonmonotone_linesearch¶
- property print_interval¶
- property quadratic_upperbound_tolerance_factor¶
- property stop_crit¶
- property update_lipschitz_in_linesearch¶
- property τ_min¶
- class panocpy._panocpy.StructuredPANOCLBFGSProgressInfo¶
Data passed to the structured PANOC progress callback.
C++ documentation:
pa::StructuredPANOCLBFGSProgressInfo
- __init__(*args, **kwargs)¶
- property L¶
- property fpr¶
- property grad_ψ¶
- property grad_ψ_hat¶
- property k¶
- property norm_sq_p¶
- property p¶
- property x¶
- property x_hat¶
- property y¶
- property Σ¶
- property γ¶
- property ε¶
- property τ¶
- property φγ¶
- property ψ¶
- property ψ_hat¶
- class panocpy._panocpy.StructuredPANOCLBFGSSolver¶
C++ documentation:
pa::StructuredPANOCLBFGSSolver
- __call__(self: panocpy._panocpy.StructuredPANOCLBFGSSolver, problem: panocpy._panocpy.Problem, Σ: numpy.ndarray[numpy.float64[m, 1]], ε: float, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) Tuple[numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], numpy.ndarray[numpy.float64[m, 1]], dict] ¶
Solve.
- Parameters
problem – Problem to solve
Σ – Penalty factor
ε – Desired tolerance
x – Initial guess
y – Initial Lagrange multipliers
- Returns
Solution \(x\)
Updated Lagrange multipliers \(y\)
Slack variable error \(g(x) - z\)
Statistics
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: panocpy._panocpy.StructuredPANOCLBFGSSolver) -> None
__init__(self: panocpy._panocpy.StructuredPANOCLBFGSSolver, panoc_params: panocpy._panocpy.StructuredPANOCLBFGSParams, lbfgs_params: panocpy._panocpy.LBFGSParams) -> None
- set_progress_callback(self: panocpy._panocpy.StructuredPANOCLBFGSSolver, callback: Callable[[panocpy._panocpy.StructuredPANOCLBFGSProgressInfo], None]) None ¶
Attach a callback that is called on each iteration of the solver.
- property params¶
- panocpy._panocpy.load_casadi_problem(so_name: str, n: int, m: int, second_order: bool = False) panocpy._panocpy.Problem ¶
Load a compiled CasADi problem without parameters.
C++ documentation:
pa::load_CasADi_problem()
- panocpy._panocpy.load_casadi_problem_full(so_name: str, n: int, m1: int, m2: int, second_order: bool = False) panocpy._panocpy.ProblemFull ¶
Load a compiled CasADi problem without parameters.
C++ documentation:
pa::load_CasADi_problem()
- panocpy._panocpy.load_casadi_problem_full_with_param(so_name: str, n: int, m1: int, m2: int, second_order: bool = False) panocpy._panocpy.ProblemFullWithParam ¶
Load a compiled CasADi problem with parameters.
C++ documentation:
pa::load_CasADi_problem_with_param()
- panocpy._panocpy.load_casadi_problem_with_param(so_name: str, n: int, m: int, second_order: bool = False) panocpy._panocpy.ProblemWithParam ¶
Load a compiled CasADi problem with parameters.
C++ documentation:
pa::load_CasADi_problem_with_param()
- panocpy._panocpy.panoc(ψ: Callable[[numpy.ndarray[numpy.float64[m, 1]]], float], grad_ψ: Callable[[numpy.ndarray[numpy.float64[m, 1]]], numpy.ndarray[numpy.float64[m, 1]]], C: panocpy._panocpy.Box, x0: Optional[numpy.ndarray[numpy.float64[m, 1]]] = None, ε: float = 1e-08, params: panocpy._panocpy.PANOCParams = <panocpy._panocpy.PANOCParams object at 0x7f059bce38b0>, lbfgs_params: panocpy._panocpy.LBFGSParams = <panocpy._panocpy.LBFGSParams object at 0x7f059bce3c70>) Tuple[numpy.ndarray[numpy.float64[m, 1]], dict] ¶
- panocpy.casadi_problem.compile_and_load_problem(cgen: casadi.casadi.CodeGenerator, n: int, m: int, p: int, name: str = 'PANOC_ALM_problem') Union[panocpy._panocpy.Problem, panocpy._panocpy.ProblemWithParam] [source]¶
Compile the C-code using the given code-generator and load it as a panocpy Problem.
- Parameters
cgen – Code generator to generate C-code for the costs and the constraints with.
n – Dimensions of the decision variables (primal dimension).
m – Number of nonlinear constraints (dual dimension).
p – Number of parameters.
name – Optional string description of the problem (used for filename).
- Returns
Problem specification that can be passed to the solvers.
- panocpy.casadi_problem.compile_and_load_problem_full(cgen: casadi.casadi.CodeGenerator, n: int, m1: int, m2: int, p: int, name: str = 'PANOC_full_problem') Union[panocpy._panocpy.ProblemFull, panocpy._panocpy.ProblemFullWithParam] [source]¶
Compile the C-code using the given code-generator and load it as a panocpy ProblemFull.
- Parameters
cgen – Code generator to generate C-code for the costs and the constraints with.
n – Dimensions of the decision variables (primal dimension).
m1 – Number of ALM constraints (dual dimension 1).
m2 – Number of quadratic penalty constraints (dual dimension 2).
p – Number of parameters.
name – Optional string description of the problem (used for filename).
- Returns
ProblemFull specification that can be passed to the solvers.
- panocpy.casadi_problem.generate_and_compile_casadi_problem(f: casadi.casadi.Function, g: casadi.casadi.Function, second_order: bool = False, name: str = 'PANOC_ALM_problem') Union[panocpy._panocpy.Problem, panocpy._panocpy.ProblemWithParam] [source]¶
Compile the objective and constraint functions into a panocpy Problem.
- Parameters
f – Objective function.
g – Constraint function.
second_order – Whether to generate functions for evaluating Hessians.
name – Optional string description of the problem (used for filename).
- Returns
Problem specification that can be passed to the solvers.
- panocpy.casadi_problem.generate_casadi_problem(f: casadi.casadi.Function, g: casadi.casadi.Function, second_order: bool = False, name: str = 'PANOC_ALM_problem') Tuple[casadi.casadi.CodeGenerator, int, int, int] [source]¶
Convert the objective and constraint functions into a CasADi code generator.
- Parameters
f – Objective function.
g – Constraint function.
second_order – Whether to generate functions for evaluating Hessians.
name – Optional string description of the problem (used for filename).
- Returns
Code generator that generates the functions and derivatives used by the solvers.
Dimensions of the decision variables (primal dimension).
Number of nonlinear constraints (dual dimension).
Number of parameters.
- panocpy.casadi_problem.generate_casadi_problem_full(f: casadi.casadi.Function, g1: casadi.casadi.Function, g2: casadi.casadi.Function, second_order: bool = False, name: str = 'PANOC_ALM_problem') Tuple[casadi.casadi.CodeGenerator, int, int, int] [source]¶
Convert the objective and constraint functions into a CasADi code generator.
- Parameters
f – Objective function.
g1 – ALM constraint function.
g2 – Quadratic penalty constraint function.
second_order – Whether to generate functions for evaluating Hessians.
name – Optional string description of the problem (used for filename).
- Returns
Code generator that generates the functions and derivatives used by the solvers.
Dimensions of the decision variables (primal dimension).
Number of nonlinear constraints (dual dimension).
Number of parameters.