Skip to main content

VectorSharedScaleView

Struct VectorSharedScaleView 

Source
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: ExactRealSetFacts

Exact-rational representation facts for all borrowed coordinates.

§known_zero_mask: u128

Bit mask of coordinates known to be exactly zero.

§known_nonzero_mask: u128

Bit mask of coordinates known to be nonzero.

§unknown_zero_mask: u128

Bit mask of coordinates whose zero status is unknown.

Implementations§

Source§

impl<'a, const N: usize> VectorSharedScaleView<'a, N>

Source

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.

Source

pub fn components(self) -> [&'a Real; N]

Returns the borrowed coordinates.

Source

pub const fn len(self) -> usize

Returns the number of coordinates in this view.

Source

pub const fn is_empty(self) -> bool

Returns whether the view has no coordinates.

Source

pub fn facts(self) -> VectorSharedScaleFacts<N>

Returns the retained common-scale fact packet for this view.

Source

pub fn is_known_zero(self) -> bool

Returns true when every coordinate is known to be exactly zero.

Source

pub fn is_known_dense(self) -> bool

Returns true when every coordinate is known to be nonzero.

Source

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).

Source

pub fn known_nonzero_count(self) -> u32

Counts coordinates known to be nonzero.

Source

pub fn unknown_zero_count(self) -> u32

Counts coordinates whose zero status is not structurally certified.

Source

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).

Source

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.

Source§

impl<'a> VectorSharedScaleView<'a, 2>

Source

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).

Source§

impl<'a> VectorSharedScaleView<'a, 3>

Source

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§

impl<'a, const N: usize> Clone for VectorSharedScaleView<'a, N>

Source§

fn clone(&self) -> VectorSharedScaleView<'a, N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, const N: usize> Debug for VectorSharedScaleView<'a, N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, const N: usize> Copy for VectorSharedScaleView<'a, N>

Auto Trait Implementations§

§

impl<'a, const N: usize> Freeze for VectorSharedScaleView<'a, N>

§

impl<'a, const N: usize> !RefUnwindSafe for VectorSharedScaleView<'a, N>

§

impl<'a, const N: usize> !Send for VectorSharedScaleView<'a, N>

§

impl<'a, const N: usize> !Sync for VectorSharedScaleView<'a, N>

§

impl<'a, const N: usize> Unpin for VectorSharedScaleView<'a, N>

§

impl<'a, const N: usize> UnsafeUnpin for VectorSharedScaleView<'a, N>

§

impl<'a, const N: usize> !UnwindSafe for VectorSharedScaleView<'a, N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.