alpaqa 1.0.0a18
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
ControlProblemWithCounters< Problem > Struct Template Reference

#include <alpaqa/problem/ocproblem.hpp>

Detailed Description

template<class Problem>
struct alpaqa::ControlProblemWithCounters< Problem >
Examples
C++/CustomControlCppProblem/main.cpp.

Definition at line 553 of file ocproblem.hpp.

+ Collaboration diagram for ControlProblemWithCounters< Problem >:

Public Types

using Box = typename TypeErasedControlProblem< config_t >::Box
 

Public Member Functions

length_t get_N () const
 
length_t get_nu () const
 
length_t get_nx () const
 
length_t get_nh () const
 
length_t get_nh_N () const
 
length_t get_nc () const
 
length_t get_nc_N () const
 
void eval_proj_diff_g (crvec z, rvec e) const
 
void eval_proj_multipliers (rvec y, real_t M) const
 
void get_x_init (rvec x_init) const
 
length_t get_R_work_size () const
 
length_t get_S_work_size () const
 
void get_U (Box &U) const
 
void get_D (Box &D) const
 
void get_D_N (Box &D) const
 
void eval_f (index_t timestep, crvec x, crvec u, rvec fxu) const
 
void eval_jac_f (index_t timestep, crvec x, crvec u, rmat J_fxu) const
 
void eval_grad_f_prod (index_t timestep, crvec x, crvec u, crvec p, rvec grad_fxu_p) const
 
void eval_h (index_t timestep, crvec x, crvec u, rvec h) const
 
void eval_h_N (crvec x, rvec h) const
 
real_t eval_l (index_t timestep, crvec h) const
 
real_t eval_l_N (crvec h) const
 
void eval_qr (index_t timestep, crvec xu, crvec h, rvec qr) const
 
void eval_q_N (crvec x, crvec h, rvec q) const
 
void eval_add_Q (index_t timestep, crvec xu, crvec h, rmat Q) const
 
void eval_add_Q_N (crvec x, crvec h, rmat Q) const
 
void eval_add_R_masked (index_t timestep, crvec xu, crvec h, crindexvec mask, rmat R, rvec work) const
 
void eval_add_S_masked (index_t timestep, crvec xu, crvec h, crindexvec mask, rmat S, rvec work) const
 
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
 
void eval_add_S_prod_masked (index_t timestep, crvec xu, crvec h, crindexvec mask_K, crvec v, rvec out, rvec work) const
 
void eval_constr (index_t timestep, crvec x, rvec c) const
 
void eval_constr_N (crvec x, rvec c) const
 
void eval_grad_constr_prod (index_t timestep, crvec x, crvec p, rvec grad_cx_p) const
 
void eval_grad_constr_prod_N (crvec x, crvec p, rvec grad_cx_p) const
 
void eval_add_gn_hess_constr (index_t timestep, crvec x, crvec M, rmat out) const
 
void eval_add_gn_hess_constr_N (crvec x, crvec M, rmat out) const
 
void check () const
 
bool provides_get_D () const
 
bool provides_get_D_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
 
 ControlProblemWithCounters ()=default
 
template<class P >
requires std::is_same_v<std::remove_cvref_t<P>, std::remove_cvref_t<Problem>>
 ControlProblemWithCounters (P &&problem)
 
template<class... Args>
requires (!std::is_lvalue_reference_v<Problem>)
 ControlProblemWithCounters (std::in_place_t, Args &&...args)
 
void reset_evaluations ()
 Reset all evaluation counters and timers to zero.
 
void decouple_evaluations ()
 Give this instance its own evaluation counters and timers, decoupling it from any other instances they might have previously been shared with.
 

Public Attributes

std::shared_ptr< OCPEvalCounterevaluations = std::make_shared<OCPEvalCounter>()
 
Problem problem
 

Static Private Member Functions

template<class TimeT , class FunT >
static decltype(autotimed (TimeT &time, FunT &&f)
 

Member Typedef Documentation

◆ Box

template<class Problem >
using Box = typename TypeErasedControlProblem<config_t>::Box

Definition at line 555 of file ocproblem.hpp.

Constructor & Destructor Documentation

◆ ControlProblemWithCounters() [1/3]

template<class Problem >
ControlProblemWithCounters ( )
default

◆ ControlProblemWithCounters() [2/3]

template<class Problem >
template<class P >
requires std::is_same_v<std::remove_cvref_t<P>, std::remove_cvref_t<Problem>>
ControlProblemWithCounters ( P &&  problem)
inlineexplicit

Definition at line 619 of file ocproblem.hpp.

◆ ControlProblemWithCounters() [3/3]

template<class Problem >
template<class... Args>
requires (!std::is_lvalue_reference_v<Problem>)
ControlProblemWithCounters ( std::in_place_t  ,
Args &&...  args 
)
inlineexplicit

Definition at line 623 of file ocproblem.hpp.

Member Function Documentation

◆ get_N()

template<class Problem >
length_t get_N ( ) const
inline
Examples
C++/CustomControlCppProblem/main.cpp.

Definition at line 557 of file ocproblem.hpp.

◆ get_nu()

template<class Problem >
length_t get_nu ( ) const
inline
Examples
C++/CustomControlCppProblem/main.cpp.

Definition at line 558 of file ocproblem.hpp.

◆ get_nx()

template<class Problem >
length_t get_nx ( ) const
inline

Definition at line 559 of file ocproblem.hpp.

◆ get_nh()

template<class Problem >
length_t get_nh ( ) const
inline

Definition at line 560 of file ocproblem.hpp.

◆ get_nh_N()

template<class Problem >
length_t get_nh_N ( ) const
inline

Definition at line 561 of file ocproblem.hpp.

◆ get_nc()

template<class Problem >
length_t get_nc ( ) const
inline
Examples
C++/CustomControlCppProblem/main.cpp.

Definition at line 562 of file ocproblem.hpp.

◆ get_nc_N()

template<class Problem >
length_t get_nc_N ( ) const
inline
Examples
C++/CustomControlCppProblem/main.cpp.

Definition at line 563 of file ocproblem.hpp.

◆ eval_proj_diff_g()

template<class Problem >
void eval_proj_diff_g ( crvec  z,
rvec  e 
) const
inline

Definition at line 566 of file ocproblem.hpp.

◆ eval_proj_multipliers()

template<class Problem >
void eval_proj_multipliers ( rvec  y,
real_t  M 
) const
inline

Definition at line 567 of file ocproblem.hpp.

◆ get_x_init()

template<class Problem >
void get_x_init ( rvec  x_init) const
inline

Definition at line 568 of file ocproblem.hpp.

◆ get_R_work_size()

template<class Problem >
length_t get_R_work_size ( ) const
inline

Definition at line 569 of file ocproblem.hpp.

◆ get_S_work_size()

template<class Problem >
length_t get_S_work_size ( ) const
inline

Definition at line 570 of file ocproblem.hpp.

◆ get_U()

template<class Problem >
void get_U ( Box U) const
inline

Definition at line 571 of file ocproblem.hpp.

◆ get_D()

template<class Problem >
void get_D ( Box D) const
inline

Definition at line 572 of file ocproblem.hpp.

◆ get_D_N()

template<class Problem >
void get_D_N ( Box D) const
inline

Definition at line 573 of file ocproblem.hpp.

◆ eval_f()

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

Definition at line 574 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_jac_f()

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

Definition at line 575 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_grad_f_prod()

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

Definition at line 576 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_h()

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

Definition at line 577 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_h_N()

template<class Problem >
void eval_h_N ( crvec  x,
rvec  h 
) const
inline

Definition at line 578 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_l()

template<class Problem >
real_t eval_l ( index_t  timestep,
crvec  h 
) const
inline

Definition at line 579 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_l_N()

template<class Problem >
real_t eval_l_N ( crvec  h) const
inline

Definition at line 580 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_qr()

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

Definition at line 581 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_q_N()

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

Definition at line 582 of file ocproblem.hpp.

◆ eval_add_Q()

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

Definition at line 583 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_add_Q_N()

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

Definition at line 584 of file ocproblem.hpp.

◆ eval_add_R_masked()

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

Definition at line 585 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_add_S_masked()

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

Definition at line 586 of file ocproblem.hpp.

+ Here is the call graph for this function:

◆ eval_add_R_prod_masked()

template<class Problem >
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

Definition at line 587 of file ocproblem.hpp.

◆ eval_add_S_prod_masked()

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

Definition at line 588 of file ocproblem.hpp.

◆ eval_constr()

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

Definition at line 589 of file ocproblem.hpp.

◆ eval_constr_N()

template<class Problem >
void eval_constr_N ( crvec  x,
rvec  c 
) const
inline

Definition at line 590 of file ocproblem.hpp.

◆ eval_grad_constr_prod()

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

Definition at line 591 of file ocproblem.hpp.

◆ eval_grad_constr_prod_N()

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

Definition at line 592 of file ocproblem.hpp.

◆ eval_add_gn_hess_constr()

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

Definition at line 593 of file ocproblem.hpp.

◆ eval_add_gn_hess_constr_N()

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

Definition at line 594 of file ocproblem.hpp.

◆ check()

template<class Problem >
void check ( ) const
inline

Definition at line 595 of file ocproblem.hpp.

◆ provides_get_D()

template<class Problem >
bool provides_get_D ( ) const
inline

Definition at line 597 of file ocproblem.hpp.

◆ provides_get_D_N()

template<class Problem >
bool provides_get_D_N ( ) const
inline

Definition at line 598 of file ocproblem.hpp.

◆ provides_eval_add_Q_N()

template<class Problem >
bool provides_eval_add_Q_N ( ) const
inline

Definition at line 599 of file ocproblem.hpp.

◆ provides_eval_add_R_prod_masked()

template<class Problem >
bool provides_eval_add_R_prod_masked ( ) const
inline

Definition at line 600 of file ocproblem.hpp.

◆ provides_eval_add_S_prod_masked()

template<class Problem >
bool provides_eval_add_S_prod_masked ( ) const
inline

Definition at line 601 of file ocproblem.hpp.

◆ provides_get_R_work_size()

template<class Problem >
bool provides_get_R_work_size ( ) const
inline

Definition at line 602 of file ocproblem.hpp.

◆ provides_get_S_work_size()

template<class Problem >
bool provides_get_S_work_size ( ) const
inline

Definition at line 603 of file ocproblem.hpp.

◆ provides_eval_constr()

template<class Problem >
bool provides_eval_constr ( ) const
inline

Definition at line 604 of file ocproblem.hpp.

◆ provides_eval_constr_N()

template<class Problem >
bool provides_eval_constr_N ( ) const
inline

Definition at line 605 of file ocproblem.hpp.

◆ provides_eval_grad_constr_prod()

template<class Problem >
bool provides_eval_grad_constr_prod ( ) const
inline

Definition at line 606 of file ocproblem.hpp.

◆ provides_eval_grad_constr_prod_N()

template<class Problem >
bool provides_eval_grad_constr_prod_N ( ) const
inline

Definition at line 607 of file ocproblem.hpp.

◆ provides_eval_add_gn_hess_constr()

template<class Problem >
bool provides_eval_add_gn_hess_constr ( ) const
inline

Definition at line 608 of file ocproblem.hpp.

◆ provides_eval_add_gn_hess_constr_N()

template<class Problem >
bool provides_eval_add_gn_hess_constr_N ( ) const
inline

Definition at line 609 of file ocproblem.hpp.

◆ reset_evaluations()

template<class Problem >
void reset_evaluations ( )
inline

Reset all evaluation counters and timers to zero.

Affects all instances that share the same evaluations. If you only want to reset the counters of this instance, use decouple_evaluations first.

Definition at line 630 of file ocproblem.hpp.

◆ decouple_evaluations()

template<class Problem >
void decouple_evaluations ( )
inline

Give this instance its own evaluation counters and timers, decoupling it from any other instances they might have previously been shared with.

The evaluation counters and timers are preserved (a copy is made).

Definition at line 634 of file ocproblem.hpp.

◆ timed()

template<class Problem >
template<class TimeT , class FunT >
static decltype(auto) timed ( TimeT time,
FunT &&  f 
)
inlinestaticprivate

Definition at line 638 of file ocproblem.hpp.

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

Member Data Documentation

◆ evaluations

template<class Problem >
std::shared_ptr<OCPEvalCounter> evaluations = std::make_shared<OCPEvalCounter>()
Examples
C++/CustomControlCppProblem/main.cpp.

Definition at line 612 of file ocproblem.hpp.

◆ problem

template<class Problem >
Problem problem

Definition at line 613 of file ocproblem.hpp.


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