Skip to main content

PreparedMatrix4

Struct PreparedMatrix4 

Source
pub struct PreparedMatrix4<'a> { /* private fields */ }
Expand description

Prepared handle for repeated use of a borrowed Matrix4.

The 4x4 handle mirrors PreparedMatrix3 and is aimed at transform stacks, projective geometry, and solver blocks that reuse one matrix across many exact operations. Cached structural facts stay at the matrix layer while scalar numerator/denominator storage remains owned by hyperreal.

Implementations§

Source§

impl<'a> PreparedMatrix4<'a>

Source

pub fn new(matrix: &'a Matrix4) -> Self

Builds a reusable prepared handle for this matrix.

Source

pub fn matrix(&self) -> &Matrix4

Borrows the prepared matrix.

Source

pub fn structural_facts(&self) -> Matrix4StructuralFacts

Returns cached structural facts for the prepared matrix.

These facts include homogeneous affine and direction shortcuts, so transform-heavy callers can select exact fast paths from one retained object summary. This is the 4x4 version of Yap’s exact-geometric preprocessing boundary.

Source

pub fn exact_facts(&self) -> ExactRealSetFacts

Returns cached exact-rational set facts for all entries.

Source

pub fn determinant_schedule_hint(&self) -> MatrixDeterminantScheduleHint

Returns the retained determinant schedule hint for this prepared matrix.

Source

pub fn cache_state(&self) -> MatrixPreparedCacheState

Return which determinant/factor/adjugate caches are warm on this prepared matrix.

Source

pub fn determinant(&mut self) -> Real

Returns the determinant using the prepared determinant/factor cache.

For 4x4 matrices this may reuse the same fixed minor factors used by the prepared adjugate path, keeping determinant, inverse, and right-division workloads on one cached object boundary as recommended by Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997).

Source

pub fn right_divisor(&mut self) -> &mut PreparedRightDivisor4<'a>

Returns a mutable prepared right-divisor view of the same matrix.

Source

pub fn transform_vec4_handle(&self) -> TransformedMatrix4<'a>

Returns a retained transform handle using this prepared matrix’s cached structural facts.

Reusing the same prepared object for matrix-vector transforms, determinant queries, inverse construction, and right division keeps affine/homogeneous facts in one semantic cache. The arithmetic kernels remain owned by the retained transform handle; this method only prevents repeated structural rediscovery, following Yap’s object-package model in “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997).

Source

pub fn transform_vector(&self, rhs: &Vector4) -> Vector4

Transforms one 4D homogeneous vector using cached prepared-matrix facts.

Source

pub fn transform_vector_batch(&self, rhs: &[Vector4]) -> Vec<Vector4>

Transforms a batch of 4D homogeneous vectors using cached prepared-matrix facts.

Source

pub fn transform_direction_vector(&self, rhs: &Vector4) -> Vector4

Transforms one caller-certified homogeneous direction (w = 0) using cached prepared-matrix facts.

Source

pub fn transform_direction_batch(&self, rhs: &[Vector4]) -> Vec<Vector4>

Transforms a batch of caller-certified homogeneous directions (w = 0) using cached prepared-matrix facts.

Source

pub fn transform_point_vector(&self, rhs: &Vector4) -> Vector4

Transforms one caller-certified homogeneous point (w = 1) using cached prepared-matrix facts.

Source

pub fn transform_point_batch(&self, rhs: &[Vector4]) -> Vec<Vector4>

Transforms a batch of caller-certified homogeneous points (w = 1) using cached prepared-matrix facts.

Source

pub fn inverse(&mut self) -> BlasResult<Matrix4>

Returns the inverse using the prepared determinant/adjugate cache.

Source

pub fn inverse_checked(&mut self) -> CheckedBlasResult<Matrix4>

Checked inverse using the prepared determinant/adjugate cache.

Source

pub fn inverse_checked_with_abort( &mut self, signal: &AbortSignal, ) -> CheckedBlasResult<Matrix4>

Abort-aware checked inverse using the prepared determinant/adjugate cache.

Source

pub fn reciprocal(&mut self) -> BlasResult<Matrix4>

Reciprocal matrix using the prepared inverse cache.

Source

pub fn reciprocal_checked(&mut self) -> CheckedBlasResult<Matrix4>

Checked reciprocal matrix using the prepared inverse cache.

Source

pub fn reciprocal_checked_with_abort( &mut self, signal: &AbortSignal, ) -> CheckedBlasResult<Matrix4>

Abort-aware checked reciprocal matrix using the prepared inverse cache.

Source

pub fn divide_left(&mut self, left: Matrix4) -> BlasResult<Matrix4>

Divides left by the prepared matrix.

Source

pub fn divide_exact_rational_left( &mut self, left: Matrix4, ) -> BlasResult<Matrix4>

Divides a caller-certified exact-rational left by the prepared matrix.

This retains the existing exact-rational-left optimization exposed by Matrix4::div_exact_rational_matrix_with_prepared while placing it on the broader prepared-matrix handle.

Source

pub fn divide_left_checked( &mut self, left: Matrix4, ) -> CheckedBlasResult<Matrix4>

Checked right-division of left by the prepared matrix.

Source

pub fn divide_left_checked_with_abort( &mut self, left: Matrix4, signal: &AbortSignal, ) -> CheckedBlasResult<Matrix4>

Abort-aware checked right-division of left by the prepared matrix.

Trait Implementations§

Source§

impl<'a> Clone for PreparedMatrix4<'a>

Source§

fn clone(&self) -> PreparedMatrix4<'a>

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> Debug for PreparedMatrix4<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for PreparedMatrix4<'a>

§

impl<'a> !RefUnwindSafe for PreparedMatrix4<'a>

§

impl<'a> !Send for PreparedMatrix4<'a>

§

impl<'a> !Sync for PreparedMatrix4<'a>

§

impl<'a> !UnwindSafe for PreparedMatrix4<'a>

§

impl<'a> Unpin for PreparedMatrix4<'a>

§

impl<'a> UnsafeUnpin for PreparedMatrix4<'a>

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.