This module provides the base classes abtract_linop_rsp
, abstract_linop_rdp
,
abstract_linop_csp
and abstract_linop_cdp
which can be used to define your own
linear operators. To do so, you simply need to provide two type-bound procedures:
matvec(self, vec_in, vec_out)
: Computes the matrix-vector product.rmatvec(self, vec_in, vec_out)
: Computes the transpose matrix-vector product.It also provides extended types to define the identity operator, symmetric linear operators, scalar-multiplication of a linear multiplication, as well as addition of two linear operators.
Abstract representation of an abstract hermitian (complex-valued) linear operator.
procedure(abstract_matvec_cdp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_cdp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Abstract representation of an abstract hermitian (complex-valued) linear operator.
procedure(abstract_matvec_csp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_csp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Base type to define an abstract linear operator. All other types defined in
LightKrylov
derive from this fundamental one.
Base type to extend in order to define a complex(dp)-valued linear operator.
procedure(abstract_matvec_cdp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_cdp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Base type to extend in order to define a complex(sp)-valued linear operator.
procedure(abstract_matvec_csp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_csp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Base type to extend in order to define a real(dp)-valued linear operator.
procedure(abstract_matvec_rdp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_rdp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Base type to extend in order to define a real(sp)-valued linear operator.
procedure(abstract_matvec_rsp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_rsp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Abstract representation of an abstract symmetric (real valued) linear operator.
procedure(abstract_matvec_rdp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_rdp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Abstract representation of an abstract symmetric (real valued) linear operator.
procedure(abstract_matvec_rsp), public, deferred, pass(self) :: matvec | ../../ Procedure to compute the matrix-vector product . |
procedure(abstract_matvec_rsp), public, deferred, pass(self) :: rmatvec | ../../ Procedure to compute the reversed matrix-vector product . |
Utility type to define an adjoint linear operator. The definition of matvec
and rmatvec
are directly inherited from those used to define A
. Note that this utility does not
compute the adjoint for you. It simply provides a utility to define a new operator
with matvec
and rmatvec
being switched.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_cdp), | public, | allocatable | :: | A |
Linear operator whose adjoint needs to be defined. |
procedure, public, pass(self) :: matvec => adjoint_matvec_cdp | |
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_cdp |
Utility type to define an adjoint linear operator. The definition of matvec
and rmatvec
are directly inherited from those used to define A
. Note that this utility does not
compute the adjoint for you. It simply provides a utility to define a new operator
with matvec
and rmatvec
being switched.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_csp), | public, | allocatable | :: | A |
Linear operator whose adjoint needs to be defined. |
procedure, public, pass(self) :: matvec => adjoint_matvec_csp | |
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_csp |
Utility type to define an adjoint linear operator. The definition of matvec
and rmatvec
are directly inherited from those used to define A
. Note that this utility does not
compute the adjoint for you. It simply provides a utility to define a new operator
with matvec
and rmatvec
being switched.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_rdp), | public, | allocatable | :: | A |
Linear operator whose adjoint needs to be defined. |
procedure, public, pass(self) :: matvec => adjoint_matvec_rdp | |
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_rdp |
Utility type to define an adjoint linear operator. The definition of matvec
and rmatvec
are directly inherited from those used to define A
. Note that this utility does not
compute the adjoint for you. It simply provides a utility to define a new operator
with matvec
and rmatvec
being switched.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_rsp), | public, | allocatable | :: | A |
Linear operator whose adjoint needs to be defined. |
procedure, public, pass(self) :: matvec => adjoint_matvec_rsp | |
procedure, public, pass(self) :: rmatvec => adjoint_rmatvec_rsp |
Utility type to define a composite linear operator .
The definitions of matvec
and rmatvec
are directly inherited from those used to
define A
and B
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_cdp), | public, | allocatable | :: | A |
Underlying linear operators. |
||
class(abstract_linop_cdp), | public, | allocatable | :: | B |
Underlying linear operators. |
||
complex(kind=dp), | public | :: | alpha |
Scaling factors. |
|||
complex(kind=dp), | public | :: | beta |
Scaling factors. |
|||
logical, | public | :: | transA | = | .false. |
Logical flag to control whether and/or need to be transposed. |
|
logical, | public | :: | transB | = | .false. |
Logical flag to control whether and/or need to be transposed. |
procedure, public, pass(self) :: matvec => axpby_matvec_cdp | |
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_cdp |
Utility type to define a composite linear operator .
The definitions of matvec
and rmatvec
are directly inherited from those used to
define A
and B
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_csp), | public, | allocatable | :: | A |
Underlying linear operators. |
||
class(abstract_linop_csp), | public, | allocatable | :: | B |
Underlying linear operators. |
||
complex(kind=sp), | public | :: | alpha |
Scaling factors. |
|||
complex(kind=sp), | public | :: | beta |
Scaling factors. |
|||
logical, | public | :: | transA | = | .false. |
Logical flag to control whether and/or need to be transposed. |
|
logical, | public | :: | transB | = | .false. |
Logical flag to control whether and/or need to be transposed. |
procedure, public, pass(self) :: matvec => axpby_matvec_csp | |
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_csp |
Utility type to define a composite linear operator .
The definitions of matvec
and rmatvec
are directly inherited from those used to
define A
and B
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_rdp), | public, | allocatable | :: | A |
Underlying linear operators. |
||
class(abstract_linop_rdp), | public, | allocatable | :: | B |
Underlying linear operators. |
||
real(kind=dp), | public | :: | alpha |
Scaling factors. |
|||
real(kind=dp), | public | :: | beta |
Scaling factors. |
|||
logical, | public | :: | transA | = | .false. |
Logical flag to control whether and/or need to be transposed. |
|
logical, | public | :: | transB | = | .false. |
Logical flag to control whether and/or need to be transposed. |
procedure, public, pass(self) :: matvec => axpby_matvec_rdp | |
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_rdp |
Utility type to define a composite linear operator .
The definitions of matvec
and rmatvec
are directly inherited from those used to
define A
and B
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_rsp), | public, | allocatable | :: | A |
Underlying linear operators. |
||
class(abstract_linop_rsp), | public, | allocatable | :: | B |
Underlying linear operators. |
||
real(kind=sp), | public | :: | alpha |
Scaling factors. |
|||
real(kind=sp), | public | :: | beta |
Scaling factors. |
|||
logical, | public | :: | transA | = | .false. |
Logical flag to control whether and/or need to be transposed. |
|
logical, | public | :: | transB | = | .false. |
Logical flag to control whether and/or need to be transposed. |
procedure, public, pass(self) :: matvec => axpby_matvec_rsp | |
procedure, public, pass(self) :: rmatvec => axpby_rmatvec_rsp |
Defines a scaled linear operator with a complex-valued operator and .
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_cdp), | public, | allocatable | :: | A |
Base linear operator to be scaled. |
||
complex(kind=dp), | public | :: | sigma |
Scaling factor. |
procedure, public, pass(self) :: matvec => scaled_matvec_cdp | |
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_cdp |
Defines a scaled linear operator with a complex-valued operator and .
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_csp), | public, | allocatable | :: | A |
Base linear operator to be scaled. |
||
complex(kind=sp), | public | :: | sigma |
Scaling factor. |
procedure, public, pass(self) :: matvec => scaled_matvec_csp | |
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_csp |
Defines a scaled linear operator with a real-valued operator and . The definitions of matvec
and rmatvec
are directly inherited from those used to define A
and do not have to
be defined by the user.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_rdp), | public, | allocatable | :: | A |
Base linear operator to be scaled. |
||
real(kind=dp), | public | :: | sigma |
Scaling factor. |
procedure, public, pass(self) :: matvec => scaled_matvec_rdp | |
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_rdp |
Defines a scaled linear operator with a real-valued operator and . The definitions of matvec
and rmatvec
are directly inherited from those used to define A
and do not have to
be defined by the user.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(abstract_linop_rsp), | public, | allocatable | :: | A |
Base linear operator to be scaled. |
||
real(kind=sp), | public | :: | sigma |
Scaling factor. |
procedure, public, pass(self) :: matvec => scaled_matvec_rsp | |
procedure, public, pass(self) :: rmatvec => scaled_rmatvec_rsp |