pub struct LatinHypercubePlan {
pub dimensions: usize,
pub points: usize,
pub seed: u64,
pub max_work: u64,
pub untested_regions: Vec<UntestedRegion>,
}Expand description
Latin hypercube request.
Fields§
§dimensions: usizeNumber of coordinates, bounded to 64.
points: usizeNumber of points and strata.
seed: u64Root seed.
max_work: u64Maximum shuffle draws.
untested_regions: Vec<UntestedRegion>Caller-owned exclusions.
Implementations§
Source§impl LatinHypercubePlan
impl LatinHypercubePlan
Sourcepub fn generate(&self) -> Result<SampleDesign, DesignError>
pub fn generate(&self) -> Result<SampleDesign, DesignError>
Generates a centered Latin hypercube with one point per stratum in every dimension.
Examples found in repository?
examples/space_filling_evidence.rs (line 11)
3fn main() {
4 let latin = LatinHypercubePlan {
5 dimensions: 3,
6 points: 8,
7 seed: 2026,
8 max_work: 21,
9 untested_regions: vec![],
10 }
11 .generate()
12 .expect("bounded Latin design");
13 let sobol = SobolPlan {
14 dimensions: 2,
15 points: 8,
16 skip: 4,
17 scramble: Scramble::DigitalShift,
18 seed: 2026,
19 max_work: 16,
20 untested_regions: vec![],
21 }
22 .generate()
23 .expect("reviewed Sobol design");
24 let covered = SweepPlan {
25 inject_lower_boundary: true,
26 inject_upper_boundary: true,
27 untested_regions: vec![UntestedRegion {
28 label: "unstable-corner".into(),
29 reason: "excluded by study protocol".into(),
30 }],
31 }
32 .apply(sobol);
33 println!(
34 "latin={} occupancy={:?} sampler={:?}",
35 latin.points.len(),
36 latin.coverage.stratum_occupancy,
37 latin.coverage.sampler
38 );
39 println!(
40 "sobol={} boundaries={:?} duplicates={:?} exclusions={:?}",
41 covered.points.len(),
42 covered.coverage.boundary_injections,
43 covered.coverage.duplicates,
44 covered.coverage.untested_regions
45 );
46}Trait Implementations§
Source§impl Clone for LatinHypercubePlan
impl Clone for LatinHypercubePlan
Source§fn clone(&self) -> LatinHypercubePlan
fn clone(&self) -> LatinHypercubePlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LatinHypercubePlan
impl Debug for LatinHypercubePlan
Source§impl PartialEq for LatinHypercubePlan
impl PartialEq for LatinHypercubePlan
impl StructuralPartialEq for LatinHypercubePlan
Auto Trait Implementations§
impl Freeze for LatinHypercubePlan
impl RefUnwindSafe for LatinHypercubePlan
impl Send for LatinHypercubePlan
impl Sync for LatinHypercubePlan
impl Unpin for LatinHypercubePlan
impl UnsafeUnpin for LatinHypercubePlan
impl UnwindSafe for LatinHypercubePlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more