Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ unit_vector_constrain() [4/11]

template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr>
auto stan::math::unit_vector_constrain ( T_x &&  x,
double &  lp 
)
inline

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

See the Wikipedia page on generating random points on an N-sphere.

Template Parameters
T_xtype of the vector
Parameters
xvector of unrestricted variables
[in,out]lplog probability to increment
Returns
Unit length vector

Definition at line 46 of file unit_vector_constrain.hpp.