Struct ExpressionType
pub struct ExpressionType<I> {
pub value_type: ValueType,
pub support: Option<SpatialSupport<I>>,
}Description
Complete static type of one residual-expression value.
Fields§
§value_type: ValueTypeChecked mathematical type, independent of execution choices.
support: Option<SpatialSupport<I>>Nominal spatial support, absent for global scalars.
Implementations§
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn require(
self,
value: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn require( self, value: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type a Boolean domain condition without changing its required value type.
pub fn select(
self,
then_value: ExpressionType<I>,
else_value: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn select( self, then_value: ExpressionType<I>, else_value: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type both value arms and the Boolean condition, without promotion.
pub fn equation(
self,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn equation( self, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Validate both sides of an equation without performing arithmetic.
pub fn compare(
self,
op: ComparisonOp,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn compare( self, op: ComparisonOp, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type a scalar comparison, with no discrete-to-real promotion.
pub fn logical_not(self) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn logical_not(self) -> Result<ExpressionType<I>, TypeViolation<I>>
Type Boolean negation.
pub fn and(
self,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn and( self, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type Boolean conjunction.
pub fn or(
self,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn or( self, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type Boolean disjunction.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn array(
elements: &[ExpressionType<I>],
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn array( elements: &[ExpressionType<I>], ) -> Result<ExpressionType<I>, TypeViolation<I>>
Construct an outer channel axis from complete elements with compatible supports.
§impl<I> ExpressionType<I>where
I: Clone,
impl<I> ExpressionType<I>where
I: Clone,
pub fn index(self, index: u32) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn index(self, index: u32) -> Result<ExpressionType<I>, TypeViolation<I>>
Select an outer channel; Cartesian component axes are not channel axes.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn complex(
self,
imag: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn complex( self, imag: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Construct a complex scalar, preserving physical dimension and compatible support.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn coordinate_partial(
&self,
selected: &ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn coordinate_partial( &self, selected: &ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type a real scalar partial derivative with respect to a coordinate.
The caller must establish that the selector is a coordinate symbol; this rule checks its support, the component types, and the resulting units.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn finite_unary(
self,
operation: FiniteUnaryOperation,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn finite_unary( self, operation: FiniteUnaryOperation, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type coordinate dualization, a map transpose, or an orthonormal adjoint.
pub fn finite_binary(
self,
operation: FiniteBinaryOperation,
right: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn finite_binary( self, operation: FiniteBinaryOperation, right: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type application, composition, or bilinear pairing; the endpoint bases must match.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn sum(
self,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn sum( self, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type arithmetic addition, including a count plus same-basis signed change.
pub fn ordinal(self) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn ordinal(self) -> Result<ExpressionType<I>, TypeViolation<I>>
Explicitly project a nominal index to its dimensionless integer ordinal.
pub fn integer_quotient(
self,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn integer_quotient( self, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type a checked integer quotient or remainder, without real promotion.
pub fn to_real(self) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn to_real(self) -> Result<ExpressionType<I>, TypeViolation<I>>
Explicitly convert an integer scalar to a dimensionless real scalar.
pub fn to_integer(self) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn to_integer(self) -> Result<ExpressionType<I>, TypeViolation<I>>
Type a checked real-to-integer conversion. Whether the value is integral and in range is checked during evaluation.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn ordered_selection(
self,
other: ExpressionType<I>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn ordered_selection( self, other: ExpressionType<I>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type a minimum or maximum, without numeric promotion or dimension changes. Only ordinary invariant real or integer scalars are ordered. On a tie the first operand is selected; both operands stay in the dependency graph.
§impl<I> ExpressionType<I>where
I: Clone + Eq,
impl<I> ExpressionType<I>where
I: Clone + Eq,
pub fn pullback(
&self,
source: &[ExpressionType<I>],
at: &[(ExpressionType<I>, ExpressionType<I>)],
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn pullback( &self, source: &[ExpressionType<I>], at: &[(ExpressionType<I>, ExpressionType<I>)], ) -> Result<ExpressionType<I>, TypeViolation<I>>
Infer scalar pullback units and support from resolved coordinate types. The syntax or DAG layer separately checks that the selectors are a complete set of unique coordinate references, not arbitrary scalar expressions.
§impl<I> ExpressionType<I>
impl<I> ExpressionType<I>
pub fn new(
value_type: ValueType,
support: Option<SpatialSupport<I>>,
) -> ExpressionType<I>
pub fn new( value_type: ValueType, support: Option<SpatialSupport<I>>, ) -> ExpressionType<I>
Attach a support to an already checked mathematical type.
pub fn scalar(
dimension: DimExponents,
support: Option<SpatialSupport<I>>,
) -> ExpressionType<I>
pub fn scalar( dimension: DimExponents, support: Option<SpatialSupport<I>>, ) -> ExpressionType<I>
An invariant real scalar with the supplied dimension and support.
pub fn shaped(
dimension: DimExponents,
shape: ValueShape,
frame: ValueFrame,
support: Option<SpatialSupport<I>>,
) -> Result<ExpressionType<I>, InvalidValueType>
pub fn shaped( dimension: DimExponents, shape: ValueShape, frame: ValueFrame, support: Option<SpatialSupport<I>>, ) -> Result<ExpressionType<I>, InvalidValueType>
A real value with the given mathematical shape, frame, and support.
§Errors
Rejects an invalid shape and frame combination or an unrepresentable component count.
pub const fn dimension(&self) -> DimExponents
pub const fn dimension(&self) -> DimExponents
Physical dimension.
pub const fn shape(&self) -> &ValueShape
pub const fn shape(&self) -> &ValueShape
Mathematical component shape.
§impl<I> ExpressionType<I>where
I: Clone + PartialEq,
impl<I> ExpressionType<I>where
I: Clone + PartialEq,
pub fn coordinate(
factor: &I,
axis: usize,
relation: Option<&SpatialSupport<I>>,
) -> Result<ExpressionType<I>, TypeViolation<I>>
pub fn coordinate( factor: &I, axis: usize, relation: Option<&SpatialSupport<I>>, ) -> Result<ExpressionType<I>, TypeViolation<I>>
Type one factor axis, keeping the projection’s declared support.
Trait Implementations§
§impl<I> Clone for ExpressionType<I>where
I: Clone,
impl<I> Clone for ExpressionType<I>where
I: Clone,
§impl<I> Debug for ExpressionType<I>where
I: Debug,
impl<I> Debug for ExpressionType<I>where
I: Debug,
§impl<I> PartialEq for ExpressionType<I>where
I: PartialEq,
impl<I> PartialEq for ExpressionType<I>where
I: PartialEq,
§fn eq(&self, other: &ExpressionType<I>) -> bool
fn eq(&self, other: &ExpressionType<I>) -> bool
self and other values to be equal, and is used by ==.impl<I> Eq for ExpressionType<I>where
I: Eq,
impl<I> StructuralPartialEq for ExpressionType<I>
Auto Trait Implementations§
impl<I> Freeze for ExpressionType<I>where
I: Freeze,
impl<I> RefUnwindSafe for ExpressionType<I>where
I: RefUnwindSafe,
impl<I> Send for ExpressionType<I>where
I: Send,
impl<I> Sync for ExpressionType<I>where
I: Sync,
impl<I> Unpin for ExpressionType<I>where
I: Unpin,
impl<I> UnsafeUnpin for ExpressionType<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for ExpressionType<I>where
I: UnwindSafe,
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.