spmatrix Derived Type

type, public :: spmatrix

Symmetric array class.


Inherited by

type~~spmatrix~~InheritedByGraph type~spmatrix spmatrix type~aggterm aggterm type~aggterm->type~spmatrix a type~pbe pbe type~pbe->type~aggterm agg

Components

Type Visibility Attributes Name Initial
real(kind=rk), public, allocatable :: ap(:)

vector with array values in packed storage format

integer, public :: n

number of rows or columns

character(len=1), public :: uplo = "u"

flag to specify whether the (u)pper or (l)ower triangle is supplied


Constructor

public interface spmatrix

  • private pure function spmatrix_init(n) result(res)

    Initialize spmatrix object.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: n

    number of rows or columns

    Return Value type(spmatrix)


Type-Bound Procedures

procedure, public, pass(self) :: multvec => spmatrix_multvec

  • private pure function spmatrix_multvec(self, x) result(y)

    Performs the matrix-vector operation:

    y:= A*x
    

    where x is an n element vector and A is a n*n symmetric matrix. Source: Lapack

    Arguments

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

    symmetric array(n,n)

    real(kind=rk), intent(in) :: x(:)

    vector(n)

    Return Value real(kind=rk), (size(x))

procedure, public, pass(self) :: get => spmatrix_get

  • private elemental function spmatrix_get(self, i, j) result(res)

    Get value of .

    Arguments

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

    object

    integer, intent(in) :: i

    index

    integer, intent(in) :: j

    index

    Return Value real(kind=rk)

procedure, public, pass(self) :: set => spmatrix_set

  • private pure subroutine spmatrix_set(self, i, j, x)

    Set value of .

    Arguments

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

    object

    integer, intent(in) :: i

    index

    integer, intent(in) :: j

    index

    real(kind=rk), intent(in) :: x

    value

Source Code

   type :: spmatrix
   !! Symmetric array class.
      real(rk), allocatable :: ap(:)
         !! vector with array values in packed storage format
      integer :: n
         !! number of rows or columns
      character(1) :: uplo = "u"
         !! flag to specify whether the (u)pper or (l)ower triangle is supplied
   contains
      procedure, pass(self) :: multvec => spmatrix_multvec
      procedure, pass(self) :: get => spmatrix_get
      procedure, pass(self) :: set => spmatrix_set
   end type spmatrix