Crates.io | numb_rs |
lib.rs | numb_rs |
version | 0.0.4 |
source | src |
created_at | 2021-01-24 04:31:09.471846 |
updated_at | 2021-08-25 13:59:35.245393 |
description | An experimental numeric package |
homepage | |
repository | https://github.com/MrGibus/numb_rs |
max_upload_size | |
id | 345900 |
size | 84,866 |
An experimental crate for numerical things in rust.
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());
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
a = [21, 10, -3; 14, 6, 0; 17, 12, -6];
b = [122; 91; 110];
a \ b
ans =
2.0000
10.5000
8.3333