Nonconvex constrained optimization
Loading...
Searching...
No Matches
OCPEvaluator< Conf > Struct Template Reference

#include <alpaqa/inner/directions/panoc-ocp/ocp-vars.hpp>

Detailed Description

template<Config Conf>
struct alpaqa::OCPEvaluator< Conf >

Definition at line 160 of file ocp-vars.hpp.

Collaboration diagram for OCPEvaluator< Conf >:

Public Types

using OCPVars = OCPVariables<config_t>
using Problem = TypeErasedControlProblem<config_t>
using Box = alpaqa::Box<config_t>

Public Member Functions

 OCPEvaluator (const Problem &problem)
length_t N () const
real_t forward (rvec storage, const Box &D, const Box &D_N, crvec μ, crvec y) const
void forward_simulate (rvec storage) const
void forward_simulate (crvec u, rvec x) const
void backward (rvec storage, rvec g, const auto &qr, const auto &q_N, const Box &D, const Box &D_N, crvec μ, crvec y) const
void Qk (crvec storage, crvec y, crvec μ, const Box &D, const Box &D_N, index_t k, rmat out) const
auto Q (crvec storage, crvec y, crvec μ, const Box &D, const Box &D_N) const
void Rk (crvec storage, index_t k, crindexvec mask, rmat out)
auto R (crvec storage)
void Sk (crvec storage, index_t k, crindexvec mask, rmat out)
auto S (crvec storage)
void Rk_prod (crvec storage, index_t k, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out) const
auto R_prod (crvec storage) const
void Sk_prod (crvec storage, index_t k, crindexvec mask_K, crvec v, rvec out) const
auto S_prod (crvec storage) const

Public Attributes

const Problemproblem
OCPVars vars
vec work_x {vars.nc() > 0 || vars.nc_N() ? vars.nx() : 0}
vec work_λ {vars.nx()}
vec work_c {std::max(vars.nc(), vars.nc_N())}
vec work_R {problem->get_R_work_size()}
vec work_S {problem->get_S_work_size()}

Member Typedef Documentation

◆ OCPVars

template<Config Conf>
using OCPVars = OCPVariables<config_t>

Definition at line 162 of file ocp-vars.hpp.

◆ Problem

template<Config Conf>
using Problem = TypeErasedControlProblem<config_t>

Definition at line 163 of file ocp-vars.hpp.

◆ Box

template<Config Conf>
using Box = alpaqa::Box<config_t>

Definition at line 164 of file ocp-vars.hpp.

Constructor & Destructor Documentation

◆ OCPEvaluator()

template<Config Conf>
OCPEvaluator ( const Problem & problem)
inline

Definition at line 173 of file ocp-vars.hpp.

Member Function Documentation

◆ N()

template<Config Conf>
length_t N ( ) const
inline

Definition at line 175 of file ocp-vars.hpp.

Here is the caller graph for this function:

◆ forward()

template<Config Conf>
real_t forward ( rvec storage,
const Box & D,
const Box & D_N,
crvec μ,
crvec y ) const
inline
Precondition
x0 and u initialized
Postcondition
x, h and c updated
Returns
\( V(u) = \sum_{k=0}^{N-1} \ell(h_k(x_k, u_k)) + V_f(h_N(x_N)) \)

Definition at line 181 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_simulate() [1/2]

template<Config Conf>
void forward_simulate ( rvec storage) const
inline
Precondition
x0 and u initialized
Postcondition
x updated

Definition at line 229 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_simulate() [2/2]

template<Config Conf>
void forward_simulate ( crvec u,
rvec x ) const
inline
Precondition
x0 and u initialized

Definition at line 253 of file ocp-vars.hpp.

Here is the call graph for this function:

◆ backward()

template<Config Conf>
void backward ( rvec storage,
rvec g,
const auto & qr,
const auto & q_N,
const Box & D,
const Box & D_N,
crvec μ,
crvec y ) const
inline
Precondition
x, u, h and c initialized (i.e. forward was called)

Definition at line 263 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Qk()

template<Config Conf>
void Qk ( crvec storage,
crvec y,
crvec μ,
const Box & D,
const Box & D_N,
index_t k,
rmat out ) const
inline

Definition at line 327 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Q()

template<Config Conf>
auto Q ( crvec storage,
crvec y,
crvec μ,
const Box & D,
const Box & D_N ) const
inline

Definition at line 361 of file ocp-vars.hpp.

Here is the call graph for this function:

◆ Rk()

template<Config Conf>
void Rk ( crvec storage,
index_t k,
crindexvec mask,
rmat out )
inline
Postcondition
initialize work_R

Definition at line 371 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ R()

template<Config Conf>
auto R ( crvec storage)
inline

Definition at line 378 of file ocp-vars.hpp.

Here is the call graph for this function:

◆ Sk()

template<Config Conf>
void Sk ( crvec storage,
index_t k,
crindexvec mask,
rmat out )
inline
Postcondition
initialize work_S

Definition at line 387 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ S()

template<Config Conf>
auto S ( crvec storage)
inline

Definition at line 394 of file ocp-vars.hpp.

Here is the call graph for this function:

◆ Rk_prod()

template<Config Conf>
void Rk_prod ( crvec storage,
index_t k,
crindexvec mask_J,
crindexvec mask_K,
crvec v,
rvec out ) const
inline
Precondition
initialized work_R

Definition at line 403 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ R_prod()

template<Config Conf>
auto R_prod ( crvec storage) const
inline

Definition at line 414 of file ocp-vars.hpp.

Here is the call graph for this function:

◆ Sk_prod()

template<Config Conf>
void Sk_prod ( crvec storage,
index_t k,
crindexvec mask_K,
crvec v,
rvec out ) const
inline
Precondition
initialized work_S

Definition at line 424 of file ocp-vars.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ S_prod()

template<Config Conf>
auto S_prod ( crvec storage) const
inline

Definition at line 433 of file ocp-vars.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ problem

template<Config Conf>
const Problem* problem

Definition at line 165 of file ocp-vars.hpp.

◆ vars

template<Config Conf>
OCPVars vars

Definition at line 166 of file ocp-vars.hpp.

◆ work_x

template<Config Conf>
vec work_x {vars.nc() > 0 || vars.nc_N() ? vars.nx() : 0}
mutable

Definition at line 167 of file ocp-vars.hpp.

◆ work_λ

template<Config Conf>
vec work_λ {vars.nx()}
mutable

Definition at line 168 of file ocp-vars.hpp.

◆ work_c

template<Config Conf>
vec work_c {std::max(vars.nc(), vars.nc_N())}
mutable

Definition at line 169 of file ocp-vars.hpp.

◆ work_R

template<Config Conf>
vec work_R {problem->get_R_work_size()}
mutable

Definition at line 170 of file ocp-vars.hpp.

◆ work_S

template<Config Conf>
vec work_S {problem->get_S_work_size()}
mutable

Definition at line 171 of file ocp-vars.hpp.


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