1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
/// Quadrature scheme for discretising the prior integral, JSON-serialisable.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq)]
#[serde(rename_all = "snake_case", tag = "kind")]
pub enum AreaQuadratureKind {
/// Sobol low-discrepancy QMC with `num_points` samples.
Sobol {
/// Number of quadrature points (powers of two are most efficient).
num_points: usize,
/// PRNG seed.
#[serde(default)]
seed: u64,
},
/// Latin-Hypercube sampling.
LatinHypercube {
/// Number of quadrature points.
num_points: usize,
/// PRNG seed.
#[serde(default)]
seed: u64,
},
/// Gauss–Legendre tensor product. Total points = `points_per_axis^D`.
GaussLegendre {
/// Nodes per axis.
points_per_axis: usize,
},
}
impl Default for AreaQuadratureKind {
fn default() -> Self {
AreaQuadratureKind::Sobol {
num_points: 64,
seed: 0xC0FFEE,
}
}
}