Back to Eqiora docs Skip to main content

LinearOperator

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§

type Scalar

Arithmetic value in each mathematical coordinate.

Required Methods§

fn rows(&self) -> usize

Output dimension.

fn columns(&self) -> usize

Input dimension.

fn apply( &self, input: &[Self::Scalar], output: &mut [Self::Scalar], ) -> 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<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

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>

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§

§

impl<O> LinearOperator for Oriented<'_, O>
where O: OrientedLinearOperator + ?Sized,

§

impl<R> LinearOperator for ParameterJacobian<'_, R>
where R: LinearizedRelation<f64> + ?Sized,

§

type Scalar = f64

§

impl<R> LinearOperator for StateJacobian<'_, R>
where R: LinearizedRelation<f64> + ?Sized,

§

type Scalar = f64

§

impl<S> LinearOperator for CsrMatrix<S>
where S: Scalar + ComplexFloat + Sync,

§

type Scalar = S

§

impl<S> LinearOperator for PacketLinearOperator<S>
where S: Scalar + ComplexFloat + Sync,

§

type Scalar = S

§

impl<S> LinearOperator for CanonicalCsrSystemView<S>
where S: Scalar + ComplexFloat<Real = f64> + Sync,

§

type Scalar = S