Skip to main content

TensorRank2SparseVec2DSymmetric

Struct TensorRank2SparseVec2DSymmetric 

Source
pub struct TensorRank2SparseVec2DSymmetric<const D: usize, const I: usize, const J: usize>(/* private fields */);
Expand description

A vector of sparse vectors of rank-2 tensors, storing only the symmetric half.

The underlying block matrix is known to be symmetric under index-pair transpose, meaning block(a, b) == block(b, a)ᵀ for every pair of block indices. Only the canonical (row <= column) half of the blocks is stored; entries on the other side are reconstructed by transposing on lookup instead of being duplicated in memory.

Implementations§

Source§

impl<const D: usize, const I: usize, const J: usize> TensorRank2SparseVec2DSymmetric<D, I, J>

Source

pub fn zero(len: usize) -> Self

Trait Implementations§

Source§

impl<const D: usize, const I: usize, const J: usize> Add<&TensorRank2SparseVec2DSymmetric<D, I, J>> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Output = TensorRank2SparseVec2DSymmetric<D, I, J>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Add for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Output = TensorRank2SparseVec2DSymmetric<D, I, J>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> AddAssign<&TensorRank2SparseVec2DSymmetric<D, I, J>> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

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

Performs the += operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> AddAssign for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> AssertEq for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

impl<const D: usize, const I: usize, const J: usize> AssertFd for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

impl<const D: usize, const I: usize, const J: usize> Clone for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn clone(&self) -> TensorRank2SparseVec2DSymmetric<D, I, J>

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<const D: usize, const I: usize, const J: usize> Debug for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

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

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

impl<const D: usize, const I: usize, const J: usize> Default for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn default() -> TensorRank2SparseVec2DSymmetric<D, I, J>

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

impl<const D: usize, const I: usize, const J: usize> Display for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

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

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

impl<const D: usize, const I: usize, const J: usize> Div<TensorRank2SparseVec2DSymmetric<D, I, J>> for &TensorRank1Vec<D, I>

Source§

type Output = TensorVector<TensorRank1<D, J>>

The resulting type after applying the / operator.
Source§

fn div( self, _tensor_rank_2_sparse_symmetric_vec_2d: TensorRank2SparseVec2DSymmetric<D, I, J>, ) -> Self::Output

Performs the / operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Div<f64> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Output = TensorRank2SparseVec2DSymmetric<D, I, J>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> DivAssign<&f64> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

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

Performs the /= operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> DivAssign<f64> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn div_assign(&mut self, scalar: TensorRank0)

Performs the /= operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> FiniteDifference for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn error_fd( &self, comparator: &Self, epsilon: TensorRank0, ) -> Option<(bool, usize)>

Source§

impl<const D: usize, const I: usize, const J: usize> Hessian for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn entry(&self, row: usize, column: usize) -> Scalar

The entry at the given (row, column) position.
Source§

fn fill_into(self, square_matrix: &mut SquareMatrix)

Fills the Hessian into a square matrix.
Source§

fn retain_from(self, retained: &[bool]) -> SquareMatrix

Return only the retained indices.
Source§

impl<const D: usize, const I: usize> HessianAccumulate<D, I> for TensorRank2SparseVec2DSymmetric<D, I, I>

Source§

fn accumulate(&mut self, a: usize, b: usize, block: TensorRank2<D, I, I>)

Source§

impl<const D: usize, const I: usize, const J: usize> Mul<f64> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Output = TensorRank2SparseVec2DSymmetric<D, I, J>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> MulAssign<&f64> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

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

Performs the *= operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> MulAssign<f64> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn mul_assign(&mut self, scalar: TensorRank0)

Performs the *= operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> PartialEq for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn eq(&self, other: &TensorRank2SparseVec2DSymmetric<D, I, J>) -> 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<B, const D: usize> SecondOrderMinimize<f64, TensorVector<TensorRank1<D, 1>>, TensorRank2SparseVec2DSymmetric<D, 1, 1>, TensorVector<TensorRank1<D, 1>>> for Model<B, D>

Source§

impl<const D: usize, const I: usize, const J: usize> Sub<&TensorRank2SparseVec2DSymmetric<D, I, J>> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Output = TensorRank2SparseVec2DSymmetric<D, I, J>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Sub for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Output = TensorRank2SparseVec2DSymmetric<D, I, J>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> SubAssign<&TensorRank2SparseVec2DSymmetric<D, I, J>> for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

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

Performs the -= operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> SubAssign for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl<const D: usize, const I: usize, const J: usize> Sum for TensorRank2SparseVec2DSymmetric<D, I, J>

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<const D: usize, const I: usize, const J: usize> Tensor for TensorRank2SparseVec2DSymmetric<D, I, J>

Source§

type Item = TensorRank2SparseVec<D, I, J>

The type of item encountered when iterating over the tensor.
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, compared against zero.
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) -> TensorRank0

Returns the tensor norm.
Source§

fn norm_inf(&self) -> TensorRank0

Returns the infinity norm.
Source§

fn norm_l1(&self) -> TensorRank0

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) -> TensorRank0

Returns the Minkowski (Lp) norm.
Source§

fn norm_squared(&self) -> TensorRank0

Returns the tensor norm squared.
Source§

fn normalize(&mut self)

Normalizes the tensor.
Source§

fn normalized(self) -> Self

Returns the tensor normalized.
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.
Source§

impl<const D: usize, const I: usize, const J: usize> StructuralPartialEq for TensorRank2SparseVec2DSymmetric<D, I, J>

Auto Trait Implementations§

§

impl<const D: usize, const I: usize, const J: usize> Freeze for TensorRank2SparseVec2DSymmetric<D, I, J>

§

impl<const D: usize, const I: usize, const J: usize> RefUnwindSafe for TensorRank2SparseVec2DSymmetric<D, I, J>

§

impl<const D: usize, const I: usize, const J: usize> Send for TensorRank2SparseVec2DSymmetric<D, I, J>

§

impl<const D: usize, const I: usize, const J: usize> Sync for TensorRank2SparseVec2DSymmetric<D, I, J>

§

impl<const D: usize, const I: usize, const J: usize> Unpin for TensorRank2SparseVec2DSymmetric<D, I, J>

§

impl<const D: usize, const I: usize, const J: usize> UnsafeUnpin for TensorRank2SparseVec2DSymmetric<D, I, J>

§

impl<const D: usize, const I: usize, const J: usize> UnwindSafe for TensorRank2SparseVec2DSymmetric<D, I, J>

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<'a, T> AssertFd<&'a T> for T

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.