Stan Math Library  2.9.0
reverse mode automatic differentiation
rep_row_vector.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_REP_ROW_VECTOR_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_REP_ROW_VECTOR_HPP
3 
4 #include <boost/math/tools/promotion.hpp>
7 
8 namespace stan {
9 
10  namespace math {
11 
12  template <typename T>
13  inline Eigen::Matrix<typename boost::math::tools::promote_args<T>::type,
14  1, Eigen::Dynamic>
15  rep_row_vector(const T& x, int m) {
17  check_nonnegative("rep_row_vector", "m", m);
18  return Eigen::Matrix<typename boost::math::tools::promote_args<T>::type,
19  1, Eigen::Dynamic>::Constant(m, x);
20  }
21 
22  }
23 }
24 
25 #endif
Eigen::Matrix< typename boost::math::tools::promote_args< T >::type, 1, Eigen::Dynamic > rep_row_vector(const T &x, int m)
bool check_nonnegative(const char *function, const char *name, const T_y &y)
Return true if y is non-negative.

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