Automatic Differentiation
 
Loading...
Searching...
No Matches
columns_dot_self.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_COLUMNS_DOT_SELF_HPP
2#define STAN_MATH_PRIM_FUN_COLUMNS_DOT_SELF_HPP
3
6
7namespace stan {
8namespace math {
9
19template <typename T, require_eigen_t<T>* = nullptr,
20 require_not_eigen_vt<is_var, T>* = nullptr>
21inline auto columns_dot_self(T&& x) {
22 return make_holder(
23 [](auto&& x_) {
24 return std::forward<decltype(x_)>(x_).colwise().squaredNorm();
25 },
26 std::forward<T>(x));
27}
28
29} // namespace math
30} // namespace stan
31
32#endif
auto columns_dot_self(const T &a)
Returns the dot product of each column of a matrix with itself.
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 ...