pub struct ContractionPlan {
pub batch: Vec<u8>,
pub contracted: Vec<u8>,
pub free_lhs: Vec<u8>,
pub free_rhs: Vec<u8>,
}Expand description
Contraction plan identifying batch, contracted, and free indices for a 2-input einsum.
- batch: indices in both inputs AND in output (iterated over, not contracted)
- contracted: indices in both inputs but NOT in output (summed over)
- free_lhs: indices only in lhs and output (not in rhs)
- free_rhs: indices only in rhs and output (not in lhs)
Fields§
§batch: Vec<u8>Indices in both inputs and the output (iterated over, not contracted).
contracted: Vec<u8>Indices in both inputs but not the output (summed over).
free_lhs: Vec<u8>Indices only in the lhs and the output.
free_rhs: Vec<u8>Indices only in the rhs and the output.
Implementations§
Source§impl ContractionPlan
impl ContractionPlan
Sourcepub fn from_expr(expr: &EinsumExpr) -> ContractionPlan
pub fn from_expr(expr: &EinsumExpr) -> ContractionPlan
Derive the batch / contracted / free index partition from a parsed einsum expression.
Trait Implementations§
Source§impl Clone for ContractionPlan
impl Clone for ContractionPlan
Source§fn clone(&self) -> ContractionPlan
fn clone(&self) -> ContractionPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContractionPlan
impl Debug for ContractionPlan
impl Eq for ContractionPlan
Source§impl PartialEq for ContractionPlan
impl PartialEq for ContractionPlan
Source§fn eq(&self, other: &ContractionPlan) -> bool
fn eq(&self, other: &ContractionPlan) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ContractionPlan
Auto Trait Implementations§
impl Freeze for ContractionPlan
impl RefUnwindSafe for ContractionPlan
impl Send for ContractionPlan
impl Sync for ContractionPlan
impl Unpin for ContractionPlan
impl UnsafeUnpin for ContractionPlan
impl UnwindSafe for ContractionPlan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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