peroxide/
lib.rs

1//! `peroxide` is comprehensive numerical library for Rust.
2//!
3//! ## Components
4//!
5//! `peroxide` has various components for scientific computation.
6//!
7//! - Linear Algebra (with BLAS & LAPACK)
8//!   - [Matrix](structure/matrix/index.html) operations
9//!     - `+,-,*,/`
10//!     - LU Decomposition, Determinant, Inverse
11//!     - QR Decomposition (`O3` feature needed)
12//!     - Singular Value Decomposition (`O3` feature needed)
13//!     - Cholesky Decomposition (`O3` feature needed)
14//!     - Reduced Row Echelon Form
15//!   - [Vector](structure/vector/index.html) operations
16//!   - [Eigenvalue, Eigenvector](numerical/eigen/index.html) algorithms
17//! - Statistics
18//!   - [Statistical operations](statistics/stat/index.html)
19//!     - `mean, var, sd`
20//!     - `factorial, P, C, H`
21//!     - Confusion Matrix & metrics
22//!   - [Distributions](statistics/dist/index.html)
23//!     - Bernoulli
24//!     - Uniform
25//!     - Binomial
26//!     - Normal
27//!     - Gamma
28//!     - Beta
29//!     - Student's t
30//!     - LogNormal
31//! - [Special functions](special/function/index.html) (Using `puruspe` crate)
32//!   - Gaussian
33//!   - Gamma
34//!   - Beta
35//!   - Error
36//!   - Incomplete Gamma
37//!   - Incomplete Beta
38//!   - Lambert W
39//! - Automatic Differentiation
40//!   - [Taylor mode forward AD](structure/ad/index.html)
41//! - Numerical Utils
42//!   - [Interpolation](numerical/interp/index.html)
43//!   - [Spline](numerical/spline/index.html)
44//!   - [Polynomial](structure/polynomial/index.html)
45//!   - [Lanczos Approximation](special/lanczos/index.html)
46//!   - [Numerical Integrations](numerical/integral/index.html)
47//! - [Optimization](numerical/optimize/index.html)
48//!   - Gradient Descent
49//!   - Levenberg-Marquardt
50//! - [Root Finding](numerical/root/index.html)
51//!   - Bisection
52//!   - False Position
53//!   - Secant
54//!   - Newton
55//!   - Broyden
56//! - [Ordinary Differential Equations](numerical/ode/index.html)
57//!   - Explicit
58//!     - Ralston's 3rd order
59//!     - Runge-Kutta 4th order
60//!     - Ralston's 4th order
61//!     - Runge-Kutta 5th order
62//!   - Embedded
63//!     - Bogacki-Shampine 3(2)
64//!     - Runge-Kutta-Fehlberg 4(5)
65//!     - Dormand-Prince 5(4)
66//!     - Tsitouras 5(4)
67//!     - Runge-Kutta-Fehlberg 7(8)
68//!   - Implicit
69//!     - Gauss-Legendre 4th order
70//! - Communication with Python
71//!   - [Plot with `matplotlib`](util/plot/index.html)
72//! - [DataFrame](structure/dataframe/index.html)
73//!   - Read & Write with `parquet` or `netcdf` or `csv` format
74//!   - Shape & info: `nrow`, `ncol`, `shape`, `dtypes`, `is_empty`, `contains`
75//!   - Row operations: `head`, `tail`, `slice`
76//!   - Column operations: `select`, `rename`, `column_names`, `select_dtypes`
77//!   - Statistics: `describe`, `sum`, `mean`
78//!   - Series statistics: `sum`, `mean`, `var`, `sd`, `min`, `max`
79//! - Macros
80//!   - [R macros](macros/r_macro/index.html)
81//!   - [Matlab macros](macros/matlab_macro/index.html)
82//!   - [Julia macros](macros/julia_macro/index.html)
83//!
84//! And all these things are built on mathematical traits.
85//!
86//! - Traits
87//!   - [Functional Programming tools](traits/fp/index.html)
88//!   - [General algorithms](traits/general/index.html)
89//!   - [Mathematics](traits/math/index.html)
90//!   - [Mutable tools](traits/mutable/index.html)
91//!   - [Number & Real](traits/num/index.html)
92//!   - [Pointer](traits/pointer/index.html)
93//!   - [Stable](traits/stable/index.html)
94//! ## Quick Start
95//!
96//! ### Cargo.toml
97//!
98//! * Run below commands in your project directory
99//!
100//! 1. Default
101//!     ```bash
102//!     cargo add peroxide
103//!     ```
104//! 2. OpenBLAS
105//!     ```bash
106//!     cargo add peroxide --features O3
107//!     ```
108//! 3. Plot
109//!     ```bash
110//!     cargo add peroxide --features plot
111//!     ```
112//! 4. NetCDF dependency for DataFrame
113//!     ```bash
114//!     cargo add peroxide --features nc
115//!     ```
116//! 5. CSV dependency for DataFrame
117//!     ```bash
118//!     cargo add peroxide --features csv
119//!     ```
120//! 6. Parquet dependency for DataFrame
121//!     ```bash
122//!     cargo add peroxide --features parquet
123//!     ```
124//! 7. All features
125//!     ```bash
126//!     cargo add peroxide --features "O3 plot nc csv parquet"
127//!     ```
128//!
129//! ## Import all at once
130//!
131//! Peroxide has two options.
132//!
133//! * [`prelude`](prelude/index.html) : To simple use
134//! * [`fuga`](fuga/index.html) : To control numerical algorithms
135//!
136//! To see differences, follow above two links.
137//!
138//! You can import all functions & structures at once
139//!
140//! * `prelude`
141//! ```
142//! #[macro_use]
143//! extern crate peroxide;
144//! use peroxide::prelude::*;
145//!
146//! fn main() {
147//!     // Write what you want
148//! }
149//! ```
150//!
151//! * `fuga`
152//! ```
153//! #[macro_use]
154//! extern crate peroxide;
155//! use peroxide::fuga::*;
156//!
157//! fn main() {
158//!     // Write what you want
159//! }
160//! ```
161//!
162//! ## Useful tips for features
163//!
164//! * If you want to use _QR_, _SVD_, or _Cholesky Decomposition_, you should use the `O3` feature. These decompositions are not implemented in the `default` feature.
165//!
166//! * If you want to save your numerical results, consider using the `parquet` or `nc` features, which correspond to the `parquet` and `netcdf` file formats, respectively. These formats are much more efficient than `csv` and `json`.
167//!
168//! * For plotting, it is recommended to use the `plot` feature. However, if you require more customization, you can use the `parquet` or `nc` feature to export your data in the parquet or netcdf format and then use Python to create the plots.
169//!
170//!     * To read parquet files in Python, you can use the `pandas` and `pyarrow` libraries.
171//!
172//!     * A template for Python code that works with netcdf files can be found in the [Socialst](https://github.com/Axect/Socialst/blob/master/Templates/PyPlot_Template/nc_plot.py) repository.
173
174//!
175#![cfg_attr(docsrs, feature(doc_auto_cfg))]
176
177#[cfg(feature = "O3")]
178extern crate blas;
179
180#[cfg(feature = "O3")]
181extern crate lapack;
182
183#[cfg(feature = "plot")]
184extern crate pyo3;
185
186#[cfg(feature = "serde")]
187extern crate serde;
188
189extern crate rand;
190
191// extern crate json;
192
193extern crate order_stat;
194
195extern crate puruspe;
196
197extern crate matrixmultiply;
198
199#[cfg(feature = "nc")]
200extern crate netcdf;
201
202extern crate peroxide_ad;
203
204#[macro_use]
205pub mod macros;
206
207pub mod fuga;
208pub mod ml;
209pub mod numerical;
210pub mod prelude;
211pub mod special;
212pub mod statistics;
213pub mod structure;
214pub mod traits;
215pub mod util;
216
217#[cfg(feature = "complex")]
218pub mod complex;
219
220#[cfg(feature = "parallel")]
221extern crate rayon;