Struct ValueType
pub struct ValueType { /* private fields */ }Description
Checked mathematical value type. Support and activation belong to its use site.
Implementations§
§impl ValueType
impl ValueType
pub fn hermitian_eigenpair_types(
&self,
metric: &ValueType,
) -> Result<(ValueType, ValueType), InvalidValueType>
pub fn hermitian_eigenpair_types( &self, metric: &ValueType, ) -> Result<(ValueType, ValueType), InvalidValueType>
Derive (eigenvalue, mode) types for a Hermitian pencil A u = lambda B u.
Both maps must be endomorphisms of the same declared orthonormal basis.
Eigenvalues are real with dimension A/B; modes have dimension
B^(-1/2) for the dimensionless normalization uᴴ B u = 1.
Either complex map requires complex modes. A standard eigenproblem uses
an explicitly dimensionless identity metric in the same basis.
This checks types only. Execution must still verify that the coefficients are Hermitian and that the metric is positive definite.
§impl ValueType
impl ValueType
pub fn coordinates(
basis: FiniteBasis,
domain: ScalarDomain,
dimension: DimExponents,
) -> Result<ValueType, InvalidValueType>
pub fn coordinates( basis: FiniteBasis, domain: ScalarDomain, dimension: DimExponents, ) -> Result<ValueType, InvalidValueType>
Numeric coordinates in one primal or dual basis. Integer coordinates describe the primal lattice; duals require real or complex scalars.
pub fn counts(
space: Id<FiniteSpace>,
extent: u32,
) -> Result<ValueType, InvalidValueType>
pub fn counts( space: Id<FiniteSpace>, extent: u32, ) -> Result<ValueType, InvalidValueType>
Nonnegative counts in one primal basis, distinct from signed coordinates.
pub fn linear_map(
source: FiniteBasis,
target: FiniteBasis,
domain: ScalarDomain,
dimension: DimExponents,
) -> Result<ValueType, InvalidValueType>
pub fn linear_map( source: FiniteBasis, target: FiniteBasis, domain: ScalarDomain, dimension: DimExponents, ) -> Result<ValueType, InvalidValueType>
A real or complex linear map with ordered input and output basis identities. Storage axes are output rows followed by input columns; physical dimension is the map’s.
pub const fn coordinate_basis(&self) -> Option<FiniteBasis>
pub const fn coordinate_basis(&self) -> Option<FiniteBasis>
Basis of a coordinate type; None for counts and linear maps.
pub const fn map_bases(&self) -> Option<(FiniteBasis, FiniteBasis)>
pub const fn map_bases(&self) -> Option<(FiniteBasis, FiniteBasis)>
Ordered input and output bases of a linear map.
pub fn finite_bases(&self) -> impl Iterator<Item = FiniteBasis>
pub fn finite_bases(&self) -> impl Iterator<Item = FiniteBasis>
Every nominal finite basis referenced by this type, input before output for maps.
pub const fn finite_space(&self) -> Option<Id<FiniteSpace>>
pub const fn finite_space(&self) -> Option<Id<FiniteSpace>>
Single finite declaration of a coordinate or count; maps have two explicit bases.
§impl ValueType
impl ValueType
pub const MAX_ENUM_MEMBERS: u32 = 65_536
pub const MAX_ENUM_MEMBERS: u32 = 65_536
Shared finite enum declaration bound; executable case DAGs have separate limits.
pub fn enumeration(
definition: Id<Enum>,
member_count: u32,
) -> Result<ValueType, InvalidValueType>
pub fn enumeration( definition: Id<Enum>, member_count: u32, ) -> Result<ValueType, InvalidValueType>
One closed nominal enum declaration; members are not numeric ordinals.
pub const fn enum_definition(&self) -> Option<Id<Enum>>
pub const fn enum_definition(&self) -> Option<Id<Enum>>
Exact enum declaration identity.
pub const fn enum_member_count(&self) -> Option<u32>
pub const fn enum_member_count(&self) -> Option<u32>
Declared member count, checked against the declaration during semantic validation.
pub fn boolean() -> ValueType
pub fn boolean() -> ValueType
Dimensionless invariant logical scalar, distinct from every numeric domain.
pub fn index(
set: Id<IndexSet>,
extent: u32,
) -> Result<ValueType, InvalidValueType>
pub fn index( set: Id<IndexSet>, extent: u32, ) -> Result<ValueType, InvalidValueType>
Ordinal bounded by one IndexSet declaration.
pub const fn index_set(&self) -> Option<Id<IndexSet>>
pub const fn index_set(&self) -> Option<Id<IndexSet>>
IndexSet identity; None for ordinary integers.
pub const fn index_extent(&self) -> Option<u32>
pub const fn index_extent(&self) -> Option<u32>
Declared exclusive index bound, validated against the semantic declaration.
pub fn with_common_scalar_domain(self, other: &ValueType) -> Option<ValueType>
pub fn with_common_scalar_domain(self, other: &ValueType) -> Option<ValueType>
Promote scalar components to the smallest common domain without changing their roles.
pub fn array(self, extent: u32) -> Result<ValueType, InvalidValueType>
pub fn array(self, extent: u32) -> Result<ValueType, InvalidValueType>
Wrap this complete element type in one ordered channel-array axis.
§Errors
Rejects a zero extent or an unrepresentable component count.
pub const fn array_rank(&self) -> usize
pub const fn array_rank(&self) -> usize
Number of outer channel-array axes, distinct from inner spatial axes.
pub fn with_dimension(
self,
dimension: DimExponents,
) -> Result<ValueType, InvalidValueType>
pub fn with_dimension( self, dimension: DimExponents, ) -> Result<ValueType, InvalidValueType>
Preserve the scalar domain and component meaning with a checked derived dimension.
pub fn scalar(
scalar_domain: ScalarDomain,
dimension: DimExponents,
) -> Result<ValueType, InvalidValueType>
pub fn scalar( scalar_domain: ScalarDomain, dimension: DimExponents, ) -> Result<ValueType, InvalidValueType>
Construct a checked invariant scalar type. Nominal enums require enumeration.
pub fn shaped(
scalar_domain: ScalarDomain,
dimension: DimExponents,
shape: ValueShape,
frame: ValueFrame,
) -> Result<ValueType, InvalidValueType>
pub fn shaped( scalar_domain: ScalarDomain, dimension: DimExponents, shape: ValueShape, frame: ValueFrame, ) -> Result<ValueType, InvalidValueType>
Construct exact channel axes (invariant) or spatial axes (Cartesian).
Wrap spatial elements with Self::array for arrays of vectors or tensors.
§Errors
Rejects an unrepresentable component count or a frame-bearing scalar.
pub const fn scalar_domain(&self) -> ScalarDomain
pub const fn scalar_domain(&self) -> ScalarDomain
Mathematical domain of each scalar component.
pub const fn dimension(&self) -> DimExponents
pub const fn dimension(&self) -> DimExponents
Exact physical dimension of each component.
pub const fn shape(&self) -> &ValueShape
pub const fn shape(&self) -> &ValueShape
Ordered mathematical component extents.
pub const fn frame(&self) -> ValueFrame
pub const fn frame(&self) -> ValueFrame
Coordinate-frame meaning of the components.
Trait Implementations§
§impl Clone for ValueType
impl Clone for ValueType
§impl Debug for ValueType
impl Debug for ValueType
§impl Hash for ValueType
impl Hash for ValueType
§fn hash<__H>(&self, state: &mut __H)where
__H: Hasher,
fn hash<__H>(&self, state: &mut __H)where
__H: Hasher,
§impl PartialEq for ValueType
impl PartialEq for ValueType
§fn eq(&self, other: &ValueType) -> bool
fn eq(&self, other: &ValueType) -> bool
self and other values to be equal, and is used by ==.impl Eq for ValueType
impl StructuralPartialEq for ValueType
Auto Trait Implementations§
impl Freeze for ValueType
impl RefUnwindSafe for ValueType
impl Send for ValueType
impl Sync for ValueType
impl Unpin for ValueType
impl UnsafeUnpin for ValueType
impl UnwindSafe for ValueType
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
§fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
§fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
§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>,
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> From<T> for T
impl<T> From<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<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>
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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Same for T
impl<T> Same for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.