Automatic Differentiation
 
Loading...
Searching...
No Matches
diagonal.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_DIAGONAL_HPP
2#define STAN_MATH_PRIM_FUN_DIAGONAL_HPP
3
6
7namespace stan {
8namespace math {
9
18template <typename T, require_matrix_t<T>* = nullptr>
19inline auto diagonal(T&& m) {
20 return make_holder(
21 [](auto&& m_) { return std::forward<decltype(m_)>(m_).diagonal(); },
22 std::forward<T>(m));
23}
24
25} // namespace math
26} // namespace stan
27
28#endif
auto diagonal(T &&a)
Diagonal of a kernel generator expression.
Definition diagonal.hpp:136
auto make_holder(F &&func, Args &&... args)
Calls given function with given arguments.
Definition holder.hpp:481
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...