pub struct SharedScaleVec<const N: usize> {
pub exact: ExactRealSetFacts,
pub facts: VectorSharedScaleFacts<N>,
/* private fields */
}Expand description
Owned vector coordinates certified to share one exact rational scale.
SharedScaleVec is the first owning common-scale carrier in
hyperlattice. It stores ordinary Real coordinates and cached
storage-free exact facts, rather than exposing rational numerators or the
common denominator. That keeps scalar representation and reduction in
hyperreal, while letting matrix, predicate, and triangulation code retain
Yap-style object structure across API boundaries. See Yap, “Towards Exact
Geometric Computation,” Computational Geometry 7.1-2 (1997).
Fields§
§exact: ExactRealSetFactsExact-rational representation facts for all owned coordinates.
facts: VectorSharedScaleFacts<N>Cached common-scale and sparse-support fact packet.
Implementations§
Sourcepub fn from_components(components: [Real; N]) -> Option<Self>
pub fn from_components(components: [Real; N]) -> Option<Self>
Attempts to construct an owned shared-scale vector.
This returns None unless every coordinate is an exact rational and all
reduced denominators match. The object is a semantic carrier for future
common-denominator kernels; it deliberately does not expose the shared
denominator.
Sourcepub fn components(&self) -> &[Real; N]
pub fn components(&self) -> &[Real; N]
Returns the owned coordinates by reference.
Sourcepub fn into_components(self) -> [Real; N]
pub fn into_components(self) -> [Real; N]
Consumes the object and returns the owned coordinates.
Sourcepub fn as_view(&self) -> VectorSharedScaleView<'_, N>
pub fn as_view(&self) -> VectorSharedScaleView<'_, N>
Returns a borrowed shared-scale view over the owned coordinates.
The view recomputes conservative masks from the retained coordinates but preserves the same scalar abstraction boundary as direct vector views.
Sourcepub fn facts(&self) -> VectorSharedScaleFacts<N>
pub fn facts(&self) -> VectorSharedScaleFacts<N>
Returns the cached common-scale fact packet for this owned vector.
The packet is collected once at construction and then reused by borrowed
views, sparse dispatch, and exact algebra helpers. Missing facts remain
only missed optimizations; topological predicates must still be decided
in hyperlimit.
Sourcepub fn known_zero_count(&self) -> u32
pub fn known_zero_count(&self) -> u32
Count coordinates known to be exactly zero.
This forwards the borrowed view’s mask-derived count without exposing the mask layout. Keeping count queries stable gives callers a cheap sparse-kernel dispatch signal while preserving the common-scale storage boundary described by Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997).
Sourcepub fn known_nonzero_count(&self) -> u32
pub fn known_nonzero_count(&self) -> u32
Count coordinates known to be nonzero.
Sourcepub fn unknown_zero_count(&self) -> u32
pub fn unknown_zero_count(&self) -> u32
Count coordinates whose zero status is unknown.
Sourcepub fn dot(&self, rhs: &Self) -> Real
pub fn dot(&self, rhs: &Self) -> Real
Returns the dot product with another owned shared-scale vector.
The owned vectors retain their common-scale certificate across lifetimes. This method consumes that certificate through borrowed views and uses the known-exact scalar product-sum path without exposing numerators or denominators.
Sourcepub fn squared_norm(&self) -> Real
pub fn squared_norm(&self) -> Real
Returns the squared Euclidean norm using the retained exact certificate.
Sourcepub fn wedge(&self, rhs: &Self) -> Real
pub fn wedge(&self, rhs: &Self) -> Real
Returns the 2D exterior product with another owned shared-scale vector.
The result is an exact algebraic scalar expression. Topological
orientation decisions remain in hyperlimit; this method only preserves
and consumes the common-scale arithmetic certificate.
Sourcepub fn cross(&self, rhs: &Self) -> Vector3
pub fn cross(&self, rhs: &Self) -> Vector3
Returns the 3D cross product with another owned shared-scale vector.
The result is an ordinary Vector3 because reduction may erase the
common-scale shape in some lanes. Use Vector3::into_shared_scale if
the caller wants to recover that certificate opportunistically.
Trait Implementations§
Source§fn clone(&self) -> SharedScaleVec<N>
fn clone(&self) -> SharedScaleVec<N>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn eq(&self, other: &SharedScaleVec<N>) -> bool
fn eq(&self, other: &SharedScaleVec<N>) -> bool
self and other values to be equal, and is used by ==.