Struct ExprDagBuilder
pub struct ExprDagBuilder { /* private fields */ }Description
Builder that makes forward references and cycles unrepresentable.
Implementations§
§impl ExprDagBuilder
impl ExprDagBuilder
pub fn push(&mut self, node: ExprNode) -> Result<ExprId, Diagnostic>
pub fn push(&mut self, node: ExprNode) -> Result<ExprId, Diagnostic>
Append one node and return its stable local ID.
pub fn constant(&mut self, value: DynQuantity) -> Result<ExprId, Diagnostic>
pub fn constant(&mut self, value: DynQuantity) -> Result<ExprId, Diagnostic>
Add a dimensioned constant.
pub fn symbol(&mut self, symbol: SymbolRef) -> Result<ExprId, Diagnostic>
pub fn symbol(&mut self, symbol: SymbolRef) -> Result<ExprId, Diagnostic>
Add a typed symbol reference.
pub fn neg(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn neg(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Add unary negation.
pub fn add(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
pub fn add(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
Add two expressions.
pub fn sub(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
pub fn sub(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
Subtract two expressions.
pub fn mul(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
pub fn mul(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
Multiply two expressions.
pub fn div(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
pub fn div(&mut self, left: ExprId, right: ExprId) -> Result<ExprId, Diagnostic>
Divide two expressions.
pub fn powi(
&mut self,
base: ExprId,
exponent: i32,
) -> Result<ExprId, Diagnostic>
pub fn powi( &mut self, base: ExprId, exponent: i32, ) -> Result<ExprId, Diagnostic>
Raise an expression to an integer power.
pub fn spatial_coordinate(&mut self, axis: usize) -> Result<ExprId, Diagnostic>
pub fn spatial_coordinate(&mut self, axis: usize) -> Result<ExprId, Diagnostic>
Read one physical Cartesian coordinate from the owning Relation’s Domain.
pub fn unary_math(
&mut self,
function: UnaryMathFunction,
value: ExprId,
) -> Result<ExprId, Diagnostic>
pub fn unary_math( &mut self, function: UnaryMathFunction, value: ExprId, ) -> Result<ExprId, Diagnostic>
Apply a dimension-aware unary mathematical function.
pub fn gradient(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn gradient(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Take the physical-space gradient.
pub fn divergence(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn divergence(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Take the physical-space divergence.
pub fn symmetric_part(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn symmetric_part(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Take the symmetric part of a square Cartesian rank-two tensor.
pub fn isotropic_lift(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn isotropic_lift(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Lift a supported invariant scalar to an isotropic Cartesian tensor.
pub fn trace(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn trace(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Restrict an expression to the owning Relation’s boundary Domain.
pub fn normal_component(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
pub fn normal_component(&mut self, value: ExprId) -> Result<ExprId, Diagnostic>
Take the outward-normal component on the owning Relation’s boundary.
pub fn pure_operator(
&mut self,
definition: &PureOperatorDefinition,
arguments: impl IntoIterator<Item = ExprId>,
) -> Result<ExprId, Diagnostic>
pub fn pure_operator( &mut self, definition: &PureOperatorDefinition, arguments: impl IntoIterator<Item = ExprId>, ) -> Result<ExprId, Diagnostic>
Apply one closed pure-operator definition to prior expressions.
The definition is deduplicated by its exact content digest and retained inside the finished expression. Arguments remain ordered by formal slot; there is no name lookup or implicit commutativity.
§Errors
Returns EQ0301 for an empty or inexact argument list, a forward
reference, or the cryptographically exceptional case in which equal
digests identify unequal canonical definitions.
pub fn finish(
self,
roots: impl IntoIterator<Item = ExprId>,
) -> Result<ExprDag, Diagnostic>
pub fn finish( self, roots: impl IntoIterator<Item = ExprId>, ) -> Result<ExprDag, Diagnostic>
Finish a DAG with one or more residual roots.
§Errors
Returns EQ0301 when the arena or root set is empty, or a root is not
present in this arena.
Trait Implementations§
§impl Debug for ExprDagBuilder
impl Debug for ExprDagBuilder
§impl Default for ExprDagBuilder
impl Default for ExprDagBuilder
§fn default() -> ExprDagBuilder
fn default() -> ExprDagBuilder
Auto Trait Implementations§
impl Freeze for ExprDagBuilder
impl RefUnwindSafe for ExprDagBuilder
impl Send for ExprDagBuilder
impl Sync for ExprDagBuilder
impl Unpin for ExprDagBuilder
impl UnsafeUnpin for ExprDagBuilder
impl UnwindSafe for ExprDagBuilder
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
§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
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.