pub struct MatrixSqrtPlan { /* private fields */ }Expand description
Execution plan for the matrix square root using Denman–Beavers iteration.
The iteration produces sequences Y_k → sqrt(A) and Z_k → sqrt(A)^{-1}:
Y_0 = A, Z_0 = I
Y_{k+1} = (Y_k * Z_k^{-1} + I) / 2
Z_{k+1} = (Z_k * Y_k^{-1} + I) / 2Convergence is detected when ||Y_{k+1} - Y_k||_F < tol.
Implementations§
Source§impl MatrixSqrtPlan
impl MatrixSqrtPlan
Sourcepub fn new(config: MatrixSqrtConfig) -> SolverResult<Self>
pub fn new(config: MatrixSqrtConfig) -> SolverResult<Self>
Creates a plan from a validated configuration.
Sourcepub fn generate_ptx(&self) -> SolverResult<String>
pub fn generate_ptx(&self) -> SolverResult<String>
Generates PTX source for the matrix square root kernels.
The generated code contains entry points for:
- init kernel — sets
Y_0 = AandZ_0 = I. - iteration kernel — computes the element-wise
(M + I) / 2step after the matrix product and inverse have been done by BLAS. - convergence kernel — computes
||Y_{k+1} - Y_k||_F²via parallel reduction.
Trait Implementations§
Source§impl Clone for MatrixSqrtPlan
impl Clone for MatrixSqrtPlan
Source§fn clone(&self) -> MatrixSqrtPlan
fn clone(&self) -> MatrixSqrtPlan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MatrixSqrtPlan
impl RefUnwindSafe for MatrixSqrtPlan
impl Send for MatrixSqrtPlan
impl Sync for MatrixSqrtPlan
impl Unpin for MatrixSqrtPlan
impl UnsafeUnpin for MatrixSqrtPlan
impl UnwindSafe for MatrixSqrtPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more