pub struct VectorSharedScaleView<'a, const N: usize> {
pub exact: ExactRealSetFacts,
pub known_zero_mask: u128,
pub known_nonzero_mask: u128,
pub unknown_zero_mask: u128,
/* private fields */
}Expand description
Borrowed view of vector coordinates that share an exact rational scale.
The view keeps references to the original Real coordinates and exposes
only conservative object facts: exact-set schedule eligibility,
denominator kind, coarse rational storage class, plus zero/nonzero masks. It
intentionally does not expose numerators or the common denominator;
hyperreal::Rational remains responsible for scalar storage and reduction.
This is the first borrowed common-scale object in the vector layer,
following Yap’s guidance that exact geometric computation should preserve
rational object structure before scalar expansion; see Yap, “Towards Exact
Geometric Computation,” Computational Geometry 7.1-2 (1997).
Fields§
§exact: ExactRealSetFactsExact-rational representation facts for all borrowed coordinates.
known_zero_mask: u128Bit mask of coordinates known to be exactly zero.
known_nonzero_mask: u128Bit mask of coordinates known to be nonzero.
unknown_zero_mask: u128Bit mask of coordinates whose zero status is unknown.
Implementations§
Sourcepub fn from_components(components: [&'a Real; N]) -> Option<Self>
pub fn from_components(components: [&'a Real; N]) -> Option<Self>
Attempts to build a borrowed shared-scale view from coordinate refs.
This returns None unless every coordinate is an exact rational and all
reduced denominators match. Empty coordinate sets are rejected because no
concrete exact shared-scale schedule can be selected from them.
Sourcepub fn components(self) -> [&'a Real; N]
pub fn components(self) -> [&'a Real; N]
Returns the borrowed coordinates.
Sourcepub fn facts(self) -> VectorSharedScaleFacts<N>
pub fn facts(self) -> VectorSharedScaleFacts<N>
Returns the retained common-scale fact packet for this view.
Sourcepub fn is_known_zero(self) -> bool
pub fn is_known_zero(self) -> bool
Returns true when every coordinate is known to be exactly zero.
Sourcepub fn is_known_dense(self) -> bool
pub fn is_known_dense(self) -> bool
Returns true when every coordinate is known to be nonzero.
Sourcepub fn known_zero_count(self) -> u32
pub fn known_zero_count(self) -> u32
Counts coordinates known to be exactly zero.
Callers should prefer this helper over reading the bit-mask layout
directly when choosing sparse exact kernels. This keeps mask encoding
local to hyperlattice while preserving the object-level structural
facts that Yap recommends using before scalar expansion; see 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
Counts coordinates known to be nonzero.
Sourcepub fn unknown_zero_count(self) -> u32
pub fn unknown_zero_count(self) -> u32
Counts coordinates whose zero status is not structurally certified.
Sourcepub fn dot(self, rhs: Self) -> Real
pub fn dot(self, rhs: Self) -> Real
Returns the dot product with another shared-scale view.
Both views certify that every lane is already an exact rational, so this
method jumps directly to the known-exact fused product-sum route instead
of asking every factor to prove exactness again. The reducer itself
remains in hyperreal, preserving the scalar abstraction boundary and
Yap’s object-structure-first exact-computation model; see Yap, “Towards
Exact Geometric Computation,” Computational Geometry 7.1-2 (1997).
The fused reduction follows the delayed-normalization idea used by
Bareiss, “Sylvester’s Identity and Multistep Integer-Preserving Gaussian
Elimination,” Mathematics of Computation 22.103 (1968).
Sourcepub fn squared_norm(self) -> Real
pub fn squared_norm(self) -> Real
Returns the squared Euclidean norm using the known-exact dot route.
This is an algebraic value, not a geometric predicate. Callers that use
the sign of the result for topology must still go through hyperlimit.
Sourcepub fn wedge(self, rhs: Self) -> Real
pub fn wedge(self, rhs: Self) -> Real
Returns the 2D exterior product self.x * rhs.y - self.y * rhs.x.
This is the algebraic determinant behind planar orientation, not an orientation predicate. The method consumes the retained exact-rational certificate and dispatches directly to the known-exact product-sum reducer, preserving the object-level common-scale information that Yap recommends retaining before scalar expansion. See Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997). The fused signed sum follows Bareiss-style delayed normalization; see Bareiss, “Sylvester’s Identity and Multistep Integer-Preserving Gaussian Elimination,” Mathematics of Computation 22.103 (1968).
Sourcepub fn cross(self, rhs: Self) -> Vector3
pub fn cross(self, rhs: Self) -> Vector3
Returns the 3D cross product as an ordinary Vector3.
Each component is a two-term determinant, so this method uses the
retained exact-rational certificate to call the known-exact fused
product-sum reducer for each lane. The result is not wrapped in
SharedScaleVec because reduced output coordinates may lose a common
reduced denominator after cancellation or zero components. This keeps
the current abstraction honest while still following Yap’s guidance to
preserve object-level exact structure for the arithmetic package
selection; see Yap, “Towards Exact Geometric Computation,”
Computational Geometry 7.1-2 (1997). The short determinant reductions
follow Bareiss-style delayed normalization; see Bareiss, “Sylvester’s
Identity and Multistep Integer-Preserving Gaussian Elimination,”
Mathematics of Computation 22.103 (1968).
Trait Implementations§
Source§fn clone(&self) -> VectorSharedScaleView<'a, N>
fn clone(&self) -> VectorSharedScaleView<'a, N>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more