Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ unit_vector_constrain() [10/11]

template<typename T , typename Lp , require_std_vector_t< T > * = nullptr, require_convertible_t< return_type_t< T >, Lp > * = nullptr>
auto stan::math::unit_vector_constrain ( const T &  y,
Lp &  lp 
)
inline

Return the unit length vector corresponding to the free vector y.

This overload handles looping over the elements of a standard vector.

Template Parameters
TA standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
LpScalar type for the lp argument. The scalar type of T should be convertable to this.
Parameters
yvector of K unrestricted variables
[in,out]lplog density accumulator
Returns
Unit length vector of dimension K

If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.

Template Parameters
Jacobianif true, increment log density accumulator with log absolute Jacobian determinant of constraining transform
TA type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
LpA scalar type for the lp argument. The scalar type of T should be convertable to this.
Parameters
yvector of K unrestricted variables
[in,out]lplog density accumulator
Returns
Unit length vector of dimension K

Definition at line 89 of file unit_vector_constrain.hpp.