state_vector_cdp Derived Type

type, public, extends(abstract_vector_cdp) :: state_vector_cdp


Components

Type Visibility Attributes Name Initial
complex(kind=dp), public :: x = cmplx(0.0_dp, 0.0_dp, kind=dp)
complex(kind=dp), public :: y = cmplx(0.0_dp, 0.0_dp, kind=dp)
complex(kind=dp), public :: z = cmplx(0.0_dp, 0.0_dp, kind=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_state_cdp

  • private subroutine axpby_state_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(state_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_state_cdp

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

    Arguments

    Type IntentOptional Attributes Name
    class(state_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_state_cdp

  • private function get_size_state_cdp(self) result(N)

    Arguments

    Type IntentOptional Attributes Name
    class(state_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_state_cdp

  • private subroutine rand_state_cdp(self, ifnorm)

    Arguments

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

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

  • private subroutine scal_state_cdp(self, alpha)

    Arguments

    Type IntentOptional Attributes Name
    class(state_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 subtracted.

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

  • private subroutine zero_state_cdp(self)

    Arguments

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

Source Code

    type, extends(abstract_vector_cdp), public :: state_vector_cdp
       complex(dp) :: x = cmplx(0.0_dp, 0.0_dp, kind=dp)
       complex(dp) :: y = cmplx(0.0_dp, 0.0_dp, kind=dp)
       complex(dp) :: z = cmplx(0.0_dp, 0.0_dp, kind=dp)
    contains
       private
       procedure, pass(self), public :: zero => zero_state_cdp
       procedure, pass(self), public :: dot => dot_state_cdp
       procedure, pass(self), public :: scal => scal_state_cdp
       procedure, pass(self), public :: axpby => axpby_state_cdp
       procedure, pass(self), public :: rand => rand_state_cdp
       procedure, pass(self), public :: get_size => get_size_state_cdp
    end type state_vector_cdp