[][src]Trait maths_traits::analysis::real::ComplexSubset

pub trait ComplexSubset: PartialEq + Clone + Semiring {
    type Real: Real + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>;
    type Natural: Natural + IntegerSubset<Signed = Self::Integer, Unsigned = Self::Natural> + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>;
    type Integer: Integer + IntegerSubset<Signed = Self::Integer, Unsigned = Self::Natural> + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>;
    fn as_real(self) -> Self::Real;
fn as_natural(self) -> Self::Natural;
fn as_integer(self) -> Self::Integer;
fn floor(self) -> Self;
fn ceil(self) -> Self;
fn round(self) -> Self;
fn trunc(self) -> Self;
fn fract(self) -> Self;
fn im(self) -> Self;
fn re(self) -> Self;
fn conj(self) -> Self; fn modulus_sqrd(self) -> Self { ... }
fn modulus(self) -> Self::Real { ... } }

An algebraic stucture that is a subset of the Complex numbers

This trait is both meant as an ensapsulation of the naturals, integers, real numbers, and complex numbers. This way, users can work with a particular set of similar-precision numeric types abstractly similarly to how they would normally.

Associated Types

type Real: Real + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>

type Natural: Natural + IntegerSubset<Signed = Self::Integer, Unsigned = Self::Natural> + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>

type Integer: Integer + IntegerSubset<Signed = Self::Integer, Unsigned = Self::Natural> + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>

Loading content...

Required methods

fn as_real(self) -> Self::Real

Converts self to a real number, discarding any imaginary component, if complex.

fn as_natural(self) -> Self::Natural

Converts self to a natural number, truncating when necessary.

fn as_integer(self) -> Self::Integer

Converts self to an integer, truncating when necessary.

fn floor(self) -> Self

Rounds the real and imaginary components of self to the closest integer downward

fn ceil(self) -> Self

Rounds the real and imaginary components of self to the closest integer upward

fn round(self) -> Self

Rounds the real and imaginary components of self to the closest integer

fn trunc(self) -> Self

Rounds the real and imaginary components of self by removing the factional parts

fn fract(self) -> Self

Removes the integral parts of the real and imaginary components of self

fn im(self) -> Self

Sets the real component of self to 0

fn re(self) -> Self

Sets the imaginary component of self to 0

fn conj(self) -> Self

The complex conjugate of self

Loading content...

Provided methods

fn modulus_sqrd(self) -> Self

The square of the complex absolute value of self

This is computed as self * self.conj() by default

fn modulus(self) -> Self::Real

The complex absolute value of self

This is computed as the square root of modulus_sqrd by default

Loading content...

Implementations on Foreign Types

impl ComplexSubset for f32[src]

type Real = f32

type Natural = u32

type Integer = i32

impl ComplexSubset for u32[src]

type Real = f32

type Natural = u32

type Integer = i32

impl ComplexSubset for i32[src]

type Real = f32

type Natural = u32

type Integer = i32

impl ComplexSubset for f64[src]

type Real = f64

type Natural = u64

type Integer = i64

impl ComplexSubset for u64[src]

type Real = f64

type Natural = u64

type Integer = i64

impl ComplexSubset for i64[src]

type Real = f64

type Natural = u64

type Integer = i64

Loading content...

Implementors

Loading content...