mod_matrix_node Module

Module that contains the implementation of nodes in the linked-list matrix representation.



Contents


Derived Types

type, public :: node_t

Base node corresponding to a given column - value pair for a given row

Components

TypeVisibilityAttributesNameInitial
integer, public :: column

column index

complex(kind=dp), private :: element

complex value for the matrix element

class(node_t), public, pointer:: next

pointer to next node

Type-Bound Procedures

procedure, public :: add_to_node_element
procedure, public :: get_node_element
procedure, public :: delete

Functions

public pure function new_node(column, element) result(node)

Constructor for a new node, sets the column and element attributes. The element passed is polymorphic, but will be cast to complex in the node itself. No nodes are linked yet; the pointer to the next node is initialised to null().

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: column

column index

class(*), intent(in) :: element

element added to the node

Return Value type(node_t)

new node with given column and element attributes

private pure function get_node_element(this) result(element)

Returns the node element.

Arguments

TypeIntentOptionalAttributesName
class(node_t), intent(in) :: this

type instance

Return Value complex(kind=dp)

node element


Subroutines

private pure subroutine delete(this)

Destructor, deallocates the node attributes.

Arguments

TypeIntentOptionalAttributesName
class(node_t), intent(inout) :: this

type instance

private subroutine add_to_node_element(this, element)

Adds a given element to the node element, does type-checking of the polymorphic element given. Allowed types are complex, real, integer.

Arguments

TypeIntentOptionalAttributesName
class(node_t), intent(inout) :: this

type instance

class(*), intent(in) :: element

element to add to the existing element