roomeq-model 0.5.5

RoomEQ configuration, pipeline, and DSP-chain contracts
Documentation
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,
        }
    }
}