pub enum EinsumOperand<'a> {
F64(StridedData<'a, f64>),
C64(StridedData<'a, Complex64>),
}Expand description
A type-erased einsum operand holding either f64 or Complex64 strided data.
Variants§
F64(StridedData<'a, f64>)
C64(StridedData<'a, Complex64>)
Implementations§
Source§impl<'a> EinsumOperand<'a>
impl<'a> EinsumOperand<'a>
Sourcepub fn permuted(self, perm: &[usize]) -> Result<Self>
pub fn permuted(self, perm: &[usize]) -> Result<Self>
Permute dimensions (metadata-only reorder, no data copy).
Sourcepub fn from_view<T: EinsumScalar>(view: &StridedView<'a, T>) -> Self
pub fn from_view<T: EinsumScalar>(view: &StridedView<'a, T>) -> Self
Create an EinsumOperand from a borrowed strided view.
Type inference selects the correct variant (F64 or C64) from the view’s element type.
Sourcepub fn to_c64_owned_ref(&self) -> EinsumOperand<'static>
pub fn to_c64_owned_ref(&self) -> EinsumOperand<'static>
Promote to an owned Complex64 operand by borrowing the data.
Unlike to_c64_owned, this works on &self and always copies.
Sourcepub fn to_c64_owned(self) -> EinsumOperand<'static>
pub fn to_c64_owned(self) -> EinsumOperand<'static>
Promote to an owned Complex64 operand.
- If already C64 and owned, returns as-is.
- If C64 view, copies into an owned array.
- If F64, converts each element to
Complex64and returns an owned array.
Trait Implementations§
Source§impl<'a> Debug for EinsumOperand<'a>
impl<'a> Debug for EinsumOperand<'a>
Source§impl From<StridedArray<Complex<f64>>> for EinsumOperand<'static>
impl From<StridedArray<Complex<f64>>> for EinsumOperand<'static>
Source§fn from(arr: StridedArray<Complex64>) -> Self
fn from(arr: StridedArray<Complex64>) -> Self
Converts to this type from the input type.
Source§impl From<StridedArray<f64>> for EinsumOperand<'static>
impl From<StridedArray<f64>> for EinsumOperand<'static>
Source§fn from(arr: StridedArray<f64>) -> Self
fn from(arr: StridedArray<f64>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for EinsumOperand<'a>
impl<'a> RefUnwindSafe for EinsumOperand<'a>
impl<'a> Send for EinsumOperand<'a>
impl<'a> Sync for EinsumOperand<'a>
impl<'a> Unpin for EinsumOperand<'a>
impl<'a> UnwindSafe for EinsumOperand<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more