vector_cdp Derived Type

type, public, extends(abstract_vector_cdp) :: vector_cdp


Components

Type Visibility Attributes Name Initial
complex(kind=dp), public, dimension(test_size) :: data = 0.0_dp

Type-Bound Procedures

procedure, public, pass(self) :: add => add_cdp

Adds two abstract_vector, i.e. .

  • private subroutine add_cdp(self, vec)

    Add two abstract_vector in-place.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_vector_cdp), intent(inout) :: self

    Input/Output vector.

    class(abstract_vector_cdp), intent(in) :: vec

    Vector to be added.

procedure, public, pass(self) :: axpby => axpby_cdp

  • private subroutine axpby_cdp(alpha, vec, beta, self)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: alpha
    class(abstract_vector_cdp), intent(in) :: vec
    complex(kind=dp), intent(in) :: beta
    class(vector_cdp), intent(inout) :: self

procedure, public, pass(self) :: chsgn => chsgn_cdp

Change the sign of a vector, i.e. .

  • private subroutine chsgn_cdp(self)

    Changes the sign of the abstract_vector.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_vector_cdp), intent(inout) :: self

    Vector whose entries need to change sign.

procedure, public, pass(self) :: dot => dot_cdp

  • private function dot_cdp(self, vec) result(alpha)

    Arguments

    Type IntentOptional Attributes Name
    class(vector_cdp), intent(in) :: self
    class(abstract_vector_cdp), intent(in) :: vec

    Return Value complex(kind=dp)

procedure, public, pass(self) :: get_size => get_size_cdp

  • private function get_size_cdp(self) result(N)

    Arguments

    Type IntentOptional Attributes Name
    class(vector_cdp), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: norm => norm_cdp

Computes the norm of the abstract_vector.

  • private function norm_cdp(self) result(alpha)

    Compute the norm of an abstract_vector.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_vector_cdp), intent(in) :: self

    Vector whose norm needs to be computed.

    Return Value real(kind=dp)

    Norm of the vector.

procedure, public, pass(self) :: rand => rand_cdp

  • private subroutine rand_cdp(self, ifnorm)

    Arguments

    Type IntentOptional Attributes Name
    class(vector_cdp), intent(inout) :: self
    logical, intent(in), optional :: ifnorm

procedure, public, pass(self) :: scal => scal_cdp

  • private subroutine scal_cdp(self, alpha)

    Arguments

    Type IntentOptional Attributes Name
    class(vector_cdp), intent(inout) :: self
    complex(kind=dp), intent(in) :: alpha

procedure, public, pass(self) :: sub => sub_cdp

Subtracts two abstract_vector, i.e. .

  • private subroutine sub_cdp(self, vec)

    Subtract two abstract_vector in-place.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_vector_cdp), intent(inout) :: self

    Input/Output vector.

    class(abstract_vector_cdp), intent(in) :: vec

    Vector to be added.

procedure, public, pass(self) :: zero => init_zero_cdp

  • private subroutine init_zero_cdp(self)

    Arguments

    Type IntentOptional Attributes Name
    class(vector_cdp), intent(inout) :: self

Source Code

    type, extends(abstract_vector_cdp), public :: vector_cdp
        complex(dp), dimension(test_size) :: data = 0.0_dp
    contains
        private
        procedure, pass(self), public :: zero => init_zero_cdp
        procedure, pass(self), public :: dot => dot_cdp
        procedure, pass(self), public :: scal => scal_cdp
        procedure, pass(self), public :: axpby => axpby_cdp
        procedure, pass(self), public :: rand => rand_cdp
        procedure, pass(self), public :: get_size => get_size_cdp
    end type vector_cdp