Automatic Differentiation
 
Loading...
Searching...
No Matches
dot_self.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_PRIM_DOT_SELF_HPP
2#define STAN_MATH_OPENCL_PRIM_DOT_SELF_HPP
3#ifdef STAN_OPENCL
8
9namespace stan {
10namespace math {
11
19template <typename T,
20 require_all_kernel_expressions_and_none_scalar_t<T>* = nullptr>
21inline auto dot_self(const T& a) {
22 return sum(elt_multiply(a, a));
23}
24
25} // namespace math
26} // namespace stan
27
28#endif
29#endif
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
Definition sum.hpp:22
auto dot_self(const T &a)
Returns squared norm of a vector or matrix.
Definition dot_self.hpp:21
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9