TripletModule Module

A module for the triplet data type. Each one stores two indices and a value. This is related to sparse matrices, the referencing indices are usually rows and columns.



Contents


Interfaces

public interface SetTriplet

  • private pure subroutine SetTriplet_r(this, index_column, index_row, point_value)

    Set the values of a triplet (real).

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_r), intent(inout) :: this

    The triplet to set the values of.

    integer, intent(in) :: index_column

    The column value.

    integer, intent(in) :: index_row

    The row value.

    real(kind=NTREAL), intent(in) :: point_value

    The value at that point.

  • private pure subroutine SetTriplet_c(this, index_column, index_row, point_value)

    Set the values of a triplet (complex).

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_c), intent(inout) :: this

    The triplet to set the values of.

    integer, intent(in) :: index_column

    The column value.

    integer, intent(in) :: index_row

    The row value.

    complex(kind=NTCOMPLEX), intent(in) :: point_value

    The value at that point.

public interface GetTripletValues

  • private pure subroutine GetTripletValues_r(this, index_column, index_row, point_value)

    Get the values of a triplet.

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_r), intent(in) :: this

    The triplet to extract the values of.

    integer, intent(out) :: index_column

    Column value.

    integer, intent(out) :: index_row

    Row value.

    real(kind=NTREAL), intent(out) :: point_value

    Actual stored value.

  • private pure subroutine GetTripletValues_c(this, index_column, index_row, point_value)

    Get the values of a triplet.

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_c), intent(in) :: this

    The triplet to extract the values of.

    integer, intent(out) :: index_column

    Column value.

    integer, intent(out) :: index_row

    Row value.

    complex(kind=NTCOMPLEX), intent(out) :: point_value

    Actual stored value.

public interface CompareTriplets

  • private pure function CompareTriplets_r(tripA, tripB) result(islessthan)

    Compare two triplets based on their index values, first by column and second by row. Returns A < B.

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_r), intent(in) :: tripA

    First triplet.

    type(Triplet_r), intent(in) :: tripB

    Second triplet.

    Return Value logical

    A < B.

  • private pure function CompareTriplets_c(tripA, tripB) result(islessthan)

    Compare two triplets based on their index values (complex), first by column and second by row. Returns A < B.

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_c), intent(in) :: tripA

    First triplet.

    type(Triplet_c), intent(in) :: tripB

    Second triplet.

    Return Value logical

    A < B.

public interface ConvertTripletType

  • private subroutine ConvertTripletToReal(cin_triplet, rout_triplet)

    Convert a complex triplet to a real triplet.

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_c), intent(in) :: cin_triplet

    The starting triplet

    type(Triplet_r), intent(inout) :: rout_triplet

    Real valued triplet.

  • private subroutine ConvertTripletToComplex(rin_triplet, cout_triplet)

    Convert a real triplet to a complex triplet.

    Arguments

    Type IntentOptional Attributes Name
    type(Triplet_r), intent(in) :: rin_triplet

    The starting triplet.

    type(Triplet_c), intent(inout) :: cout_triplet

    Complex valued triplet.


Derived Types

type, public ::  Triplet_r

A data type for a triplet of integer, integer, double.

Components

Type Visibility Attributes Name Initial
integer, public :: index_column

column value.

integer, public :: index_row

row value.

real(kind=NTREAL), public :: point_value

actual value at those indices.

type, public ::  Triplet_c

A data type for a triplet of integer, integer, complex.

Components

Type Visibility Attributes Name Initial
integer, public :: index_column

column value.

integer, public :: index_row

row value.

complex(kind=NTCOMPLEX), public :: point_value

actual value at those indices.


Functions

public function GetMPITripletType_r() result(mpi_triplet_type)

Returns an MPI derived data type for a triplet (Real). We statically store this derived type so that we do not have to recreate it every time this function is called. Thus this functional call should add very little overhead.

Arguments

None

Return Value integer

MPI Derived Type

public function GetMPITripletType_c() result(mpi_triplet_type)

Returns an MPI derived data type for a triplet (complex). We statically store this derived type so that we do not have to recreate it every time this function is called. Thus this functional call should add very little overhead.

Arguments

None

Return Value integer

MPI Derived Type