#[non_exhaustive]pub enum ScalarDomain {
Field,
NonField,
}Expand description
Algebra that a scalar’s ordinary arithmetic belongs to.
§Examples
use tenferro_tensor_core::{Scalar, ScalarDomain};
assert_eq!(<f64 as Scalar>::DOMAIN, ScalarDomain::Field);
assert_eq!(<bool as Scalar>::DOMAIN, ScalarDomain::NonField);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Field
Addition, subtraction, multiplication, and multiplication by a negative value follow the ordinary real or complex field rules, so the canonical mathematical derivative definitions apply.
NonField
Any other algebra: tropical or min-plus, boolean, saturating, or another semiring. Such a scalar can still be stored and computed with, but the canonical field derivative rules are not valid for it.
Trait Implementations§
Source§impl Clone for ScalarDomain
impl Clone for ScalarDomain
Source§fn clone(&self) -> ScalarDomain
fn clone(&self) -> ScalarDomain
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 moreimpl Copy for ScalarDomain
Source§impl Debug for ScalarDomain
impl Debug for ScalarDomain
impl Eq for ScalarDomain
Source§impl PartialEq for ScalarDomain
impl PartialEq for ScalarDomain
impl StructuralPartialEq for ScalarDomain
Auto Trait Implementations§
impl Freeze for ScalarDomain
impl RefUnwindSafe for ScalarDomain
impl Send for ScalarDomain
impl Sync for ScalarDomain
impl Unpin for ScalarDomain
impl UnsafeUnpin for ScalarDomain
impl UnwindSafe for ScalarDomain
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