Enum spaces::Card [−][src]
pub enum Card { Null, Finite(usize), Infinite, }
Measure of the cardinality (#) of a vector space.
Card
is typically used to compute the number of possible values that can
be reached within some vector space. For example, for a space with 2
dimensions, each with a finite set of values, we have:
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
Null
Finite(usize)
Infinite
Trait Implementations
impl Clone for Card
[src]
impl Clone for Card
fn clone(&self) -> Card
[src]
fn clone(&self) -> Card
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Card
[src]
impl Copy for Card
impl Debug for Card
[src]
impl Debug for Card
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Card
[src]
impl PartialEq for Card
fn eq(&self, other: &Card) -> bool
[src]
fn eq(&self, other: &Card) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Card) -> bool
[src]
fn ne(&self, other: &Card) -> bool
This method tests for !=
.
impl Eq for Card
[src]
impl Eq for Card
impl Mul for Card
[src]
impl Mul for Card
type Output = Card
The resulting type after applying the *
operator.
fn mul(self, rhs: Card) -> Card
[src]
fn mul(self, rhs: Card) -> Card
Performs the *
operation.
impl Into<usize> for Card
[src]
impl Into<usize> for Card