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
agrad
rev
matrix
fill.hpp
Go to the documentation of this file.
1
#ifndef __STAN__AGRAD__REV__MATRIX__FILL_HPP__
2
#define __STAN__AGRAD__REV__MATRIX__FILL_HPP__
3
4
#include <vector>
5
#include <
stan/math/matrix/Eigen.hpp
>
6
7
namespace
stan {
8
namespace
agrad {
9
10
template
<
typename
T,
typename
S>
11
void
fill
(T& x,
const
S& y) {
12
x = y;
13
}
14
15
template
<
typename
T,
int
R,
int
C,
typename
S>
16
void
fill
(Eigen::Matrix<T,R,C>& x,
const
S& y) {
17
x.fill(y);
18
}
19
20
template
<
typename
T,
typename
S>
21
void
fill
(std::vector<T>& x,
const
S& y) {
22
for
(
size_t
i = 0; i < x.size(); ++i)
23
fill
(x[i],y);
24
}
25
26
}
27
}
28
#endif
[
Stan Home Page
]
© 2011–2013, Stan Development Team.