pub struct Partition { /* private fields */ }
Expand description
Type representing a finite, uniformly partitioned interval.
Implementations§
source§impl Partition
impl Partition
pub fn new(lb: f64, ub: f64, density: usize) -> Partition
pub fn from_interval<I: Into<Interval>>(d: I, density: usize) -> Partition
pub fn density(&self) -> usize
pub fn partition_width(&self) -> f64
pub fn centres(&self) -> Vec<f64>
pub fn to_partition(&self, val: f64) -> usize
Trait Implementations§
source§impl BoundedSpace for Partition
impl BoundedSpace for Partition
§type BoundValue = f64
type BoundValue = f64
The upper/lower bound type; not necessarily equal to
Space::Value
.source§fn contains(&self, val: Self::BoundValue) -> bool
fn contains(&self, val: Self::BoundValue) -> bool
Returns true iff
val
lies within the dimension’s bounds (closed).source§impl<'de> Deserialize<'de> for Partition
impl<'de> Deserialize<'de> for Partition
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more