Skip to main content

QuantitySparseVec

Struct QuantitySparseVec 

Source
pub struct QuantitySparseVec<U = Dimensionless>(/* private fields */);
Expand description

A sparse vector of quantities, storing only inserted entries.

Implementations§

Source§

impl<U> QuantitySparseVec<U>

Source

pub fn entries(&self) -> impl Iterator<Item = (usize, &Quantity<U>)>

Trait Implementations§

Source§

impl<U> Add<&QuantitySparseVec<U>> for QuantitySparseVec<U>

Source§

type Output = QuantitySparseVec<U>

The resulting type after applying the + operator.
Source§

fn add(self, other: &Self) -> Self

Performs the + operation. Read more
Source§

impl<U> Add for QuantitySparseVec<U>

Source§

type Output = QuantitySparseVec<U>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl<U> AddAssign<&QuantitySparseVec<U>> for QuantitySparseVec<U>

Source§

fn add_assign(&mut self, other: &Self)

Performs the += operation. Read more
Source§

impl<U> AddAssign for QuantitySparseVec<U>

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl<U> Clone for QuantitySparseVec<U>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<U> Debug for QuantitySparseVec<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<U> Default for QuantitySparseVec<U>

Source§

fn default() -> Self

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

impl<U> Display for QuantitySparseVec<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<U> Div<f64> for QuantitySparseVec<U>

Source§

type Output = QuantitySparseVec<U>

The resulting type after applying the / operator.
Source§

fn div(self, scalar: TensorRank0) -> Self

Performs the / operation. Read more
Source§

impl<U> DivAssign<&f64> for QuantitySparseVec<U>

Source§

fn div_assign(&mut self, scalar: &TensorRank0)

Performs the /= operation. Read more
Source§

impl<U> DivAssign<f64> for QuantitySparseVec<U>

Source§

fn div_assign(&mut self, scalar: TensorRank0)

Performs the /= operation. Read more
Source§

impl<U> FromIterator<Quantity<U>> for QuantitySparseVec<U>

Source§

fn from_iter<T>(into_iterator: T) -> Self
where T: IntoIterator<Item = Quantity<U>>,

Creates a value from an iterator. Read more
Source§

impl<U> Index<usize> for QuantitySparseVec<U>

Source§

type Output = Quantity<U>

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

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

impl<U> IndexMut<usize> for QuantitySparseVec<U>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

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

impl<U> Mul<f64> for QuantitySparseVec<U>

Source§

type Output = QuantitySparseVec<U>

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: TensorRank0) -> Self

Performs the * operation. Read more
Source§

impl<U> MulAssign<&f64> for QuantitySparseVec<U>

Source§

fn mul_assign(&mut self, scalar: &TensorRank0)

Performs the *= operation. Read more
Source§

impl<U> MulAssign<f64> for QuantitySparseVec<U>

Source§

fn mul_assign(&mut self, scalar: TensorRank0)

Performs the *= operation. Read more
Source§

impl<U> PartialEq for QuantitySparseVec<U>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U> Sub<&QuantitySparseVec<U>> for QuantitySparseVec<U>

Source§

type Output = QuantitySparseVec<U>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Self) -> Self

Performs the - operation. Read more
Source§

impl<U> Sub for QuantitySparseVec<U>

Source§

type Output = QuantitySparseVec<U>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl<U> SubAssign<&QuantitySparseVec<U>> for QuantitySparseVec<U>

Source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
Source§

impl<U> SubAssign for QuantitySparseVec<U>

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl<U> Sum for QuantitySparseVec<U>

Source§

fn sum<T>(iter: T) -> Self
where T: Iterator<Item = Self>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<U> Tensor for QuantitySparseVec<U>

Source§

type Item = Quantity<U>

The type of item encountered when iterating over the tensor.
Source§

type Unit = U

The physical unit the tensor carries.
Source§

fn iter(&self) -> impl Iterator<Item = &Self::Item>

Returns an iterator. Read more
Source§

fn iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Item>

Returns an iterator that allows modifying each value. Read more
Source§

fn len(&self) -> usize

Returns the number of elements, also referred to as the ‘length’.
Source§

fn size(&self) -> usize

Returns the total number of entries.
Source§

fn error_count_zero(&self, tol_abs: Scalar, tol_rel: Scalar) -> Option<usize>

Returns number of nonzero entries given absolute and relative tolerances.
Source§

fn error_count( &self, other: &Self, tol_abs: Scalar, tol_rel: Scalar, ) -> Option<usize>

Returns number of different entries given absolute and relative tolerances.
Source§

fn full_contraction(&self, tensor: &Self) -> TensorRank0

Returns the full contraction with another tensor.
Source§

fn is_zero(&self) -> bool

Checks whether the tensor is the zero tensor.
Source§

fn norm(&self) -> Quantity<Self::Unit>

Returns the tensor norm.
Source§

fn norm_inf(&self) -> Quantity<Self::Unit>

Returns the infinity norm.
Source§

fn norm_l1(&self) -> Quantity<Self::Unit>

Returns the L1 (Manhattan) norm.
Source§

fn norm_p_sum(&self, p: TensorRank0) -> TensorRank0

Returns the sum of p-th powers of absolute values (used internally by norm_p).
Source§

fn norm_p(&self, p: TensorRank0) -> Quantity<Self::Unit>

Returns the Minkowski (Lp) norm.
Source§

fn norm_squared(&self) -> Quantity<Square<Self::Unit>>
where Self::Unit: UnitMul<Self::Unit>,

Returns the tensor norm squared, which carries the square of its unit.
Source§

fn normalize(&mut self)

Normalizes the tensor in place.
Source§

fn sub_abs(&self, other: &Self) -> Self

Returns the positive difference of the two tensors.
Source§

fn sub_rel(&self, other: &Self) -> Self

Returns the relative difference of the two tensors.

Auto Trait Implementations§

§

impl<U> Freeze for QuantitySparseVec<U>

§

impl<U> RefUnwindSafe for QuantitySparseVec<U>
where U: RefUnwindSafe,

§

impl<U> Send for QuantitySparseVec<U>
where U: Send,

§

impl<U> Sync for QuantitySparseVec<U>
where U: Sync,

§

impl<U> Unpin for QuantitySparseVec<U>
where U: Unpin,

§

impl<U> UnsafeUnpin for QuantitySparseVec<U>

§

impl<U> UnwindSafe for QuantitySparseVec<U>
where U: UnwindSafe,

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<'a, T> AssertEq<&'a T> for T
where T: Display + PartialEq + Tensor,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> Is<T> for T