#[repr(transparent)]
pub struct SimpleBlade<T: AllocBlade<N, G>, N: Dim, G: Dim> { /* private fields */ }
Expand description

A Blade that is the wedge product of G vectors

This is usually used to represent weighted vector spaces or when the cost to normalize to a UnitBlade is too high.

Implementations

Constructs a value with elements from an iterator using a generic shape

Constructs a value from an index function using a generic shape

Constructs a value filled with given element using a generic shape

Constructs a value cloned from a slice

Constructs a value from a Vec

Constructs a blade with all components set to zero using a generic shape

Returns the ith basis element or panics if i is out of range

Constructs a value using elements from an iterator

Panics if the iterator has too few elements to fill in the blade

Examples

let array = [0, 1, 2, 3, 4, 5];

let v1 = Vec6::from_iterator(0..); //static dim, static grade
let v2 = VecD::from_iterator(6, 0..); //dynamic dim, static grade
let v3 = Blade6::from_iterator(1, 0..); //static dim, dynamic grade
let v4 = BladeD::from_iterator(6, 1, 0..); //dynamic dim, dynamic grade

assert_eq!(v1.as_slice(), &array);
assert_eq!(v2.as_slice(), &array);
assert_eq!(v3.as_slice(), &array);
assert_eq!(v4.as_slice(), &array);

Constructs a value using a function mapping an index to an element

Examples

//computes the nth fibonnacci number
fn fib(n: usize) -> usize {
    if n <= 1 {
        1
    } else {
        fib(n-1) + fib(n-2)
    }
}

//5D bivector, so 10 elements
let array = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55];

let b1 = BiVec5::from_index_fn(fib); //static dim, static grade
let b2 = BiVecD::from_index_fn(5, fib); //dynamic dim, static grade
let b3 = Blade5::from_index_fn(2, fib); //static dim, dynamic grade
let b4 = BladeD::from_index_fn(5, 2, fib); //dynamic dim, dynamic grade

assert_eq!(b1.as_slice(), &array);
assert_eq!(b2.as_slice(), &array);
assert_eq!(b3.as_slice(), &array);
assert_eq!(b4.as_slice(), &array);

Constructs a value where every component is the given element

Examples

//4D Trivector, so 4 elements
let array = [6.28; 4];

let t1 = TriVec4::from_element(6.28); //static dim, static grade
let t2 = TriVecD::from_element(4, 6.28); //dynamic dim, static grade
let t3 = Blade4::from_element(3, 6.28); //static dim, dynamic grade
let t4 = BladeD::from_element(4, 3, 6.28); //dynamic dim, dynamic grade

assert_eq!(t1.as_slice(), &array);
assert_eq!(t2.as_slice(), &array);
assert_eq!(t3.as_slice(), &array);
assert_eq!(t4.as_slice(), &array);

Constructs an elements by cloning values from a slice

Panics if not enough values are provided


let values = [6, 2, 8, 3];

let v1 = Vec4::from_slice(&values);
let v2 = VecD::from_slice(4, &values);
let q = Even3::from_slice(&values);

assert_eq!(v1.as_slice(), &values);
assert_eq!(v2.as_slice(), &values);
assert_eq!(q.as_slice(), &values);

Constructs an elements by moving values from a Vec

Panics if not enough values are provided


let values = vec![6, 2, 8, 3];

let v1 = Vec4::from_vec(values.clone());
let v2 = VecD::from_vec(4, values.clone());
let q = Even3::from_vec(values.clone());

assert_eq!(v1.as_slice(), &*values);
assert_eq!(v2.as_slice(), &*values);
assert_eq!(q.as_slice(), &*values);

Constructs a value with all components set to zero

Examples

let array = [0.0; 4];

let v1 = Vec4::<f64>::zeroed(); //static dim, static grade
let v2 = VecD::<f64>::zeroed(4); //dynamic dim, static grade
let v3 = Blade4::<f64>::zeroed(1); //static dim, dynamic grade
let v4 = BladeD::<f64>::zeroed(4, 1); //dynamic dim, dynamic grade

assert_eq!(v1.as_slice(), &array);
assert_eq!(v2.as_slice(), &array);
assert_eq!(v3.as_slice(), &array);
assert_eq!(v4.as_slice(), &array);

Returns an element where the ith value is one and the rest are zeroes

Panics if i is out of range

Constructs a value using elements from an iterator

Panics if the iterator has too few elements to fill in the blade

Examples

let array = [0, 1, 2, 3, 4, 5];

let v1 = Vec6::from_iterator(0..); //static dim, static grade
let v2 = VecD::from_iterator(6, 0..); //dynamic dim, static grade
let v3 = Blade6::from_iterator(1, 0..); //static dim, dynamic grade
let v4 = BladeD::from_iterator(6, 1, 0..); //dynamic dim, dynamic grade

assert_eq!(v1.as_slice(), &array);
assert_eq!(v2.as_slice(), &array);
assert_eq!(v3.as_slice(), &array);
assert_eq!(v4.as_slice(), &array);

Constructs a value using a function mapping an index to an element

Examples

//computes the nth fibonnacci number
fn fib(n: usize) -> usize {
    if n <= 1 {
        1
    } else {
        fib(n-1) + fib(n-2)
    }
}

//5D bivector, so 10 elements
let array = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55];

let b1 = BiVec5::from_index_fn(fib); //static dim, static grade
let b2 = BiVecD::from_index_fn(5, fib); //dynamic dim, static grade
let b3 = Blade5::from_index_fn(2, fib); //static dim, dynamic grade
let b4 = BladeD::from_index_fn(5, 2, fib); //dynamic dim, dynamic grade

assert_eq!(b1.as_slice(), &array);
assert_eq!(b2.as_slice(), &array);
assert_eq!(b3.as_slice(), &array);
assert_eq!(b4.as_slice(), &array);

Constructs a value where every component is the given element

Examples

//4D Trivector, so 4 elements
let array = [6.28; 4];

let t1 = TriVec4::from_element(6.28); //static dim, static grade
let t2 = TriVecD::from_element(4, 6.28); //dynamic dim, static grade
let t3 = Blade4::from_element(3, 6.28); //static dim, dynamic grade
let t4 = BladeD::from_element(4, 3, 6.28); //dynamic dim, dynamic grade

assert_eq!(t1.as_slice(), &array);
assert_eq!(t2.as_slice(), &array);
assert_eq!(t3.as_slice(), &array);
assert_eq!(t4.as_slice(), &array);

Constructs an elements by cloning values from a slice

Panics if not enough values are provided


let values = [6, 2, 8, 3];

let v1 = Vec4::from_slice(&values);
let v2 = VecD::from_slice(4, &values);
let q = Even3::from_slice(&values);

assert_eq!(v1.as_slice(), &values);
assert_eq!(v2.as_slice(), &values);
assert_eq!(q.as_slice(), &values);

Constructs an elements by moving values from a Vec

Panics if not enough values are provided


let values = vec![6, 2, 8, 3];

let v1 = Vec4::from_vec(values.clone());
let v2 = VecD::from_vec(4, values.clone());
let q = Even3::from_vec(values.clone());

assert_eq!(v1.as_slice(), &*values);
assert_eq!(v2.as_slice(), &*values);
assert_eq!(q.as_slice(), &*values);

Constructs a value with all components set to zero

Examples

let array = [0.0; 4];

let v1 = Vec4::<f64>::zeroed(); //static dim, static grade
let v2 = VecD::<f64>::zeroed(4); //dynamic dim, static grade
let v3 = Blade4::<f64>::zeroed(1); //static dim, dynamic grade
let v4 = BladeD::<f64>::zeroed(4, 1); //dynamic dim, dynamic grade

assert_eq!(v1.as_slice(), &array);
assert_eq!(v2.as_slice(), &array);
assert_eq!(v3.as_slice(), &array);
assert_eq!(v4.as_slice(), &array);

Returns an element where the ith value is one and the rest are zeroes

Panics if i is out of range

Unrwaps self into its internal algebraic type

Unrwaps self into a reference to its internal algebraic type

Creates a new value of Self from an internal algebraic type assuming that it satisfies all the guarrantees of this type

Safety

This function is not marked unsafe since there is no way an invalid argument could violate any of Rust’s memory safety rules. However, caution should still be taken since an invalid input can still dramatically break many other functions of this type.

Unwraps self and a mutable reference of its inner algebraic struct

Creates a new value of Self from its inner algebraic struct

Since T:AllocSimpleBlade<N,G>, this is guarranteed to satisfy all the preconditions of this type

Reverses the order of the vectors in each basis blade

Negates self of each component with an odd grade

The multiplicative inverse of this element

Divides self by its norm

Divides self by its norm if it is non-zero

Normalizes self and returns its norm and normalization

Normalizes self and returns its norm and normalization if non-zero

Finds the parallel component of b onto self

Finds the perpendicular component of b onto self

Reflects about self

Computes the exponential of this bivector as a Rotor

This will produce a Rotor that performs a simple rotation in the plane of self by an angle twice the norm of self

This is almost always faster than [BiVecN::exp_rotor()], but can only result in simple rotations.

Embeds self into a different dimension by either removing elements or inserting zeros

Embeds self into a different dimension by either removing elements or inserting zeros

Embeds self into a different dimension by either removing elements or inserting zeros

Finds the dual of this simple blade. See Blade::dual() for more information

Finds the inverse dual of this simple blade. See Blade::undual() for more information

Constructs a SimpleVec1 directly from components

Examples
let arr = [6];
let x = SimpleVec1::new(6);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleVec2 directly from components

Examples
let arr = [6, 2];
let x = SimpleVec2::new(6, 2);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleVec3 directly from components

Examples
let arr = [6, 2, 8];
let x = SimpleVec3::new(6, 2, 8);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleVec4 directly from components

Examples
let arr = [6, 2, 8, 3];
let x = SimpleVec4::new(6, 2, 8, 3);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleVec5 directly from components

Examples
let arr = [6, 2, 8, 3, 1];
let x = SimpleVec5::new(6, 2, 8, 3, 1);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleVec6 directly from components

Examples
let arr = [6, 2, 8, 3, 1, 8];
let x = SimpleVec6::new(6, 2, 8, 3, 1, 8);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleBiVec3 directly from components

Examples
let arr = [6, 2, 8];
let x = SimpleBiVec3::new(6, 2, 8);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleTriVec4 directly from components

Examples
let arr = [6, 2, 8, 3];
let x = SimpleTriVec4::new(6, 2, 8, 3);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleQuadVec5 directly from components

Examples
let arr = [6, 2, 8, 3, 1];
let x = SimpleQuadVec5::new(6, 2, 8, 3, 1);

assert_eq!(x.as_slice(), &arr);

Constructs a SimplePentVec6 directly from components

Examples
let arr = [6, 2, 8, 3, 1, 8];
let x = SimplePentVec6::new(6, 2, 8, 3, 1, 8);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleBiVec2 directly from components

Examples
let arr = [6];
let x = SimpleBiVec2::new(6);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleTriVec3 directly from components

Examples
let arr = [6];
let x = SimpleTriVec3::new(6);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleQuadVec4 directly from components

Examples
let arr = [6];
let x = SimpleQuadVec4::new(6);

assert_eq!(x.as_slice(), &arr);

Constructs a SimplePentVec5 directly from components

Examples
let arr = [6];
let x = SimplePentVec5::new(6);

assert_eq!(x.as_slice(), &arr);

Constructs a SimpleHexVec6 directly from components

Examples
let arr = [6];
let x = SimpleHexVec6::new(6);

assert_eq!(x.as_slice(), &arr);

Creates a new SimpleScalar directly from its component

use wedged::subspace::*;
use wedged::base::U1;

let x = 6.2831;
let s = SimpleScalar::<_,U1>::new(x);

assert_eq!(s.value, x);

Creates a psuedoscalar directly from its component

use wedged::subspace::*;
use wedged::base::U3;

let x = 6.2831;
let s = SimpleBlade::<_,U3,U3>::new_psuedoscalar(x);

assert_eq!(s.value, x);
assert_eq!(s.grade(), 3);

Returns the unit psuedoscalar in dimension N

Methods from Deref<Target = Blade<T, N, G>>

Returns the dimension of this value as an instance of the generic type N

This is mostly used internally to unify the codebase between Const dimensions and Dynamic dimensions. Since Dynamic grades often require a usize input when Const grades do not, this allows a function to take a ZST for static dimensions and to take a numeric value for dynamic ones

Returns the grade of this Blade as an instance of the generic type G

This is mostly used internally to unify the codebase between Const grades and Dynamic grades. Since Dynamic grades often require a usize input when Const grades do not, this allows a function to take a ZST for static Blades and to take a numeric value for dynamic ones

The number of dimensions this value resides in

Note that this differs from both the grade and number of elements. Instead, this describes the dimension of the vector space generating the algebra this blade resides in.

Examples

//All of these live in 3-dimensions
let v = Vec3::new(3, 1, 4);
let b = BiVec3::new(6, 2, 8);
let r = Even3::new(1, 6, 1, 8);
let m = Multivector3::new(0, 5, 7, 7, 2, 1, 5, 6);

assert_eq!(v.dim(), 3);
assert_eq!(b.dim(), 3);
assert_eq!(r.dim(), 3);
assert_eq!(m.dim(), 3);

//whereas these are in 4D
let v = Vec4::from_element(6);
let b = BiVec4::from_element(2);
let r = Even4::from_element(8);
let m = Multivector4::from_element(3);

assert_eq!(v.dim(), 4);
assert_eq!(b.dim(), 4);
assert_eq!(r.dim(), 4);
assert_eq!(m.dim(), 4);

The grade of this blade

This describes the “dimension” of the vector space this blade represents. Note that this is completely different that the dimension of the blade which describes the the dimension of the surrounding space the blade lives in.

More concretely, the grade is the number of vector basis elements multiplied together to get a basis of this blade. So to get a blade of grade 3, you would need to wedge three vectors together.

Examples

//All vectors are grade 1
let v1 = Vec3::new(6, 2, 8);
let v2 = Vec6::new(6, 2, 8, 3, 1, 8);
let v3 = VecD::from_element(2, 0.0);

assert_eq!(v1.grade(), 1);
assert_eq!(v2.grade(), 1);
assert_eq!(v3.grade(), 1);

//All Bivectors are grade 2
let b1 = BiVec4::new(6, 2, 8, 3, 1, 8);
let b2 = BiVecD::from_element(3, 0.0);

assert_eq!(b1.grade(), 2);
assert_eq!(b2.grade(), 2);

//Dynamic blades
let blade1 = Blade6::from_element(5, 0.0);
let blade2 = BladeD::from_element(4, 3, 0.0);

assert_eq!(blade1.grade(), 5);
assert_eq!(blade2.grade(), 3);

The number of coordinates this value has

Note that for all values besides vectors and psuedovectors, this is completely different than the dimension which instead measures the dimension of the space the value lives in.

  • For blades, this value is equal to number of combinations of size self.grade() you can make from self.dim() basis vectors, ie binom(self.dim(), self.grade()).
  • For even values, the number of elements is 2^(self.dim()-1) with the exception of 1 when the dimension is 0
  • For general multivectors, there are 2^self.dim() components

Finally, note that in all cases, the value returned is either a compile-time constant or cached as the length of some array, so there is no computational overhead to this function.

Examples

let v = Vec4::from_element(0);
let b = BiVec4::from_element(0);
let r = Even4::from_element(0);
let m = Multivector4::from_element(0);

assert_eq!(v.elements(), 4); // (4 choose 1) = 4
assert_eq!(b.elements(), 6); // (4 choose 2) = 6
assert_eq!(r.elements(), 8); // 2^(4-1) = 8
assert_eq!(m.elements(), 16); // 2^4 = 16

Borrows the components of this value as a slice

Borrows the components of this value as a mutable slice

Creates an iterator over references of each component

Creates an iterator over mutable references of each component

True if the grade if this blade is even

True if the grade if this blade is odd

True if blades if this grade square to positive numbers

True if blades if this grade square to negative numbers

Determines if the dimension and grade of two Blades are equal

The sum of squares of each element

Note that this does not take into account the conjugate of any complex elements. This is by explicit design:

  1. We can relax the ComplexField requirement and have more possibilies for scalars types (like polynomials!).
  2. For vectors, this should give the quadradic form of the Clifford algebra, but the function Q(z) = zz̅ is not a valid quadradic form

The square root of the sum of squares of each element

As with norm_squared, this does not take into account the complex conjugate even though ComplexField is a requirement.

Finds the parallel component of b onto self

Finds the perpendicular component of b onto self

Reflects about self

Trait Implementations

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of AbsDiffEq::abs_diff_eq.

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of AbsDiffEq::abs_diff_eq.

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of AbsDiffEq::abs_diff_eq.

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of AbsDiffEq::abs_diff_eq.

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of AbsDiffEq::abs_diff_eq.

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Formats the value using the given formatter.

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

Immutably borrows from an owned value. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

Formats the value using the given formatter.

Formats the value using the given formatter.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

Formats the value using the given formatter.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

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

This method tests for !=.

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of RelativeEq::relative_eq.

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of RelativeEq::relative_eq.

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of RelativeEq::relative_eq.

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of RelativeEq::relative_eq.

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of RelativeEq::relative_eq.

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of UlpsEq::ulps_eq.

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of UlpsEq::ulps_eq.

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of UlpsEq::ulps_eq.

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of UlpsEq::ulps_eq.

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of UlpsEq::ulps_eq.

Formats the value using the given formatter.

Formats the value using the given formatter.

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.