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

Trait Implementations

impl Clone for Card
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Card
[src]

impl Debug for Card
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Card
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Card
[src]

impl Mul for Card
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Into<usize> for Card
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Card

impl Sync for Card