numb_rs

Crates.ionumb_rs
lib.rsnumb_rs
version0.0.4
sourcesrc
created_at2021-01-24 04:31:09.471846
updated_at2021-08-25 13:59:35.245393
descriptionAn experimental numeric package
homepage
repositoryhttps://github.com/MrGibus/numb_rs
max_upload_size
id345900
size84,866
(MrGibus)

documentation

README

numb_rs

An experimental crate for numerical things in rust.

Linear Algebra Example

    use numb_rs::{mat, solver::solve_dense, Dense, IntoCol};

    // Use commas to dictate a new item in a row
    // Use Semi-colons to indicate a new row
    let a = mat![
        21., 10., -3.;
        14., 6., 0.;
        17., 12., -6.
    ];

    let b = mat![
        122.;
        91.;
        110.
    ];

    println!("\nSolving ax=b\na:\n{}\nb:\n{}", a, b);
    let solution = solve_dense(a, b).unwrap();

    println!("x:\n{}", solution.into_col());

Output

Solving ax=b
a:
  21.00  10.00  -3.00
  14.00   6.00   0.00
  17.00  12.00  -6.00
b:
  122.00
   91.00
  110.00
x:
   2.00
  10.50
   8.33

Verification (matlab)

a = [21, 10, -3; 14, 6, 0; 17, 12, -6];
b = [122; 91; 110];
a \ b
ans =

    2.0000
   10.5000
    8.3333
Commit count: 67

cargo fmt