Stan Math Library  2.20.0
reverse mode automatic differentiation
Public Member Functions | List of all members
stan::math::idas_forward_system< F, Tyy, Typ, Tpar > Class Template Reference

IDAS DAE system with forward sensitivity calculation. More...

#include <idas_forward_system.hpp>

Inheritance diagram for stan::math::idas_forward_system< F, Tyy, Typ, Tpar >:
stan::math::idas_system< F, Tyy, Typ, Tpar >

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...
 
- Public Member Functions inherited from stan::math::idas_system< F, Tyy, Typ, Tpar >
 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_typevars () 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

- Public Types inherited from stan::math::idas_system< F, Tyy, Typ, Tpar >
using scalar_type = typename stan::return_type< Tyy, Typ, Tpar >::type
 
using return_type = std::vector< std::vector< scalar_type > >
 
- Static Public Attributes inherited from stan::math::idas_system< F, Tyy, Typ, Tpar >
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
 
- Protected Attributes inherited from stan::math::idas_system< F, Tyy, Typ, Tpar >
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_
 

Detailed Description

template<typename F, typename Tyy, typename Typ, typename Tpar>
class stan::math::idas_forward_system< F, Tyy, Typ, Tpar >

IDAS DAE system with forward sensitivity calculation.

Template Parameters
Ftype of functor for DAE residual.
Tyytype of initial unknown values.
Typtype of initial unknown's derivative values.
Tpartype of parameters.

Definition at line 28 of file idas_forward_system.hpp.

Constructor & Destructor Documentation

◆ idas_forward_system()

template<typename F, typename Tyy, typename Typ, typename Tpar>
stan::math::idas_forward_system< F, Tyy, Typ, Tpar >::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 
)
inline

Construct IDAS DAE system from initial condition and parameters.

Parameters
[in]fDAE residual functor
[in]eq_idarray 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]yy0initial condition
[in]yp0initial condition for derivatives
[in]thetaparameters of the base DAE
[in]x_rcontinuous data vector for the DAE
[in]x_iinteger data vector for the DAE
[in]msgsstream to which messages are printed

Definition at line 47 of file idas_forward_system.hpp.

◆ ~idas_forward_system()

template<typename F, typename Tyy, typename Typ, typename Tpar>
stan::math::idas_forward_system< F, Tyy, Typ, Tpar >::~idas_forward_system ( )
inline

destructor to deallocate IDAS solution memory and workspace.

Definition at line 67 of file idas_forward_system.hpp.

Member Function Documentation

◆ nv_yps()

template<typename F, typename Tyy, typename Typ, typename Tpar>
N_Vector* stan::math::idas_forward_system< F, Tyy, Typ, Tpar >::nv_yps ( )
inline

return N_Vector pointer array of sensitivity time derivative

Definition at line 82 of file idas_forward_system.hpp.

◆ nv_yys()

template<typename F, typename Tyy, typename Typ, typename Tpar>
N_Vector* stan::math::idas_forward_system< F, Tyy, Typ, Tpar >::nv_yys ( )
inline

return N_Vector pointer array of sensitivity

Definition at line 77 of file idas_forward_system.hpp.

◆ sensitivity_residual()

template<typename F, typename Tyy, typename Typ, typename Tpar>
IDASensResFn stan::math::idas_forward_system< F, Tyy, Typ, Tpar >::sensitivity_residual ( ) const
inline

return a lambda for sensitivity residual callback.

Definition at line 94 of file idas_forward_system.hpp.

◆ to_user_data()

template<typename F, typename Tyy, typename Typ, typename Tpar>
void* stan::math::idas_forward_system< F, Tyy, Typ, Tpar >::to_user_data ( )
inline

convert to void pointer for IDAS callbacks

Definition at line 87 of file idas_forward_system.hpp.


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

     [ Stan Home Page ] © 2011–2018, Stan Development Team.