egobox_doe/lib.rs
1/*!
2This library implements some Design of Experiments (DoE) methods a.k.a. sampling methods,
3specially the [Latin Hypercube sampling](https://en.wikipedia.org/wiki/Latin_hypercube_sampling)
4method which is used by surrogate-based methods.
5This library is a port of [SMT sampling methods](https://smt.readthedocs.io/en/latest/_src_docs/sampling_methods.html).
6
7A DoE method is a way to generate a set of points (i.e. a DoE) within a design (or sample) space `xlimits`.
8The design space is defined as a 2D ndarray `(nx, 2)`, specifying lower bound and upper bound
9of each `nx` components of the samples `x`.
10
11Example:
12```
13use egobox_doe::{FullFactorial, Lhs, LhsKind, Random, SamplingMethod};
14use ndarray::{arr2};
15use ndarray_rand::rand::SeedableRng;
16use rand_xoshiro::Xoshiro256Plus;
17
18// Design space is defined as [5., 10.] x [0., 1.], samples are 2-dimensional.
19let xlimits = arr2(&[[5., 10.], [0., 1.]]);
20// We generate five samples using centered Latin Hypercube sampling.
21let samples = Lhs::new(&xlimits).kind(LhsKind::Centered).sample(5);
22// or else with FullFactorial sampling
23let samples = FullFactorial::new(&xlimits).sample(5);
24// or else randomly with random generator for reproducibility
25let samples = Random::new(&xlimits).with_rng(Xoshiro256Plus::seed_from_u64(42)).sample(5);
26```
27
28This library contains three kinds of sampling methods:
29* [Latin Hypercube Sampling](crate::lhs::Lhs),
30* [Full Factorial Sampling](crate::full_factorial::FullFactorial),
31* [Random Sampling](crate::random::Random)
32
33*/
34#![warn(missing_docs)]
35#![warn(rustdoc::broken_intra_doc_links)]
36mod full_factorial;
37mod lhs;
38mod random;
39mod traits;
40mod utils;
41
42pub use full_factorial::*;
43pub use lhs::*;
44pub use random::*;
45pub use traits::*;