1#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP
2#define STAN_MATH_OPENCL_REV_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP
21 require_all_kernel_expressions_and_none_scalar_t<T>* =
nullptr>
29 A.adj() += elt_divide(res.adj(), r)
30 - A.val() * (dot_product(A.val(), res.adj()) / (r * r * r));
54 A.adj() += elt_divide(res.adj(), r)
55 - A.val() * (dot_product(A.val(), res.adj()) / (r * r * r))
Represents an arithmetic matrix on the OpenCL device.
elt_divide_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_divide(T_a &&a, T_b &&b)
require_all_t< is_kernel_expression_and_not_scalar< Types >... > require_all_kernel_expressions_and_none_scalar_t
Enables a template if all given types are non-scalar types that are a valid kernel generator expressi...
var_value< plain_type_t< T > > make_callback_var(T &&value, F &&functor)
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback funct...
auto unit_vector_constrain(const EigMat &y)
fvar< T > sqrt(const fvar< T > &x)
auto dot_self(const T &a)
Returns squared norm of a vector or matrix.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...