Trait LinearOperator
pub trait LinearOperator: Debug + Sync {
type Scalar;
// Required methods
fn rows(&self) -> usize;
fn columns(&self) -> usize;
fn apply(
&self,
input: &[Self::Scalar],
output: &mut [Self::Scalar],
) -> Result<(), Diagnostic>;
// Provided methods
fn row_action(&self) -> Option<&dyn RowLinearAction<Scalar = Self::Scalar>> { ... }
fn orientation(&self) -> LinearOperatorOrientation { ... }
fn diagonal(
&self,
_output: &mut [Self::Scalar],
) -> Result<DiagonalAvailability, Diagnostic> { ... }
}Description
A host-local linear action over complete typed finite 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 Associated Types§
Required Methods§
Provided Methods§
fn row_action(&self) -> Option<&dyn RowLinearAction<Scalar = Self::Scalar>>
fn row_action(&self) -> Option<&dyn RowLinearAction<Scalar = Self::Scalar>>
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
fn orientation(&self) -> LinearOperatorOrientation
Orientation represented by this callable action.
Ordinary operators are normal. Eqiora’s Oriented 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 [Self::Scalar],
) -> Result<DiagonalAvailability, Diagnostic>
fn diagonal( &self, _output: &mut [Self::Scalar], ) -> 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.