Class DimensionValidator
Defined in File DimensionValidator.hpp
Class Documentation
The interface to a class that validates dimensions.
Note that this class is only expected to be used by the ValidationContext class.
This validator can function across multiple matrices. Add matrices and expected dimensions with a dim() function. After all matrices have been loaded, call perform_validation() to validate all of the matrices.
Public Functions
Deleted to prevent pointer invalidation.
Deleted to prevent pointer invalidation.
Deleted to prevent pointer invalidation.
Deleted to prevent pointer invalidation.
Provide a matrix, name, and dimensions to validate.
Validation is not done here. After all matrices are loaded, call perform_validation().
- Parameters
name – The name of the matrix to show in errors.
matrix – The matrix to validate.
rows – The desired number of rows in the matrix.
cols – The desired number of columns in the matrix.
Provide a matrix, name, and dimensions to validate.
Validation is not done here. After all matrices are loaded, call perform_validation().
- Parameters
name – The name of the matrix to show in errors.
matrix – The matrix to validate.
rows – The desired number of rows in the matrix.
cols – Variable name for number of columns in the matrix.
Provide a matrix, name, and dimensions to validate.
Validation is not done here. After all matrices are loaded, call perform_validation().
- Parameters
name – The name of the matrix to show in errors.
matrix – The matrix to validate.
rows – Variable name for number of rows in the matrix.
cols – The desired number of columns in the matrix.
Provide a matrix, name, and dimensions to validate.
Validation is not done here. After all matrices are loaded, call perform_validation().
- Parameters
name – The name of the matrix to show in errors.
matrix – The matrix to validate.
rows – Variable name for number of rows in the matrix.
cols – Variable name for number of columns in the matrix.
Check matrices against set rules and populate the given ValidationResult, optionally throwing an exception or logging an error in the case of a bad result.
- Parameters
mode – How to behave when validation fails.
result_out – Reference that will be set to ValidationResult::GOOD or ValidationResult::BAD depending on the outcome of validation. This is an out parameter, rather than a return value, to ensure its value is written before any exception is thrown.
- Throws
std::range_error – if dimension validation fails and mode is ErrorMode::DIE.