Abstract type to define complex(sp)-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_csp), | intent(inout) | :: | self | 
                 Input/Output vector.  | 
        ||
| class(abstract_vector_csp), | 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=sp), | intent(in) | :: | alpha | |||
| class(abstract_vector_csp), | intent(in) | :: | vec | 
                 Vector to be added/subtracted.  | 
        ||
| complex(kind=sp), | intent(in) | :: | beta | |||
| class(abstract_vector_csp), | 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_csp), | intent(inout) | :: | self | 
                 Vector whose entries need to change sign.  | 
        
Computes the dot product between two abstract_vector_csp.
Abstract interface to compute the dot product.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_vector_csp), | intent(in) | :: | self | 
                 Vectors whose dot product will be computed.  | 
        ||
| class(abstract_vector_csp), | 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_csp), | 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_csp), | intent(in) | :: | self | 
                 Vector whose norm needs to be computed.  | 
        
Norm of the vector.
Creates a random abstract_vector_csp.
Abstract interface to generate a random (normalized) vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_vector_csp), | 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_csp), | intent(inout) | :: | self | 
                 Vector to be scaled.  | 
        ||
| complex(kind=sp), | 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_csp), | intent(inout) | :: | self | 
                 Input/Output vector.  | 
        ||
| class(abstract_vector_csp), | intent(in) | :: | vec | 
                 Vector to be subtracted.  | 
        
Sets an abstract_vector_csp to zero.
Abstract interface to zero-out a vector in-place.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_vector_csp), | intent(inout) | :: | self | 
                 Vector to be zeroed-out.  | 
        
type, abstract, extends(abstract_vector), public :: abstract_vector_csp !! Abstract type to define complex(sp)-valued vectors. !! Derived-types defined by the user should be extending one such class. contains private procedure(abstract_zero_csp), pass(self), deferred, public :: zero !! Sets an `abstract_vector_csp` to zero. procedure(abstract_rand_csp), pass(self), deferred, public :: rand !! Creates a random `abstract_vector_csp`. procedure(abstract_scal_csp), pass(self), deferred, public :: scal !! Compute the scalar-vector product. procedure(abstract_axpby_csp), pass(self), deferred, public :: axpby !! In-place computation of \( \mathbf{y} \leftarrow \alpha \mathbf{x} + \beta \mathbf{y} \). procedure(abstract_dot_csp), pass(self), deferred, public :: dot !! Computes the dot product between two `abstract_vector_csp`. procedure(abstract_get_size_csp), pass(self), deferred, public :: get_size !! Return size of specific abstract vector procedure, pass(self), public :: norm => norm_csp !! Computes the norm of the `abstract_vector`. procedure, pass(self), public :: add => add_csp !! Adds two `abstract_vector`, i.e. \( \mathbf{y} \leftarrow \mathbf{x} + \mathbf{y}\). procedure, pass(self), public :: sub => sub_csp !! Subtracts two `abstract_vector`, i.e. \( \mathbf{y} \leftarrow \mathbf{y} - \mathbf{x} \). procedure, pass(self), public :: chsgn => chsgn_csp !! Change the sign of a vector, i.e. \( \mathbf{x} \leftarrow -\mathbf{x} \). end type abstract_vector_csp