pub struct SparseDesignMatrix { /* private fields */ }Implementations§
Source§impl SparseDesignMatrix
impl SparseDesignMatrix
pub fn new(matrix: SparseColMat<usize, f64>) -> Self
Sourcepub fn hessian_accumulator_template(&self) -> Option<SparseHessianAccumulator>
pub fn hessian_accumulator_template(&self) -> Option<SparseHessianAccumulator>
A zero-valued accumulator over this design’s XᵀWX sparsity pattern,
building that pattern at most once per design.
Every IRLS/Newton iteration reassembles Xᵀ diag(w) X with new weights
but the SAME X, and the symbolic pattern is a function of X alone.
Rebuilding it per assembly cost O(Σ_i nnz_i² · log) in BTreeSet
insertions and showed up as the second-largest symbol in a fit profile.
Caching it here — rather than in a process-global keyed by address —
ties the pattern’s lifetime to the data that determines it, so a
dropped-and-reallocated design can never inherit a stale neighbour’s
pattern (#2416).
pub fn try_to_dense_arc( &self, context: &str, ) -> Result<Arc<Array2<f64>>, String>
Sourcepub fn try_to_dense_governed(
&self,
context: &str,
) -> Result<Governed<Arc<Array2<f64>>>, String>
pub fn try_to_dense_governed( &self, context: &str, ) -> Result<Governed<Arc<Array2<f64>>>, String>
Densify under the process-wide byte governor, coupling the returned dense copy to its RAII reservation. A refusal is typed evidence that the dense footprint does not fit the joint ledger right now — callers route to a streaming / sparse strategy instead of allocating.
pub fn to_dense_arc(&self) -> Arc<Array2<f64>> ⓘ
pub fn to_csr_arc(&self) -> Option<Arc<SparseRowMat<usize, f64>>>
Trait Implementations§
Source§impl Clone for SparseDesignMatrix
impl Clone for SparseDesignMatrix
Source§fn clone(&self) -> SparseDesignMatrix
fn clone(&self) -> SparseDesignMatrix
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SparseDesignMatrix
impl RefUnwindSafe for SparseDesignMatrix
impl Send for SparseDesignMatrix
impl Sync for SparseDesignMatrix
impl Unpin for SparseDesignMatrix
impl UnsafeUnpin for SparseDesignMatrix
impl UnwindSafe for SparseDesignMatrix
Blanket Implementations§
Source§impl<'short, T, Target> AsGeneralizedRef<'short, &'short Target> for T
impl<'short, T, Target> AsGeneralizedRef<'short, &'short Target> for T
fn as_generalized_ref(&'short self) -> &'short Target
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more