All Projects → Axect → Peroxide

Axect / Peroxide

Licence: other
Rust numeric library with R, MATLAB & Python syntax

Programming Languages

rust
11053 projects
r
7636 projects
matlab
3953 projects

Projects that are alternatives of or similar to Peroxide

Owl
Owl - OCaml Scientific and Engineering Computing @ http://ocaml.xyz
Stars: ✭ 919 (+381.15%)
Mutual labels:  matrix, statistics, linear-algebra, scientific-computing, optimization, regression
Mathnet Numerics
Math.NET Numerics
Stars: ✭ 2,688 (+1307.33%)
Mutual labels:  matrix, statistics, linear-algebra, regression, interpolation
Smile
Statistical Machine Intelligence & Learning Engine
Stars: ✭ 5,412 (+2733.51%)
Mutual labels:  dataframe, statistics, linear-algebra, regression, interpolation
Math Php
Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra
Stars: ✭ 2,009 (+951.83%)
Mutual labels:  matrix, statistics, linear-algebra, regression
Armadillo Code
Armadillo: fast C++ library for linear algebra & scientific computing - http://arma.sourceforge.net
Stars: ✭ 388 (+103.14%)
Mutual labels:  matrix, statistics, linear-algebra, scientific-computing
saddle
SADDLE: Scala Data Library
Stars: ✭ 23 (-87.96%)
Mutual labels:  matrix, linear-algebra, dataframe
data-science-notes
Open-source project hosted at https://makeuseofdata.com to crowdsource a robust collection of notes related to data science (math, visualization, modeling, etc)
Stars: ✭ 52 (-72.77%)
Mutual labels:  statistics, linear-algebra, regression
monolish
monolish: MONOlithic LInear equation Solvers for Highly-parallel architecture
Stars: ✭ 166 (-13.09%)
Mutual labels:  matrix, linear-algebra, scientific-computing
Teaching
Teaching Materials for Dr. Waleed A. Yousef
Stars: ✭ 435 (+127.75%)
Mutual labels:  statistics, linear-algebra, optimization
Morpheus Core
The foundational library of the Morpheus data science framework
Stars: ✭ 203 (+6.28%)
Mutual labels:  dataframe, statistics, regression
Simpeg
Simulation and Parameter Estimation in Geophysics - A python package for simulation and gradient based parameter estimation in the context of geophysical applications.
Stars: ✭ 283 (+48.17%)
Mutual labels:  linear-algebra, scientific-computing, optimization
Design Of Experiment Python
Design-of-experiment (DOE) generator for science, engineering, and statistics
Stars: ✭ 143 (-25.13%)
Mutual labels:  matrix, dataframe, statistics
Tensor
A library and extension that provides objects for scientific computing in PHP.
Stars: ✭ 146 (-23.56%)
Mutual labels:  matrix, linear-algebra, scientific-computing
Julia-data-science
Data science and numerical computing with Julia
Stars: ✭ 54 (-71.73%)
Mutual labels:  linear-algebra, scientific-computing, dataframe
Phpsci Carray
PHP library for scientific computing powered by C
Stars: ✭ 176 (-7.85%)
Mutual labels:  matrix, linear-algebra, scientific-computing
Gonum
开源Go语言数值算法库(An open numerical library purely based on Go programming language)
Stars: ✭ 128 (-32.98%)
Mutual labels:  matrix, scientific-computing, interpolation
Gonum
Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more
Stars: ✭ 5,384 (+2718.85%)
Mutual labels:  matrix, statistics, scientific-computing
Gosl
Linear algebra, eigenvalues, FFT, Bessel, elliptic, orthogonal polys, geometry, NURBS, numerical quadrature, 3D transfinite interpolation, random numbers, Mersenne twister, probability distributions, optimisation, differential equations.
Stars: ✭ 1,629 (+752.88%)
Mutual labels:  linear-algebra, scientific-computing, optimization
Quant Notes
Quantitative Interview Preparation Guide, updated version here ==>
Stars: ✭ 180 (-5.76%)
Mutual labels:  statistics, linear-algebra, optimization
Hep
hep is the mono repository holding all of go-hep.org/x/hep packages and tools
Stars: ✭ 146 (-23.56%)
Mutual labels:  statistics, plot

Peroxide

On crates.io On docs.rs

builds.sr.ht status travis github

maintenance

Rust numeric library contains linear algebra, numerical analysis, statistics and machine learning tools with R, MATLAB, Python like macros.

Why Peroxide?

1. Customize features

Peroxide provides various features.

  • default - Pure Rust (No dependencies of architecture - Perfect cross compilation)
  • O3 - OpenBLAS (Perfect performance but little bit hard to set-up - Strongly recommend to read OpenBLAS for Rust)
  • plot - With matplotlib of python, we can draw any plots.
  • nc - To handle netcdf file format with DataFrame
  • csv - To handle csv file format with Matrix or DataFrame
  • serde - serialization with Serde.

If you want to do high performance computation and more linear algebra, then choose openblas feature. If you don't want to depend C/C++ or Fortran libraries, then choose default feature. If you want to draw plot with some great templates, then choose plot feature.

You can choose any features simultaneously.

2. Easy to optimize

Peroxide uses 1D data structure to describe matrix. So, it's too easy to integrate BLAS. It means peroxide guarantees perfect performance for linear algebraic computations.

3. Friendly syntax

Rust is so strange for Numpy, MATLAB, R users. Thus, it's harder to learn the more rusty libraries. With peroxide, you can do heavy computations with R, Numpy, MATLAB like syntax.

For example,

#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;

fn main() {
    // MATLAB like matrix constructor
    let a = ml_matrix("1 2;3 4");

    // R like matrix constructor (default)
    let b = matrix(c!(1,2,3,4), 2, 2, Row);

    // Or use zeros
    let mut z = zeros(2, 2);
    z[(0,0)] = 1.0;
    z[(0,1)] = 2.0;
    z[(1,0)] = 3.0;
    z[(1,1)] = 4.0;
    
    // Simple but effective operations
    let c = a * b; // Matrix multiplication (BLAS integrated)

    // Easy to pretty print
    c.print();
    //       c[0] c[1]
    // r[0]     1    3
    // r[1]     2    4

    // Easy to do linear algebra
    c.det().print();
    c.inv().print();

    // and etc.
}

4. Can choose two different coding styles.

In peroxide, there are two different options.

  • prelude: To simple use.
  • fuga: To choose numerical algorithms explicitly.

For examples, let's see norm.

In prelude, use norm is simple: a.norm(). But it only uses L2 norm for Vec<f64>. (For Matrix, Frobenius norm.)

#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;

fn main() {
    let a = c!(1, 2, 3);
    let l2 = a.norm();      // L2 is default vector norm
    
    assert_eq!(l2, 14f64.sqrt());
}

In fuga, use various norms. But you should write longer than prelude.

#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
   
fn main() {
    let a = c!(1, 2, 3);
    let l1 = a.norm(Norm::L1);
    let l2 = a.norm(Norm::L2);
    let l_inf = a.norm(Norm::LInf);
    assert_eq!(l1, 6f64);
    assert_eq!(l2, 14f64.sqrt());
    assert_eq!(l_inf, 3f64);
}

5. Batteries included

Peroxide can do many things.

  • Linear Algebra
    • Effective Matrix structure
    • Transpose, Determinant, Diagonal
    • LU Decomposition, Inverse matrix, Block partitioning
    • QR Decomposition (O3 feature)
    • Singular Value Decomposition (SVD) (O3 feature)
    • Reduced Row Echelon form
    • Column, Row operations
    • Eigenvalue, Eigenvector
  • Functional Programming
    • More easy functional programming with Vec<f64>
    • For matrix, there are three maps
      • fmap : map for all elements
      • col_map : map for column vectors
      • row_map : map for row vectors
  • Automatic Differentiation
    • Taylor mode Forward AD - for nth order AD
    • Exact jacobian
    • Real trait to constrain for f64 and AD (for ODE)
  • Numerical Analysis
    • Lagrange interpolation
    • Cubic spline
    • Non-linear regression
      • Gradient Descent
      • Levenberg Marquardt
    • Ordinary Differential Equation
      • Euler
      • Runge Kutta 4th order
      • Backward Euler (Implicit)
      • Gauss Legendre 4th order (Implicit)
    • Numerical Integration
      • Newton-Cotes Quadrature
      • Gauss-Legendre Quadrature (up to 30 order)
      • Gauss-Kronrod Quadrature (Adaptive)
        • G7K15, G10K21, G15K31, G20K41, G25K51, G30K61
    • Root Finding
      • Bisection
      • False Position (Regula Falsi)
      • Secant
      • Newton
  • Statistics
    • More easy random with rand crate
    • Ordered Statistics
      • Median
      • Quantile (Matched with R quantile)
    • Probability Distributions
      • Bernoulli
      • Uniform
      • Binomial
      • Normal
      • Gamma
      • Beta
      • Student's-t
    • RNG algorithms
      • Acceptance Rejection
      • Marsaglia Polar
      • Ziggurat
      • Wrapper for rand-dist crate
  • Special functions
    • Wrapper for puruspe crate (pure rust)
  • Utils
    • R-like macro & functions
    • Matlab-like macro & functions
    • Numpy-like macro & functions
    • Julia-like macro & functions
  • Plotting
    • With pyo3 & matplotlib
  • DataFrame
    • Support various types simultaneously
    • Read & Write csv files (csv feature)
    • Read & Write netcdf files (nc feature)

6. Compatible with Mathematics

After 0.23.0, peroxide is compatible with mathematical structures. Matrix, Vec<f64>, f64 are considered as inner product vector spaces. And Matrix, Vec<f64> are linear operators - Vec<f64> to Vec<f64> and Vec<f64> to f64. For future, peroxide will include more & more mathematical concepts. (But still practical.)

7. Written in Rust

Rust & Cargo are awesome for scientific computations. You can use any external packages easily with Cargo, not make. And default runtime performance of Rust is also great. If you use many iterations for computations, then Rust become great choice.

Latest README version

Corresponding to 0.30.2

Pre-requisite

  • For O3 feature - Need OpenBLAS
  • For plot feature - Need matplotlib of python
  • For nc feature - Need netcdf

Install

  • Add next block to your cargo.toml
  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. OpenBLAS & Plot & NetCDF
    [dependencies.peroxide]
    version = "0.30"
    default-features = false
    features = ["O3", "plot", "nc", "csv"] 
    

Useful tips for features

  • 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.)
  • 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

Module Structure

Documentation

  • On docs.rs

Example

Peroxide Gallery

Version Info

To see RELEASES.md

Contributes Guide

See CONTRIBUTES.md

TODO

To see TODO.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].