Skip to main content

SharedScaleVec

Struct SharedScaleVec 

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

Exact-rational representation facts for all owned coordinates.

§facts: VectorSharedScaleFacts<N>

Cached common-scale and sparse-support fact packet.

Implementations§

Source§

impl<const N: usize> SharedScaleVec<N>

Source

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.

Source

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

Returns the owned coordinates by reference.

Source

pub fn into_components(self) -> [Real; N]

Consumes the object and returns the owned coordinates.

Source

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.

Source

pub const fn len(&self) -> usize

Returns the number of coordinates.

Source

pub const fn is_empty(&self) -> bool

Returns whether this vector contains no coordinates.

Source

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.

Source

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

Source

pub fn known_nonzero_count(&self) -> u32

Count coordinates known to be nonzero.

Source

pub fn unknown_zero_count(&self) -> u32

Count coordinates whose zero status is unknown.

Source

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.

Source

pub fn squared_norm(&self) -> Real

Returns the squared Euclidean norm using the retained exact certificate.

Source§

impl SharedScaleVec<2>

Source

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.

Source§

impl SharedScaleVec<3>

Source

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§

impl<const N: usize> Clone for SharedScaleVec<N>

Source§

fn clone(&self) -> SharedScaleVec<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<const N: usize> Debug for SharedScaleVec<N>

Source§

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

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

impl<const N: usize> PartialEq for SharedScaleVec<N>

Source§

fn eq(&self, other: &SharedScaleVec<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> StructuralPartialEq for SharedScaleVec<N>

Auto Trait Implementations§

§

impl<const N: usize> !Freeze for SharedScaleVec<N>

§

impl<const N: usize> !RefUnwindSafe for SharedScaleVec<N>

§

impl<const N: usize> Send for SharedScaleVec<N>

§

impl<const N: usize> !Sync for SharedScaleVec<N>

§

impl<const N: usize> Unpin for SharedScaleVec<N>

§

impl<const N: usize> UnsafeUnpin for SharedScaleVec<N>

§

impl<const N: usize> UnwindSafe for SharedScaleVec<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.