Skip to main content

HyperfiniteSet

Struct HyperfiniteSet 

Source
pub struct HyperfiniteSet {
    pub cardinality: usize,
    pub label: String,
}
Expand description

A hyperfinite set represented by a hypernatural cardinality N (as usize for computability).

Fields§

§cardinality: usize

The (hyper)natural cardinality of the set (as an ordinary usize for computational purposes).

§label: String

An optional label for the set.

Implementations§

Source§

impl HyperfiniteSet

Source

pub fn new(cardinality: usize, label: &str) -> Self

Create a hyperfinite set with given cardinality.

Source

pub fn hyperfinite_sum<F: Fn(usize) -> f64>(&self, f: F) -> f64

Compute the sum of a function over this hyperfinite set (approximation).

Source

pub fn hyperfinite_product<F: Fn(usize) -> f64>(&self, f: F) -> f64

Compute the product of a function over this hyperfinite set (approximation).

Source

pub fn loeb_integral<F: Fn(usize) -> f64>(&self, f: F) -> f64

Compute the normalized sum (Loeb-measure approximation).

Source

pub fn is_nonempty(&self) -> bool

Check whether the set is nonempty.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.