1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Abstract linear operator interface.
//!
//! An abstract linear operator is a linear mapping A:X -> Y, where
//! X and Y are arbitrary vector spaces. The space `X` is the `domain`
//! space and the space `Y` is the `range` space. Every abstract linear operator
//! provides an [OperatorBase::apply] method that implements the map `y = Ax` for
//! `x` an element of `X`.
//!
//! To define an abstract linear operator one needs to implement the [OperatorBase] trait on a
//! type `Op_Impl`. The type `Operator<Op_Impl: OperatorBase>` then implements a complete algebra,
//! including [std::ops::Add], [std::ops::Sub], [std::ops::Mul] for a scalar parameter, [std::ops::AddAssign],
//! [std::ops::SubAssign], [std::ops::Neg], and [std::ops::MulAssign] for operators as long as the underlying
//! spaces support the corresponding operations on their elements.
use ;
use crate::;
/// Interface between an abstract linear operator and its implementation.
///
/// `Domain` and `Range` identify the spaces whose elements are accepted by
/// [`Self::apply`]. Implementations must preserve the BLAS-like algebraic contract
/// `y <- alpha A x + beta y`. Implementations may still evaluate the prior value of `y`
/// when `beta` is zero, so initialize `y` to finite values unless the concrete operator
/// documents otherwise.