alpaqa no-casadi-dep
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TypeErasedControlProblem< Conf, Allocator > Class Template Reference

#include <alpaqa/problem/ocproblem.hpp>

Detailed Description

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
class alpaqa::TypeErasedControlProblem< Conf, Allocator >

Nonlinear optimal control problem with finite horizon \( N \).

\[ \newcommand\U{U} \newcommand\D{D} \newcommand\nnu{{n_u}} \newcommand\nnx{{n_x}} \newcommand\nny{{n_y}} \newcommand\xinit{x_\text{init}} \begin{equation}\label{eq:OCP} \tag{OCP}\hspace{-0.8em} \begin{aligned} &\minimize_{u,x} && \sum_{k=0}^{N-1} \ell_k\big(h_k(x^k, u^k)\big) + \ell_N\big(h_N(x^N)\big)\hspace{-0.8em} \\ &\subjto && u^k \in \U \\ &&& c_k(x^k) \in \D \\ &&& c_N(x^N) \in \D_N \\ &&& x^0 = \xinit \\ &&& x^{k+1} = f(x^k, u^k) \quad\quad (0 \le k \lt N) \end{aligned} \end{equation} \]

The function \( f : \R^\nnx \times \R^\nnu \to \R^\nnx \) models the discrete-time, nonlinear dynamics of the system, which starts from an initial state \( \xinit \). The functions \( h_k : \R^\nnx \times \R^\nnu \to \R^{n_h} \) for \( 0 \le k \lt N \) and \( h_N : \R^\nnx \to \R^{n_h^N} \) can be used to represent the (possibly time-varying) output mapping of the system, and the convex functions \( \ell_k : \R^{n_h} \to \R \) and \( \ell_N : \R^{n_h^N} \to \R \) define the stage costs and the terminal cost respectively. Stage constraints and terminal constraints are represented by the functions \( c_k : \R^{n_x} \to \R^{n_c} \) and \( c_N : \R^{n_x} \to \R^{n_c^N} \), and the boxes \( D \) and \( D_N \).

Additional functions for computing Gauss-Newton approximations of the cost Hessian are included as well:

\[ \begin{aligned} q^k &\defeq \tp{\jac_{h_k}^x\!(\barxuk)} \nabla \ell_k(\hhbar^k) \\ r^k &\defeq \tp{\jac_{h_k}^u\!(\barxuk)} \nabla \ell_k(\hhbar^k) \\ \Lambda_k &\defeq \partial^2 \ell_k(\hhbar^k) \\ Q_k &\defeq \tp{\jac_{h_k}^x\!(\barxuk)} \Lambda_k\, \jac_{h_k}^x\!(\barxuk) \\ S_k &\defeq \tp{\jac_{h_k}^u\!(\barxuk)} \Lambda_k\, \jac_{h_k}^x\!(\barxuk) \\ R_k &\defeq \tp{\jac_{h_k}^u\!(\barxuk)} \Lambda_k\, \jac_{h_k}^u\!(\barxuk). \\ \end{aligned} \]

See [3] for more details.

Definition at line 237 of file ocproblem.hpp.

+ Inheritance diagram for TypeErasedControlProblem< Conf, Allocator >:
+ Collaboration diagram for TypeErasedControlProblem< Conf, Allocator >:

Problem dimensions

length_t get_N () const
 Horizon length.
 
length_t get_nu () const
 Number of inputs.
 
length_t get_nx () const
 Number of states.
 
length_t get_nh () const
 Number of outputs.
 
length_t get_nh_N () const
 
length_t get_nc () const
 Number of constraints.
 
length_t get_nc_N () const
 
Dim get_dim () const
 All dimensions.
 
length_t get_n () const
 Total number of variables.
 
length_t get_m () const
 Total number of constraints.
 

Projections onto constraint sets

void eval_proj_diff_g (crvec z, rvec e) const
 [Required] Function that evaluates the difference between the given point \( z \) and its projection onto the constraint set \( D \).
 
void eval_proj_multipliers (rvec y, real_t M) const
 [Required] Function that projects the Lagrange multipliers for ALM.
 

Constraint sets

void get_U (Box &U) const
 Input box constraints \( U \).
 
void get_D (Box &D) const
 Stage box constraints \( D \).
 
void get_D_N (Box &D) const
 Terminal box constraints \( D_N \).
 

Dynamics and initial state

void get_x_init (rvec x_init) const
 Initial state \( x_\text{init} \).
 
void eval_f (index_t timestep, crvec x, crvec u, rvec fxu) const
 Discrete-time dynamics \( x^{k+1} = f_k(x^k, u^k) \).
 
void eval_jac_f (index_t timestep, crvec x, crvec u, rmat J_fxu) const
 Jacobian of discrete-time dynamics \( \jac_f(x^k, u^k) \).
 
void eval_grad_f_prod (index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const
 Gradient-vector product of discrete-time dynamics \( \nabla f(x^k, u^k)\,p \).
 

Output mapping

void eval_h (index_t timestep, crvec x, crvec u, rvec h) const
 Stage output mapping \( h_k(x^k, u^k) \).
 
void eval_h_N (crvec x, rvec h) const
 Terminal output mapping \( h_N(x^N) \).
 

Stage and terminal cost

real_t eval_l (index_t timestep, crvec h) const
 Stage cost \( \ell_k(\hbar^k) \).
 
real_t eval_l_N (crvec h) const
 Terminal cost \( \ell_N(\hbar^N) \).
 

Gauss-Newton approximations

void eval_qr (index_t timestep, crvec xu, crvec h, rvec qr) const
 Cost gradients w.r.t.
 
void eval_q_N (crvec x, crvec h, rvec q) const
 Terminal cost gradient w.r.t.
 
void eval_add_Q (index_t timestep, crvec xu, crvec h, rmat Q) const
 Cost Hessian w.r.t.
 
void eval_add_Q_N (crvec x, crvec h, rmat Q) const
 Terminal cost Hessian w.r.t.
 
void eval_add_R_masked (index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work) const
 Cost Hessian w.r.t.
 
void eval_add_S_masked (index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work) const
 Cost Hessian w.r.t.
 
void eval_add_R_prod_masked (index_t timestep, crvec xu, crvec h, crindexvec mask_J, crindexvec mask_K, crvec v, rvec out, rvec work) const
 \( out \leftarrow out + R[\mathcal J, \mathcal K]\,v[\mathcal K] \).
 
void eval_add_S_prod_masked (index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work) const
 \( out \leftarrow out + \tp{S[\mathcal K, \cdot]}\, v[\mathcal K] \).
 
length_t get_R_work_size () const
 Size of the workspace required by eval_add_R_masked() and eval_add_R_prod_masked().
 
length_t get_S_work_size () const
 Size of the workspace required by eval_add_S_masked() and eval_add_S_prod_masked().
 

Constraints

void eval_constr (index_t timestep, crvec x, rvec c) const
 Stage constraints \( c_k(x^k) \).
 
void eval_constr_N (crvec x, rvec c) const
 Terminal constraints \( c_N(x^N) \).
 
void eval_grad_constr_prod (index_t timestep, crvec x, crvec p, rvec grad_cx_p) const
 Gradient-vector product of stage constraints \( \nabla c_k(x^k)\, p \).
 
void eval_grad_constr_prod_N (crvec x, crvec p, rvec grad_cx_p) const
 Gradient-vector product of terminal constraints \( \nabla c_N(x^N)\, p \).
 
void eval_add_gn_hess_constr (index_t timestep, crvec x, crvec M, rmat out) const
 Gauss-Newton Hessian of stage constraints \( \tp{\jac_{c_k}}(x^k)\, \operatorname{diag}(M)\; \jac_{c_k}(x^k) \).
 
void eval_add_gn_hess_constr_N (crvec x, crvec M, rmat out) const
 Gauss-Newton Hessian of terminal constraints \( \tp{\jac_{c_N}}(x^N)\, \operatorname{diag}(M)\; \jac_{c_N}(x^N) \).
 

Checks

void check () const
 Check that the problem formulation is well-defined, the dimensions match, etc.
 

Querying specialized implementations

bool provides_get_D () const
 
bool provides_get_D_N () const
 
bool provides_eval_h () const
 
bool provides_eval_h_N () const
 
bool provides_eval_add_Q_N () const
 
bool provides_eval_add_R_prod_masked () const
 
bool provides_eval_add_S_prod_masked () const
 
bool provides_get_R_work_size () const
 
bool provides_get_S_work_size () const
 
bool provides_eval_constr () const
 
bool provides_eval_constr_N () const
 
bool provides_eval_grad_constr_prod () const
 
bool provides_eval_grad_constr_prod_N () const
 
bool provides_eval_add_gn_hess_constr () const
 
bool provides_eval_add_gn_hess_constr_N () const
 

Public Types

using VTable = ControlProblemVTable< config_t >
 
using allocator_type = Allocator
 
using Box = typename VTable::Box
 
using Dim = OCPDim< config_t >
 
using TypeErased = util::TypeErased< VTable, allocator_type >
 

Public Member Functions

 TypeErased () noexcept(noexcept(allocator_type()) &&noexcept(VTable()))=default
 Default constructor.
 
template<class Alloc >
 TypeErased (std::allocator_arg_t, const Alloc &alloc)
 Default constructor (allocator aware).
 
 TypeErased (const TypeErased &other)
 Copy constructor.
 
 TypeErased (const TypeErased &other, const allocator_type &alloc)
 Copy constructor (allocator aware).
 
 TypeErased (std::allocator_arg_t, const allocator_type &alloc, const TypeErased &other)
 Copy constructor (allocator aware).
 
 TypeErased (TypeErased &&other) noexcept
 Move constructor.
 
 TypeErased (TypeErased &&other, const allocator_type &alloc) noexcept
 Move constructor (allocator aware).
 
 TypeErased (std::allocator_arg_t, const allocator_type &alloc, TypeErased &&other) noexcept
 Move constructor (allocator aware).
 
template<class T , class Alloc >
requires no_child_of_ours<T>
 TypeErased (std::allocator_arg_t, const Alloc &alloc, T &&d)
 Main constructor that type-erases the given argument.
 
template<class T , class Alloc , class... Args>
 TypeErased (std::allocator_arg_t, const Alloc &alloc, std::in_place_type_t< T >, Args &&...args)
 Main constructor that type-erases the object constructed from the given argument.
 
template<class T >
requires no_child_of_ours<T>
 TypeErased (T &&d)
 
template<class T , class... Args>
 TypeErased (std::in_place_type_t< T >, Args &&...args)
 Main constructor that type-erases the object constructed from the given argument.
 
 operator bool () const noexcept
 Check if this wrapper wraps an object.
 
bool owns_referenced_object () const noexcept
 Check if this wrapper owns the storage of the wrapped object, or whether it simply stores a reference to an object that was allocated elsewhere.
 
bool referenced_object_is_const () const noexcept
 Check if the wrapped object is const.
 
allocator_type get_allocator () const noexcept
 Get a copy of the allocator.
 
const std::type_info & type () const noexcept
 Query the contained type.
 
template<class T >
requires (!std::is_const_v<T>)
Tas () &
 Convert the type-erased object to the given type.
 
template<class T >
requires (std::is_const_v<T>)
Tas () const &
 Convert the type-erased object to the given type.
 
template<class T >
T && as () &&
 Convert the type-erased object to the given type.
 
voidget_pointer () const
 Get a type-erased pointer to the wrapped object.
 
const voidget_const_pointer () const
 Get a type-erased pointer to the wrapped object.
 

Static Public Member Functions

template<class T , class... Args>
static TypeErasedControlProblem make (Args &&...args)
 
template<class Ret , class T , class Alloc , class... Args>
requires std::is_base_of_v<TypeErased, Ret>
static Ret make (std::allocator_arg_t tag, const Alloc &alloc, Args &&...args)
 Construct a type-erased wrapper of type Ret for an object of type T, initialized in-place with the given arguments.
 

Static Public Attributes

static constexpr size_t small_buffer_size = SmallBufferSize
 

Protected Member Functions

template<class Ret , class... FArgs, class... Args>
decltype(autocall (Ret(*f)(const void *, FArgs...), Args &&...args) const
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class Ret , class... FArgs, class... Args>
decltype(autocall (Ret(*f)(void *, FArgs...), Args &&...args)
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class Ret >
decltype(autocall (Ret(*f)(const void *)) const
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class Ret >
decltype(autocall (Ret(*f)(void *))
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class Ret >
decltype(autocall (Ret(*f)(const void *, const VTable &)) const
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class Ret >
decltype(autocall (Ret(*f)(void *, const VTable &))
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class T , class... Args>
void construct_inplace (Args &&...args)
 Ensure storage and construct the type-erased object of type T in-place.
 
template<class Ret >
decltype(autocall (Ret(*f)(const void *, const VTable &)) const
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 
template<class Ret >
decltype(autocall (Ret(*f)(void *, const VTable &))
 Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.
 

Static Protected Member Functions

static bool size_indicates_ownership (size_t size)
 
static bool size_indicates_const (size_t size)
 

Protected Attributes

voidself
 Pointer to the stored object.
 
VTable vtable
 
size_t size = invalid_size
 Size required to store the object.
 

Static Protected Attributes

static constexpr size_t invalid_size
 
static constexpr size_t mut_ref_size
 
static constexpr size_t const_ref_size
 

Private Types

using allocator_traits = std::allocator_traits< allocator_type >
 
using buffer_type = std::array< std::byte, small_buffer_size >
 

Private Member Functions

Deallocator allocate (size_t size)
 Ensure that storage is available, either by using the small buffer if it is large enough, or by calling the allocator.
 
void deallocate ()
 Deallocate the memory without invoking the destructor.
 
void cleanup ()
 Destroy the type-erased object (if not empty), and deallocate the memory if necessary.
 
template<bool CopyAllocator>
void do_copy_assign (const TypeErased &other)
 

Private Attributes

buffer_type small_buffer
 
allocator_type allocator
 

Static Private Attributes

template<class T >
static constexpr auto no_child_of_ours
 True if T is not a child class of TypeErased.
 

Member Typedef Documentation

◆ VTable

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
using VTable = ControlProblemVTable<config_t>

Definition at line 240 of file ocproblem.hpp.

◆ allocator_type

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
using allocator_type = Allocator

Definition at line 241 of file ocproblem.hpp.

◆ Box

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
using Box = typename VTable::Box

Definition at line 242 of file ocproblem.hpp.

◆ Dim

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
using Dim = OCPDim<config_t>

Definition at line 243 of file ocproblem.hpp.

◆ TypeErased

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
using TypeErased = util::TypeErased<VTable, allocator_type>

Definition at line 244 of file ocproblem.hpp.

◆ allocator_traits

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
using allocator_traits = std::allocator_traits<allocator_type>
privateinherited

Definition at line 199 of file type-erasure.hpp.

◆ buffer_type

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
using buffer_type = std::array<std::byte, small_buffer_size>
privateinherited

Definition at line 200 of file type-erasure.hpp.

Member Function Documentation

◆ make() [1/2]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class T , class... Args>
static TypeErasedControlProblem make ( Args &&...  args)
inlinestatic

Definition at line 254 of file ocproblem.hpp.

◆ get_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_N ( ) const
inline

Horizon length.

Definition at line 262 of file ocproblem.hpp.

◆ get_nu()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_nu ( ) const
inline

Number of inputs.

Definition at line 264 of file ocproblem.hpp.

◆ get_nx()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_nx ( ) const
inline

Number of states.

Definition at line 266 of file ocproblem.hpp.

◆ get_nh()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_nh ( ) const
inline

Number of outputs.

Definition at line 268 of file ocproblem.hpp.

◆ get_nh_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_nh_N ( ) const
inline

Definition at line 269 of file ocproblem.hpp.

◆ get_nc()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_nc ( ) const
inline

Number of constraints.

Definition at line 271 of file ocproblem.hpp.

◆ get_nc_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_nc_N ( ) const
inline

Definition at line 272 of file ocproblem.hpp.

◆ get_dim()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
Dim get_dim ( ) const
inline

All dimensions.

Definition at line 274 of file ocproblem.hpp.

◆ get_n()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_n ( ) const
inline

Total number of variables.

Definition at line 286 of file ocproblem.hpp.

◆ get_m()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
length_t get_m ( ) const
inline

Total number of constraints.

Definition at line 288 of file ocproblem.hpp.

◆ eval_proj_diff_g()

template<Config Conf, class Allocator >
void eval_proj_diff_g ( crvec  z,
rvec  e 
) const
inline

[Required] Function that evaluates the difference between the given point \( z \) and its projection onto the constraint set \( D \).

Parameters
[in]zSlack variable, \( z \in \R^m \)
[out]eThe difference relative to its projection, \( e = z - \Pi_D(z) \in \R^m \)
Note
z and e can refer to the same vector.

Definition at line 519 of file ocproblem.hpp.

◆ eval_proj_multipliers()

template<Config Conf, class Allocator >
void eval_proj_multipliers ( rvec  y,
real_t  M 
) const
inline

[Required] Function that projects the Lagrange multipliers for ALM.

Parameters
[in,out]yMultipliers, \( y \leftarrow \Pi_Y(y) \in \R^m \)
[in]MThe radius/size of the set \( Y \). See ALMParams::max_multiplier.

Definition at line 520 of file ocproblem.hpp.

◆ get_U()

template<Config Conf, class Allocator >
void get_U ( Box U) const
inline

Input box constraints \( U \).

Definition at line 521 of file ocproblem.hpp.

◆ get_D()

template<Config Conf, class Allocator >
void get_D ( Box D) const
inline

Stage box constraints \( D \).

Definition at line 522 of file ocproblem.hpp.

◆ get_D_N()

template<Config Conf, class Allocator >
void get_D_N ( Box D) const
inline

Terminal box constraints \( D_N \).

Definition at line 523 of file ocproblem.hpp.

◆ get_x_init()

template<Config Conf, class Allocator >
void get_x_init ( rvec  x_init) const
inline

Initial state \( x_\text{init} \).

Definition at line 524 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_f()

template<Config Conf, class Allocator >
void eval_f ( index_t  timestep,
crvec  x,
crvec  u,
rvec  fxu 
) const
inline

Discrete-time dynamics \( x^{k+1} = f_k(x^k, u^k) \).

Definition at line 525 of file ocproblem.hpp.

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

◆ eval_jac_f()

template<Config Conf, class Allocator >
void eval_jac_f ( index_t  timestep,
crvec  x,
crvec  u,
rmat  J_fxu 
) const
inline

Jacobian of discrete-time dynamics \( \jac_f(x^k, u^k) \).

Definition at line 526 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_grad_f_prod()

template<Config Conf, class Allocator >
void eval_grad_f_prod ( index_t  timestep,
crvec  x,
crvec  u,
crvec  p,
rvec  grad_fxu_p 
) const
inline

Gradient-vector product of discrete-time dynamics \( \nabla f(x^k, u^k)\,p \).

Definition at line 527 of file ocproblem.hpp.

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

◆ eval_h()

template<Config Conf, class Allocator >
void eval_h ( index_t  timestep,
crvec  x,
crvec  u,
rvec  h 
) const
inline

Stage output mapping \( h_k(x^k, u^k) \).

Definition at line 528 of file ocproblem.hpp.

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

◆ eval_h_N()

template<Config Conf, class Allocator >
void eval_h_N ( crvec  x,
rvec  h 
) const
inline

Terminal output mapping \( h_N(x^N) \).

Definition at line 529 of file ocproblem.hpp.

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

◆ eval_l()

template<Config Conf, class Allocator >
auto eval_l ( index_t  timestep,
crvec  h 
) const
inline

Stage cost \( \ell_k(\hbar^k) \).

Definition at line 530 of file ocproblem.hpp.

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

◆ eval_l_N()

template<Config Conf, class Allocator >
auto eval_l_N ( crvec  h) const
inline

Terminal cost \( \ell_N(\hbar^N) \).

Definition at line 531 of file ocproblem.hpp.

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

◆ eval_qr()

template<Config Conf, class Allocator >
void eval_qr ( index_t  timestep,
crvec  xu,
crvec  h,
rvec  qr 
) const
inline

Cost gradients w.r.t.

states and inputs \( q^k = \tp{\jac_{h_k}^x\!(\barxuk)} \nabla \ell_k(\hbar^k) \) and \( r^k = \tp{\jac_{h_k}^u\!(\barxuk)} \nabla \ell_k(\hbar^k) \).

Definition at line 532 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_q_N()

template<Config Conf, class Allocator >
void eval_q_N ( crvec  x,
crvec  h,
rvec  q 
) const
inline

Terminal cost gradient w.r.t.

states \( q^N = \tp{\jac_{h_N}(\bar x^N)} \nabla \ell_k(\hbar^N) \).

Definition at line 533 of file ocproblem.hpp.

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

◆ eval_add_Q()

template<Config Conf, class Allocator >
void eval_add_Q ( index_t  timestep,
crvec  xu,
crvec  h,
rmat  Q 
) const
inline

Cost Hessian w.r.t.

states \( Q_k = \tp{\jac_{h_k}^x\!(\barxuk)} \partial^2\ell_k(\hbar^k)\, \jac_{h_k}^x\!(\barxuk) \), added to the given matrix Q. \( Q \leftarrow Q + Q_k \).

Definition at line 534 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_Q_N()

template<Config Conf, class Allocator >
void eval_add_Q_N ( crvec  x,
crvec  h,
rmat  Q 
) const
inline

Terminal cost Hessian w.r.t.

states \( Q_N = \tp{\jac_{h_N}(\bar x^N)} \partial^2\ell_N(\hbar^N)\, \jac_{h_N}(\bar x^N) \), added to the given matrix Q. \( Q \leftarrow Q + Q_N \).

Definition at line 535 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_R_masked()

template<Config Conf, class Allocator >
void eval_add_R_masked ( index_t  timestep,
crvec  xu,
crvec  h,
crindexvec  mask,
rmat  R,
rvec  work 
) const
inline

Cost Hessian w.r.t.

inputs \( R_k = \tp{\jac_{h_k}^u\!(\barxuk)} \partial^2\ell_k(\hbar^k)\, \jac_{h_k}^u\!(\barxuk) \), keeping only rows and columns in the mask \( \mathcal J \), added to the given matrix R. \( R \leftarrow R + R_k[\mathcal J, \mathcal J] \). The size of work should be get_R_work_size().

Definition at line 536 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_S_masked()

template<Config Conf, class Allocator >
void eval_add_S_masked ( index_t  timestep,
crvec  xu,
crvec  h,
crindexvec  mask,
rmat  S,
rvec  work 
) const
inline

Cost Hessian w.r.t.

inputs and states \( S_k = \tp{\jac_{h_k}^u\!(\barxuk)} \partial^2\ell_k(\hbar^k)\, \jac_{h_k}^x\!(\barxuk) \), keeping only rows in the mask \( \mathcal J \), added to the given matrix S. \( S \leftarrow S + S_k[\mathcal J, \cdot] \). The size of work should be get_S_work_size().

Definition at line 537 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_R_prod_masked()

template<Config Conf, class Allocator >
void eval_add_R_prod_masked ( index_t  timestep,
crvec  xu,
crvec  h,
crindexvec  mask_J,
crindexvec  mask_K,
crvec  v,
rvec  out,
rvec  work 
) const
inline

\( out \leftarrow out + R[\mathcal J, \mathcal K]\,v[\mathcal K] \).

Work should contain the contents written to it by a prior call to eval_add_R_masked() in the same point.

Definition at line 538 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_S_prod_masked()

template<Config Conf, class Allocator >
void eval_add_S_prod_masked ( index_t  timestep,
crvec  xu,
crvec  h,
crindexvec  mask_K,
crvec  v,
rvec  out,
rvec  work 
) const
inline

\( out \leftarrow out + \tp{S[\mathcal K, \cdot]}\, v[\mathcal K] \).

Work should contain the contents written to it by a prior call to eval_add_S_masked() in the same point.

Definition at line 539 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ get_R_work_size()

template<Config Conf, class Allocator >
auto get_R_work_size ( ) const
inline

Size of the workspace required by eval_add_R_masked() and eval_add_R_prod_masked().

Definition at line 540 of file ocproblem.hpp.

◆ get_S_work_size()

template<Config Conf, class Allocator >
auto get_S_work_size ( ) const
inline

Size of the workspace required by eval_add_S_masked() and eval_add_S_prod_masked().

Definition at line 541 of file ocproblem.hpp.

◆ eval_constr()

template<Config Conf, class Allocator >
void eval_constr ( index_t  timestep,
crvec  x,
rvec  c 
) const
inline

Stage constraints \( c_k(x^k) \).

Definition at line 542 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_constr_N()

template<Config Conf, class Allocator >
void eval_constr_N ( crvec  x,
rvec  c 
) const
inline

Terminal constraints \( c_N(x^N) \).

Definition at line 543 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_grad_constr_prod()

template<Config Conf, class Allocator >
void eval_grad_constr_prod ( index_t  timestep,
crvec  x,
crvec  p,
rvec  grad_cx_p 
) const
inline

Gradient-vector product of stage constraints \( \nabla c_k(x^k)\, p \).

Definition at line 544 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_grad_constr_prod_N()

template<Config Conf, class Allocator >
void eval_grad_constr_prod_N ( crvec  x,
crvec  p,
rvec  grad_cx_p 
) const
inline

Gradient-vector product of terminal constraints \( \nabla c_N(x^N)\, p \).

Definition at line 545 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_gn_hess_constr()

template<Config Conf, class Allocator >
void eval_add_gn_hess_constr ( index_t  timestep,
crvec  x,
crvec  M,
rmat  out 
) const
inline

Gauss-Newton Hessian of stage constraints \( \tp{\jac_{c_k}}(x^k)\, \operatorname{diag}(M)\; \jac_{c_k}(x^k) \).

Definition at line 546 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ eval_add_gn_hess_constr_N()

template<Config Conf, class Allocator >
void eval_add_gn_hess_constr_N ( crvec  x,
crvec  M,
rmat  out 
) const
inline

Gauss-Newton Hessian of terminal constraints \( \tp{\jac_{c_N}}(x^N)\, \operatorname{diag}(M)\; \jac_{c_N}(x^N) \).

Definition at line 547 of file ocproblem.hpp.

+ Here is the caller graph for this function:

◆ check()

template<Config Conf, class Allocator >
void check ( ) const
inline

Check that the problem formulation is well-defined, the dimensions match, etc.

Throws an exception if this is not the case.

Definition at line 548 of file ocproblem.hpp.

◆ provides_get_D()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_get_D ( ) const
inline

Definition at line 449 of file ocproblem.hpp.

◆ provides_get_D_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_get_D_N ( ) const
inline

Definition at line 450 of file ocproblem.hpp.

◆ provides_eval_h()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_h ( ) const
inline

Definition at line 451 of file ocproblem.hpp.

◆ provides_eval_h_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_h_N ( ) const
inline

Definition at line 452 of file ocproblem.hpp.

◆ provides_eval_add_Q_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_add_Q_N ( ) const
inline

Definition at line 453 of file ocproblem.hpp.

◆ provides_eval_add_R_prod_masked()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_add_R_prod_masked ( ) const
inline

Definition at line 454 of file ocproblem.hpp.

◆ provides_eval_add_S_prod_masked()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_add_S_prod_masked ( ) const
inline

Definition at line 455 of file ocproblem.hpp.

◆ provides_get_R_work_size()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_get_R_work_size ( ) const
inline

Definition at line 456 of file ocproblem.hpp.

◆ provides_get_S_work_size()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_get_S_work_size ( ) const
inline

Definition at line 457 of file ocproblem.hpp.

◆ provides_eval_constr()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_constr ( ) const
inline

Definition at line 458 of file ocproblem.hpp.

◆ provides_eval_constr_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_constr_N ( ) const
inline

Definition at line 459 of file ocproblem.hpp.

◆ provides_eval_grad_constr_prod()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_grad_constr_prod ( ) const
inline

Definition at line 460 of file ocproblem.hpp.

◆ provides_eval_grad_constr_prod_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_grad_constr_prod_N ( ) const
inline

Definition at line 461 of file ocproblem.hpp.

◆ provides_eval_add_gn_hess_constr()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_add_gn_hess_constr ( ) const
inline

Definition at line 462 of file ocproblem.hpp.

◆ provides_eval_add_gn_hess_constr_N()

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
bool provides_eval_add_gn_hess_constr_N ( ) const
inline

Definition at line 463 of file ocproblem.hpp.

◆ TypeErased() [1/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( )
defaultnoexcept

Default constructor.

◆ TypeErased() [2/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Alloc >
TypeErased ( std::allocator_arg_t  ,
const Alloc alloc 
)
inline

Default constructor (allocator aware).

Definition at line 236 of file type-erasure.hpp.

◆ TypeErased() [3/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( const TypeErased other)
inline

Copy constructor.

Definition at line 239 of file type-erasure.hpp.

◆ TypeErased() [4/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( const TypeErased other,
const allocator_type alloc 
)
inline

Copy constructor (allocator aware).

Definition at line 246 of file type-erasure.hpp.

◆ TypeErased() [5/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( std::allocator_arg_t  ,
const allocator_type alloc,
const TypeErased other 
)
inline

Copy constructor (allocator aware).

Definition at line 251 of file type-erasure.hpp.

◆ TypeErased() [6/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( TypeErased &&  other)
inlinenoexcept

Move constructor.

Definition at line 268 of file type-erasure.hpp.

◆ TypeErased() [7/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( TypeErased &&  other,
const allocator_type alloc 
)
inlinenoexcept

Move constructor (allocator aware).

Definition at line 291 of file type-erasure.hpp.

◆ TypeErased() [8/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
TypeErased ( std::allocator_arg_t  ,
const allocator_type alloc,
TypeErased &&  other 
)
inlinenoexcept

Move constructor (allocator aware).

Definition at line 328 of file type-erasure.hpp.

◆ TypeErased() [9/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class T , class Alloc >
requires no_child_of_ours<T>
TypeErased ( std::allocator_arg_t  ,
const Alloc alloc,
T &&  d 
)
inlineexplicit

Main constructor that type-erases the given argument.

Definition at line 394 of file type-erasure.hpp.

◆ TypeErased() [10/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class T , class Alloc , class... Args>
TypeErased ( std::allocator_arg_t  ,
const Alloc alloc,
std::in_place_type_t< T ,
Args &&...  args 
)
inlineexplicit

Main constructor that type-erases the object constructed from the given argument.

Definition at line 401 of file type-erasure.hpp.

◆ TypeErased() [11/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class T >
requires no_child_of_ours<T>
TypeErased ( T &&  d)
inlineexplicit

Requirement prevents this constructor from taking precedence over the copy and move constructors.

Definition at line 411 of file type-erasure.hpp.

◆ TypeErased() [12/12]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class T , class... Args>
TypeErased ( std::in_place_type_t< T ,
Args &&...  args 
)
inlineexplicit

Main constructor that type-erases the object constructed from the given argument.

Definition at line 417 of file type-erasure.hpp.

◆ call() [1/8]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Ret , class... FArgs, class... Args>
decltype(auto) call ( Ret(*)(const void *, FArgs...)  f,
Args &&...  args 
) const
inlineprotected

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 620 of file type-erasure.hpp.

◆ call() [2/8]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Ret , class... FArgs, class... Args>
decltype(auto) call ( Ret(*)(void *, FArgs...)  f,
Args &&...  args 
)
inlineprotected

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 632 of file type-erasure.hpp.

◆ call() [3/8]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Ret >
decltype(auto) call ( Ret(*)(const void *)  f) const
inlineprotected

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 646 of file type-erasure.hpp.

◆ call() [4/8]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Ret >
decltype(auto) call ( Ret(*)(void *)  f)
inlineprotected

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 653 of file type-erasure.hpp.

◆ call() [5/8]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Ret >
decltype(auto) call ( Ret(*)(const void *, const VTable &)  f) const
inlineprotected

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 662 of file type-erasure.hpp.

◆ call() [6/8]

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
template<class Ret >
decltype(auto) call ( Ret(*)(void *, const VTable &)  f)
inlineprotected

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 670 of file type-erasure.hpp.

◆ size_indicates_ownership()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
static bool size_indicates_ownership ( size_t  size)
inlinestaticprotectedinherited

Definition at line 217 of file type-erasure.hpp.

+ Here is the caller graph for this function:

◆ size_indicates_const()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
static bool size_indicates_const ( size_t  size)
inlinestaticprotectedinherited

Definition at line 220 of file type-erasure.hpp.

+ Here is the caller graph for this function:

◆ make() [2/2]

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class Ret , class T , class Alloc , class... Args>
requires std::is_base_of_v<TypeErased, Ret>
static Ret make ( std::allocator_arg_t  tag,
const Alloc alloc,
Args &&...  args 
)
inlinestaticinherited

Construct a type-erased wrapper of type Ret for an object of type T, initialized in-place with the given arguments.

Definition at line 425 of file type-erasure.hpp.

◆ operator bool()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
operator bool ( ) const
inlineexplicitnoexceptinherited

Check if this wrapper wraps an object.

False for default-constructed objects.

Definition at line 442 of file type-erasure.hpp.

◆ owns_referenced_object()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
bool owns_referenced_object ( ) const
inlinenoexceptinherited

Check if this wrapper owns the storage of the wrapped object, or whether it simply stores a reference to an object that was allocated elsewhere.

Definition at line 447 of file type-erasure.hpp.

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

◆ referenced_object_is_const()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
bool referenced_object_is_const ( ) const
inlinenoexceptinherited

Check if the wrapped object is const.

Definition at line 452 of file type-erasure.hpp.

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

◆ get_allocator()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
allocator_type get_allocator ( ) const
inlinenoexceptinherited

Get a copy of the allocator.

Definition at line 457 of file type-erasure.hpp.

◆ type()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
const std::type_info & type ( ) const
inlinenoexceptinherited

Query the contained type.

Definition at line 460 of file type-erasure.hpp.

+ Here is the caller graph for this function:

◆ as() [1/3]

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class T >
requires (!std::is_const_v<T>)
T & as ( ) &
inlineinherited

Convert the type-erased object to the given type.

Exceptions
alpaqa::util::bad_type_erased_typeIf T does not match the stored type.

Definition at line 469 of file type-erasure.hpp.

+ Here is the call graph for this function:

◆ as() [2/3]

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class T >
requires (std::is_const_v<T>)
T & as ( ) const &
inlineinherited

Convert the type-erased object to the given type.

Exceptions
alpaqa::util::bad_type_erased_typeIf T does not match the stored type.

Definition at line 479 of file type-erasure.hpp.

+ Here is the call graph for this function:

◆ as() [3/3]

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class T >
T && as ( ) &&
inlineinherited

Convert the type-erased object to the given type.

Exceptions
alpaqa::util::bad_type_erased_typeIf T does not match the stored type.

Definition at line 486 of file type-erasure.hpp.

+ Here is the call graph for this function:

◆ get_pointer()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
void * get_pointer ( ) const
inlineinherited

Get a type-erased pointer to the wrapped object.

Exceptions
alpaqa::util::bad_type_erased_constnessIf the wrapped object is const.
See also
get_const_pointer()

Definition at line 498 of file type-erasure.hpp.

+ Here is the call graph for this function:

◆ get_const_pointer()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
const void * get_const_pointer ( ) const
inlineinherited

Get a type-erased pointer to the wrapped object.

Definition at line 504 of file type-erasure.hpp.

◆ allocate()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
Deallocator allocate ( size_t  size)
inlineprivateinherited

Ensure that storage is available, either by using the small buffer if it is large enough, or by calling the allocator.

Returns a RAII wrapper that deallocates the storage unless released.

Definition at line 530 of file type-erasure.hpp.

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

◆ deallocate()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
void deallocate ( )
inlineprivateinherited

Deallocate the memory without invoking the destructor.

Definition at line 542 of file type-erasure.hpp.

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

◆ cleanup()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
void cleanup ( )
inlineprivateinherited

Destroy the type-erased object (if not empty), and deallocate the memory if necessary.

Definition at line 554 of file type-erasure.hpp.

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

◆ do_copy_assign()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<bool CopyAllocator>
void do_copy_assign ( const TypeErased< VTable, Allocator, SmallBufferSize > &  other)
inlineprivateinherited

Definition at line 564 of file type-erasure.hpp.

+ Here is the call graph for this function:

◆ construct_inplace()

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class T , class... Args>
void construct_inplace ( Args &&...  args)
inlineprotectedinherited

Ensure storage and construct the type-erased object of type T in-place.

Definition at line 589 of file type-erasure.hpp.

+ Here is the call graph for this function:

◆ call() [7/8]

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class Ret >
decltype(auto) call ( Ret(*)(const void *, const VTable &)  f) const
inlineprotectedinherited

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 662 of file type-erasure.hpp.

◆ call() [8/8]

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class Ret >
decltype(auto) call ( Ret(*)(void *, const VTable &)  f)
inlineprotectedinherited

Call the vtable function f with the given arguments args, implicitly passing the self pointer and vtable reference if necessary.

Definition at line 670 of file type-erasure.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ self

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
void* self
protected

Pointer to the stored object.

Definition at line 225 of file type-erasure.hpp.

◆ vtable

template<Config Conf = DefaultConfig, class Allocator = std::allocator<std::byte>>
VTable vtable
protected

Definition at line 228 of file type-erasure.hpp.

◆ small_buffer_size

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
constexpr size_t small_buffer_size = SmallBufferSize
staticconstexprinherited

Definition at line 195 of file type-erasure.hpp.

◆ small_buffer

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
buffer_type small_buffer
privateinherited

Definition at line 201 of file type-erasure.hpp.

◆ allocator

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
allocator_type allocator
privateinherited

Definition at line 202 of file type-erasure.hpp.

◆ no_child_of_ours

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
template<class T >
constexpr auto no_child_of_ours
staticconstexprprivateinherited
Initial value:
=
!std::is_base_of_v<TypeErased, std::remove_cvref_t<T>>

True if T is not a child class of TypeErased.

Definition at line 207 of file type-erasure.hpp.

◆ invalid_size

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
constexpr size_t invalid_size
staticconstexprprotectedinherited
Initial value:
=
static_cast<size_t>(0xDEAD'BEEF'DEAD'BEEF)

Definition at line 211 of file type-erasure.hpp.

◆ mut_ref_size

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
constexpr size_t mut_ref_size
staticconstexprprotectedinherited
Initial value:
=
static_cast<size_t>(0xFFFF'FFFF'FFFF'FFFF)

Definition at line 213 of file type-erasure.hpp.

◆ const_ref_size

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
constexpr size_t const_ref_size
staticconstexprprotectedinherited
Initial value:
=
static_cast<size_t>(0xFFFF'FFFF'FFFF'FFFE)

Definition at line 215 of file type-erasure.hpp.

◆ size

template<class VTable = BasicVTable, class Allocator = std::allocator<std::byte>, size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
size_t size = invalid_size
protectedinherited

Size required to store the object.

Definition at line 227 of file type-erasure.hpp.


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