Stan Math Library  2.12.0
reverse mode automatic differentiation
Public Member Functions | Public Attributes | List of all members
stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var > 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...
 
stan::math::var value (double value)
 Returns a T_return_type with the value specified with the partial derivatves. More...
 

Public Attributes

size_t nvaris
 
vari ** all_varis
 
double * all_partials
 
VectorView< double, is_vector< T1 >::value, is_constant_struct< T1 >::valued_x1
 
VectorView< double, is_vector< T2 >::value, is_constant_struct< T2 >::valued_x2
 
VectorView< double, is_vector< T3 >::value, is_constant_struct< T3 >::valued_x3
 
VectorView< double, is_vector< T4 >::value, is_constant_struct< T4 >::valued_x4
 
VectorView< double, is_vector< T5 >::value, is_constant_struct< T5 >::valued_x5
 
VectorView< double, is_vector< T6 >::value, is_constant_struct< T6 >::valued_x6
 

Detailed Description

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
struct stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >

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.

This is the partial template specialization for when the return type is stan::math::var.

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 89 of file OperandsAndPartials.hpp.

Constructor & Destructor Documentation

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::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 123 of file OperandsAndPartials.hpp.

Member Function Documentation

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
stan::math::var stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::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 and the adjoints set for reverse mode autodiff

Definition at line 183 of file OperandsAndPartials.hpp.

Member Data Documentation

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
double* stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::all_partials

Definition at line 92 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
vari** stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::all_varis

Definition at line 91 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VectorView<double, is_vector<T1>::value, is_constant_struct<T1>::value> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::d_x1

Definition at line 96 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VectorView<double, is_vector<T2>::value, is_constant_struct<T2>::value> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::d_x2

Definition at line 99 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VectorView<double, is_vector<T3>::value, is_constant_struct<T3>::value> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::d_x3

Definition at line 102 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VectorView<double, is_vector<T4>::value, is_constant_struct<T4>::value> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::d_x4

Definition at line 105 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VectorView<double, is_vector<T5>::value, is_constant_struct<T5>::value> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::d_x5

Definition at line 108 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VectorView<double, is_vector<T6>::value, is_constant_struct<T6>::value> stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::d_x6

Definition at line 111 of file OperandsAndPartials.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
size_t stan::math::OperandsAndPartials< T1, T2, T3, T4, T5, T6, stan::math::var >::nvaris

Definition at line 90 of file OperandsAndPartials.hpp.


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

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