Stan Math Library  2.20.0
reverse mode automatic differentiation
col.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_COL_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_COL_HPP
3 
6 
7 namespace stan {
8 namespace math {
9 
22 template <typename T>
23 inline Eigen::Matrix<T, Eigen::Dynamic, 1> col(
24  const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& m, size_t j) {
25  check_column_index("col", "j", m, j);
26  return m.col(j - 1);
27 }
28 
29 } // namespace math
30 } // namespace stan
31 #endif
void check_column_index(const char *function, const char *name, const Eigen::Matrix< T_y, R, C > &y, size_t i)
Check if the specified index is a valid column of the matrix.
Eigen::Matrix< T, Eigen::Dynamic, 1 > col(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m, size_t j)
Return the specified column of the specified matrix using start-at-1 indexing.
Definition: col.hpp:23

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