Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
Public Member Functions | Public Attributes | List of all members
stan::math::coupled_ode_system< F, double, double > Struct Template Reference

The coupled ode system for known initial values and known parameters. More...

#include <coupled_ode_system.hpp>

Public Member Functions

 coupled_ode_system (const F &f, const std::vector< double > &y0, const std::vector< double > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs)
 Construct the coupled ODE system from the base system function, initial state, parameters, data and a stream for messages. More...
 
void operator() (const std::vector< double > &y, std::vector< double > &dy_dt, double t)
 Calculates the derivative of the coupled ode system with respect to the specified state at the specified time using the system state function. More...
 
int size () const
 Returns the size of the coupled system. More...
 
std::vector< double > initial_state ()
 Returns the initial state of the coupled system, which is identical to the base ODE original state in this implementation because the initial state is known. More...
 
std::vector< std::vector
< double > > 
decouple_states (const std::vector< std::vector< double > > &y)
 Returns the base portion of the coupled state. More...
 

Public Attributes

const F & f_
 
const std::vector< double > & y0_dbl_
 
const std::vector< double > & theta_dbl_
 
const std::vector< double > & x_
 
const std::vector< int > & x_int_
 
const int N_
 
const int M_
 
const int size_
 
std::ostream * msgs_
 

Detailed Description

template<typename F>
struct stan::math::coupled_ode_system< F, double, double >

The coupled ode system for known initial values and known parameters.

This coupled system does not add anything to the base system used to construct it, but is here for generality of the integration implementation.

Template Parameters
Ftype of system function for the base ODE system.

Definition at line 41 of file coupled_ode_system.hpp.

Constructor & Destructor Documentation

template<typename F >
stan::math::coupled_ode_system< F, double, double >::coupled_ode_system ( const F &  f,
const std::vector< double > &  y0,
const std::vector< double > &  theta,
const std::vector< double > &  x,
const std::vector< int > &  x_int,
std::ostream *  msgs 
)
inline

Construct the coupled ODE system from the base system function, initial state, parameters, data and a stream for messages.

Parameters
[in]fbase ode system functor.
[in]y0initial state of the base ode.
[in]thetaparameters of the base ode.
[in]xreal data.
[in]x_intinteger data.
[in,out]msgsprint stream.

Definition at line 64 of file coupled_ode_system.hpp.

Member Function Documentation

template<typename F >
std::vector<std::vector<double> > stan::math::coupled_ode_system< F, double, double >::decouple_states ( const std::vector< std::vector< double > > &  y)
inline

Returns the base portion of the coupled state.

In this class's implementation, the coupled system is equivalent to the base system, so this function just returns its input.

Parameters
ythe vector of the coupled states after solving the ode
Returns
the decoupled states

Definition at line 144 of file coupled_ode_system.hpp.

template<typename F >
std::vector<double> stan::math::coupled_ode_system< F, double, double >::initial_state ( )
inline

Returns the initial state of the coupled system, which is identical to the base ODE original state in this implementation because the initial state is known.

The return value is a vector of length size() where the first N (base ode system size) parameters are the initial conditions of the base ode system and the rest of the initial conditions is 0.

Returns
initial state of the coupled system

Definition at line 126 of file coupled_ode_system.hpp.

template<typename F >
void stan::math::coupled_ode_system< F, double, double >::operator() ( const std::vector< double > &  y,
std::vector< double > &  dy_dt,
double  t 
)
inline

Calculates the derivative of the coupled ode system with respect to the specified state at the specified time using the system state function.

The derivative vector created is the same length as the length as the state vector.

Parameters
[in]ycurrent state of the coupled ode.
[out]dy_dtpopulated with derivatives of the coupled system evaluated at specified state and time.
[in]ttime.
Exceptions
exceptionif the system function does not return a derivative vector of the same size as the state vector.

Definition at line 96 of file coupled_ode_system.hpp.

template<typename F >
int stan::math::coupled_ode_system< F, double, double >::size ( ) const
inline

Returns the size of the coupled system.

Returns
size of the coupled system.

Definition at line 110 of file coupled_ode_system.hpp.

Member Data Documentation

template<typename F >
const F& stan::math::coupled_ode_system< F, double, double >::f_

Definition at line 42 of file coupled_ode_system.hpp.

template<typename F >
const int stan::math::coupled_ode_system< F, double, double >::M_

Definition at line 48 of file coupled_ode_system.hpp.

template<typename F >
std::ostream* stan::math::coupled_ode_system< F, double, double >::msgs_

Definition at line 50 of file coupled_ode_system.hpp.

template<typename F >
const int stan::math::coupled_ode_system< F, double, double >::N_

Definition at line 47 of file coupled_ode_system.hpp.

template<typename F >
const int stan::math::coupled_ode_system< F, double, double >::size_

Definition at line 49 of file coupled_ode_system.hpp.

template<typename F >
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::theta_dbl_

Definition at line 44 of file coupled_ode_system.hpp.

template<typename F >
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::x_

Definition at line 45 of file coupled_ode_system.hpp.

template<typename F >
const std::vector<int>& stan::math::coupled_ode_system< F, double, double >::x_int_

Definition at line 46 of file coupled_ode_system.hpp.

template<typename F >
const std::vector<double>& stan::math::coupled_ode_system< F, double, double >::y0_dbl_

Definition at line 43 of file coupled_ode_system.hpp.


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

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