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

◆ unit_vector_constrain() [8/11]

template<typename T1 , typename T2 , require_eigen_col_vector_t< T1 > * = nullptr, require_all_not_vt_autodiff< T1, T2 > * = nullptr>
plain_type_t< T1 > stan::math::unit_vector_constrain ( const T1 &  y,
T2 &  lp 
)
inline

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

See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points

Template Parameters
T1type inheriting from EigenBase that does not have an fvar scalar type.
Parameters
yvector of K unrestricted variables
Returns
Unit length vector of dimension K
Parameters
lpLog probability reference to increment.

Definition at line 49 of file unit_vector_constrain.hpp.