brahmap.base.NoiseCovLinearOperator¶
Bases: LinearOperator
Base class for noise covariance operators
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nargin
|
int
|
The number of rows/columns of the operator |
required |
matvec
|
Callable
|
A function that defines the matrix-vector product \(x \mapsto N(x)=Nx\) |
required |
input_type
|
Literal['covariance', 'power_spectrum']
|
Specifies whether the input is a covariance array or a power spectrum array,
by default |
'covariance'
|
dtype
|
DTypeFloat
|
The data type of the operator, by default |
float64
|
**kwargs
|
Any
|
Extra keyword arguments |
{}
|
Attributes:
| Name | Type | Description |
|---|---|---|
size |
int
|
The dimension i.e. the number of rows/columns of the operator |
diag |
NDArray[number]
|
An array containing the diagonal of the operator |
Methods:
| Name | Description |
|---|---|
reset_counters |
Resets matrix-vector product counter to zero. |
dot |
Numpy-like dot() method. |
matvec |
Matrix-vector multiplication method. |
to_array |
Returns the dense form of the linear operator as a 2D NumPy array. |
get_inverse |
Returns the inverse of the operator. |
Source code in brahmap/base/noise_ops.py
Attributes¶
dtype: npt.DTypeLike
property
writable
¶
The data type of the operator.
Returns:
| Type | Description |
|---|---|
DTypeLike
|
The NumPy data type of the operator |
nargin: int
property
¶
Size of the input vector \(x\), i.e. the number of columns of the operator
Returns:
| Type | Description |
|---|---|
int
|
The number of input columns |
nargout: int
property
¶
Size of the output vector \(A(x)\), i.e. the number of rows of the operator
Returns:
| Type | Description |
|---|---|
int
|
The number of output rows |
symmetric: bool
property
¶
Indicates whether the operator is symmetric or not
Returns:
| Type | Description |
|---|---|
bool
|
|
shape: Tuple[int, int]
property
¶
A tuple (nargout, nargin) representing the shape of the operator
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
A tuple |
nMatvec: int
property
¶
The number of matrix-vector multiplications computed so far
Returns:
| Type | Description |
|---|---|
int
|
The number of matrix-vector multiplications performed |
T: LinearOperator
property
¶
The transpose operator
Returns:
| Type | Description |
|---|---|
LinearOperator
|
The transpose of this linear operator |
H: LinearOperator
property
¶
The adjoint operator
Returns:
| Type | Description |
|---|---|
LinearOperator
|
The Hermitian adjoint of this linear operator |
size: int
property
¶
The dimension i.e. the number of rows/columns of the operator
Returns:
| Type | Description |
|---|---|
int
|
The size of the operator |
diag: npt.NDArray[np.number]
property
¶
The diagonal of the operator.
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
An array containing the diagonal of the operator |
Functions¶
reset_counters() -> None
¶
dot(x) -> npt.NDArray[np.number]
¶
Numpy-like dot() method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Any
|
The input vector or object to multiply with. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
The result of the dot product. |
Source code in brahmap/base/linop.py
matvec(x) -> npt.NDArray[np.number]
¶
Matrix-vector multiplication method.
The matvec method encapsulates the matvec
routine specified at construct time, to ensure the
consistency of the input and output arrays with the
operator's shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
NDArray[number]
|
The input vector \(x\) to be multiplied by the operator |
required |
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
The result of the matrix-vector multiplication \(A(x)\) |
Source code in brahmap/base/linop.py
to_array() -> npt.NDArray[np.number]
¶
Returns the dense form of the linear operator as a 2D NumPy array.
Warning
This method first allocates a NumPy array of shape self.shape
and data-type self.dtype, and then fills them with numbers. As
such, for a large linear operator, it can occupy an enormous
amount of memory and crash your system. Don't use it unless you
understand the risk!
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
The dense 2D array representation of the linear operator |
Source code in brahmap/base/linop.py
get_inverse() -> InvNoiseCovLinearOperator
¶
Returns the inverse of the operator.
Returns:
| Type | Description |
|---|---|
InvNoiseCovLinearOperator
|
The inverse noise covariance operator |