datastructs_lists_fixed_list_mod Module

This module implements a fixed list, that has a fixed size and cannot be resized. It also has pointers, allowing to build a linked list structure. Example:

program example_fixed_list
    use datastructs_fortran
    use kinds_mod
    implicit none
    type(fixed_list_t) :: my_list
    type(fixed_list_t), target :: my_list2
    my_list = fixed_list([1,2,3,4,5])
    my_list2 = fixed_list([6,7,8])

    call my_list%print()

    my_list%next => my_list2

    call my_list%next%print()
end program example_fixed_list

Uses

  • module~~datastructs_lists_fixed_list_mod~~UsesGraph module~datastructs_lists_fixed_list_mod datastructs_lists_fixed_list_mod module~datastructs_kinds_mod datastructs_kinds_mod module~datastructs_lists_fixed_list_mod->module~datastructs_kinds_mod iso_fortran_env iso_fortran_env module~datastructs_kinds_mod->iso_fortran_env

Used by

  • module~~datastructs_lists_fixed_list_mod~~UsedByGraph module~datastructs_lists_fixed_list_mod datastructs_lists_fixed_list_mod module~datastructs_lists_mod datastructs_lists_mod module~datastructs_lists_mod->module~datastructs_lists_fixed_list_mod module~datastructs_mod datastructs_mod module~datastructs_mod->module~datastructs_lists_mod module~datastructs_samplers_rejection_maxheap_composition_mod datastructs_samplers_rejection_maxheap_composition_mod module~datastructs_samplers_rejection_maxheap_composition_mod->module~datastructs_lists_mod module~datastructs_samplers_rejection_maxheap_mod datastructs_samplers_rejection_maxheap_mod module~datastructs_samplers_rejection_maxheap_composition_mod->module~datastructs_samplers_rejection_maxheap_mod module~datastructs_samplers_rejection_maxheap_mod->module~datastructs_lists_mod module~datastructs_samplers_rejection_maxheap_two_classes_mod datastructs_samplers_rejection_maxheap_two_classes_mod module~datastructs_samplers_rejection_maxheap_two_classes_mod->module~datastructs_lists_mod module~datastructs_samplers_rejection_maxheap_two_classes_mod->module~datastructs_samplers_rejection_maxheap_mod module~datastructs_samplers_rejection_mod datastructs_samplers_rejection_mod module~datastructs_samplers_rejection_mod->module~datastructs_lists_mod module~datastructs_samplers_rejection_two_classes_mod datastructs_samplers_rejection_two_classes_mod module~datastructs_samplers_rejection_two_classes_mod->module~datastructs_lists_mod module~datastructs_samplers_rejection_two_classes_mod->module~datastructs_samplers_rejection_mod proc~choose_sampler choose_sampler proc~choose_sampler->module~datastructs_samplers_rejection_maxheap_composition_mod proc~choose_sampler->module~datastructs_samplers_rejection_maxheap_mod proc~choose_sampler->module~datastructs_samplers_rejection_maxheap_two_classes_mod proc~choose_sampler->module~datastructs_samplers_rejection_mod proc~choose_sampler->module~datastructs_samplers_rejection_two_classes_mod

Interfaces

public interface fixed_list

Constructor for a fixed list

  • private function fixed_list_new(list) result(this)

    Create a new fixed list Input: list - an array of integers

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i4), intent(in) :: list(:)

    Return Value type(fixed_list_t)


Derived Types

type, public ::  fixed_list_t

Type for a fixed list, that can be used as a list of lists

Components

Type Visibility Attributes Name Initial
integer(kind=i4), public :: initial_index

Metadata

integer(kind=i4), public :: final_index

Metadata

integer(kind=i4), public :: n = 0
integer(kind=i4), public, allocatable :: list(:)
type(fixed_list_t), public, pointer :: next
type(fixed_list_t), public, pointer :: prev

Finalizations Procedures

final :: finalize_fixed_list

Type-Bound Procedures

procedure, public :: init => fixed_list_init
procedure, public :: sum => fixed_list_sum
procedure, public :: print => fixed_list_print

Functions

public function new_fixed_list_pointer(list) result(this)

Create a new fixed list pointer Input: list - an array of integers

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in) :: list(:)

Return Value type(fixed_list_t), pointer