Skip to main content

LocalDesignJacobianProvider

Trait LocalDesignJacobianProvider 

Source
pub trait LocalDesignJacobianProvider:
    Send
    + Sync
    + Debug {
    // Required methods
    fn n_data(&self) -> usize;
    fn latent_dim(&self) -> usize;
    fn n_axes(&self) -> usize;
    fn p_out(&self) -> usize;
    fn local_design_jacobian_row(
        &self,
        row: usize,
        axis: usize,
    ) -> Result<Array1<f64>, BasisError>;

    // Provided methods
    fn row_axis(&self, flat_axis: usize) -> (usize, usize) { ... }
    fn forward_mul_axis(
        &self,
        flat_axis: usize,
        u: &ArrayView1<'_, f64>,
    ) -> Result<Array1<f64>, BasisError> { ... }
    fn transpose_mul_axis(
        &self,
        flat_axis: usize,
        v: &ArrayView1<'_, f64>,
    ) -> Result<Array1<f64>, BasisError> { ... }
    fn materialize_axis(
        &self,
        flat_axis: usize,
    ) -> Result<Array2<f64>, BasisError> { ... }
}
Expand description

The complete contract a per-row latent / novel-manifold coordinate type must supply to participate in the REML design-derivative operator surface.

Onboarding a new coordinate type (the SAE / novel-manifold frontier) reduces to implementing the small set of required methods below — the coordinate geometry (n_data, latent_dim, n_axes) plus the single genuinely-new payload local_design_jacobian_row (the local block ∂(design row)/∂(coord)). The streaming operator surface consumed by LatentCoordDerivativeOp in src/solver/reml/mod.rs — forward matvec, transpose matvec, and dense materialization, together with the flat-axis → (row, axis) decode — is inherited as default methods and never re-implemented per coordinate type.

This is the close condition for #767: a new coordinate type touches zero operator-surface code; it provides only its local Jacobian and geometry.

Required Methods§

Source

fn n_data(&self) -> usize

Number of data rows n the operator spans.

Source

fn latent_dim(&self) -> usize

Latent coordinate dimension d (perturbation axes per row).

Source

fn n_axes(&self) -> usize

Number of flat hyper-axes n · d (one per (row, coordinate-axis) pair).

Source

fn p_out(&self) -> usize

Number of output-basis columns in each local design-Jacobian row.

Source

fn local_design_jacobian_row( &self, row: usize, axis: usize, ) -> Result<Array1<f64>, BasisError>

The only per-coordinate payload: the projected local design-Jacobian row ∂(design row row)/∂(coordinate axis axis) in output-basis columns.

Provided Methods§

Source

fn row_axis(&self, flat_axis: usize) -> (usize, usize)

Decode a flat hyper-axis into its (row, coordinate axis). Row-major over (row, axis) with stride latent_dim; uniform across coordinate types.

Source

fn forward_mul_axis( &self, flat_axis: usize, u: &ArrayView1<'_, f64>, ) -> Result<Array1<f64>, BasisError>

Forward matvec for one flat hyper-axis: place J_row · u at row.

Source

fn transpose_mul_axis( &self, flat_axis: usize, v: &ArrayView1<'_, f64>, ) -> Result<Array1<f64>, BasisError>

Transpose matvec for one flat hyper-axis: scatter v[row] · J_rowᵀ.

Source

fn materialize_axis(&self, flat_axis: usize) -> Result<Array2<f64>, BasisError>

Dense (n_data × p_out) materialization of one flat hyper-axis: the local Jacobian row placed at row, all other rows zero.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§