alpaqa develop
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
UnconstrProblem< Conf > Class Template Reference

#include <alpaqa/problem/unconstr-problem.hpp>

Detailed Description

template<Config Conf>
class alpaqa::UnconstrProblem< Conf >

Implements common problem functions for minimization problems without constraints.

Meant to be used as a base class for custom problem implementations.

Examples
C++/SimpleUnconstrProblem/main.cpp.

Definition at line 14 of file unconstr-problem.hpp.

+ Collaboration diagram for UnconstrProblem< Conf >:

Public Member Functions

 UnconstrProblem (length_t n)
 
void resize (length_t n)
 Change the number of decision variables.
 
 UnconstrProblem (const UnconstrProblem &)=default
 
UnconstrProblemoperator= (const UnconstrProblem &)=default
 
 UnconstrProblem (UnconstrProblem &&) noexcept=default
 
UnconstrProblemoperator= (UnconstrProblem &&) noexcept=default
 
length_t get_n () const
 Number of decision variables, n.
 
length_t get_m () const
 Number of constraints (always zero)
 
void eval_g (crvec, rvec) const
 No-op, no constraints.
 
void eval_grad_g_prod (crvec, crvec, rvec grad) const
 Constraint gradient is always zero.
 
void eval_jac_g (crvec, rvec) const
 Constraint Jacobian is always empty.
 
void eval_grad_gi (crvec, index_t, rvec grad_gi) const
 Constraint gradient is always zero.
 
real_t eval_prox_grad_step (real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const
 No proximal mapping, just a forward (gradient) step.
 
void eval_proj_diff_g (crvec, rvec) const
 
void eval_proj_multipliers (rvec, real_t) const
 
index_t eval_inactive_indices_res_lna (real_t, crvec, crvec, rindexvec J) const
 
std::string get_name () const
 

Public Attributes

length_t n
 Number of decision variables, dimension of x.
 

Constructor & Destructor Documentation

◆ UnconstrProblem() [1/3]

template<Config Conf>
UnconstrProblem ( length_t  n)
inline
Parameters
nNumber of decision variables

Definition at line 22 of file unconstr-problem.hpp.

◆ UnconstrProblem() [2/3]

template<Config Conf>
UnconstrProblem ( const UnconstrProblem< Conf > &  )
default

◆ UnconstrProblem() [3/3]

template<Config Conf>
UnconstrProblem ( UnconstrProblem< Conf > &&  )
defaultnoexcept

Member Function Documentation

◆ resize()

template<Config Conf>
void resize ( length_t  n)
inline

Change the number of decision variables.

Definition at line 25 of file unconstr-problem.hpp.

◆ operator=() [1/2]

template<Config Conf>
UnconstrProblem & operator= ( const UnconstrProblem< Conf > &  )
default

◆ operator=() [2/2]

template<Config Conf>
UnconstrProblem & operator= ( UnconstrProblem< Conf > &&  )
defaultnoexcept

◆ get_n()

template<Config Conf>
length_t get_n ( ) const
inline

Number of decision variables, n.

Definition at line 33 of file unconstr-problem.hpp.

◆ get_m()

template<Config Conf>
length_t get_m ( ) const
inline

Number of constraints (always zero)

Definition at line 35 of file unconstr-problem.hpp.

◆ eval_g()

template<Config Conf>
void eval_g ( crvec  ,
rvec   
) const
inline

No-op, no constraints.

See also
TypeErasedProblem::eval_g

Definition at line 39 of file unconstr-problem.hpp.

◆ eval_grad_g_prod()

template<Config Conf>
void eval_grad_g_prod ( crvec  ,
crvec  ,
rvec  grad 
) const
inline

Constraint gradient is always zero.

See also
TypeErasedProblem::eval_grad_g_prod

Definition at line 42 of file unconstr-problem.hpp.

◆ eval_jac_g()

template<Config Conf>
void eval_jac_g ( crvec  ,
rvec   
) const
inline

Constraint Jacobian is always empty.

See also
TypeErasedProblem::eval_jac_g

Definition at line 45 of file unconstr-problem.hpp.

◆ eval_grad_gi()

template<Config Conf>
void eval_grad_gi ( crvec  ,
index_t  ,
rvec  grad_gi 
) const
inline

Constraint gradient is always zero.

See also
TypeErasedProblem::eval_grad_gi

Definition at line 48 of file unconstr-problem.hpp.

◆ eval_prox_grad_step()

template<Config Conf>
real_t eval_prox_grad_step ( real_t  γ,
crvec  x,
crvec  grad_ψ,
rvec  ,
rvec  p 
) const
inline

No proximal mapping, just a forward (gradient) step.

See also
TypeErasedProblem::eval_prox_grad_step

Definition at line 52 of file unconstr-problem.hpp.

◆ eval_proj_diff_g()

template<Config Conf>
void eval_proj_diff_g ( crvec  ,
rvec   
) const
inline
See also
TypeErasedProblem::eval_proj_diff_g

Definition at line 59 of file unconstr-problem.hpp.

◆ eval_proj_multipliers()

template<Config Conf>
void eval_proj_multipliers ( rvec  ,
real_t   
) const
inline

◆ eval_inactive_indices_res_lna()

template<Config Conf>
index_t eval_inactive_indices_res_lna ( real_t  ,
crvec  ,
crvec  ,
rindexvec  J 
) const
inline

◆ get_name()

template<Config Conf>
std::string get_name ( ) const
inline
See also
TypeErasedProblem::get_name

Definition at line 71 of file unconstr-problem.hpp.

Member Data Documentation

◆ n

template<Config Conf>
length_t n

Number of decision variables, dimension of x.

Definition at line 19 of file unconstr-problem.hpp.


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