Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
stan
math
prim
scal
meta
VectorBuilder.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_SCAL_META_VECTORBUILDER_HPP
2
#define STAN_MATH_PRIM_SCAL_META_VECTORBUILDER_HPP
3
4
#include <
stan/math/prim/scal/meta/VectorBuilderHelper.hpp
>
5
#include <
stan/math/prim/scal/meta/contains_vector.hpp
>
6
7
namespace
stan
{
8
9
/**
10
*
11
* VectorBuilder allocates type T1 values to be used as
12
* intermediate values. There are 2 template parameters:
13
* - used: boolean variable indicating whether this instance
14
* is used. If this is false, there is no storage allocated
15
* and operator[] throws.
16
* - is_vec: boolean variable indicating whether this instance
17
* should allocate a vector, if it is used. If this is false,
18
* the instance will only allocate a single double value.
19
* If this is true, it will allocate the number requested.
20
* Note that this is calculated based on template parameters
21
* T2 through T7.
22
*
23
* These values are mutable.
24
*/
25
template
<
bool
used,
typename
T1,
typename
T2,
typename
T3 = double,
26
typename
T4 = double,
typename
T5 = double,
typename
T6 = double,
27
typename
T7 =
double
>
28
class
VectorBuilder
{
29
private
:
30
typedef
VectorBuilderHelper
<T1, used,
31
contains_vector<T2, T3, T4, T5, T6, T7>::value
>
32
helper
;
33
34
public
:
35
typedef
typename
helper::type
type
;
36
helper
a
;
37
38
explicit
VectorBuilder
(
size_t
n
) : a(n) {}
39
40
T1&
operator[]
(
size_t
i
) {
return
a[
i
]; }
41
42
inline
type
data
() {
return
a.
data
(); }
43
};
44
45
}
// namespace stan
46
#endif
getGoodRuns4SAM.n
int n
Definition:
getGoodRuns4SAM.py:79
stan
Definition:
StanTypedefs.h:9
stan::VectorBuilder::a
helper a
Definition:
VectorBuilder.hpp:36
stan::VectorBuilder::operator[]
T1 & operator[](size_t i)
Definition:
VectorBuilder.hpp:40
MECModelEnuComparisons.i
int i
Definition:
MECModelEnuComparisons.py:63
stan::VectorBuilderHelper::data
type & data()
Definition:
VectorBuilderHelper.hpp:35
stan::VectorBuilder::data
type data()
Definition:
VectorBuilder.hpp:42
stan::VectorBuilderHelper< T1, used, contains_vector< T2, T3, T4, T5, T6, T7 >::value >::type
T1 type
Definition:
VectorBuilderHelper.hpp:33
contains_vector.hpp
VectorBuilderHelper.hpp
stan::VectorBuilder::type
helper::type type
Definition:
VectorBuilder.hpp:35
stan::contains_vector
Definition:
contains_vector.hpp:10
stan::VectorBuilder::helper
VectorBuilderHelper< T1, used, contains_vector< T2, T3, T4, T5, T6, T7 >::value > helper
Definition:
VectorBuilder.hpp:32
stan::VectorBuilder
Definition:
VectorBuilder.hpp:28
stan::VectorBuilder::VectorBuilder
VectorBuilder(size_t n)
Definition:
VectorBuilder.hpp:38
stan::VectorBuilderHelper
Definition:
VectorBuilderHelper.hpp:25
Generated on Wed Feb 24 2021 14:14:52 for NOvA by
1.8.11