Expand description
peroxide
is comprehensive numerical library for Rust.
Components
peroxide
has various components for scientific computation.
- Linear Algebra (with BLAS & LAPACK)
- Matrix operations
+,-,*,/
- LU Decomposition, Determinant, Inverse
- QR Decomposition (
O3
feature needed) - Singular Value Decomposition (
O3
feature needed) - Cholesky Decomposition (
O3
feature needed) - Reduced Row Echelon Form
- Vector operations
- Eigenvalue, Eigenvector algorithms
- Matrix operations
- Statistics
- Statistical operations
mean, var, sd
factorial, P, C, H
- Distributions
- Bernoulli
- Uniform
- Binomial
- Normal
- Gamma
- Beta
- Student’s t
- Statistical operations
- Special functions (Using
puruspe
crate)- Gaussian
- Gamma
- Beta
- Error
- Incomplete Gamma
- Incomplete Beta
- Automatic Differentiation
- Numerical Utils
- Optimization
- Gradient Descent
- Levenberg-Marquardt
- Root Finding
- Bisection
- False Position (Regula falsi)
- Secant
- Newton
- Differential Equations
- Explicit
- Runge-Kutta 4th order
- Euler methods
- Implicit
- Backward Euler
- Gauss-Legendre 4th order
- Explicit
- Communication with Python
- DataFrame
- Read & Write with
netcdf
orcsv
format
- Read & Write with
- Macros
And all these things are built on mathematical traits.
- Traits
Quick Start
Cargo.toml
- To use
peroxide
, you should editCargo.toml
- Current document version is corresponding to
0.30.11
- Default
[dependencies] peroxide = "0.30"
- OpenBLAS
[dependencies.peroxide] version = "0.30" default-features = false features = ["O3"]
- Plot
[dependencies.peroxide] version = "0.30" default-features = false features = ["plot"]
netcdf
dependency for DataFrame[dependencies.peroxide] version = "0.30" default-features = false features = ["nc"]
csv
dependency for DataFrame[dependencies.peroxide] version = "0.30" default-features = false features = ["csv"]
- Together
[dependencies.peroxide] version = "0.30" default-features = false features = ["O3", "plot", "nc"]
Import all at once
Peroxide has two options.
To see differences, follow above two links.
You can import all functions & structures at once
prelude
#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;
fn main() {
// Write what you want
}
fuga
#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
// Write what you want
}
Useful tips for features
- After
0.28.0
,dataframe
feature is replaced bync
feature. - If you want to use QR or SVD or Cholesky Decomposition then should use
O3
feature (there are no implementations for these decompositions indefault
) - If you want to write your numerical results, then use
nc
feature andnetcdf
format. (It is much more effective thancsv
andjson
.) - After
0.23.0
, there are two options -fuga
,prelude
. Choose proper option for your computations. - To plot, use
nc
feature to export data as netcdf format and use python to draw plot.plot
feature has limited plot abilities.- There is a template of python code. - Socialst
Modules
Choose what you want.
Useful macros
Machine learning tools
Differential equations & Numerical Analysis tools
Do not disturbed. Just use.
Special function module
Statistical Modules
Main structures for peroxide
Utility - plot, print, pickle and etc.
Macros
R like concatenate (Type: Vec<f64>)
R like cbind
R like dnorm
R like dt
MATLAB like eye - identity matrix
MATLAB like linspace
R like lm
More R like Matrix constructor (Macro)
R like pnorm
R like pt
MATLAB like rand - random matrix
R like rbind
R like random normal
R like random Student’s t
R like random uniform
R like seq macro
MATLAB like zeros - zero matrix