rustebra 0.4.0

A hybrid no_std/alloc linear algebra crate for Rust, scaling from embedded targets to dynamic Krylov subspace solvers.
Documentation
use rustebra::sparse::{CscMatrix, CsrMatrix, SparseLinearOp};

pub(crate) fn run() {
    println!("\n== SparseLinearOp ==");

    let mut y = [0.0; 2];

    let eye_csr =
        CsrMatrix::new(2, 2, vec![0, 1, 2], vec![0, 1], vec![1.0_f64, 1.0]).expect("valid CSR");
    eye_csr
        .apply(&[3.0, 5.0], &mut y)
        .expect("dimensions match");
    println!("CsrMatrix::apply (identity): {y:?}");

    let eye_csc =
        CscMatrix::new(2, 2, vec![0, 1, 2], vec![0, 1], vec![1.0_f64, 1.0]).expect("valid CSC");
    eye_csc
        .apply(&[3.0, 5.0], &mut y)
        .expect("dimensions match");
    println!("CscMatrix::apply (identity): {y:?}");
}