Back to Eqiora docs Skip to main content

LinearOperator

Trait LinearOperator 

pub trait LinearOperator: Debug + Sync {
    // Required methods
    fn rows(&self) -> usize;
    fn columns(&self) -> usize;
    fn apply(&self, input: &[f64], output: &mut [f64]) -> Result<(), Diagnostic>;

    // Provided methods
    fn row_action(&self) -> Option<&dyn RowLinearAction> { ... }
    fn orientation(&self) -> LinearOperatorOrientation { ... }
    fn diagonal(
        &self,
        _output: &mut [f64],
    ) -> Result<DiagonalAvailability, Diagnostic> { ... }
}
Description

A host-local linear action over complete finite f64 vectors.

This v0 trait is intentionally not a distributed-vector abstraction. The complete input is resident in one process, the caller owns both buffers, and apply must not allocate merely to return its output.

Required Methods§

fn rows(&self) -> usize

Output dimension.

fn columns(&self) -> usize

Input dimension.

fn apply(&self, input: &[f64], output: &mut [f64]) -> Result<(), Diagnostic>

Compute output = self * input.

§Errors

Returns a numerical diagnostic for shape or non-finite failures.

Provided Methods§

fn row_action(&self) -> Option<&dyn RowLinearAction>

Expose independently executable row ranges when the realization has that capability.

The default is an explicit absence. Threaded adapters must fail closed rather than silently running an unpartitionable operator serially.

fn orientation(&self) -> LinearOperatorOrientation

Orientation represented by this callable action.

Ordinary operators are normal. Eqiora’s Transposed view overrides this metadata so solve evidence distinguishes A x = b from A^T x = b without duplicating the solver plan.

fn diagonal( &self, _output: &mut [f64], ) -> Result<DiagonalAvailability, Diagnostic>

Write the operator diagonal when it is naturally available.

The default reports Unavailable without modifying output.

§Errors

Implementations return a numerical diagnostic for shape or non-finite failures.

Implementors§