Skip to main content

HyperOperator

Trait HyperOperator 

Source
pub trait HyperOperator: Send + Sync {
Show 19 methods // Required methods fn dim(&self) -> usize; fn mul_vec(&self, v: &Array1<f64>) -> Array1<f64>; fn is_implicit(&self) -> bool; // Provided methods fn as_any(&self) -> &(dyn Any + 'static) { ... } fn mul_vec_view(&self, v: ArrayView1<'_, f64>) -> Array1<f64> { ... } fn mul_vec_into(&self, v: ArrayView1<'_, f64>, out: ArrayViewMut1<'_, f64>) { ... } fn mul_mat(&self, factor: &Array2<f64>) -> Array2<f64> { ... } fn trace_projected_factor(&self, factor: &Array2<f64>) -> f64 { ... } fn projection_design_id(&self) -> Option<usize> { ... } fn trace_projected_factor_cached( &self, factor: &Array2<f64>, factor_cache: &ProjectedFactorCache, ) -> f64 { ... } fn projected_matrix(&self, factor: &Array2<f64>) -> Array2<f64> { ... } fn projected_matrix_cached( &self, factor: &Array2<f64>, factor_cache: &ProjectedFactorCache, ) -> Array2<f64> { ... } fn mul_basis_columns_into(&self, start: usize, out: ArrayViewMut2<'_, f64>) { ... } fn scaled_add_mul_vec( &self, v: ArrayView1<'_, f64>, scale: f64, out: ArrayViewMut1<'_, f64>, ) { ... } fn bilinear(&self, v: &Array1<f64>, u: &Array1<f64>) -> f64 { ... } fn bilinear_view( &self, v: ArrayView1<'_, f64>, u: ArrayView1<'_, f64>, ) -> f64 { ... } fn has_fast_bilinear_view(&self) -> bool { ... } fn to_dense(&self) -> Array2<f64> { ... } fn block_local_data(&self) -> Option<(&Array2<f64>, usize, usize)> { ... }
}

Required Methods§

Source

fn dim(&self) -> usize

Operator dimension p such that B · v consumes a p-vector and produces a p-vector.

Source

fn mul_vec(&self, v: &Array1<f64>) -> Array1<f64>

Compute B · v (matrix-vector product). v and result are p-vectors.

Source

fn is_implicit(&self) -> bool

Whether this operator uses implicit (non-materialized) storage.

Provided Methods§

Source

fn as_any(&self) -> &(dyn Any + 'static)

Expose the concrete type for solver-local downcast helpers when the implementor has a 'static concrete type. Borrowing adapters may keep the default, which simply cannot downcast.

Source

fn mul_vec_view(&self, v: ArrayView1<'_, f64>) -> Array1<f64>

Compute B · v from a vector view.

Source

fn mul_vec_into(&self, v: ArrayView1<'_, f64>, out: ArrayViewMut1<'_, f64>)

Compute B · v into caller-owned storage.

Source

fn mul_mat(&self, factor: &Array2<f64>) -> Array2<f64>

Compute B · F where F is (p × k). Default dispatches per-column in parallel unless already inside a rayon worker.

Source

fn trace_projected_factor(&self, factor: &Array2<f64>) -> f64

Compute trace(F^T B F) for a (p x k) factor matrix F.

Source

fn projection_design_id(&self) -> Option<usize>

Optional stable identity for this operator’s action B. When Some, the default cached trace / projected-matrix paths memoize the B · F product in the shared ProjectedFactorCache under a (design_id, factor) key, so repeated projections of the same factor against the same operator within one outer iteration build B · F once. None (the default) disables that reuse: an operator with no design factor stable across calls cannot key the cache without risking a stale B · F, so it recomputes every time.

Source

fn trace_projected_factor_cached( &self, factor: &Array2<f64>, factor_cache: &ProjectedFactorCache, ) -> f64

Source

fn projected_matrix(&self, factor: &Array2<f64>) -> Array2<f64>

Compute the exact projected matrix F^T B F.

Source

fn projected_matrix_cached( &self, factor: &Array2<f64>, factor_cache: &ProjectedFactorCache, ) -> Array2<f64>

Compute the exact projected matrix F^T B F, reusing caller-owned projection caches when the operator has a shared row/design factor.

Source

fn mul_basis_columns_into(&self, start: usize, out: ArrayViewMut2<'_, f64>)

Fill columns [start, start + out.ncols()) of B into out.

Source

fn scaled_add_mul_vec( &self, v: ArrayView1<'_, f64>, scale: f64, out: ArrayViewMut1<'_, f64>, )

Accumulate scale * B · v into caller-owned storage.

Source

fn bilinear(&self, v: &Array1<f64>, u: &Array1<f64>) -> f64

Compute v^T · B · u (bilinear form).

Source

fn bilinear_view(&self, v: ArrayView1<'_, f64>, u: ArrayView1<'_, f64>) -> f64

Compute v^T · B · u without requiring owned vector inputs.

Source

fn has_fast_bilinear_view(&self) -> bool

Whether bilinear_view is implemented as a direct scalar contraction.

Source

fn to_dense(&self) -> Array2<f64>

Full dense materialization.

Source

fn block_local_data(&self) -> Option<(&Array2<f64>, usize, usize)>

If this operator is block-local, returns the block range and local matrix.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§