rep_vector.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_MAT_FUN_REP_VECTOR_HPP
#define STAN_MATH_PRIM_MAT_FUN_REP_VECTOR_HPP
#include <boost/math/tools/promotion.hpp>
#include <stan/math/prim/scal/err/check_nonnegative.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
namespace stan {
namespace math {
template <typename T>
inline
Eigen::Matrix<typename boost::math::tools::promote_args<T>::type,
Eigen::Dynamic, 1>
rep_vector(const T& x, int n) {
check_nonnegative("rep_vector", "n", n);
return Eigen::Matrix<typename boost::math::tools::promote_args<T>::type,
Eigen::Dynamic, 1>::Constant(n, x);
}
}
}
#endif
stan
Definition: log_sum_exp.hpp:8
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:15
stan::math::check_nonnegative
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
Definition: check_nonnegative.hpp:61
check_nonnegative.hpp
Eigen.hpp

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