pub struct ConjMask { /* private fields */ }Expand description
Per-operand conjugation of an einsum: operand i is conjugated when entry
i is Conj::Yes. Missing entries are Conj::No; the default
conjugates nothing.
§Examples
use tenferro_einsum::ConjMask;
use tenferro_tensor::Conj;
let mask = ConjMask::new([Conj::Yes, Conj::No]);
assert_eq!(mask.get(0), Conj::Yes);
assert_eq!(mask.get(5), Conj::No);
assert!(ConjMask::default().is_none());Implementations§
Source§impl ConjMask
impl ConjMask
Sourcepub fn new(operands: impl IntoIterator<Item = Conj>) -> Self
pub fn new(operands: impl IntoIterator<Item = Conj>) -> Self
A mask with one entry per leading operand.
§Examples
use tenferro_einsum::ConjMask;
use tenferro_tensor::Conj;
assert_eq!(ConjMask::new([Conj::No, Conj::Yes]).len(), 2);Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of explicit entries.
§Examples
use tenferro_einsum::ConjMask;
assert_eq!(ConjMask::default().len(), 0);Trait Implementations§
impl Eq for ConjMask
impl StructuralPartialEq for ConjMask
Auto Trait Implementations§
impl Freeze for ConjMask
impl RefUnwindSafe for ConjMask
impl Send for ConjMask
impl Sync for ConjMask
impl Unpin for ConjMask
impl UnsafeUnpin for ConjMask
impl UnwindSafe for ConjMask
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T, U> Imply<T> for U
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