Skip to main content

validate_rhs

Function validate_rhs 

Source
pub fn validate_rhs(
    rhs: &[f32],
    expected_len: usize,
) -> Result<(), ValidationError>
Expand description

Validate a right-hand-side vector for a linear solve.

Checks:

  1. rhs.len() == expected_len (dimension must match the matrix).
  2. No NaN or Inf entries.
  3. If all entries are zero, emits a tracing::warn (a zero RHS is technically valid but often indicates a bug).

§Errors

Returns ValidationError on dimension mismatch or non-finite values.