pub enum Card {
Null,
Finite(usize),
Infinite,
}
Expand description
Measure of the cardinality (#) of a set.
Card
is used to represent the number of possible values that are contained by a space. Take,
for example, a 2-dimensional space, each with a finite set of values. In this case we have the
following:
use spaces::{Space, Card};
use spaces::product::PairSpace;
use spaces::discrete::Discrete;
let d1 = Discrete::new(5);
let d2 = Discrete::new(10);
let space = PairSpace::new(d1, d2);
assert_eq!(space.card(), Card::Finite(50));
Internally, this above code does the following:
use spaces::Card;
let s1 = Card::Finite(5);
let s2 = Card::Finite(10);
assert_eq!(s1*s2, Card::Finite(50));
Variants§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Card
impl<'de> Deserialize<'de> for Card
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