Peroxide
Rust numeric library with R Syntax.
Latest README version
Corresponds with 0.2.2
.
Usage
Matrix Declaration
# R
a =
// Peroxide
let a = new;
# R
a =
# [,1] [,2]
# [1,] 1 2
# [2,] 3 4
// Peroxide
let a = new;
println!;
// c[0] c[1]
// r[0] 1 2
// r[1] 3 4
Matrix operation
- If you want to do multiple operations on same matrix, then you should use
clone
because Ruststd::ops
consume value.
# R
a =
b =
// Peroxide
let a = new;
let b = new;
println!;
println!;
println!; // Element-wise multiplication
println!; // Matrix multiplication
// Consume -> You can't use a,b anymore.
Functional Programming
// Peroxide
let a = new;
println!;
println!;
println!;
// Results
//
// c[0] c[1]
// r[0] 2 3
// r[1] 4 5
//
// c[0] c[1]
// r[0] 0 1
// r[1] 2 3
//
// c[0] c[1]
// r[0] 2 4
// r[1] 6 8
TODO
- Extract row & col operator