pub struct DiscoveredEntity {
pub name: String,
pub grades: Vec<usize>,
pub geometric_constraint: Option<String>,
pub antiproduct_constraint: Option<String>,
}Expand description
Represents a discovered geometric entity.
An entity is a valid grade combination with associated metadata. Valid entities must satisfy two constraints:
- Geometric Product Constraint:
u * ũ = scalar - Antiproduct Constraint:
u ⊟ ũ̃ = antiscalar
Each constraint may require a field constraint expression that must equal zero.
Fields§
§name: StringSuggested name for this entity (e.g., “Entity_0_2”).
grades: Vec<usize>The grades present in this entity.
geometric_constraint: Option<String>Field constraint for the geometric product constraint (u * ũ = scalar).
If None, the entity automatically satisfies the geometric constraint.
If Some(expr), the expression must equal zero for the constraint to hold.
Example: “e01e23 + e02e31 + e03*e12 = 0” for PGA bivectors.
antiproduct_constraint: Option<String>Field constraint for the antiproduct constraint (u ⊟ ũ̃ = antiscalar).
If None, the entity automatically satisfies the antiproduct constraint.
If Some(expr), the expression must equal zero for the constraint to hold.
Implementations§
Source§impl DiscoveredEntity
impl DiscoveredEntity
Sourcepub fn new(name: impl Into<String>, grades: Vec<usize>) -> Self
pub fn new(name: impl Into<String>, grades: Vec<usize>) -> Self
Creates a new discovered entity with minimal information.
Sourcepub fn with_geometric_constraint(self, constraint: impl Into<String>) -> Self
pub fn with_geometric_constraint(self, constraint: impl Into<String>) -> Self
Sets the geometric field constraint expression.
Sourcepub fn with_antiproduct_constraint(self, constraint: impl Into<String>) -> Self
pub fn with_antiproduct_constraint(self, constraint: impl Into<String>) -> Self
Sets the antiproduct field constraint expression.
Sourcepub fn constraint_count(&self) -> usize
pub fn constraint_count(&self) -> usize
Returns the total number of constraints this entity has.
Sourcepub fn has_constraints(&self) -> bool
pub fn has_constraints(&self) -> bool
Returns true if this entity has any field constraints.
Trait Implementations§
Source§impl Clone for DiscoveredEntity
impl Clone for DiscoveredEntity
Source§fn clone(&self) -> DiscoveredEntity
fn clone(&self) -> DiscoveredEntity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveredEntity
impl Debug for DiscoveredEntity
Source§impl PartialEq for DiscoveredEntity
impl PartialEq for DiscoveredEntity
impl Eq for DiscoveredEntity
impl StructuralPartialEq for DiscoveredEntity
Auto Trait Implementations§
impl Freeze for DiscoveredEntity
impl RefUnwindSafe for DiscoveredEntity
impl Send for DiscoveredEntity
impl Sync for DiscoveredEntity
impl Unpin for DiscoveredEntity
impl UnwindSafe for DiscoveredEntity
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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