Abstract type to define complex(dp)-valued vectors. Derived-types defined by the user should be extending one such class.
Adds two abstract_vector
, i.e. .
Add two abstract_vector
in-place.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(inout) | :: | self |
Input/Output vector. |
||
class(abstract_vector_cdp), | intent(in) | :: | vec |
Vector to be added. |
In-place computation of .
Abstract interface to add/scale two vectors in-place.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in) | :: | alpha | |||
class(abstract_vector_cdp), | intent(in) | :: | vec |
Vector to be added/subtracted. |
||
complex(kind=dp), | intent(in) | :: | beta | |||
class(abstract_vector_cdp), | intent(inout) | :: | self |
Input/Output vector. |
Change the sign of a vector, i.e. .
Changes the sign of the abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(inout) | :: | self |
Vector whose entries need to change sign. |
Computes the dot product between two abstract_vector_cdp
.
Abstract interface to compute the dot product.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(in) | :: | self |
Vectors whose dot product will be computed. |
||
class(abstract_vector_cdp), | intent(in) | :: | vec |
Vectors whose dot product will be computed. |
Result of the dot product.
Return size of specific abstract vector
Abstract interface to return the size of the specific abstract vector.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(in) | :: | self |
Vector for which to return the size. |
Size of the vector
Computes the norm of the abstract_vector
.
Compute the norm of an abstract_vector
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(in) | :: | self |
Vector whose norm needs to be computed. |
Norm of the vector.
Creates a random abstract_vector_cdp
.
Abstract interface to generate a random (normalized) vector.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(inout) | :: | self |
Vector to be initialized. |
||
logical, | intent(in), | optional | :: | ifnorm |
Compute the scalar-vector product.
Abstract interface to scale a vector.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(inout) | :: | self |
Vector to be scaled. |
||
complex(kind=dp), | intent(in) | :: | alpha |
Scaling factor. |
Subtracts two abstract_vector
, i.e. .
Subtract two abstract_vector
in-place.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(inout) | :: | self |
Input/Output vector. |
||
class(abstract_vector_cdp), | intent(in) | :: | vec |
Vector to be subtracted. |
Sets an abstract_vector_cdp
to zero.
Abstract interface to zero-out a vector in-place.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_vector_cdp), | intent(inout) | :: | self |
Vector to be zeroed-out. |
type, abstract, extends(abstract_vector), public :: abstract_vector_cdp !! Abstract type to define complex(dp)-valued vectors. !! Derived-types defined by the user should be extending one such class. contains private procedure(abstract_zero_cdp), pass(self), deferred, public :: zero !! Sets an `abstract_vector_cdp` to zero. procedure(abstract_rand_cdp), pass(self), deferred, public :: rand !! Creates a random `abstract_vector_cdp`. procedure(abstract_scal_cdp), pass(self), deferred, public :: scal !! Compute the scalar-vector product. procedure(abstract_axpby_cdp), pass(self), deferred, public :: axpby !! In-place computation of \( \mathbf{y} \leftarrow \alpha \mathbf{x} + \beta \mathbf{y} \). procedure(abstract_dot_cdp), pass(self), deferred, public :: dot !! Computes the dot product between two `abstract_vector_cdp`. procedure(abstract_get_size_cdp), pass(self), deferred, public :: get_size !! Return size of specific abstract vector procedure, pass(self), public :: norm => norm_cdp !! Computes the norm of the `abstract_vector`. procedure, pass(self), public :: add => add_cdp !! Adds two `abstract_vector`, i.e. \( \mathbf{y} \leftarrow \mathbf{x} + \mathbf{y}\). procedure, pass(self), public :: sub => sub_cdp !! Subtracts two `abstract_vector`, i.e. \( \mathbf{y} \leftarrow \mathbf{y} - \mathbf{x} \). procedure, pass(self), public :: chsgn => chsgn_cdp !! Change the sign of a vector, i.e. \( \mathbf{x} \leftarrow -\mathbf{x} \). end type abstract_vector_cdp