Skip to content

Solver

class Solver

Types

Name Description
Options Solver options

Functions

Name Description
retract Retraction map (elementwise)
retract_deriv Retraction map derivative (elementwise)
retract_second_deriv Retraction map second derivative (elementwise)
ruiz_equilibration Ruiz equilibration for current problem data using copies of H and J_*.
set_problem Sets the problem for the solver given sparse matrices, computes sparsity indexing
set_problem Sets the problem for the solver given dense matrices, computes sparsity indexing
set_problem Populates the KKT system, computes sparsity indexing
get_problem Returns the problem currently set for the solver
initialize_kkt_sparsity Construct and initialize KKT sparsity
update_KKT_residual Compute KKT residual given the current guess stored in the workspace
update_KKT_system Update KKT system given the current guess stored in the workspace
update_KKT_ineq Update the KKT terms associated with s_ineq (no dependence on m_ineq)
update_KKT_comp Update the KKT terms associated with s_comp and m_comp
update_KKT_penalty Update the KKT penalty diagonal
update_KKT_primal_regularizer Update the KKT regularizer
analytical_factorization Perform an analytical factorization of the KKT system using QDLDL
numerical_factorization Perform an numerical factorization of the KKT system using QDLDL
check_inertia The KKT system should define a saddle point, with n_primal positive and n_dual negative eigenvalues We can check this (called the inertia) after numerical_factorization() by checking the number of positive and negative elements of D because LDLt factorizations preserve inertia
backsolve Solve the KKT system using the factorized matrix, populating the solution in workspace->newton_step.
compute_amd_ordering Compute AMD ordering
get_workspace Returns the workspace used by the solver
get_filter Get the filter object Return : Filter& Filter object used for linesearch in the solver
filter_linesearch Perform backtracking filter linesearch given a step direction sqrt_relax_param : Square root of the complementarity and inequality relaxation parameter inv_penalty_param : Inverse of the AL penalty parameter max_iters : Maximum number of iterations for the linesearch !!! warning This function modifies the workspace solution to store the candidate solution, and updates the constraint residuals based on the candidate solution, which are used to evaluate the filter conditions. If the linesearch fails, the workspace solution is restored to its original value before returning. Return : true Linesearch succeeded, new iterate is stored in workspace x_candidate Return : false Linesearch failed
solve Solve the current problem instance.
convergence Determine if the solver has converged based on KKT residual norm, constraint satisfaction

Function Details

analytical_factorization

bool analytical_factorization()

Perform an analytical factorization of the KKT system using QDLDL

backsolve

void backsolve()

Solve the KKT system using the factorized matrix, populating the solution in workspace->newton_step.

check_inertia

bool check_inertia()

The KKT system should define a saddle point, with n_primal positive and n_dual negative eigenvalues We can check this (called the inertia) after numerical_factorization() by checking the number of positive and negative elements of D because LDLt factorizations preserve inertia

compute_amd_ordering

void compute_amd_ordering()

Compute AMD ordering

convergence

bool convergence(const Options &options)

Determine if the solver has converged based on KKT residual norm, constraint satisfaction

filter_linesearch

bool filter_linesearch(const double sqrt_relax_param, const double inv_penalty_param, int max_iters)

Perform backtracking filter linesearch given a step direction

sqrt_relax_param : Square root of the complementarity and inequality relaxation parameter

inv_penalty_param : Inverse of the AL penalty parameter

max_iters : Maximum number of iterations for the linesearch

Warning

This function modifies the workspace solution to store the candidate solution, and updates the constraint residuals based on the candidate solution, which are used to evaluate the filter conditions. If the linesearch fails, the workspace solution is restored to its original value before returning.

Return : true Linesearch succeeded, new iterate is stored in workspace x_candidate

Return : false Linesearch failed

get_filter

Filter& get_filter()

Get the filter object

Return : Filter& Filter object used for linesearch in the solver

get_problem

Problem& get_problem()

Returns the problem currently set for the solver

get_workspace

Workspace& get_workspace()

Returns the workspace used by the solver

initialize_kkt_sparsity

void initialize_kkt_sparsity()

Construct and initialize KKT sparsity

numerical_factorization

bool numerical_factorization()

Perform an numerical factorization of the KKT system using QDLDL

retract

Vec retract(const Vec& s, double sqrt_relax_param) const

Retraction map (elementwise)

retract_deriv

Vec retract_deriv(const Vec& s, double sqrt_relax_param) const

Retraction map derivative (elementwise)

retract_second_deriv

Vec retract_second_deriv(const Vec& s, double sqrt_relax_param) const

Retraction map second derivative (elementwise)

ruiz_equilibration

void ruiz_equilibration(int niter = 10)

Ruiz equilibration for current problem data using copies of H and J_*. Writes concatenated scaling vector [d; e_eq; e_ineq; e_comp] into workspace->scaling.

set_problem

void set_problem(SMat cost_hessian, Vec cost_gradient, double cost_const, SMat J_eq, Vec c_eq, SMat J_ineq, Vec c_ineq, SMat L, Vec l, SMat R, Vec r, Solver::Options& options)

Sets the problem for the solver given sparse matrices, computes sparsity indexing

void set_problem(Mat cost_hessian, Vec cost_gradient, double cost_const, Mat J_eq, Vec c_eq, Mat J_ineq, Vec c_ineq, Mat L, Vec l, Mat R, Vec r, Solver::Options& options)

Sets the problem for the solver given dense matrices, computes sparsity indexing

void set_problem(const Solver::Options& options)

Populates the KKT system, computes sparsity indexing

solve

SolveResult solve()

Solve the current problem instance.

update_KKT_comp

void update_KKT_comp(const Vec& s_comp, const Vec& m_comp, double sqrt_relax_param)

Update the KKT terms associated with s_comp and m_comp

update_KKT_ineq

void update_KKT_ineq(const Vec& s_ineq, double sqrt_relax_param)

Update the KKT terms associated with s_ineq (no dependence on m_ineq)

update_KKT_penalty

void update_KKT_penalty(const double inv_penalty_param)

Update the KKT penalty diagonal

update_KKT_primal_regularizer

void update_KKT_primal_regularizer(const double reg)

Update the KKT regularizer

update_KKT_residual

void update_KKT_residual(double sqrt_relax_param, double inv_penalty_param)

Compute KKT residual given the current guess stored in the workspace

update_KKT_system

void update_KKT_system(double sqrt_relax_param, double inv_penalty_param)

Update KKT system given the current guess stored in the workspace