Crate peroxide[−][src]
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, Determinant, Inverse
- QR Decomposition (
O3feature needed) - Singular Value Decomposition (
O3feature needed) - Reduced Row Echelon Form
- Vector operations
- Eigenvalue, Eigenvector algorithms
- Matrix operations
- Statistics
- Statistical operations
mean, var, sdfactorial, P, C, H
- Distributions
- Bernoulli
- Uniform
- Binomial
- Normal
- Gamma
- Beta
- Student’s t
- Statistical operations
- Special functions (Using
puruspecrate)- 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
netcdforcsvformat
- 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.2
- 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"] netcdfdependency for DataFrame[dependencies.peroxide] version = "0.30" default-features = false features = ["nc"]csvdependency 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,dataframefeature is replaced byncfeature. - If you want to use
QRorSVDthen should useO3feature (there are no implementations for these decompositions indefault) - If you want to write your numerical results, then use
ncfeature andnetcdfformat. (It is much more effective thancsvandjson.) - After
0.23.0, there are two options -fuga,prelude. Choose proper option for your computations. - To plot, use
ncfeature to export data as netcdf format and use python to draw plot.plotfeature has limited plot abilities.- There is a template of python code. - Socialst
Modules
| fuga | Choose what you want. |
| macros | Useful macros |
| ml | Machine learning tools |
| numerical | Differential equations & Numerical Analysis tools |
| prelude | Do not disturbed. Just use. |
| special | Special function module |
| statistics | Statistical Modules |
| structure | Main structures for peroxide |
| traits | |
| util | Utility - plot, print, pickle and etc. |
Macros
| c | R like concatenate (Type: Vec<f64>) |
| cbind | R like cbind |
| dnorm | R like |
| dt | R like |
| eye | MATLAB like eye - identity matrix |
| hstack | |
| linspace | MATLAB like linspace |
| lm | R like lm |
| matrix | More R like Matrix constructor (Macro) |
| pnorm | R like |
| pt | R like |
| rand | MATLAB like rand - random matrix |
| rbind | R like rbind |
| rnorm | R like random normal |
| rt | R like random Student’s t |
| runif | R like random uniform |
| seq | R like seq macro |
| vstack | |
| zeros | MATLAB like zeros - zero matrix |