[][src]Crate peroxide

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.28.0
  1. Default
    [dependencies]
    peroxide = "0.28"
    
  2. OpenBLAS
    [dependencies.peroxide]
    version = "0.28"
    default-features = false
    features = ["O3"]
    
  3. Plot
    [dependencies.peroxide]
    version = "0.28"
    default-features = false
    features = ["plot"]
    
  4. netcdf dependency for DataFrame
    [dependencies.peroxide]
    version = "0.28"
    default-features = false
    features = ["nc"]
    
  5. Together
    [dependencies.peroxide]
    version = "0.28"
    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 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<f64>)

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