pub struct DiagPlan<'a> { /* private fields */ }Expand description
Read-only diagonal extraction plan for one operand.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 0], &[0]], &[0]);
let tree = ContractionTree::from_pairs(&subs, &[&[3, 3], &[3]], &[(0, 1)]).unwrap();
let diag = tree.step_plan(0).unwrap().lhs_diag().unwrap();
assert_eq!(diag.result_subs(), &[0]);Implementations§
Source§impl<'a> DiagPlan<'a>
impl<'a> DiagPlan<'a>
Sourcepub fn stages(self) -> impl ExactSizeIterator<Item = DiagStage<'a>> + 'a
pub fn stages(self) -> impl ExactSizeIterator<Item = DiagStage<'a>> + 'a
Return the sequential diagonal extraction stages.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 0], &[0]], &[0]);
let tree = ContractionTree::from_pairs(&subs, &[&[3, 3], &[3]], &[(0, 1)]).unwrap();
let diag = tree.step_plan(0).unwrap().lhs_diag().unwrap();
let mut stages = diag.stages();
assert_eq!(stages.next().unwrap().axis_pairs(), &[(0, 1)]);
assert!(stages.next().is_none());Sourcepub fn result_subs(&self) -> &'a [u32]
pub fn result_subs(&self) -> &'a [u32]
Return final subscripts after all diagonal extraction stages.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 0], &[0]], &[0]);
let tree = ContractionTree::from_pairs(&subs, &[&[3, 3], &[3]], &[(0, 1)]).unwrap();
let diag = tree.step_plan(0).unwrap().lhs_diag().unwrap();
assert_eq!(diag.result_subs(), &[0]);Trait Implementations§
impl<'a> Copy for DiagPlan<'a>
Auto Trait Implementations§
impl<'a> Freeze for DiagPlan<'a>
impl<'a> RefUnwindSafe for DiagPlan<'a>
impl<'a> Send for DiagPlan<'a>
impl<'a> Sync for DiagPlan<'a>
impl<'a> Unpin for DiagPlan<'a>
impl<'a> UnsafeUnpin for DiagPlan<'a>
impl<'a> UnwindSafe for DiagPlan<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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