mod_transform_matrix Module

Contains various subroutines and functions to switch between linked-list matrix representations, banded matrix representations, and full array matrices.



Contents


Interfaces

public interface matrix_to_array

  • private subroutine matrix_to_complex_array(matrix, array)

    Converts a given matrix data structure with complex nodes to a 2D complex array.

    Arguments

    TypeIntentOptionalAttributesName
    type(matrix_t), intent(in) :: matrix

    the original matrix datastructure

    complex(kind=dp), intent(out) :: array(matrix%matrix_dim,matrix%matrix_dim)

    the resulting complex 2D array

public interface matrix_to_banded

  • private subroutine matrix_to_complex_banded(matrix, subdiags, superdiags, banded)

    Converts a matrix data structure into a complex banded matrix.

    Arguments

    TypeIntentOptionalAttributesName
    type(matrix_t), intent(in) :: matrix

    the original matrix datastructure

    integer, intent(in) :: subdiags

    number of subdiagonals

    integer, intent(in) :: superdiags

    number of superdiagonals

    type(banded_matrix_t), intent(out) :: banded

    the resulting banded datastructure

public interface matrix_to_hermitian_banded

  • private subroutine matrix_to_complex_hermitian_banded(matrix, diags, uplo, banded)

    Converts a matrix data structure into a complex Hermitian banded matrix.

    Arguments

    TypeIntentOptionalAttributesName
    type(matrix_t), intent(in) :: matrix

    the original matrix datastructure

    integer, intent(in) :: diags

    number of sub/superdiagonals

    character, intent(in) :: uplo

    upper or lower triangular part of the matrix

    type(hermitian_banded_matrix_t), intent(out) :: banded

    the resulting banded datastructure

public interface array_to_matrix

  • private function general_array_to_matrix(array, label) result(matrix)

    Converts a given 2D array to the linked-list matrix datastructure.

    Arguments

    TypeIntentOptionalAttributesName
    class(*), intent(in) :: array(:,:)

    the original array

    character(len=*), intent(in), optional :: label

    optional label for matrix datastructure

    Return Value type(matrix_t)

    the resulting matrix datastructure

public interface array_to_banded

  • private subroutine array_to_complex_banded(array, subdiags, superdiags, banded)

    Converts a given array to a banded datastructure.

    Arguments

    TypeIntentOptionalAttributesName
    class(*), intent(in) :: array(:,:)

    the original array

    integer, intent(in) :: subdiags

    the number of subdiagonals

    integer, intent(in) :: superdiags

    the number of superdiagonals

    type(banded_matrix_t), intent(out) :: banded

    the resulting banded datastructure

public interface array_to_hermitian_banded

  • private subroutine array_to_complex_hermitian_banded(array, diags, uplo, banded)

    Converts a given array to a Hermitian banded datastructure.

    Arguments

    TypeIntentOptionalAttributesName
    class(*), intent(in) :: array(:,:)

    the original array

    integer, intent(in) :: diags

    the number of sub/superdiagonals

    character, intent(in) :: uplo

    upper or lower triangular part of the matrix

    type(hermitian_banded_matrix_t), intent(out) :: banded

    the resulting banded datastructure

public interface banded_to_array

  • private pure function banded_to_complex_array(banded) result(array)

    Converts a banded datastructure to a full complex array.

    Arguments

    TypeIntentOptionalAttributesName
    type(banded_matrix_t), intent(in) :: banded

    the original banded datastructure

    Return Value complex(kind=dp)(banded%m,banded%n)

    the resulting complex array

public interface hermitian_banded_to_array

  • private pure function hermitian_banded_to_complex_array(banded) result(array)

    Converts a Hermitian banded datastructure to a full complex array.

    Arguments

    TypeIntentOptionalAttributesName
    type(hermitian_banded_matrix_t), intent(in) :: banded

    the original banded structure

    Return Value complex(kind=dp)(banded%n,banded%n)

    the resulting complex array


Functions

private function general_array_to_matrix(array, label) result(matrix)

Converts a given 2D array to the linked-list matrix datastructure.

Arguments

TypeIntentOptionalAttributesName
class(*), intent(in) :: array(:,:)

the original array

character(len=*), intent(in), optional :: label

optional label for matrix datastructure

Return Value type(matrix_t)

the resulting matrix datastructure

private pure function banded_to_complex_array(banded) result(array)

Converts a banded datastructure to a full complex array.

Arguments

TypeIntentOptionalAttributesName
type(banded_matrix_t), intent(in) :: banded

the original banded datastructure

Return Value complex(kind=dp)(banded%m,banded%n)

the resulting complex array

private pure function hermitian_banded_to_complex_array(banded) result(array)

Converts a Hermitian banded datastructure to a full complex array.

Arguments

TypeIntentOptionalAttributesName
type(hermitian_banded_matrix_t), intent(in) :: banded

the original banded structure

Return Value complex(kind=dp)(banded%n,banded%n)

the resulting complex array

private pure function get_array_element(array, irow, icol) result(element)

Retrieves the element at index (i, j) for an array of general type. Returns the element as a (casted) complex type.

Arguments

TypeIntentOptionalAttributesName
class(*), intent(in) :: array(:,:)

the general array

integer, intent(in) :: irow

row index of element

integer, intent(in) :: icol

column index of element

Return Value complex(kind=dp)

the element at position (irow, icol), cast to complex


Subroutines

private subroutine matrix_to_complex_array(matrix, array)

Converts a given matrix data structure with complex nodes to a 2D complex array.

Arguments

TypeIntentOptionalAttributesName
type(matrix_t), intent(in) :: matrix

the original matrix datastructure

complex(kind=dp), intent(out) :: array(matrix%matrix_dim,matrix%matrix_dim)

the resulting complex 2D array

private subroutine matrix_to_complex_banded(matrix, subdiags, superdiags, banded)

Converts a matrix data structure into a complex banded matrix.

Arguments

TypeIntentOptionalAttributesName
type(matrix_t), intent(in) :: matrix

the original matrix datastructure

integer, intent(in) :: subdiags

number of subdiagonals

integer, intent(in) :: superdiags

number of superdiagonals

type(banded_matrix_t), intent(out) :: banded

the resulting banded datastructure

private subroutine matrix_to_complex_hermitian_banded(matrix, diags, uplo, banded)

Converts a matrix data structure into a complex Hermitian banded matrix.

Arguments

TypeIntentOptionalAttributesName
type(matrix_t), intent(in) :: matrix

the original matrix datastructure

integer, intent(in) :: diags

number of sub/superdiagonals

character, intent(in) :: uplo

upper or lower triangular part of the matrix

type(hermitian_banded_matrix_t), intent(out) :: banded

the resulting banded datastructure

private subroutine array_to_complex_banded(array, subdiags, superdiags, banded)

Converts a given array to a banded datastructure.

Arguments

TypeIntentOptionalAttributesName
class(*), intent(in) :: array(:,:)

the original array

integer, intent(in) :: subdiags

the number of subdiagonals

integer, intent(in) :: superdiags

the number of superdiagonals

type(banded_matrix_t), intent(out) :: banded

the resulting banded datastructure

private subroutine array_to_complex_hermitian_banded(array, diags, uplo, banded)

Converts a given array to a Hermitian banded datastructure.

Arguments

TypeIntentOptionalAttributesName
class(*), intent(in) :: array(:,:)

the original array

integer, intent(in) :: diags

the number of sub/superdiagonals

character, intent(in) :: uplo

upper or lower triangular part of the matrix

type(hermitian_banded_matrix_t), intent(out) :: banded

the resulting banded datastructure