Fortran Standard Library (stdlib)

Fortran Standard Library (stdlib)#

Fortran stdlib is a community-driven standard library for modern Fortran, providing utilities for strings, sorting, statistics, linear algebra, and more.

The documentation below is generated from the stdlib v0.8.1 source code using f:automodule. stdlib uses fypp preprocessing. The FORD bridge processes the preprocessed output automatically.

module stdlib_ascii#

Uses: stdlib_kinds

parameter NUL = achar(int(z'00'))#

Type: character(len=1)

parameter SOH = achar(int(z'01'))#

Type: character(len=1)

parameter STX = achar(int(z'02'))#

Type: character(len=1)

parameter ETX = achar(int(z'03'))#

Type: character(len=1)

parameter EOT = achar(int(z'04'))#

Type: character(len=1)

parameter ENQ = achar(int(z'05'))#

Type: character(len=1)

parameter ACK = achar(int(z'06'))#

Type: character(len=1)

parameter BEL = achar(int(z'07'))#

Type: character(len=1)

parameter BS = achar(int(z'08'))#

Type: character(len=1)

parameter TAB = achar(int(z'09'))#

Type: character(len=1)

parameter LF = achar(int(z'0A'))#

Type: character(len=1)

parameter VT = achar(int(z'0B'))#

Type: character(len=1)

parameter FF = achar(int(z'0C'))#

Type: character(len=1)

parameter CR = achar(int(z'0D'))#

Type: character(len=1)

parameter SO = achar(int(z'0E'))#

Type: character(len=1)

parameter SI = achar(int(z'0F'))#

Type: character(len=1)

parameter DLE = achar(int(z'10'))#

Type: character(len=1)

parameter DC1 = achar(int(z'11'))#

Type: character(len=1)

parameter DC2 = achar(int(z'12'))#

Type: character(len=1)

parameter DC3 = achar(int(z'13'))#

Type: character(len=1)

parameter DC4 = achar(int(z'14'))#

Type: character(len=1)

parameter NAK = achar(int(z'15'))#

Type: character(len=1)

parameter SYN = achar(int(z'16'))#

Type: character(len=1)

parameter ETB = achar(int(z'17'))#

Type: character(len=1)

parameter CAN = achar(int(z'18'))#

Type: character(len=1)

parameter EM = achar(int(z'19'))#

Type: character(len=1)

parameter SUB = achar(int(z'1A'))#

Type: character(len=1)

parameter ESC = achar(int(z'1B'))#

Type: character(len=1)

parameter FS = achar(int(z'1C'))#

Type: character(len=1)

parameter GS = achar(int(z'1D'))#

Type: character(len=1)

parameter RS = achar(int(z'1E'))#

Type: character(len=1)

parameter US = achar(int(z'1F'))#

Type: character(len=1)

parameter DEL = achar(int(z'7F'))#

Type: character(len=1)

parameter fullhex_digits = "0123456789ABCDEFabcdef"#

Type: character(len=*)

parameter hex_digits = fullhex_digits(1:16)#

Type: character(len=*)

parameter lowerhex_digits = "0123456789abcdef"#

Type: character(len=*)

parameter digits = hex_digits(1:10)#

Type: character(len=*)

parameter octal_digits = digits(1:8)#

Type: character(len=*)

parameter letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"#

Type: character(len=*)

parameter uppercase = letters(1:26)#

Type: character(len=*)

parameter lowercase = letters(27:)#

Type: character(len=*)

parameter whitespace = " "//TAB//VT//CR//LF//FF#

Type: character(len=*)

interface to_lower#
elemental function to_lower(string)#

Arguments:

  • character(len=*), intent(in) :: string

Returns: character(len=len)

interface to_upper#
elemental function to_upper(string)#

Arguments:

  • character(len=*), intent(in) :: string

Returns: character(len=len)

interface to_title#
elemental function to_title(string)#

Arguments:

  • character(len=*), intent(in) :: string

Returns: character(len=len)

interface to_sentence#
elemental function to_sentence(string)#

Arguments:

  • character(len=*), intent(in) :: string

Returns: character(len=len)

interface reverse#
elemental function reverse(string)#

Arguments:

  • character(len=*), intent(in) :: string

Returns: character(len=len)

elemental function is_alpha(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_alphanum(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_ascii(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_control(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_digit(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_octal_digit(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_hex_digit(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_punctuation(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_graphical(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_printable(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_lower(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_upper(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_white(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function is_blank(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: logical

elemental function char_to_lower(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: character(len=1)

elemental function char_to_upper(c)#

Arguments:

  • character(len=1), intent(in) :: c

Returns: character(len=1)

module stdlib_kinds#

Uses: iso_fortran_env, iso_c_binding

parameter sp = selected_real_kind(6)#

Type: integer

parameter dp = selected_real_kind(15)#

Type: integer

parameter xdp = #{ifWITH_XDP}#selected_real_kind(18)#{else}#-1#{endif}##

Type: integer

parameter qp = #{ifWITH_QP}#selected_real_kind(33)#{else}#-1#{endif}##

Type: integer

parameter lk = kind(.true.)#

Type: integer

module stdlib_string_type#

Uses: stdlib_ascii, stdlib_kinds, stdlib_optval

parameter long = selected_int_kind(18)#

Type: integer

type string_type#
member raw#

Type: character(len=:), allocatable

Constructors:

interface len#
elemental function len_string(string)#

Arguments:

Returns: integer

interface len_trim#
elemental function len_trim_string(string)#

Arguments:

Returns: integer

interface trim#
elemental function trim_string(string)#

Arguments:

Returns: type (string_type)

interface adjustl#
elemental function adjustl_string(string)#

Arguments:

Returns: type (string_type)

interface adjustr#
elemental function adjustr_string(string)#

Arguments:

Returns: type (string_type)

interface repeat#
elemental function repeat_string(string, ncopies)#

Arguments:

  • type (string_type), intent(in) :: string

  • integer, intent(in) :: ncopies

Returns: type (string_type)

interface to_lower#
elemental function to_lower_string(string)#

Arguments:

Returns: type (string_type)

interface to_upper#
elemental function to_upper_string(string)#

Arguments:

Returns: type (string_type)

interface to_title#
elemental function to_title_string(string)#

Arguments:

Returns: type (string_type)

interface to_sentence#
elemental function to_sentence_string(string)#

Arguments:

Returns: type (string_type)

interface reverse#
elemental function reverse_string(string)#

Arguments:

Returns: type (string_type)

interface char#
pure function char_string(string)#

Arguments:

Returns: character(len=len)

elemental function char_string_pos(string, pos)#

Arguments:

  • type (string_type), intent(in) :: string

  • integer, intent(in) :: pos

Returns: character(len=1)

pure function char_string_range(string, start, last)#

Arguments:

  • type (string_type), intent(in) :: string

  • integer, intent(in) :: start

  • integer, intent(in) :: last

Returns: character(len=last)

interface ichar#
elemental function ichar_string(string)#

Arguments:

Returns: integer

interface iachar#
elemental function iachar_string(string)#

Arguments:

Returns: integer

interface index#
elemental function index_string_string(string, substring, back)#

Arguments:

  • type (string_type), intent(in) :: string

  • type (string_type), intent(in) :: substring

  • logical, intent(in), optional :: back

Returns: integer

elemental function index_string_char(string, substring, back)#

Arguments:

  • type (string_type), intent(in) :: string

  • character(len=*), intent(in) :: substring

  • logical, intent(in), optional :: back

Returns: integer

elemental function index_char_string(string, substring, back)#

Arguments:

  • character(len=*), intent(in) :: string

  • type (string_type), intent(in) :: substring

  • logical, intent(in), optional :: back

Returns: integer

interface scan#
elemental function scan_string_string(string, set, back)#

Arguments:

  • type (string_type), intent(in) :: string

  • type (string_type), intent(in) :: set

  • logical, intent(in), optional :: back

Returns: integer

elemental function scan_string_char(string, set, back)#

Arguments:

  • type (string_type), intent(in) :: string

  • character(len=*), intent(in) :: set

  • logical, intent(in), optional :: back

Returns: integer

elemental function scan_char_string(string, set, back)#

Arguments:

  • character(len=*), intent(in) :: string

  • type (string_type), intent(in) :: set

  • logical, intent(in), optional :: back

Returns: integer

interface verify#
elemental function verify_string_string(string, set, back)#

Arguments:

  • type (string_type), intent(in) :: string

  • type (string_type), intent(in) :: set

  • logical, intent(in), optional :: back

Returns: integer

elemental function verify_string_char(string, set, back)#

Arguments:

  • type (string_type), intent(in) :: string

  • character(len=*), intent(in) :: set

  • logical, intent(in), optional :: back

Returns: integer

elemental function verify_char_string(string, set, back)#

Arguments:

  • character(len=*), intent(in) :: string

  • type (string_type), intent(in) :: set

  • logical, intent(in), optional :: back

Returns: integer

interface move#
elemental subroutine move_string_string(from, to)#

Arguments:

pure subroutine move_string_char(from, to)#

Arguments:

  • type (string_type), intent(inout) :: from

  • character(len=:), intent(out), allocatable :: to

pure subroutine move_char_string(from, to)#

Arguments:

  • character(len=:), intent(inout), allocatable :: from

  • type (string_type), intent(out) :: to

pure subroutine move_char_char(from, to)#

Arguments:

  • character(len=:), intent(inout), allocatable :: from

  • character(len=:), intent(out), allocatable :: to

interface lgt#
elemental function lgt_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function lgt_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function lgt_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface llt#
elemental function llt_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function llt_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function llt_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface lge#
elemental function lge_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function lge_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function lge_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface lle#
elemental function lle_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function lle_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function lle_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface assignment(=)#
elemental subroutine assign_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(inout) :: lhs

  • character(len=*), intent(in) :: rhs

interface operator(>)#
elemental function gt_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function gt_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function gt_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface operator(<)#
elemental function lt_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function lt_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function lt_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface operator(>=)#
elemental function ge_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function ge_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function ge_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface operator(<=)#
elemental function le_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function le_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function le_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface operator(==)#
elemental function eq_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function eq_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function eq_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface operator(/=)#
elemental function ne_string_string(lhs, rhs)#

Arguments:

Returns: logical

elemental function ne_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: logical

elemental function ne_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: logical

interface operator(//)#
elemental function concat_string_string(lhs, rhs)#

Arguments:

Returns: type (string_type)

elemental function concat_string_char(lhs, rhs)#

Arguments:

  • type (string_type), intent(in) :: lhs

  • character(len=*), intent(in) :: rhs

Returns: type (string_type)

elemental function concat_char_string(lhs, rhs)#

Arguments:

  • character(len=*), intent(in) :: lhs

  • type (string_type), intent(in) :: rhs

Returns: type (string_type)

interface write(formatted)#
subroutine write_formatted(string, unit, iotype, v_list, iostat, iomsg)#

Arguments:

  • type (string_type), intent(in) :: string

  • integer, intent(in) :: unit

  • character(len=*), intent(in) :: iotype

  • integer, intent(in) :: v_list

  • integer, intent(out) :: iostat

  • character(len=*), intent(inout) :: iomsg

interface write(unformatted)#
subroutine write_unformatted(string, unit, iostat, iomsg)#

Arguments:

  • type (string_type), intent(in) :: string

  • integer, intent(in) :: unit

  • integer, intent(out) :: iostat

  • character(len=*), intent(inout) :: iomsg

interface read(formatted)#
subroutine read_formatted(string, unit, iotype, v_list, iostat, iomsg)#

Arguments:

  • type (string_type), intent(inout) :: string

  • integer, intent(in) :: unit

  • character(len=*), intent(in) :: iotype

  • integer, intent(in) :: v_list

  • integer, intent(out) :: iostat

  • character(len=*), intent(inout) :: iomsg

interface read(unformatted)#
subroutine read_unformatted(string, unit, iostat, iomsg)#

Arguments:

  • type (string_type), intent(inout) :: string

  • integer, intent(in) :: unit

  • integer, intent(out) :: iostat

  • character(len=*), intent(inout) :: iomsg

pure function maybe(string)#

Arguments:

Returns: character(len=len)

elemental subroutine unused_dummy_argument(dummy)#

Arguments:

  • class (*), intent(in) :: dummy

module stdlib_error#

Uses: iso_fortran_env, stdlib_optval, stdlib_kinds

parameter STDLIB_SUCCESS = 0_ilp#

Type: integer (ilp)

parameter STDLIB_VALUE_ERROR = -1_ilp#

Type: integer (ilp)

parameter STDLIB_LINALG_ERROR = -2_ilp#

Type: integer (ilp)

parameter STDLIB_INTERNAL_ERROR = -3_ilp#

Type: integer (ilp)

parameter STDLIB_IO_ERROR = -4_ilp#

Type: integer (ilp)

parameter STDLIB_FS_ERROR = -5_ilp#

Type: integer (ilp)

parameter MSG_LENGTH = 512_ilp#

Type: integer (ilp)

parameter NAME_LENGTH = 32_ilp#

Type: integer (ilp)

parameter FMT_INT = '(i0)'#

Type: character(len=*)

parameter FMT_REAL_SP = '(es15.8e2)'#

Type: character(len=*)

parameter FMT_REAL_DP = '(es24.16e3)'#

Type: character(len=*)

parameter FMT_REAL_XDP = '(es26.18e3)'#

Type: character(len=*)

parameter FMT_REAL_QP = '(es44.35e4)'#

Type: character(len=*)

parameter FMT_COMPLEX_SP = '(es15.8e2,1x,es15.8e2)'#

Type: character(len=*)

parameter FMT_COMPLEX_DP = '(es24.16e3,1x,es24.16e3)'#

Type: character(len=*)

parameter FMT_COMPLEX_XDP = '(es26.18e3,1x,es26.18e3)'#

Type: character(len=*)

parameter FMT_COMPLEX_QP = '(es44.35e4,1x,es44.35e4)'#

Type: character(len=*)

type state_type#
member state = STDLIB_SUCCESS#

Type: integer (ilp)

member message = repeat(' ', MSG_LENGTH)#

Type: character(len=MSG_LENGTH)

member where_at = repeat(' ', NAME_LENGTH)#

Type: character(len=NAME_LENGTH)

procedure destroy#

Binds to: state_destroy

procedure state_parse_at_location#

Binds to: state_parse_at_location

procedure state_parse_arguments#

Binds to: state_parse_arguments

procedure parse#

Binds to: state_parse_at_location, state_parse_arguments

procedure print#

Binds to: state_print

procedure print_msg#

Binds to: state_message

procedure ok#

Binds to: state_is_ok

procedure error#

Binds to: state_is_error

procedure handle#

Binds to: error_handling

Constructors:

pure function new_state(where_at, flag, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)#

Arguments:

  • character(len=*), intent(in) :: where_at

  • integer, intent(in) :: flag

  • class (*), intent(in), optional, dimension(..) :: a1

  • class (*), intent(in), optional, dimension(..) :: a2

  • class (*), intent(in), optional, dimension(..) :: a3

  • class (*), intent(in), optional, dimension(..) :: a4

  • class (*), intent(in), optional, dimension(..) :: a5

  • class (*), intent(in), optional, dimension(..) :: a6

  • class (*), intent(in), optional, dimension(..) :: a7

  • class (*), intent(in), optional, dimension(..) :: a8

  • class (*), intent(in), optional, dimension(..) :: a9

  • class (*), intent(in), optional, dimension(..) :: a10

  • class (*), intent(in), optional, dimension(..) :: a11

  • class (*), intent(in), optional, dimension(..) :: a12

  • class (*), intent(in), optional, dimension(..) :: a13

  • class (*), intent(in), optional, dimension(..) :: a14

  • class (*), intent(in), optional, dimension(..) :: a15

  • class (*), intent(in), optional, dimension(..) :: a16

  • class (*), intent(in), optional, dimension(..) :: a17

  • class (*), intent(in), optional, dimension(..) :: a18

  • class (*), intent(in), optional, dimension(..) :: a19

  • class (*), intent(in), optional, dimension(..) :: a20

Returns: type (state_type)

pure function new_state_nowhere(flag, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)#

Arguments:

  • integer, intent(in) :: flag

  • class (*), intent(in), optional, dimension(..) :: a1

  • class (*), intent(in), optional, dimension(..) :: a2

  • class (*), intent(in), optional, dimension(..) :: a3

  • class (*), intent(in), optional, dimension(..) :: a4

  • class (*), intent(in), optional, dimension(..) :: a5

  • class (*), intent(in), optional, dimension(..) :: a6

  • class (*), intent(in), optional, dimension(..) :: a7

  • class (*), intent(in), optional, dimension(..) :: a8

  • class (*), intent(in), optional, dimension(..) :: a9

  • class (*), intent(in), optional, dimension(..) :: a10

  • class (*), intent(in), optional, dimension(..) :: a11

  • class (*), intent(in), optional, dimension(..) :: a12

  • class (*), intent(in), optional, dimension(..) :: a13

  • class (*), intent(in), optional, dimension(..) :: a14

  • class (*), intent(in), optional, dimension(..) :: a15

  • class (*), intent(in), optional, dimension(..) :: a16

  • class (*), intent(in), optional, dimension(..) :: a17

  • class (*), intent(in), optional, dimension(..) :: a18

  • class (*), intent(in), optional, dimension(..) :: a19

  • class (*), intent(in), optional, dimension(..) :: a20

Returns: type (state_type)

interface error_stop#
interface operator(==)#
elemental function state_eq_flag(err, flag)#

Arguments:

  • class (state_type), intent(in) :: err

  • integer, intent(in) :: flag

Returns: logical (lk)

elemental function flag_eq_state(flag, err)#

Arguments:

  • integer, intent(in) :: flag

  • class (state_type), intent(in) :: err

Returns: logical (lk)

interface operator(/=)#
elemental function state_neq_flag(err, flag)#

Arguments:

  • class (state_type), intent(in) :: err

  • integer, intent(in) :: flag

Returns: logical (lk)

elemental function flag_neq_state(flag, err)#

Arguments:

  • integer, intent(in) :: flag

  • class (state_type), intent(in) :: err

Returns: logical (lk)

interface operator(<)#
elemental function state_lt_flag(err, flag)#

Arguments:

  • class (state_type), intent(in) :: err

  • integer, intent(in) :: flag

Returns: logical (lk)

elemental function flag_lt_state(flag, err)#

Arguments:

  • integer, intent(in) :: flag

  • class (state_type), intent(in) :: err

Returns: logical (lk)

interface operator(<=)#
elemental function state_le_flag(err, flag)#

Arguments:

  • class (state_type), intent(in) :: err

  • integer, intent(in) :: flag

Returns: logical (lk)

elemental function flag_le_state(flag, err)#

Arguments:

  • integer, intent(in) :: flag

  • class (state_type), intent(in) :: err

Returns: logical (lk)

interface operator(>)#
elemental function state_gt_flag(err, flag)#

Arguments:

  • class (state_type), intent(in) :: err

  • integer, intent(in) :: flag

Returns: logical (lk)

elemental function flag_gt_state(flag, err)#

Arguments:

  • integer, intent(in) :: flag

  • class (state_type), intent(in) :: err

Returns: logical (lk)

interface operator(>=)#
elemental function state_ge_flag(err, flag)#

Arguments:

  • class (state_type), intent(in) :: err

  • integer, intent(in) :: flag

Returns: logical (lk)

elemental function flag_ge_state(flag, err)#

Arguments:

  • integer, intent(in) :: flag

  • class (state_type), intent(in) :: err

Returns: logical (lk)

interface assignment(=)#
elemental subroutine state_assign_state(to, from)#

Arguments:

pure function state_flag_message(flag)#

Arguments:

  • integer (ilp), intent(in) :: flag

Returns: character(len=:), allocatable

pure function state_message(this)#

Arguments:

Returns: character(len=:), allocatable

pure function state_print(this)#

Arguments:

Returns: character(len=:), allocatable

elemental function state_is_ok(this)#

Arguments:

Returns: logical (lk)

elemental function state_is_error(this)#

Arguments:

Returns: logical (lk)

subroutine check(condition, msg, code, warn)#

Arguments:

  • logical, intent(in) :: condition

  • character(len=*), intent(in), optional :: msg

  • integer, intent(in), optional :: code

  • logical, intent(in), optional :: warn

elemental subroutine state_destroy(this)#

Arguments:

pure subroutine error_handling(ierr, ierr_out)#

Arguments:

pure subroutine appendr(msg, a, prefix)#

Arguments:

  • character(len=*), intent(inout) :: msg

  • class (*), intent(in), optional :: a

  • character(len=1), intent(in), optional :: prefix

pure subroutine append(msg, a, prefix)#

Arguments:

  • character(len=*), intent(inout) :: msg

  • class (*), intent(in) :: a

  • character(len=1), intent(in), optional :: prefix

pure subroutine appendv(msg, a)#

Arguments:

  • character(len=*), intent(inout) :: msg

  • class (*), intent(in) :: a

pure subroutine state_parse_at_location(new_state, where_at, flag, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)#

Arguments:

  • class (state_type), intent(inout) :: new_state

  • character(len=*), intent(in) :: where_at

  • integer, intent(in) :: flag

  • class (*), intent(in), optional, dimension(..) :: a1

  • class (*), intent(in), optional, dimension(..) :: a2

  • class (*), intent(in), optional, dimension(..) :: a3

  • class (*), intent(in), optional, dimension(..) :: a4

  • class (*), intent(in), optional, dimension(..) :: a5

  • class (*), intent(in), optional, dimension(..) :: a6

  • class (*), intent(in), optional, dimension(..) :: a7

  • class (*), intent(in), optional, dimension(..) :: a8

  • class (*), intent(in), optional, dimension(..) :: a9

  • class (*), intent(in), optional, dimension(..) :: a10

  • class (*), intent(in), optional, dimension(..) :: a11

  • class (*), intent(in), optional, dimension(..) :: a12

  • class (*), intent(in), optional, dimension(..) :: a13

  • class (*), intent(in), optional, dimension(..) :: a14

  • class (*), intent(in), optional, dimension(..) :: a15

  • class (*), intent(in), optional, dimension(..) :: a16

  • class (*), intent(in), optional, dimension(..) :: a17

  • class (*), intent(in), optional, dimension(..) :: a18

  • class (*), intent(in), optional, dimension(..) :: a19

  • class (*), intent(in), optional, dimension(..) :: a20

pure subroutine state_parse_arguments(new_state, flag, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)#

Arguments:

  • class (state_type), intent(inout) :: new_state

  • integer, intent(in) :: flag

  • class (*), intent(in), optional, dimension(..) :: a1

  • class (*), intent(in), optional, dimension(..) :: a2

  • class (*), intent(in), optional, dimension(..) :: a3

  • class (*), intent(in), optional, dimension(..) :: a4

  • class (*), intent(in), optional, dimension(..) :: a5

  • class (*), intent(in), optional, dimension(..) :: a6

  • class (*), intent(in), optional, dimension(..) :: a7

  • class (*), intent(in), optional, dimension(..) :: a8

  • class (*), intent(in), optional, dimension(..) :: a9

  • class (*), intent(in), optional, dimension(..) :: a10

  • class (*), intent(in), optional, dimension(..) :: a11

  • class (*), intent(in), optional, dimension(..) :: a12

  • class (*), intent(in), optional, dimension(..) :: a13

  • class (*), intent(in), optional, dimension(..) :: a14

  • class (*), intent(in), optional, dimension(..) :: a15

  • class (*), intent(in), optional, dimension(..) :: a16

  • class (*), intent(in), optional, dimension(..) :: a17

  • class (*), intent(in), optional, dimension(..) :: a18

  • class (*), intent(in), optional, dimension(..) :: a19

  • class (*), intent(in), optional, dimension(..) :: a20

module stdlib_hashmaps#

Uses: iso_fortran_env, stdlib_kinds, stdlib_hashmap_wrappers

parameter inmap_probe_factor = 10#

Type: integer

parameter map_probe_factor = 5#

Type: integer

parameter default_bits = 6#

Type: integer

parameter max_bits = 30#

Type: integer

parameter int_calls = int64#

Type: integer

parameter int_depth = int64#

Type: integer

parameter int_index = int32#

Type: integer

parameter int_probes = int64#

Type: integer

parameter success = 0#

Type: integer

parameter alloc_fault = 1#

Type: integer

parameter array_size_error = 2#

Type: integer

parameter int8_bits = bit_size(0_int8)#

Type: integer

parameter char_bits = character_storage_size#

Type: integer

parameter load_factor = 0.5625#

Type: real

parameter pool_size = 64#

Type: integer (int32)

parameter module_name = 'STDLIB_HASHMAPS'#

Type: character(len=*)

type hashmap_type#
member call_count = 0#

Type: integer (int_calls)

member probe_count = 0#

Type: integer (int_calls)

member total_probes = 0#

Type: integer (int_calls)

member num_entries = 0#

Type: integer (int_index)

member num_free = 0#

Type: integer (int_index)

member nbits = default_bits#

Type: integer (int32)

member hasher = default_hasher#

Type: procedure(hasher_fun), pointer, nopass

member initialized = .false.#

Type: logical

procedure calls#

Binds to: calls

procedure entries#

Binds to: entries

procedure map_probes#

Binds to: map_probes

procedure num_slots#

Binds to: num_slots

procedure slots_bits#

Binds to: slots_bits

procedure get_all_keys#
procedure init#
procedure loading#
procedure rehash#
procedure total_depth#
procedure key_key_test#
procedure int8_key_test#

Binds to: int8_key_test

procedure int32_key_test#

Binds to: int32_key_test

procedure char_key_test#

Binds to: char_key_test

procedure key_test#

Binds to: int8_key_test, int32_key_test, char_key_test

procedure key_map_entry#
procedure int8_map_entry#

Binds to: int8_map_entry

procedure int32_map_entry#

Binds to: int32_map_entry

procedure char_map_entry#

Binds to: char_map_entry

procedure map_entry#

Binds to: int8_map_entry, int32_map_entry, char_map_entry

procedure key_get_other_data#
procedure int8_get_other_data#

Binds to: int8_get_other_data

procedure int32_get_other_data#

Binds to: int32_get_other_data

procedure char_get_other_data#

Binds to: char_get_other_data

procedure get_other_data#

Binds to: int8_get_other_data, int32_get_other_data, char_get_other_data

procedure key_remove_entry#
procedure int8_remove_entry#

Binds to: int8_remove_entry

procedure int32_remove_entry#

Binds to: int32_remove_entry

procedure char_remove_entry#

Binds to: char_remove_entry

procedure remove#

Binds to: int8_remove_entry, int32_remove_entry, char_remove_entry

procedure key_set_other_data#
procedure int8_set_other_data#

Binds to: int8_set_other_data

procedure int32_set_other_data#

Binds to: int32_set_other_data

procedure char_set_other_data#

Binds to: char_set_other_data

procedure set_other_data#

Binds to: int8_set_other_data, int32_set_other_data, char_set_other_data

type chaining_map_entry_type#
member hash_val#

Type: integer (int_hash)

member key#

Type: type (key_type)

member other#

Type: class (*), allocatable

member inmap#

Type: integer (int_index)

member next = null()#

Type: type (chaining_map_entry_type), pointer

type chaining_map_entry_ptr#
member target = null()#

Type: type (chaining_map_entry_type), pointer

type chaining_map_entry_pool#
member next = 0#

Type: integer (int_index)

member more_map_entries#

Type: type (chaining_map_entry_type), allocatable

member lastpool = null()#

Type: type (chaining_map_entry_pool), pointer

type chaining_hashmap_type, extends(hashmap_type)#
member cache = null()#

Type: type (chaining_map_entry_pool), pointer

member free_list = null()#

Type: type (chaining_map_entry_type), pointer

member inverse#

Type: type (chaining_map_entry_ptr), allocatable

member slots#

Type: type (chaining_map_entry_ptr), allocatable

procedure get_all_keys#
procedure key_get_other_data#
procedure init#
procedure loading#
procedure key_map_entry#
procedure rehash#
procedure key_remove_entry#
procedure key_set_other_data#
procedure total_depth#
procedure key_key_test#
type open_map_entry_type#
member hash_val#

Type: integer (int_hash)

member key#

Type: type (key_type)

member other#

Type: class (*), allocatable

member inmap#

Type: integer (int_index)

type open_map_entry_list#
member target = null()#

Type: type (open_map_entry_type), pointer

member next = null()#

Type: type (open_map_entry_list), pointer

type open_map_entry_ptr#
member target = null()#

Type: type (open_map_entry_type), pointer

type open_map_entry_pool#
member next = 0#

Type: integer (int_index)

member more_map_entries#

Type: type (open_map_entry_type), allocatable

member lastpool = null()#

Type: type (open_map_entry_pool), pointer

type open_hashmap_type, extends(hashmap_type)#
member index_mask = 2_int_index**default_bits-1#

Type: integer (int_index)

member cache = null()#

Type: type (open_map_entry_pool), pointer

member free_list = null()#

Type: type (open_map_entry_list), pointer

member inverse#

Type: type (open_map_entry_ptr), allocatable

member slots#

Type: integer (int_index), allocatable

procedure get_all_keys#
procedure key_get_other_data#
procedure init#
procedure loading#
procedure key_map_entry#
procedure rehash#
procedure key_remove_entry#
procedure key_set_other_data#
procedure total_depth#
procedure key_key_test#
interface chaining_loading#
interface total_chaining_depth#
interface free_chaining_map#
interface get_all_chaining_keys#
interface get_other_chaining_data#
interface init_chaining_map#
interface chaining_key_test#
interface map_chain_entry#
interface rehash_chaining_map#
interface remove_chaining_entry#
interface set_other_chaining_data#
interface open_loading#
interface total_open_depth#
interface free_open_map#
interface get_all_open_keys#
interface get_other_open_data#
interface init_open_map#
interface open_key_test#
interface map_open_entry#
interface rehash_open_map#
interface remove_open_entry#
interface set_other_open_data#
pure function calls(map)#

Arguments:

Returns: integer (int_calls)

pure function entries(map)#

Arguments:

Returns: integer (int_index)

pure function map_probes(map)#

Arguments:

Returns: integer (int_calls)

pure function num_slots(map)#

Arguments:

Returns: integer (int_index)

pure function slots_bits(map)#

Arguments:

Returns: integer

subroutine int8_get_other_data(map, value, other, exists)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int8), intent(in) :: value

  • class (*), intent(out), allocatable :: other

  • logical, intent(out), optional :: exists

subroutine int32_get_other_data(map, value, other, exists)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int32), intent(in) :: value

  • class (*), intent(out), allocatable :: other

  • logical, intent(out), optional :: exists

subroutine char_get_other_data(map, value, other, exists)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • character(len=*), intent(in) :: value

  • class (*), intent(out), allocatable :: other

  • logical, intent(out), optional :: exists

subroutine int8_remove_entry(map, value, existed)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int8), intent(in) :: value

  • logical, intent(out), optional :: existed

subroutine int32_remove_entry(map, value, existed)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int32), intent(in) :: value

  • logical, intent(out), optional :: existed

subroutine char_remove_entry(map, value, existed)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • character(len=*), intent(in) :: value

  • logical, intent(out), optional :: existed

subroutine int8_map_entry(map, value, other, conflict)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int8), intent(in) :: value

  • class (*), intent(in), optional :: other

  • logical, intent(out), optional :: conflict

subroutine int32_map_entry(map, value, other, conflict)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int32), intent(in) :: value

  • class (*), intent(in), optional :: other

  • logical, intent(out), optional :: conflict

subroutine char_map_entry(map, value, other, conflict)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • character(len=*), intent(in) :: value

  • class (*), intent(in), optional :: other

  • logical, intent(out), optional :: conflict

subroutine int8_key_test(map, value, present)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int8), intent(in) :: value

  • logical, intent(out) :: present

subroutine int32_key_test(map, value, present)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int32), intent(in) :: value

  • logical, intent(out) :: present

subroutine char_key_test(map, value, present)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • character(len=*), intent(in) :: value

  • logical, intent(out) :: present

subroutine int8_set_other_data(map, value, other, exists)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int8), intent(in) :: value

  • class (*), intent(in) :: other

  • logical, intent(out), optional :: exists

subroutine int32_set_other_data(map, value, other, exists)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • integer (int32), intent(in) :: value

  • class (*), intent(in) :: other

  • logical, intent(out), optional :: exists

subroutine char_set_other_data(map, value, other, exists)#

Arguments:

  • class (hashmap_type), intent(inout) :: map

  • character(len=*), intent(in) :: value

  • class (*), intent(in) :: other

  • logical, intent(out), optional :: exists