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§
Sourcefn dim(&self) -> usize
fn dim(&self) -> usize
Operator dimension p such that B · v consumes a p-vector and
produces a p-vector.
Sourcefn mul_vec(&self, v: &Array1<f64>) -> Array1<f64>
fn mul_vec(&self, v: &Array1<f64>) -> Array1<f64>
Compute B · v (matrix-vector product). v and result are p-vectors.
Sourcefn is_implicit(&self) -> bool
fn is_implicit(&self) -> bool
Whether this operator uses implicit (non-materialized) storage.
Provided Methods§
Sourcefn as_any(&self) -> &(dyn Any + 'static)
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.
Sourcefn mul_vec_view(&self, v: ArrayView1<'_, f64>) -> Array1<f64>
fn mul_vec_view(&self, v: ArrayView1<'_, f64>) -> Array1<f64>
Compute B · v from a vector view.
Sourcefn mul_vec_into(&self, v: ArrayView1<'_, f64>, out: ArrayViewMut1<'_, f64>)
fn mul_vec_into(&self, v: ArrayView1<'_, f64>, out: ArrayViewMut1<'_, f64>)
Compute B · v into caller-owned storage.
Sourcefn mul_mat(&self, factor: &Array2<f64>) -> Array2<f64>
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.
Sourcefn trace_projected_factor(&self, factor: &Array2<f64>) -> f64
fn trace_projected_factor(&self, factor: &Array2<f64>) -> f64
Compute trace(F^T B F) for a (p x k) factor matrix F.
Sourcefn projection_design_id(&self) -> Option<usize>
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.
fn trace_projected_factor_cached( &self, factor: &Array2<f64>, factor_cache: &ProjectedFactorCache, ) -> f64
Sourcefn projected_matrix(&self, factor: &Array2<f64>) -> Array2<f64>
fn projected_matrix(&self, factor: &Array2<f64>) -> Array2<f64>
Compute the exact projected matrix F^T B F.
Sourcefn projected_matrix_cached(
&self,
factor: &Array2<f64>,
factor_cache: &ProjectedFactorCache,
) -> Array2<f64>
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.
Sourcefn mul_basis_columns_into(&self, start: usize, out: ArrayViewMut2<'_, f64>)
fn mul_basis_columns_into(&self, start: usize, out: ArrayViewMut2<'_, f64>)
Fill columns [start, start + out.ncols()) of B into out.
Sourcefn scaled_add_mul_vec(
&self,
v: ArrayView1<'_, f64>,
scale: f64,
out: ArrayViewMut1<'_, f64>,
)
fn scaled_add_mul_vec( &self, v: ArrayView1<'_, f64>, scale: f64, out: ArrayViewMut1<'_, f64>, )
Accumulate scale * B · v into caller-owned storage.
Sourcefn bilinear(&self, v: &Array1<f64>, u: &Array1<f64>) -> f64
fn bilinear(&self, v: &Array1<f64>, u: &Array1<f64>) -> f64
Compute v^T · B · u (bilinear form).
Sourcefn bilinear_view(&self, v: ArrayView1<'_, f64>, u: ArrayView1<'_, f64>) -> f64
fn bilinear_view(&self, v: ArrayView1<'_, f64>, u: ArrayView1<'_, f64>) -> f64
Compute v^T · B · u without requiring owned vector inputs.
Sourcefn has_fast_bilinear_view(&self) -> bool
fn has_fast_bilinear_view(&self) -> bool
Whether bilinear_view is implemented as a direct scalar contraction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".