Stan Math Library  2.15.0
reverse mode automatic differentiation
Public Member Functions | Public Attributes | List of all members
stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type > Struct Template Reference

This class builds partial derivatives with respect to a set of operands. More...

#include <OperandsAndPartials.hpp>

Public Member Functions

 OperandsAndPartials (const T1 &x1=0, const T2 &x2=0, const T3 &x3=0, const T4 &x4=0, const T5 &x5=0, const T6 &x6=0)
 Constructor. More...
 
T_return_type value (double value)
 Returns a T_return_type with the value specified with the partial derivatves. More...
 

Public Attributes

VectorView< T_return_type, false, true > d_x1
 
VectorView< T_return_type, false, true > d_x2
 
VectorView< T_return_type, false, true > d_x3
 
VectorView< T_return_type, false, true > d_x4
 
VectorView< T_return_type, false, true > d_x5
 
VectorView< T_return_type, false, true > d_x6
 

Detailed Description

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
struct stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >

This class builds partial derivatives with respect to a set of operands.

There are two reason for the generality of this class. The first is to handle vector and scalar arguments without needing to write additional code. The second is to use this class for writing probability distributions that handle primitives, reverse mode, and forward mode variables seamlessly.

The default template class handles the case where the arguments are primitive. There are template specializations for reverse mode and forward mode.

Template Parameters
T1First set of operands.
T2Second set of operands.
T3Third set of operands.
T4Fourth set of operands.
T5Fifth set of operands.
T6Sixth set of operands.
T_return_typeReturn type of the expression. This defaults to a template metaprogram that calculates the scalar promotion of T1 – T6.

Definition at line 37 of file OperandsAndPartials.hpp.

Constructor & Destructor Documentation

§ OperandsAndPartials()

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::OperandsAndPartials ( const T1 &  x1 = 0,
const T2 &  x2 = 0,
const T3 &  x3 = 0,
const T4 &  x4 = 0,
const T5 &  x5 = 0,
const T6 &  x6 = 0 
)
inline

Constructor.

Parameters
x1first set of operands
x2second set of operands
x3third set of operands
x4fourth set of operands
x5fifth set of operands
x6sixth set of operands

Definition at line 55 of file OperandsAndPartials.hpp.

Member Function Documentation

§ value()

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
T_return_type stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::value ( double  value)
inline

Returns a T_return_type with the value specified with the partial derivatves.

Parameters
[in]valueValue of the variable
Returns
a variable with the appropriate value

Definition at line 67 of file OperandsAndPartials.hpp.

Member Data Documentation

§ d_x1

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
VectorView<T_return_type, false, true> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::d_x1

Definition at line 38 of file OperandsAndPartials.hpp.

§ d_x2

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
VectorView<T_return_type, false, true> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::d_x2

Definition at line 39 of file OperandsAndPartials.hpp.

§ d_x3

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
VectorView<T_return_type, false, true> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::d_x3

Definition at line 40 of file OperandsAndPartials.hpp.

§ d_x4

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
VectorView<T_return_type, false, true> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::d_x4

Definition at line 41 of file OperandsAndPartials.hpp.

§ d_x5

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
VectorView<T_return_type, false, true> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::d_x5

Definition at line 42 of file OperandsAndPartials.hpp.

§ d_x6

template<typename T1 = double, typename T2 = double, typename T3 = double, typename T4 = double, typename T5 = double, typename T6 = double, typename T_return_type = typename stan::return_type<T1, T2, T3, T4, T5, T6>::type>
VectorView<T_return_type, false, true> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, T_return_type >::d_x6

Definition at line 43 of file OperandsAndPartials.hpp.


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

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