Stan Math Library  2.15.0
reverse mode automatic differentiation
Public Member Functions | List of all members
stan::math::array_builder< T > Class Template Reference

Structure for building up arrays in an expression (rather than in statements) using an argumentchaining add() method and a getter method array() to return the result. More...

#include <array_builder.hpp>

Public Member Functions

 array_builder ()
 Construct an array_builder. More...
 
template<typename S >
array_builderadd (const S &u)
 Add one element of type S to array, promoting to type T. More...
 
std::vector< T > array ()
 Getter method to return array itself. More...
 

Detailed Description

template<typename T>
class stan::math::array_builder< T >

Structure for building up arrays in an expression (rather than in statements) using an argumentchaining add() method and a getter method array() to return the result.

Array elements are held in std::vector of type T.

Template Parameters
Ttype of array elements

Definition at line 19 of file array_builder.hpp.

Constructor & Destructor Documentation

§ array_builder()

template<typename T >
stan::math::array_builder< T >::array_builder ( )
inline

Construct an array_builder.

Definition at line 27 of file array_builder.hpp.

Member Function Documentation

§ add()

template<typename T >
template<typename S >
array_builder& stan::math::array_builder< T >::add ( const S &  u)
inline

Add one element of type S to array, promoting to type T.

Parameters
uelement to add
Returns
this array_builder object

Definition at line 36 of file array_builder.hpp.

§ array()

template<typename T >
std::vector<T> stan::math::array_builder< T >::array ( )
inline

Getter method to return array itself.

Returns
std:vector<T> of composed array elements.

Definition at line 46 of file array_builder.hpp.


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

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