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
- Confusion Matrix & metrics
- 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
parquet
ornetcdf
orcsv
format
- Read & Write with
- Macros
And all these things are built on mathematical traits.
- Traits
Quick Start
Cargo.toml
- Run below commands in your project directory
- Default
cargo add peroxide
- OpenBLAS
cargo add peroxide --features O3
- Plot
cargo add peroxide --features plot
- NetCDF dependency for DataFrame
cargo add peroxide --features nc
- CSV dependency for DataFrame
cargo add peroxide --features csv
- Parquet dependency for DataFrame
cargo add peroxide --features parquet
- All features
cargo add peroxide --features "O3 plot nc csv parquet"
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
parquet
ornc
features (corresponding toparquet
ornetcdf
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
parquet
ornc
feature to export data as parquet or netcdf format and use python to draw plot.plot
feature has limited plot abilities.- To read parquet file in python, use
pandas
&pyarrow
libraries. - There is a template of python code for netcdf. - 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