itable_t Derived Type

type, public :: itable_t


Inherits

type~~itable_t~~InheritsGraph type~itable_t itable_t type~ivector_t ivector_t type~itable_t->type~ivector_t buffer

Contents

Source Code


Components

TypeVisibility AttributesNameInitial
integer, public :: num_rows =0
type(ivector_t), public :: buffer
integer, public, dimension(:), allocatable:: row_indx

Type-Bound Procedures

procedure, public :: delete => itbl_delete

  • private subroutine itbl_delete(this)

    Deletes an itable_t. No access is allowed to this object after this call.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(inout) :: this

procedure, public :: clear => itbl_clear

  • private subroutine itbl_clear(this)

    Clears all rows. Does not deallocate memory.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(inout) :: this

procedure, public :: append => itbl_append

  • private subroutine itbl_append(this, irow, val)

    Appends an element val to row irow.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(inout) :: this
    integer, intent(in) :: irow
    integer, intent(in) :: val

procedure, public :: set_val => itbl_set_val

  • private subroutine itbl_set_val(this, irow, j, val)

    Sets the value of the jth element of row irow.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(inout) :: this
    integer, intent(in) :: irow
    integer, intent(in) :: j
    integer, intent(in) :: val

procedure, public :: is_in => itbl_is_in

  • private function itbl_is_in(this, irow, val) result(res)

    Returns .true. if val is in row irow, .false. otherwise.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(in) :: this
    integer, intent(in) :: irow
    integer, intent(in) :: val

    Return Value logical

procedure, public :: get_val => itbl_get_val

  • private function itbl_get_val(this, irow, j) result(res)

    Returns the jth element of row irow

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(in) :: this
    integer, intent(in) :: irow
    integer, intent(in) :: j

    Return Value integer

procedure, public :: get_row => itbl_get_row

  • private subroutine itbl_get_row(this, irow, res)

    Returns a pointer to the row data of irow. No bounds checking is performed.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(in), target:: this
    integer, intent(in) :: irow
    integer, intent(out), dimension(:), pointer:: res

procedure, public :: shrink_to_fit => itbl_shrink_to_fit

  • private subroutine itbl_shrink_to_fit(this, ierr)

    Releases additional memory to fit underlying data.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(inout) :: this
    integer, intent(out), optional :: ierr

procedure, public :: print => itbl_print

  • private subroutine itbl_print(this)

    Prints an itable_t.

    Arguments

    Type IntentOptional AttributesName
    class(itable_t), intent(in) :: this

Source Code

type itable_t
    integer :: num_rows = 0 !Must be > 0
    type(ivector_t) :: buffer
    integer, dimension(:), allocatable :: row_indx

    contains
        procedure :: delete   => itbl_delete
        procedure :: clear    => itbl_clear
        procedure :: append   => itbl_append
        procedure :: set_val  => itbl_set_val
        procedure :: is_in    => itbl_is_in
        procedure :: get_val  => itbl_get_val
        procedure :: get_row  => itbl_get_row
        procedure :: shrink_to_fit  => itbl_shrink_to_fit
        procedure :: print    => itbl_print
end type itable_t