![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
IDAS DAE system with forward sensitivity calculation. More...
#include <idas_forward_system.hpp>
Public Member Functions | |
idas_forward_system (const F &f, const std::vector< int > &eq_id, const std::vector< Tyy > &yy0, const std::vector< Typ > &yp0, const std::vector< Tpar > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, std::ostream *msgs) | |
Construct IDAS DAE system from initial condition and parameters. More... | |
~idas_forward_system () | |
destructor to deallocate IDAS solution memory and workspace. More... | |
N_Vector * | nv_yys () |
return N_Vector pointer array of sensitivity More... | |
N_Vector * | nv_yps () |
return N_Vector pointer array of sensitivity time derivative More... | |
void * | to_user_data () |
convert to void pointer for IDAS callbacks More... | |
IDASensResFn | sensitivity_residual () const |
return a lambda for sensitivity residual callback. More... | |
![]() | |
idas_system (const F &f, const std::vector< int > &eq_id, const std::vector< Tyy > &yy0, const std::vector< Typ > &yp0, const std::vector< Tpar > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, std::ostream *msgs) | |
Construct IDAS DAE system from initial condition and parameters. More... | |
~idas_system () | |
destructor to deallocate IDAS solution memory and workspace. More... | |
N_Vector & | nv_yy () |
return reference to current N_Vector of unknown variable More... | |
N_Vector & | nv_yp () |
return reference to current N_Vector of derivative variable More... | |
N_Vector & | nv_rr () |
return reference to current N_Vector of residual workspace More... | |
N_Vector & | id () |
return reference to DAE variable IDs More... | |
const std::vector< double > & | yy_val () |
return reference to current solution vector value More... | |
const std::vector< double > & | yp_val () |
return reference to current solution derivative vector value More... | |
const std::vector< Tyy > & | yy0 () const |
return reference to initial condition More... | |
const std::vector< Typ > & | yp0 () const |
return reference to derivative initial condition More... | |
const std::vector< Tpar > & | theta () const |
return reference to parameter More... | |
std::vector< scalar_type > | vars () const |
return a vector of vars for that contains the initial condition and parameters in case they are vars. More... | |
const size_t | n () |
return number of unknown variables More... | |
const size_t | ns () |
return number of sensitivity parameters More... | |
const size_t | n_sys () |
return size of DAE system for primary and sensitivity unknowns More... | |
const size_t | n_par () |
return theta size More... | |
void * | mem () |
return IDAS memory handle More... | |
const F & | f () |
return reference to DAE functor More... | |
IDAResFn | residual () |
return a closure for IDAS residual callback More... | |
void | check_ic_consistency (const double &t0, const double &tol) |
Additional Inherited Members | |
![]() | |
using | scalar_type = typename stan::return_type< Tyy, Typ, Tpar >::type |
using | return_type = std::vector< std::vector< scalar_type > > |
![]() | |
static constexpr bool | is_var_yy0 = stan::is_var<Tyy>::value |
static constexpr bool | is_var_yp0 = stan::is_var<Typ>::value |
static constexpr bool | is_var_par = stan::is_var<Tpar>::value |
static constexpr bool | need_sens = is_var_yy0 || is_var_yp0 || is_var_par |
![]() | |
const F & | f_ |
const std::vector< Tyy > & | yy_ |
const std::vector< Typ > & | yp_ |
std::vector< double > | yy_val_ |
std::vector< double > | yp_val_ |
const std::vector< Tpar > & | theta_ |
const std::vector< double > & | x_r_ |
const std::vector< int > & | x_i_ |
const size_t | N_ |
const size_t | M_ |
const size_t | ns_ |
N_Vector | nv_yy_ |
N_Vector | nv_yp_ |
std::vector< double > | rr_val_ |
N_Vector | nv_rr_ |
N_Vector | id_ |
void * | mem_ |
std::ostream * | msgs_ |
IDAS DAE system with forward sensitivity calculation.
F | type of functor for DAE residual. |
Tyy | type of initial unknown values. |
Typ | type of initial unknown's derivative values. |
Tpar | type of parameters. |
Definition at line 28 of file idas_forward_system.hpp.
|
inline |
Construct IDAS DAE system from initial condition and parameters.
[in] | f | DAE residual functor |
[in] | eq_id | array for DAE's variable ID, it is a reference to a constant vector with 1 or 0 as member entries. 1 for derivative variables, 0 for algebraic variables. |
[in] | yy0 | initial condition |
[in] | yp0 | initial condition for derivatives |
[in] | theta | parameters of the base DAE |
[in] | x_r | continuous data vector for the DAE |
[in] | x_i | integer data vector for the DAE |
[in] | msgs | stream to which messages are printed |
Definition at line 47 of file idas_forward_system.hpp.
|
inline |
destructor to deallocate IDAS solution memory and workspace.
Definition at line 67 of file idas_forward_system.hpp.
|
inline |
return N_Vector pointer array of sensitivity time derivative
Definition at line 82 of file idas_forward_system.hpp.
|
inline |
return N_Vector pointer array of sensitivity
Definition at line 77 of file idas_forward_system.hpp.
|
inline |
return a lambda for sensitivity residual callback.
Definition at line 94 of file idas_forward_system.hpp.
|
inline |
convert to void pointer for IDAS callbacks
Definition at line 87 of file idas_forward_system.hpp.