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//! - Macros
75//!   - [R macros](macros/r_macro/index.html)
76//!   - [Matlab macros](macros/matlab_macro/index.html)
77//!   - [Julia macros](macros/julia_macro/index.html)
78//!
79//! And all these things are built on mathematical traits.
80//!
81//! - Traits
82//!   - [Functional Programming tools](traits/fp/index.html)
83//!   - [General algorithms](traits/general/index.html)
84//!   - [Mathematics](traits/math/index.html)
85//!   - [Mutable tools](traits/mutable/index.html)
86//!   - [Number & Real](traits/num/index.html)
87//!   - [Pointer](traits/pointer/index.html)
88//!   - [Stable](traits/stable/index.html)
89//! ## Quick Start
90//!
91//! ### Cargo.toml
92//!
93//! * Run below commands in your project directory
94//!
95//! 1. Default
96//!     ```bash
97//!     cargo add peroxide
98//!     ```
99//! 2. OpenBLAS
100//!     ```bash
101//!     cargo add peroxide --features O3
102//!     ```
103//! 3. Plot
104//!     ```bash
105//!     cargo add peroxide --features plot
106//!     ```
107//! 4. NetCDF dependency for DataFrame
108//!     ```bash
109//!     cargo add peroxide --features nc
110//!     ```
111//! 5. CSV dependency for DataFrame
112//!     ```bash
113//!     cargo add peroxide --features csv
114//!     ```
115//! 6. Parquet dependency for DataFrame
116//!     ```bash
117//!     cargo add peroxide --features parquet
118//!     ```
119//! 7. All features
120//!     ```bash
121//!     cargo add peroxide --features "O3 plot nc csv parquet"
122//!     ```
123//!
124//! ## Import all at once
125//!
126//! Peroxide has two options.
127//!
128//! * [`prelude`](prelude/index.html) : To simple use
129//! * [`fuga`](fuga/index.html) : To control numerical algorithms
130//!
131//! To see differences, follow above two links.
132//!
133//! You can import all functions & structures at once
134//!
135//! * `prelude`
136//! ```
137//! #[macro_use]
138//! extern crate peroxide;
139//! use peroxide::prelude::*;
140//!
141//! fn main() {
142//!     // Write what you want
143//! }
144//! ```
145//!
146//! * `fuga`
147//! ```
148//! #[macro_use]
149//! extern crate peroxide;
150//! use peroxide::fuga::*;
151//!
152//! fn main() {
153//!     // Write what you want
154//! }
155//! ```
156//!
157//! ## Useful tips for features
158//!
159//! * 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.
160//!
161//! * 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`.
162//!
163//! * 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.
164//!
165//!     * To read parquet files in Python, you can use the `pandas` and `pyarrow` libraries.
166//!
167//!     * 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.
168
169//!
170#![cfg_attr(docsrs, feature(doc_auto_cfg))]
171
172#[cfg(feature = "O3")]
173extern crate blas;
174
175#[cfg(feature = "O3")]
176extern crate lapack;
177
178#[cfg(feature = "plot")]
179extern crate pyo3;
180
181#[cfg(feature = "serde")]
182extern crate serde;
183
184extern crate rand;
185
186// extern crate json;
187
188extern crate order_stat;
189
190extern crate puruspe;
191
192extern crate matrixmultiply;
193
194#[cfg(feature = "nc")]
195extern crate netcdf;
196
197extern crate peroxide_ad;
198
199#[macro_use]
200pub mod macros;
201
202pub mod fuga;
203pub mod ml;
204pub mod numerical;
205pub mod prelude;
206pub mod special;
207pub mod statistics;
208pub mod structure;
209pub mod traits;
210pub mod util;
211
212#[cfg(feature = "complex")]
213pub mod complex;
214
215#[cfg(feature = "parallel")]
216extern crate rayon;