state_vector_rdp Derived Type

type, public, extends(abstract_vector_rdp) :: state_vector_rdp


Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: x = 0.0_dp
real(kind=dp), public :: y = 0.0_dp
real(kind=dp), public :: z = 0.0_dp

Type-Bound Procedures

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

Adds two abstract_vector, i.e. .

  • private subroutine add_rdp(self, vec)

    Add two abstract_vector in-place.

    Arguments

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

    Input/Output vector.

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

    Vector to be added.

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

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

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: alpha
    class(abstract_vector_rdp), intent(in) :: vec
    real(kind=dp), intent(in) :: beta
    class(state_vector_rdp), intent(inout) :: self

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

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

  • private subroutine chsgn_rdp(self)

    Changes the sign of the abstract_vector.

    Arguments

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

    Vector whose entries need to change sign.

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

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

    Arguments

    Type IntentOptional Attributes Name
    class(state_vector_rdp), intent(in) :: self
    class(abstract_vector_rdp), intent(in) :: vec

    Return Value real(kind=dp)

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

  • private function get_size_state_rdp(self) result(N)

    Arguments

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

    Return Value integer

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

Computes the norm of the abstract_vector.

  • private function norm_rdp(self) result(alpha)

    Compute the norm of an abstract_vector.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_vector_rdp), 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_rdp

  • private subroutine rand_state_rdp(self, ifnorm)

    Arguments

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

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

  • private subroutine scal_state_rdp(self, alpha)

    Arguments

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

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

Subtracts two abstract_vector, i.e. .

  • private subroutine sub_rdp(self, vec)

    Subtract two abstract_vector in-place.

    Arguments

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

    Input/Output vector.

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

    Vector to be added.

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

  • private subroutine zero_state_rdp(self)

    Arguments

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

Source Code

    type, extends(abstract_vector_rdp), public :: state_vector_rdp
       real(dp) :: x = 0.0_dp
       real(dp) :: y = 0.0_dp
       real(dp) :: z = 0.0_dp
    contains
       private
       procedure, pass(self), public :: zero => zero_state_rdp
       procedure, pass(self), public :: dot => dot_state_rdp
       procedure, pass(self), public :: scal => scal_state_rdp
       procedure, pass(self), public :: axpby => axpby_state_rdp
       procedure, pass(self), public :: rand => rand_state_rdp
       procedure, pass(self), public :: get_size => get_size_state_rdp
    end type state_vector_rdp