Stan
1.3
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Pages
src
stan
math
matrix
array_builder.hpp
Go to the documentation of this file.
1
#ifndef __STAN__MATH__MATRIX__ARRAY_BUILDER_HPP__
2
#define __STAN__MATH__MATRIX__ARRAY_BUILDER_HPP__
3
4
#include <vector>
5
#include <
stan/math/matrix/promoter.hpp
>
6
7
namespace
stan {
8
namespace
math {
9
15
template
<
typename
T>
16
struct
array_builder
{
17
std::vector<T>
x_
;
18
array_builder
() :
x_
() { }
19
template
<
typename
F>
20
array_builder
&
add
(
const
F& u) {
21
T t;
22
promoter<F,T>::promote
(u,t);
23
x_
.push_back(t);
24
return
*
this
;
25
}
26
std::vector<T>
array
() {
27
return
x_
;
28
}
29
};
30
31
}
32
}
33
#endif
[
Stan Home Page
]
© 2011–2013, Stan Development Team.