vector_rsp Derived Type

type, public, extends(abstract_vector_rsp) :: vector_rsp


Components

Type Visibility Attributes Name Initial
real(kind=sp), public, dimension(test_size) :: data = 0.0_sp

Type-Bound Procedures

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

Adds two abstract_vector, i.e. .

  • private subroutine add_rsp(self, vec)

    Add two abstract_vector in-place.

    Arguments

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

    Input/Output vector.

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

    Vector to be added.

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

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

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: alpha
    class(abstract_vector_rsp), intent(in) :: vec
    real(kind=sp), intent(in) :: beta
    class(vector_rsp), intent(inout) :: self

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

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

  • private subroutine chsgn_rsp(self)

    Changes the sign of the abstract_vector.

    Arguments

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

    Vector whose entries need to change sign.

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

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

    Arguments

    Type IntentOptional Attributes Name
    class(vector_rsp), intent(in) :: self
    class(abstract_vector_rsp), intent(in) :: vec

    Return Value real(kind=sp)

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

  • private function get_size_rsp(self) result(N)

    Arguments

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

    Return Value integer

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

Computes the norm of the abstract_vector.

  • private function norm_rsp(self) result(alpha)

    Compute the norm of an abstract_vector.

    Arguments

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

    Vector whose norm needs to be computed.

    Return Value real(kind=sp)

    Norm of the vector.

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

  • private subroutine rand_rsp(self, ifnorm)

    Arguments

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

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

  • private subroutine scal_rsp(self, alpha)

    Arguments

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

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

Subtracts two abstract_vector, i.e. .

  • private subroutine sub_rsp(self, vec)

    Subtract two abstract_vector in-place.

    Arguments

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

    Input/Output vector.

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

    Vector to be added.

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

  • private subroutine init_zero_rsp(self)

    Arguments

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

Source Code

    type, extends(abstract_vector_rsp), public :: vector_rsp
        real(sp), dimension(test_size) :: data = 0.0_sp
    contains
        private
        procedure, pass(self), public :: zero => init_zero_rsp
        procedure, pass(self), public :: dot => dot_rsp
        procedure, pass(self), public :: scal => scal_rsp
        procedure, pass(self), public :: axpby => axpby_rsp
        procedure, pass(self), public :: rand => rand_rsp
        procedure, pass(self), public :: get_size => get_size_rsp
    end type vector_rsp