hipparchus_mean/lib.rs
1//! [![github]](https://github.com/web3nemo/hipparchus) 
2//! [![crates-io]](https://crates.io/crates/hipparchus-mean) 
3//! [![docs-rs]](https://docs.rs/hipparchus-mean)
4//!
5//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
6//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
7//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
8//!
9//! The crate provides various mathematics solver:
10//! - factory to create various type of sequences with map/fold OPs for derived sequences
11//! - utility to calculate various Lp norm for n-dimension vectors
12//! - utility to calculate various mean & average moving for n-dimension vectors
13//!
14//! # License
15//!
16//! This project is licensed under either of
17//! - [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([LICENSE-APACHE](https://github.com/web3nemo/hipparchus/blob/HEAD/LICENSE-APACHE))
18//! - [MIT License](https://opensource.org/license/mit/) ([LICENSE-MIT](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-MIT))
19//! at your option.
20//!
21//! # Usage
22//!
23//! Add the following to your '''Cargo.toml''':
24//!
25//! ```toml
26//! [dependencies]
27//! hipparchus-mean = "0.1"
28//! ```
29//!
30//! # Example
31//!
32//! ## Lp Norm
33//!
34//! Here's an example to calculate L1 norm of a vector via ``hipparchus``:
35//!
36//! ```rust
37//!
38//! use hipparchus_mean::LpNorm;
39//!
40//! let v = vec![1.0, 2.0, 3.0, 4.0, 5.0];
41//! let norm = v.iter().l0norm().unwrap();
42//!
43//! ```
44//!
45//! Below is a full list of all norm algorithms ``hipperchus`` has supported:
46//!
47//! | Norm | Syntax | Feature |
48//! | :-- | :-- | :-- |
49//! | l0norm | - | L0 norm |
50//! | l1norm | - | L1 norm |
51//! | l2norm | - | L2 norm |
52//! | lpnorm | (f32) | Lp norm with p factor |
53//! | lpnorm_inf | - | Lp norm (p=inf) |
54//!
55//! ## Mean & Moving Average
56//!
57//! Here's an example to calculate the arithmetic mean of a vector via ``hipparchus``:
58//!
59//! ```rust
60//!
61//! use hipparchus_mean::Mean;
62//!
63//! let v = vec![1.0, 2.0, 3.0, 4.0, 5.0];
64//! let mean = v.iter().arithmetic_mean().unwrap();
65//!
66//! ```
67//!
68//! Below is a full list of all mean algorithm ``hipperchus`` has supported:
69//!
70//! | Mean | Syntax | Feature |
71//! | :-- | :-- | :-- |
72//! | ArithmeticMean | - | arithmetic mean |
73//! | GeometricMean | - | geometric mean |
74//! | QuadraticMean | - | quadratic mean |
75//! | HarmonicMean | - | harmonic mean |
76//! | SimpleMovingAverage | - | simple moving average |
77//! | CumulativeMovingAverage | - | cumulative moving average |
78//! | WeightedMovingAverage | - | weighted moving average |
79//! | ExponentialMovingAverage | (f32) | exponential moving average with decay |
80//!
81//! # Contributing
82//!
83//! We welcome all people who want to contribute. Please see the contributing instructions for more information.
84//!
85//! Contributions in any form (issues, pull requests, etc.) to this project must adhere to Rust's Code of Conduct.
86//!
87//! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in hipparchus-* by you,
88//! as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
89//!
90//!
91
92// re-exports
93pub use self::value::*;
94pub use self::two::*;
95pub use self::power::*;
96pub use self::lpnorm::*;
97pub use self::mean::*;
98pub use self::movingavg::*;
99
100// modules
101pub mod value;
102pub mod two;
103pub mod power;
104pub mod lpnorm;
105pub mod mean;
106pub mod movingavg;