Skip to main content

Module array_checks

Module array_checks 

Source
Expand description

Array validation: finiteness, sign, symmetry, orthogonality, positive-definiteness, stochasticity

§Array Validation Utilities

Comprehensive validation functions for ndarray arrays, covering finiteness, sign constraints, matrix properties (symmetry, orthogonality, positive-definiteness, stochasticity), shape matching, and diagnostic summaries.

All functions return CoreResult and avoid panics.

Structs§

ArrayStats
Summary statistics for an array, useful for diagnostics.

Functions§

assert_finite
Assert that every element of the array is finite (not NaN, not Inf).
assert_non_negative
Assert that every element is non-negative (>= 0).
assert_orthogonal
Assert that a 2-D matrix is orthogonal within tolerance.
assert_positive
Assert that every element is strictly positive (> 0).
assert_positive_definite
Assert that a 2-D symmetric matrix is positive definite.
assert_shape
Assert that the array has the exact expected shape.
assert_stochastic
Assert that a 2-D matrix is (row-)stochastic: each row sums to 1 within tolerance, and all elements are non-negative.
assert_symmetric
Assert that a 2-D matrix is symmetric within a given tolerance.
compute_array_stats
Compute summary statistics for a flat array.
diagnose_array
Comprehensive array health check, returning a human-readable diagnostic string.