@@ -232,13 +232,9 @@ is an `intent(out)` argument.
232
232
copy_key, operator(==)equal_keys, key_type
233
233
use iso_fortran_env, only: int8
234
234
implicit none
235
- integer(int8), allocatable :: value(: )
235
+ integer(int8) :: i, value(15 )
236
236
type(key_type) :: key_in, key_out
237
- integer(int_8) :: i
238
- allocate( value(1:15) )
239
- do i=1, 15
240
- value(i) = i
241
- end do
237
+ value = [(i, i = 1, 15)]
242
238
call set( key_in, value )
243
239
call copy_key( key_in, key_out )
244
240
print *, "key_in == key_out = ", key_in == key_out
@@ -281,11 +277,11 @@ is an `intent(out)` argument.
281
277
implicit none
282
278
type(other_type) :: other_in, other_out
283
279
integer(int_8) :: i
284
- class(*), allocatable :: dummy
285
- type dummy_type
280
+ class(*), allocatable :: dummy
281
+ type dummy_type
286
282
integer(int8) :: value(15)
287
283
end type
288
- type(dummy_type) :: dummy_val
284
+ type(dummy_type) :: dummy_val
289
285
do i=1, 15
290
286
dummy_val % value1(i) = i
291
287
end do
@@ -473,13 +469,9 @@ is an `intent(out)` argument.
473
469
copy_key, free_key, key_type, set
474
470
use iso_fortran_env, only: int8
475
471
implicit none
476
- integer(int8), allocatable :: value(: )
472
+ integer(int8) :: i, value(15 )
477
473
type(key_type) :: key_in, key_out
478
- integer(int_8) :: i
479
- allocate( value(1:15) )
480
- do i=1, 15
481
- value(i) = i
482
- end do
474
+ value = [(i, i=1, 15)]
483
475
call set( key_in, value )
484
476
call copy_key( key_in, key_out )
485
477
call free_key( key_out )
@@ -922,7 +914,7 @@ is an `intent(out)` argument.
922
914
` other ` : shall be a scalar variable of type ` other_type ` . It
923
915
is an ` intent(out) ` argument.
924
916
925
- ` value ` : if the first argument is ` key ` ` vaalue ` shall be a default
917
+ ` value ` : if the first argument is ` key ` ` value ` shall be a default
926
918
character string expression, or a vector expression of type integer
927
919
and kind ` int8 ` , while for a first argument of type ` other ` ` value `
928
920
shall be of type ` class(*) ` . It is an ` intent(in) ` argument.
@@ -956,7 +948,7 @@ associated procedures and constants that implement two simple hash map
956
948
types using separate chaining hashing and open addressing hashing. The
957
949
derived type ` hashmap_type ` is the parent type to its two
958
950
extensions: ` chaining_hashmap_type ` and ` open_hashmap_type ` .
959
- ` chaining_hashmap_type ` . The extension types provide
951
+ The extension types provide
960
952
procedures to manipulate the structure of a hash map object:
961
953
` init ` , ` map_entry ` , ` rehash ` , ` remove_entry ` , and
962
954
` set_other_data ` . They also provide procedures to inquire about
@@ -1011,7 +1003,7 @@ entities of kind `int_probes`. Currently `int_probes` has the value of
1011
1003
1012
1004
The constant ` load_factor ` is only used by the ` open_hashmap_type ` . It
1013
1005
specifies the maximum fraction of the available slots that may be
1014
- filled before expansion occurs. The current ` load_factor = ) .5625 ` so
1006
+ filled before expansion occurs. The current ` load_factor = 0 .5625 ` so
1015
1007
the current implementation of ` open_hashmap_type ` can only hold a
1016
1008
little more than ` 2**29 ` entries.
1017
1009
@@ -1035,7 +1027,7 @@ the implementation of the `chaining_hashmap_type` public type. The
1035
1027
four private derived types, ` open_map_entry_type ` ,
1036
1028
` open_map_entry_list ` , ` open_map_entry_ptr ` , and ` open_map_entry_pool `
1037
1029
are used in the implementation of the ` open_hashmap_type ` public
1038
- type: . Each of these types are described below.
1030
+ type. Each of these types are described below.
1039
1031
1040
1032
#### The ` hashmap_type ` abstract type
1041
1033
@@ -1459,11 +1451,12 @@ Subroutine
1459
1451
` intent(out) ` argument. If ` true ` an entry with the given ` key `
1460
1452
exists in the map, if false ` other ` is undefined.
1461
1453
1462
- * The following is an example of the retrieval of other data
1454
+ ##### Example
1455
+
1456
+ The following is an example of the retrieval of other data
1463
1457
associated with a ` key ` :
1464
1458
1465
1459
1466
- ##### Example
1467
1460
1468
1461
``` Fortran
1469
1462
program demo_get_other_data
@@ -1485,11 +1478,11 @@ exists in the map, if false `other` is undefined.
1485
1478
call map % init( fnv_1_hasher )
1486
1479
call set( key, [ 0_int8, 1_int8, 2_int8, 3_int8, 4_int8 ] )
1487
1480
call set( other, data )
1488
- call map % map_entry( key, other. conflict )
1481
+ call map % map_entry( key, other, conflict )
1489
1482
if ( .not. conflict ) then
1490
1483
call map % get_other_data( key, other )
1491
1484
else
1492
- stop 'Key is already present in the map.''
1485
+ stop 'Key is already present in the map.'
1493
1486
end if
1494
1487
call get( other, data )
1495
1488
select type( data )
@@ -1514,7 +1507,7 @@ Initializes a `chaining_hashmap_type` object.
1514
1507
1515
1508
##### Syntax
1516
1509
1517
- ` call [[stdlib_hashmaps:map%init]]( hasher [, slots_bits, status ] ] ) `
1510
+ ` call [[stdlib_hashmaps:map%init]]( hasher [, slots_bits, status ] ) `
1518
1511
1519
1512
####@# Class
1520
1513
@@ -1593,7 +1586,7 @@ Pure function
1593
1586
##### Argument
1594
1587
1595
1588
` map ` (pass) - shall be an expression of class ` chaining_hashmap_type `
1596
- or `` open_hashmap_type` . It is an ` intent(in)` argument.
1589
+ or ` open_hashmap_type ` . It is an ` intent(in) ` argument.
1597
1590
1598
1591
##### Result character
1599
1592
@@ -1860,7 +1853,7 @@ to be removed.
1860
1853
` existed ` (optional): shall be a scalar variable of type default
1861
1854
logical. It is an ` intent(out) ` argument. If present with the value
1862
1855
` true ` the entry existed
1863
- in the map before removal, if false the entry was not present to be
1856
+ in the map before removal, if ` false ` the entry was not present to be
1864
1857
removed.
1865
1858
1866
1859
##### Example
@@ -2019,7 +2012,7 @@ Pure function
2019
2012
##### Argument
2020
2013
2021
2014
` map ` (pass): shall be a scalar expression of class
2022
- ` chaining_hashmap_type ` . It is an ` intent(in) ` argument. It is the
2015
+ ` hashmap_type ` . It is an ` intent(in) ` argument. It is the
2023
2016
hash map of interest.
2024
2017
2025
2018
##### Result character
0 commit comments