pub struct TensorRegistry { /* private fields */ }Expand description
Complete tensor specification: which function heads are tensors and what symmetries their slots have.
Implementations§
Source§impl TensorRegistry
impl TensorRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, name: Symbol, spec: SymmetrySpec)
pub fn register(&mut self, name: Symbol, spec: SymmetrySpec)
Register a tensor with its slot symmetry spec.
Sourcepub fn set_index_group(&mut self, label: Symbol, group: u64)
pub fn set_index_group(&mut self, label: Symbol, group: u64)
Set the index group for a label (e.g. “mu” → 1 for spacetime, “i” → 2 for internal).
Sourcepub fn spec(&self, name: Symbol) -> Option<&SymmetrySpec>
pub fn spec(&self, name: Symbol) -> Option<&SymmetrySpec>
Look up a tensor’s symmetry spec.
Sourcepub fn index_group(&self, label: Symbol) -> u64
pub fn index_group(&self, label: Symbol) -> u64
Look up an index label’s group (0 = ungrouped/default).
Trait Implementations§
Source§impl Clone for TensorRegistry
impl Clone for TensorRegistry
Source§fn clone(&self) -> TensorRegistry
fn clone(&self) -> TensorRegistry
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 TensorRegistry
impl Debug for TensorRegistry
Source§impl Default for TensorRegistry
impl Default for TensorRegistry
Source§fn default() -> TensorRegistry
fn default() -> TensorRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TensorRegistry
impl RefUnwindSafe for TensorRegistry
impl Send for TensorRegistry
impl Sync for TensorRegistry
impl Unpin for TensorRegistry
impl UnsafeUnpin for TensorRegistry
impl UnwindSafe for TensorRegistry
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,
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