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

◆ check_unit_vector() [2/2]

template<typename StdVec , require_std_vector_t< StdVec > * = nullptr>
void stan::math::check_unit_vector ( const char *  function,
const char *  name,
const StdVec &  theta 
)

Throw an exception if the each element in a standard vector does not have unit Euclidiean length.

Template Parameters
StdVecA standard vector with inner type inheriting from Eigen::EigenBase
Parameters
functionFunction name (for error messages)
nameVariable name (for error messages)
thetaVector to test
Exceptions
`std::invalid_argument`if theta is a 0-vector
`std::domain_error`if the vector is not a unit vector or if any element is NaN

Definition at line 67 of file check_unit_vector.hpp.