Skip to main content

oars/
constructors.rs

1//! Implementations of different orthogonal array construction techniques.
2//!
3//! Various constructors that implement the `OAConstructor`/`ParOAConstructor` traits, and provide
4//! methods to generate orthogonal arrays. Each struct contains the configuration parameters
5//! necessary for the construction method, and the `gen` method (from the trait) will construct an
6//! orthogonal array from the given parameters.
7//!
8//! The description of the construction method is the struct that contains the parameters for that
9//! particular method.
10//!
11//! The constructors offer parameter checked and non-checked variants. The parameter checked
12//! variants ensure that the supplied parameters are valid so that the resultant orthogonal array
13//! will be well-formed at the expense of some computational overhead. The constructors can be used
14//! directly to avoid this overhead, or if the user is certain that the supplied parameters are
15//! correct.
16//!
17//! Parameter checking is implemented using stateful types. The parameters can be supplied to the
18//! checked variant of a construction struct, which will be consumed when the verification method
19//! is called, yielding a `Result` with the constructor that implements the trait necessary to
20//! generate an orthogonal array.
21//!
22//! For example:
23//!
24//! ```
25//! use oars::prelude::*;
26//! use oars::constructors::{Bose, BoseChecked};
27//!
28//! # fn main() -> OarsResult<()> {
29//!
30//! // Construct the checked variant
31//! let b = BoseChecked {
32//!     prime_base: 3,
33//!     dimensions: 2,
34//! };
35//!
36//! let oa = b.verify()?.gen();
37//! # Ok(())
38//! # }
39//! ```
40
41// We declare each constructor in their own file to avoid maintaining a massive file of
42// constructors
43mod bose;
44mod bush;
45
46// Re-export child modules so constructors can be used as `constructors::some_constructor`
47pub use bose::Bose;
48pub use bose::BoseChecked;
49pub use bush::Bush;
50pub use bush::BushChecked;