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 >::value > | d_x1
VectorView< double, is_vector< T2 >::value, is_constant_struct< T2 >::value > | d_x2
VectorView< double, is_vector< T3 >::value, is_constant_struct< T3 >::value > | d_x3
VectorView< double, is_vector< T4 >::value, is_constant_struct< T4 >::value > | d_x4
VectorView< double, is_vector< T5 >::value, is_constant_struct< T5 >::value > | d_x5
VectorView< double, is_vector< T6 >::value, is_constant_struct< T6 >::value > | d_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

  T1 | First set of operands.
  T2 | Second set of operands.
  T3 | Third set of operands.
  T4 | Fourth set of operands.
  T5 | Fifth set of operands.
  T6 | Sixth set of operands.
  T_return_type | Return 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

## OperandsAndPartials()

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

  x1 | first set of operands
  x2 | second set of operands
  x3 | third set of operands
  x4 | fourth set of operands
  x5 | fifth set of operands
  x6 | sixth set of operands

Definition at line 123 of file OperandsAndPartials.hpp.

## Member Function Documentation

## value()

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] | value | Value 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

## all_partials

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.

## all_varis

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.

## d_x1

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.

## d_x2

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.

## d_x3

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.

## d_x4

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.

## d_x5

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.

## d_x6

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.

## nvaris

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/math/rev/scal/meta/OperandsAndPartials.hpp

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