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

◆ is_unit_vector()

template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr>
bool stan::math::is_unit_vector ( const EigVec &  theta)
inline

Return true if the vector is not a unit vector or if any element is NaN.

A valid unit vector is one where the square elements summed is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE. This function only accepts Eigen::Matrix vectors, statically typed vectors, not general matrices with 1 column.

Template Parameters
EigMatA type derived from EigenBase with 1 compile time row or column
Parameters
thetaEigen vector to test
Returns
true if the vector is not a unit vector or if any element is NaN

Definition at line 28 of file is_unit_vector.hpp.