Struct DraftExpression
pub struct DraftExpression { /* private fields */ }Description
Immutable symbolic expression used only while defining a native model.
Shape and spatial support remain opaque here. The shared semantic validator infers them and checks the compatibility of each equation’s sides.
Implementations§
§impl DraftExpression
impl DraftExpression
pub fn array(
values: impl IntoIterator<Item = DraftExpression>,
) -> DraftExpression
pub fn array( values: impl IntoIterator<Item = DraftExpression>, ) -> DraftExpression
Construct an ordered channel-array expression.
pub fn index(self, index: u32) -> DraftExpression
pub fn index(self, index: u32) -> DraftExpression
Select a static channel index. The compiler checks type and bounds.
pub fn slice(self, lower: u32, upper: u32) -> DraftExpression
pub fn slice(self, lower: u32, upper: u32) -> DraftExpression
Select an immutable nonempty half-open channel slice.
pub fn enum_value(
value: ValueLiteral,
) -> Result<DraftExpression, AstConstructionError>
pub fn enum_value( value: ValueLiteral, ) -> Result<DraftExpression, AstConstructionError>
Construct one checked enum member, retaining its exact declaration identity.
§Errors
Rejects literals that are not enum members.
pub fn boolean(value: bool) -> DraftExpression
pub fn boolean(value: bool) -> DraftExpression
Boolean literal with no numeric coercion.
pub fn select(
condition: DraftExpression,
then_value: DraftExpression,
else_value: DraftExpression,
) -> DraftExpression
pub fn select( condition: DraftExpression, then_value: DraftExpression, else_value: DraftExpression, ) -> DraftExpression
Select one value lazily from a Boolean condition and two branches.
pub fn logical_not(self) -> DraftExpression
pub fn logical_not(self) -> DraftExpression
Boolean negation.
pub fn equal(self, right: DraftExpression) -> DraftExpression
pub fn equal(self, right: DraftExpression) -> DraftExpression
Construct a equal predicate.
pub fn not_equal(self, right: DraftExpression) -> DraftExpression
pub fn not_equal(self, right: DraftExpression) -> DraftExpression
Construct a not_equal predicate.
pub fn less(self, right: DraftExpression) -> DraftExpression
pub fn less(self, right: DraftExpression) -> DraftExpression
Construct a less predicate.
pub fn less_equal(self, right: DraftExpression) -> DraftExpression
pub fn less_equal(self, right: DraftExpression) -> DraftExpression
Construct a less_equal predicate.
pub fn greater(self, right: DraftExpression) -> DraftExpression
pub fn greater(self, right: DraftExpression) -> DraftExpression
Construct a greater predicate.
pub fn greater_equal(self, right: DraftExpression) -> DraftExpression
pub fn greater_equal(self, right: DraftExpression) -> DraftExpression
Construct a greater_equal predicate.
pub fn logical_and(self, right: DraftExpression) -> DraftExpression
pub fn logical_and(self, right: DraftExpression) -> DraftExpression
Construct a logical_and predicate.
pub fn logical_or(self, right: DraftExpression) -> DraftExpression
pub fn logical_or(self, right: DraftExpression) -> DraftExpression
Construct a logical_or predicate.
§impl DraftExpression
impl DraftExpression
pub fn constant(value: DecimalLiteral) -> DraftExpression
pub fn constant(value: DecimalLiteral) -> DraftExpression
Dimensionless numeric literal.
pub fn complex(real: f64, imaginary: f64) -> DraftExpression
pub fn complex(real: f64, imaginary: f64) -> DraftExpression
Construct a complex scalar without discarding either component.
pub fn derivative(field: &DraftField) -> DraftExpression
pub fn derivative(field: &DraftField) -> DraftExpression
Time derivative of one Field.
pub fn across(port: &DraftConservingPort) -> DraftExpression
pub fn across(port: &DraftConservingPort) -> DraftExpression
Read the across variable of one scalar conserving Port.
pub fn through(port: &DraftConservingPort) -> DraftExpression
pub fn through(port: &DraftConservingPort) -> DraftExpression
Read the through variable of one scalar conserving Port.
pub fn gradient(value: DraftExpression) -> DraftExpression
pub fn gradient(value: DraftExpression) -> DraftExpression
Spatial gradient of one expression.
pub fn divergence(value: DraftExpression) -> DraftExpression
pub fn divergence(value: DraftExpression) -> DraftExpression
Spatial divergence of one expression.
pub fn trace(
value: DraftExpression,
on: Option<&DraftSpatialDomain>,
from: Option<&DraftSpatialDomain>,
) -> DraftExpression
pub fn trace( value: DraftExpression, on: Option<&DraftSpatialDomain>, from: Option<&DraftSpatialDomain>, ) -> DraftExpression
Boundary trace of one expression.
§impl DraftExpression
impl DraftExpression
pub fn matrix_trace(self) -> DraftExpression
pub fn matrix_trace(self) -> DraftExpression
Algebraic diagonal sum on an exact finite endomorphism or spatial tensor.
pub fn determinant(self) -> DraftExpression
pub fn determinant(self) -> DraftExpression
Determinant of an admitted real finite endomorphism.
pub fn inverse(self) -> DraftExpression
pub fn inverse(self) -> DraftExpression
Inverse real finite map under the execution owner’s regularity policy.
pub fn transpose(self) -> DraftExpression
pub fn transpose(self) -> DraftExpression
Algebraic dual or map transpose, without conjugating coefficients.
pub fn adjoint(self) -> DraftExpression
pub fn adjoint(self) -> DraftExpression
Conjugate transpose in the declared orthonormal finite bases.
pub fn apply(self, coordinates: DraftExpression) -> DraftExpression
pub fn apply(self, coordinates: DraftExpression) -> DraftExpression
Apply this map to coordinates in its exact input basis.
pub fn compose_map(self, right: DraftExpression) -> DraftExpression
pub fn compose_map(self, right: DraftExpression) -> DraftExpression
Compose this map after right; equal extents do not imply equal bases.
pub fn pair(self, right: DraftExpression) -> DraftExpression
pub fn pair(self, right: DraftExpression) -> DraftExpression
Bilinear pairing of dual coordinates with the matching primal basis.
pub fn tensor_product(self, right: DraftExpression) -> DraftExpression
pub fn tensor_product(self, right: DraftExpression) -> DraftExpression
Ordered tensor product; the right factor varies fastest.
pub fn permute_factors(self, order: [u8; 2]) -> DraftExpression
pub fn permute_factors(self, order: [u8; 2]) -> DraftExpression
Explicitly reorder the two factors of coordinates or both map endpoints.
§impl DraftExpression
impl DraftExpression
pub fn observable(observable: &DraftObservable) -> DraftExpression
pub fn observable(observable: &DraftObservable) -> DraftExpression
Reference one exact reduced Observable declared in the same native Module.
pub fn integral(
value: DraftExpression,
measure: DraftExpression,
) -> DraftExpression
pub fn integral( value: DraftExpression, measure: DraftExpression, ) -> DraftExpression
Integral expression with an explicit measure(domain) expression.
pub fn measure(domain: &DraftSpatialDomain) -> DraftExpression
pub fn measure(domain: &DraftSpatialDomain) -> DraftExpression
Exact Domain measure; its volume or boundary kind is resolved during typing.
Trait Implementations§
§impl Add for DraftExpression
impl Add for DraftExpression
§type Output = DraftExpression
type Output = DraftExpression
+ operator.§fn add(self, right: DraftExpression) -> <DraftExpression as Add>::Output
fn add(self, right: DraftExpression) -> <DraftExpression as Add>::Output
+ operation. Read more§impl Clone for DraftExpression
impl Clone for DraftExpression
§impl Debug for DraftExpression
impl Debug for DraftExpression
§impl Div for DraftExpression
impl Div for DraftExpression
§type Output = DraftExpression
type Output = DraftExpression
/ operator.§fn div(self, right: DraftExpression) -> <DraftExpression as Div>::Output
fn div(self, right: DraftExpression) -> <DraftExpression as Div>::Output
/ operation. Read more§impl Mul for DraftExpression
impl Mul for DraftExpression
§type Output = DraftExpression
type Output = DraftExpression
* operator.§fn mul(self, right: DraftExpression) -> <DraftExpression as Mul>::Output
fn mul(self, right: DraftExpression) -> <DraftExpression as Mul>::Output
* operation. Read more§impl Neg for DraftExpression
impl Neg for DraftExpression
§type Output = DraftExpression
type Output = DraftExpression
- operator.§impl Sub for DraftExpression
impl Sub for DraftExpression
§type Output = DraftExpression
type Output = DraftExpression
- operator.§fn sub(self, right: DraftExpression) -> <DraftExpression as Sub>::Output
fn sub(self, right: DraftExpression) -> <DraftExpression as Sub>::Output
- operation. Read moreAuto Trait Implementations§
impl Freeze for DraftExpression
impl RefUnwindSafe for DraftExpression
impl Send for DraftExpression
impl Sync for DraftExpression
impl Unpin for DraftExpression
impl UnsafeUnpin for DraftExpression
impl UnwindSafe for DraftExpression
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>,
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.