# 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 (O3 feature needed)
• Singular Value Decomposition (O3 feature needed)
• Reduced Row Echelon Form
• Vector operations
• Eigenvalue, Eigenvector algorithms
• Statistics
• Special functions (Using puruspe crate)
• Gaussian
• Gamma
• Beta
• Error
• Incomplete Gamma
• Incomplete Beta
• Automatic Differentiation
• Numerical Utils
• Optimization
• 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
• Communication with Python
• DataFrame
• Read & Write with netcdf or csv format
• Macros

And all these things are built on mathematical traits.

## Quick Start

### Cargo.toml

• To use peroxide, you should edit Cargo.toml
• Current document version is corresponding to 0.30.2
1. Default
[dependencies]
peroxide = "0.30"

2. OpenBLAS
[dependencies.peroxide]
version = "0.30"
default-features = false
features = ["O3"]

3. Plot
[dependencies.peroxide]
version = "0.30"
default-features = false
features = ["plot"]

4. netcdf dependency for DataFrame
[dependencies.peroxide]
version = "0.30"
default-features = false
features = ["nc"]

5. csv dependency for DataFrame
[dependencies.peroxide]
version = "0.30"
default-features = false
features = ["csv"]

6. Together
[dependencies.peroxide]
version = "0.30"
default-features = false
features = ["O3", "plot", "nc"]


## Import all at once

Peroxide has two options.

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 by nc feature.
• If you want to use QR or SVD then should use O3 feature (there are no implementations for these decompositions in default)
• If you want to write your numerical results, then use nc feature and netcdf format. (It is much more effective than csv and json.)
• 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

 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) cbind R like cbind dnorm R like dnorm dt R like dt 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 pnorm pt R like pt 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