pub struct EinBuilder<L: Label = usize> { /* private fields */ }Expand description
Builder for constructing einsum specifications.
§Example
use omeinsum::EinBuilder;
let ein = EinBuilder::new()
.input(&[0, 1]) // A[i,j]
.input(&[1, 2]) // B[j,k]
.output(&[0, 2]) // C[i,k]
.size(0, 10) // i has size 10
.size(1, 20) // j has size 20
.size(2, 30) // k has size 30
.build();Implementations§
Source§impl<L: Label> EinBuilder<L>
impl<L: Label> EinBuilder<L>
Sourcepub fn sizes(self, sizes: impl IntoIterator<Item = (L, usize)>) -> Self
pub fn sizes(self, sizes: impl IntoIterator<Item = (L, usize)>) -> Self
Set multiple sizes at once.
Trait Implementations§
Auto Trait Implementations§
impl<L> Freeze for EinBuilder<L>
impl<L> RefUnwindSafe for EinBuilder<L>where
L: RefUnwindSafe,
impl<L> Send for EinBuilder<L>
impl<L> Sync for EinBuilder<L>
impl<L> Unpin for EinBuilder<L>where
L: Unpin,
impl<L> UnwindSafe for EinBuilder<L>where
L: UnwindSafe,
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