Throw an exception if the specified vector does not sum to 0.
Throw an exception if any vector in a standard vector does not sum to 0.
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
-
| T | A type inheriting from Eigen::EigenBase |
- 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 does not sum to zero |
This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE.
- Template Parameters
-
| T | A standard vector with inner type inheriting from Eigen::EigenBase |
- 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 does not sum to zero |
Definition at line 31 of file check_sum_to_zero.hpp.