alpaqa matlab
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Attributes | List of all members
alpaqa_problem_functions_t Struct Reference

#include <alpaqa/dl/dl-problem.h>

Detailed Description

C API providing function pointers to problem functions.

Used by alpaqa::dl::DLProblem.

Examples
C++/DLProblem/main.cpp, and problems/sparse-logistic-regression.cpp.

Definition at line 157 of file dl-problem.h.

+ Collaboration diagram for alpaqa_problem_functions_t:

Public Attributes

alpaqa_length_t n { 0 }
 Number of decision variables.
 
alpaqa_length_t m { 0 }
 Number of constraints.
 
alpaqa_real_t(* eval_f )(void *instance, const alpaqa_real_t *x)
 Cost function.
 
void(* eval_grad_f )(void *instance, const alpaqa_real_t *x, alpaqa_real_t *grad_fx)
 Gradient of the cost function.
 
void(* eval_g )(void *instance, const alpaqa_real_t *x, alpaqa_real_t *gx)
 Constraints function.
 
void(* eval_grad_g_prod )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t *grad_gxy)
 Gradient-vector product of the constraints function.
 
void(* eval_jac_g )(void *instance, const alpaqa_real_t *x, alpaqa_real_t *J_values)
 Jacobian of the constraints function.
 
alpaqa_sparsity_t(* get_jac_g_sparsity )(void *instance)
 Get the sparsity pattern of the Jacobian of the constraints function.
 
void(* eval_grad_gi )(void *instance, const alpaqa_real_t *x, alpaqa_index_t i, alpaqa_real_t *grad_gi)
 Gradient of specific constraint function.
 
void(* eval_hess_L_prod )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t scale, const alpaqa_real_t *v, alpaqa_real_t *Hv)
 Hessian-vector product of the Lagrangian.
 
void(* eval_hess_L )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t scale, alpaqa_real_t *H_values)
 Hessian of the Lagrangian.
 
alpaqa_sparsity_t(* get_hess_L_sparsity )(void *instance)
 Get the sparsity pattern of the Hessian of the Lagrangian.
 
void(* eval_hess_ψ_prod )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, alpaqa_real_t scale, const alpaqa_real_t *zl, const alpaqa_real_t *zu, const alpaqa_real_t *v, alpaqa_real_t *Hv)
 Hessian-vector product of the augmented Lagrangian.
 
void(* eval_hess_ψ )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, alpaqa_real_t scale, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *H_values)
 Hessian of the augmented Lagrangian.
 
alpaqa_sparsity_t(* get_hess_ψ_sparsity )(void *instance)
 Get the sparsity pattern of the Hessian of the augmented Lagrangian.
 
alpaqa_real_t(* eval_f_grad_f )(void *instance, const alpaqa_real_t *x, alpaqa_real_t *grad_fx)
 Cost and its gradient.
 
alpaqa_real_t(* eval_f_g )(void *instance, const alpaqa_real_t *x, alpaqa_real_t *g)
 Cost and constraints.
 
void(* eval_grad_f_grad_g_prod )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t *grad_f, alpaqa_real_t *grad_gxy)
 Gradient of the cost and gradient-vector product of the constraints.
 
void(* eval_grad_L )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t *grad_L, alpaqa_real_t *work_n)
 Gradient of the Lagrangian.
 
alpaqa_real_t(* eval_ψ )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *ŷ)
 Augmented Lagrangian.
 
void(* eval_grad_ψ )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *grad_ψ, alpaqa_real_t *work_n, alpaqa_real_t *work_m)
 Gradient of the augmented Lagrangian.
 
alpaqa_real_t(* eval_ψ_grad_ψ )(void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *grad_ψ, alpaqa_real_t *work_n, alpaqa_real_t *work_m)
 Augmented Lagrangian and its gradient.
 
alpaqa_real_t(* eval_prox_grad_step )(void *instance, alpaqa_real_t γ, const alpaqa_real_t *x, const alpaqa_real_t *grad_ψ, alpaqa_real_t *x̂, alpaqa_real_t *p)
 Proximal gradient step.
 
void(* initialize_box_C )(void *instance, alpaqa_real_t *lb, alpaqa_real_t *ub)
 Provide the initial values for the bounds of alpaqa::BoxConstrProblem::C, i.e.
 
void(* initialize_box_D )(void *instance, alpaqa_real_t *lb, alpaqa_real_t *ub)
 Provide the initial values for the bounds of alpaqa::BoxConstrProblem::D, i.e.
 
void(* initialize_l1_reg )(void *instance, alpaqa_real_t *lambda, alpaqa_length_t *size)
 Provide the initial values for alpaqa::BoxConstrProblem::l1_reg, the ℓ₁-regularization factor.
 

Member Data Documentation

◆ n

alpaqa_length_t n { 0 }

Number of decision variables.

See also
alpaqa::TypeErasedProblem::get_n()

Definition at line 160 of file dl-problem.h.

◆ m

alpaqa_length_t m { 0 }

Number of constraints.

See also
alpaqa::TypeErasedProblem::get_m()

Definition at line 163 of file dl-problem.h.

◆ eval_f

alpaqa_real_t(* eval_f) (void *instance, const alpaqa_real_t *x)
inline

Cost function.

See also
alpaqa::TypeErasedProblem::eval_f()

Definition at line 168 of file dl-problem.h.

◆ eval_grad_f

void(* eval_grad_f) (void *instance, const alpaqa_real_t *x, alpaqa_real_t *grad_fx)
inline

Gradient of the cost function.

See also
alpaqa::TypeErasedProblem::eval_grad_f()

Definition at line 173 of file dl-problem.h.

◆ eval_g

void(* eval_g) (void *instance, const alpaqa_real_t *x, alpaqa_real_t *gx)
inline

Constraints function.

See also
alpaqa::TypeErasedProblem::eval_g()

Definition at line 179 of file dl-problem.h.

◆ eval_grad_g_prod

void(* eval_grad_g_prod) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t *grad_gxy)
inline

Gradient-vector product of the constraints function.

See also
alpaqa::TypeErasedProblem::eval_grad_g_prod()

Definition at line 185 of file dl-problem.h.

◆ eval_jac_g

void(* eval_jac_g) (void *instance, const alpaqa_real_t *x, alpaqa_real_t *J_values)
inline

Jacobian of the constraints function.

See also
alpaqa::TypeErasedProblem::eval_jac_g()

Definition at line 192 of file dl-problem.h.

◆ get_jac_g_sparsity

alpaqa_sparsity_t(* get_jac_g_sparsity) (void *instance)
inline

Get the sparsity pattern of the Jacobian of the constraints function.

See also
alpaqa::TypeErasedProblem::get_jac_g_sparsity()

Definition at line 198 of file dl-problem.h.

◆ eval_grad_gi

void(* eval_grad_gi) (void *instance, const alpaqa_real_t *x, alpaqa_index_t i, alpaqa_real_t *grad_gi)
inline

Gradient of specific constraint function.

See also
alpaqa::TypeErasedProblem::eval_grad_gi()

Definition at line 202 of file dl-problem.h.

◆ eval_hess_L_prod

void(* eval_hess_L_prod) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t scale, const alpaqa_real_t *v, alpaqa_real_t *Hv)
inline

Hessian-vector product of the Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_hess_L_prod()

Definition at line 209 of file dl-problem.h.

◆ eval_hess_L

void(* eval_hess_L) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t scale, alpaqa_real_t *H_values)
inline

Hessian of the Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_hess_L()

Definition at line 218 of file dl-problem.h.

◆ get_hess_L_sparsity

alpaqa_sparsity_t(* get_hess_L_sparsity) (void *instance)
inline

Get the sparsity pattern of the Hessian of the Lagrangian.

See also
alpaqa::TypeErasedProblem::get_hess_L_sparsity()

Definition at line 226 of file dl-problem.h.

◆ eval_hess_ψ_prod

void(* eval_hess_ψ_prod) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, alpaqa_real_t scale, const alpaqa_real_t *zl, const alpaqa_real_t *zu, const alpaqa_real_t *v, alpaqa_real_t *Hv)
inline

Hessian-vector product of the augmented Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_hess_ψ_prod()

Definition at line 230 of file dl-problem.h.

◆ eval_hess_ψ

void(* eval_hess_ψ) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, alpaqa_real_t scale, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *H_values)
inline

Hessian of the augmented Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_hess_ψ()

Definition at line 242 of file dl-problem.h.

◆ get_hess_ψ_sparsity

alpaqa_sparsity_t(* get_hess_ψ_sparsity) (void *instance)
inline

Get the sparsity pattern of the Hessian of the augmented Lagrangian.

See also
alpaqa::TypeErasedProblem::get_hess_ψ_sparsity()

Definition at line 253 of file dl-problem.h.

◆ eval_f_grad_f

alpaqa_real_t(* eval_f_grad_f) (void *instance, const alpaqa_real_t *x, alpaqa_real_t *grad_fx)
inline

Cost and its gradient.

See also
alpaqa::TypeErasedProblem::eval_f_grad_f()

Definition at line 257 of file dl-problem.h.

◆ eval_f_g

alpaqa_real_t(* eval_f_g) (void *instance, const alpaqa_real_t *x, alpaqa_real_t *g)
inline

Cost and constraints.

See also
alpaqa::TypeErasedProblem::eval_f_g()

Definition at line 263 of file dl-problem.h.

◆ eval_grad_f_grad_g_prod

void(* eval_grad_f_grad_g_prod) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t *grad_f, alpaqa_real_t *grad_gxy)
inline

Gradient of the cost and gradient-vector product of the constraints.

See also
alpaqa::TypeErasedProblem::eval_grad_f_grad_g_prod()

Definition at line 269 of file dl-problem.h.

◆ eval_grad_L

void(* eval_grad_L) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, alpaqa_real_t *grad_L, alpaqa_real_t *work_n)
inline

Gradient of the Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_grad_L()

Definition at line 277 of file dl-problem.h.

◆ eval_ψ

alpaqa_real_t(* eval_ψ) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *ŷ)
inline

Augmented Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_ψ()

Definition at line 285 of file dl-problem.h.

◆ eval_grad_ψ

void(* eval_grad_ψ) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *grad_ψ, alpaqa_real_t *work_n, alpaqa_real_t *work_m)
inline

Gradient of the augmented Lagrangian.

See also
alpaqa::TypeErasedProblem::eval_grad_ψ()

Definition at line 295 of file dl-problem.h.

◆ eval_ψ_grad_ψ

alpaqa_real_t(* eval_ψ_grad_ψ) (void *instance, const alpaqa_real_t *x, const alpaqa_real_t *y, const alpaqa_real_t *Σ, const alpaqa_real_t *zl, const alpaqa_real_t *zu, alpaqa_real_t *grad_ψ, alpaqa_real_t *work_n, alpaqa_real_t *work_m)
inline

Augmented Lagrangian and its gradient.

See also
alpaqa::TypeErasedProblem::eval_ψ_grad_ψ()

Definition at line 307 of file dl-problem.h.

◆ eval_prox_grad_step

alpaqa_real_t(* eval_prox_grad_step) (void *instance, alpaqa_real_t γ, const alpaqa_real_t *x, const alpaqa_real_t *grad_ψ, alpaqa_real_t *x̂, alpaqa_real_t *p)
inline

Proximal gradient step.

See also
alpaqa::TypeErasedProblem::eval_prox_grad_step() If not set, the default implementation from alpaqa::BoxConstrProblem is used.

Definition at line 321 of file dl-problem.h.

◆ initialize_box_C

void(* initialize_box_C) (void *instance, alpaqa_real_t *lb, alpaqa_real_t *ub)
inline

Provide the initial values for the bounds of alpaqa::BoxConstrProblem::C, i.e.

the constraints on the decision variables.

Definition at line 331 of file dl-problem.h.

◆ initialize_box_D

void(* initialize_box_D) (void *instance, alpaqa_real_t *lb, alpaqa_real_t *ub)
inline

Provide the initial values for the bounds of alpaqa::BoxConstrProblem::D, i.e.

the general constraints.

Definition at line 337 of file dl-problem.h.

◆ initialize_l1_reg

void(* initialize_l1_reg) (void *instance, alpaqa_real_t *lambda, alpaqa_length_t *size)
inline

Provide the initial values for alpaqa::BoxConstrProblem::l1_reg, the ℓ₁-regularization factor.

This function is called twice:

  1. with lambda set to nullptr, and the user should set the size.
  2. with lambda pointing to an array of that size, and the user should initialize this array.

Definition at line 347 of file dl-problem.h.


The documentation for this struct was generated from the following file: