Throw an exception if the specified vector does not have unit Euclidiean length.
A valid unit vector is one where the square of the 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 vectors, statically typed vectors, not general matrices with 1 column.
- Template Parameters
-
| Vec | A type derived from Eigen::EigenBase with either dynamic rows or columns but not both |
- Parameters
-
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| theta | Vector 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 37 of file check_unit_vector.hpp.