Automatic Differentiation
 
Loading...
Searching...
No Matches
col.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_COL_HPP
2#define STAN_MATH_PRIM_FUN_COL_HPP
3
7
8namespace stan {
9namespace math {
10
24template <typename T, require_matrix_t<T>* = nullptr>
25inline auto col(T&& m, size_t j) {
26 check_column_index("col", "j", m, j);
27 return make_holder([j](auto&& m_) { return m_.col(j - 1); },
28 std::forward<T>(m));
29}
30
31} // namespace math
32} // namespace stan
33
34#endif
auto col(T_x &&x, size_t j)
Return the specified column of the specified kernel generator expression using start-at-1 indexing.
Definition col.hpp:23
auto make_holder(F &&func, Args &&... args)
Calls given function with given arguments.
Definition holder.hpp:481
void check_column_index(const char *function, const char *name, const T_y &y, size_t i)
Check if the specified index is a valid column of the matrix.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...