Throw an exception if the specified matrix is not a column stochastic matrix.
Throw an exception if the specified matrices in a standard vector are not a column stochastic matrix.
To be a column stochastic matrix, all the values in each column must be greater than or equal to 0 and the values must sum to 1. A valid column stochastic matrix is one where the sum of the elements by column is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE
. This function only accepts Eigen matrices, 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 | Matrix to test |
- Exceptions
-
`std::invalid_argument` | if theta is a 0-vector |
`std::domain_error` | if the vector is not a column stochastic matrix or if any element is NaN |
To be a column stochastic matrix, all the values in each column must be greater than or equal to 0 and the values must sum to 1. A valid column stochastic matrix is one where the sum of the elements by column is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE
. This function only accepts Eigen matrices, 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 | Matrix to test |
- Exceptions
-
`std::invalid_argument` | if theta is a 0-vector |
`std::domain_error` | if the vector's matrices are not column stochastic matrices or if any element is NaN |
Definition at line 35 of file check_stochastic_column.hpp.