A mathematical library
For now, only matrices calculator is implemented.
Every matrix can be created using a macro that will parse a string represenging the matrix in the following way: {{a11, a12, a13, ...}. {a21, a22, a23, ...}, ...}
. As each matrix can contain different type of numbers, you have to specify which type of number will you get: matrix_<number_type>!("{{a11, a12, ...}, {a21, a22, ...}, ...}")
.
The call
rust
let matrix = matrix_f32!("{{1.1, 2.2}, {2.1, 3.2}}");
println!("{matrix}")
will print
asdf
+1.1000000 +2.2000000
+2.1000000 +3.2000000
```ts const performSum = async () => { await init(); result.value = RMatrixF32.checkedsum( RMatrixF32.fromstring(matA.value, 1e-6), RMatrixF32.fromstring(matB.value, 1e-6) ).tostring(); };
const performSub = async () => { await init(); result.value = RMatrixF32.checkedsub( RMatrixF32.fromstring(matA.value, 1e-6), RMatrixF32.fromstring(matB.value, 1e-6) ).tostring(); };
const performMul = async () => { await init(); result.value = RMatrixF32.checkedmul( RMatrixF32.fromstring(matA.value, 1e-6), RMatrixF32.fromstring(matB.value, 1e-6) ).tostring(); };
const mat = ref(""); const result2 = ref("Nothing yet...");
const preformGaussReduction = async () => { await init(); result2.value = RMatrixF32.fromstring(mat.value, 1e-6) .gaussiantriangulation() .to_string(); };
const performGaussJordanDeterminant = async () => { await init(); result2.value = RMatrixF32.fromstring(mat.value, 1e-6) .determinantusing_gauss() .toString(); };
const performGaussJordanInverse = async () => { await init(); result2.value = RMatrixF32.fromstring(mat.value, 1e-6) .inversegaussjordan() .tostring(); }; ```