Skip to main content

backward_error

Function backward_error 

Source
pub fn backward_error(
    a: &SparseColMat<usize, f64>,
    x: &Col<f64>,
    b: &Col<f64>,
) -> f64
Expand description

Compute the scaled backward error for a linear solve.

Returns ||Ax - b|| / (||A||_F * ||x|| + ||b||).

Returns 0.0 if the denominator is zero (which only occurs when both A and b are zero, since the denominator is a sum of non-negative IEEE 754 values).

ยงFuture optimization

Currently converts A to dense for the matrix-vector product. For large matrices, use faer::sparse::linalg::matmul::sparse_dense_matmul to avoid the O(n^2) dense conversion.