| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
rep_vector.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_REP_VECTOR_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_REP_VECTOR_HPP
3
4 #include <boost/math/tools/promotion.hpp>
5 #include <stan/math/prim/scal/err/check_nonnegative.hpp>
6 #include <stan/math/prim/mat/fun/Eigen.hpp>
7
8 namespace stan {
9
10 namespace math {
11
12 template <typename T>
13 inline
14 Eigen::Matrix<typename boost::math::tools::promote_args<T>::type,
15 Eigen::Dynamic, 1>
16 rep_vector(const T& x, int n) {
17 using stan::math::check_nonnegative;
18 check_nonnegative("rep_vector", "n", n);
19 return Eigen::Matrix<typename boost::math::tools::promote_args<T>::type,
20 Eigen::Dynamic, 1>::Constant(n, x);
21 }
22
23
24 }
25 }
26
27 #endif
stan::math::rep_vector
Eigen::Matrix< typename boost::math::tools::promote_args< T >::type, Eigen::Dynamic, 1 > rep_vector(const T &x, int n)
Definition: rep_vector.hpp:16
check_nonnegative.hpp
Eigen.hpp
stan::math::check_nonnegative
bool check_nonnegative(const char *function, const char *name, const T_y &y)
Return true if y is non-negative.
Definition: check_nonnegative.hpp:66

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