Expand description

peroxide is comprehensive numerical library for Rust.

Components

peroxide has various components for scientific computation.

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.11
  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.

  • prelude : To simple use
  • fuga : To control numerical algorithms

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 by nc feature.
  • If you want to use QR or SVD or Cholesky Decomposition 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

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