pub trait Tensorwhere
for<'a> Self: Sized + Add<Self, Output = Self> + Add<&'a Self, Output = Self> + AddAssign + AddAssign<&'a Self> + Clone + Debug + Default + Display + Div<TensorRank0, Output = Self> + DivAssign<TensorRank0> + DivAssign<&'a TensorRank0> + Mul<TensorRank0, Output = Self> + MulAssign<TensorRank0> + MulAssign<&'a TensorRank0> + Sub<Self, Output = Self> + Sub<&'a Self, Output = Self> + SubAssign + SubAssign<&'a Self> + Sum,
Self::Item: Tensor,{
type Item;
Show 14 methods
// Required methods
fn iter(&self) -> impl Iterator<Item = &Self::Item>;
fn iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Item>;
fn len(&self) -> usize;
fn size(&self) -> usize;
// Provided methods
fn error_count(
&self,
other: &Self,
tol_abs: Scalar,
tol_rel: Scalar,
) -> Option<usize> { ... }
fn full_contraction(&self, tensor: &Self) -> TensorRank0 { ... }
fn is_zero(&self) -> bool { ... }
fn norm(&self) -> TensorRank0 { ... }
fn norm_inf(&self) -> TensorRank0 { ... }
fn norm_squared(&self) -> TensorRank0 { ... }
fn normalize(&mut self) { ... }
fn normalized(self) -> Self { ... }
fn sub_abs(&self, other: &Self) -> Self { ... }
fn sub_rel(&self, other: &Self) -> Self { ... }
}Expand description
Common methods for tensors.
Required Associated Types§
Required Methods§
Sourcefn iter(&self) -> impl Iterator<Item = &Self::Item>
fn iter(&self) -> impl Iterator<Item = &Self::Item>
Returns an iterator.
The iterator yields all items from start to end. Read more
Provided Methods§
Sourcefn error_count(
&self,
other: &Self,
tol_abs: Scalar,
tol_rel: Scalar,
) -> Option<usize>
fn error_count( &self, other: &Self, tol_abs: Scalar, tol_rel: Scalar, ) -> Option<usize>
Returns number of different entries given absolute and relative tolerances.
Sourcefn full_contraction(&self, tensor: &Self) -> TensorRank0
fn full_contraction(&self, tensor: &Self) -> TensorRank0
Returns the full contraction with another tensor.
Sourcefn norm(&self) -> TensorRank0
fn norm(&self) -> TensorRank0
Returns the tensor norm.
Sourcefn norm_inf(&self) -> TensorRank0
fn norm_inf(&self) -> TensorRank0
Returns the infinity norm.
Sourcefn norm_squared(&self) -> TensorRank0
fn norm_squared(&self) -> TensorRank0
Returns the tensor norm squared.
Sourcefn normalized(self) -> Self
fn normalized(self) -> Self
Returns the tensor normalized.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.