@@ -170,9 +170,9 @@ Procedures to manipulate `other_type` data:
170
170
` other_out ` .
171
171
172
172
* ` get( other, value ) ` - extracts the contents of ` other ` into the
173
- class(* ) variable ` value ` .
173
+ ` class(*) ` variable ` value ` .
174
174
175
- * ` set( other, value ) ` - sets the content of ` other ` to the class(* )
175
+ * ` set( other, value ) ` - sets the content of ` other ` to the ` class(*) `
176
176
variable ` value ` .
177
177
178
178
* ` free_other( other ) ` - frees the memory in ` other ` .
@@ -194,7 +194,7 @@ Procedures to hash keys to 32 bit integers:
194
194
195
195
Operator to compare two ` key_type ` values for equality
196
196
197
- * ` key1 == key2 ` - compares `key1' with ' key2' for equality
197
+ * ` key1 == key2 ` - compares ` key1 ` with ` key2 ` for equality
198
198
199
199
### Specifications of the ` stdlib_hashmap_wrappers ` procedures
200
200
@@ -445,7 +445,7 @@ Experimental
445
445
446
446
##### Description
447
447
448
- Deallocates the memory associated with an variable of type
448
+ Deallocates the memory associated with a variable of type
449
449
` key_type ` .
450
450
451
451
##### Syntax
@@ -486,7 +486,7 @@ Experimental
486
486
487
487
##### Description
488
488
489
- Deallocates the memory associated with an variable of type
489
+ Deallocates the memory associated with a variable of type
490
490
` other_type ` .
491
491
492
492
##### Syntax
@@ -580,7 +580,7 @@ an allocatable of `class(*)`. It is an `intent(out)` argument.
580
580
end do
581
581
call set( key, value )
582
582
call get( key, result )
583
- print *, ` RESULT == VALUE = ', all( value == result )
583
+ print *, ' RESULT == VALUE = ', all( value == result )
584
584
end program demo_get
585
585
```
586
586
@@ -654,7 +654,7 @@ Returns `.true.` if two keys are equal, and `.false.` otherwise.
654
654
655
655
##### Syntax
656
656
657
- ` test = [stdlib_hashmap_wrappers: key1== key2] `
657
+ ` test = key1 == key2 `
658
658
659
659
##### Class
660
660
@@ -920,8 +920,8 @@ shall be of type `class(*)`. It is an `intent(in)` argument.
920
920
##### Note
921
921
922
922
Values of types other than a scalar default character or an
923
- ` INT8 ` vector can be used as the basis of a ` key ` by transferring the
924
- value to an ` INT8 ` vector.
923
+ ` int8 ` vector can be used as the basis of a ` key ` by transferring the
924
+ value to an ` int8 ` vector.
925
925
926
926
##### Example
927
927
@@ -940,7 +940,7 @@ value to an `INT8` vector.
940
940
end do
941
941
call set( key, value )
942
942
call get( key, result )
943
- print *, ` RESULT == VALUE = ', all( value == result )
943
+ print *, ' RESULT == VALUE = ', all( value == result )
944
944
end program demo_set
945
945
```
946
946
@@ -1038,35 +1038,57 @@ type. Each of these types are described below.
1038
1038
The ` hashmap_type ` abstract type serves as the parent type for the two
1039
1039
types ` chaining_hashmap_type ` and ` open_hashmap_type ` . It defines
1040
1040
seven private components:
1041
+
1041
1042
* ` call_count ` - the number of procedure calls on the map;
1043
+
1042
1044
* ` nbits ` - the number of bits used to address the slots;
1045
+
1043
1046
* ` num_entries ` - the humber of entries in the map;
1047
+
1044
1048
* ` num_free ` - the number of entries in the free list of removed
1045
1049
entries;
1050
+
1046
1051
* ` probe_count ` - the number of map probes since the last resizing or
1047
1052
initialization;
1053
+
1048
1054
* ` total_probes ` - the number of probes of the map up to the last
1049
1055
resizing or initialization; and
1056
+
1050
1057
* ` hasher ` - a pointer to the hash function used by the map.
1058
+
1051
1059
It also defines five non-overridable procedures:
1060
+
1052
1061
* ` calls ` - returns the number of procedure calls on the map;
1062
+
1053
1063
* ` entries ` - returns the number of entries in the map;
1064
+
1054
1065
* ` map_probes ` - returns the number of map probes since
1055
1066
initialization;
1067
+
1056
1068
* ` num_slots ` - returns the number of slots in the map; and
1069
+
1057
1070
* ` slots_bits ` - returns the number of bits used to address the slots;
1058
1071
and eleven deferred procedures:
1072
+
1059
1073
* ` get_other_data ` - gets the other map data associated with the key;
1074
+
1060
1075
* ` init ` - initializes the hash map;
1076
+
1061
1077
* ` key_test ` - returns a logical flag indicating whether the key is
1062
1078
defined in the map.
1079
+
1063
1080
* ` loading ` - returns the ratio of the number of entries to the number
1064
1081
of slots;
1082
+
1065
1083
* ` map_entry ` - inserts a key and its other associated data into the
1066
1084
map;
1085
+
1067
1086
* ` rehash ` - rehashes the map with the provided hash function;
1087
+
1068
1088
* ` remove ` - removes the entry associated wit the key;
1089
+
1069
1090
* ` set_other_data ` - replaces the other data associated with the key;
1091
+
1070
1092
* ` total_depth ` - returns the number of probes needed to address all
1071
1093
the entries in the map;
1072
1094
@@ -1158,13 +1180,18 @@ costs. The type's definition is below:
1158
1180
The ` chaining_hashmap_type ` derived type extends the ` hashmap_type ` to
1159
1181
implements a separate chaining hash map. In addition to the components
1160
1182
of the ` hashmap_type ` it provides the four components:
1183
+
1161
1184
* ` cache ` - a pool of ` chaining_map_entry_pool ` objects used to reduce
1162
1185
allocation costs;
1186
+
1163
1187
* ` free_list ` - a free list of map entries;
1188
+
1164
1189
* ` inverse ` - an array of ` chaining_map_entry_ptr ` bucket lists
1165
1190
(inverses) storing entries at fixed locations once
1166
1191
entered; and
1192
+
1167
1193
* ` slots ` - an array of bucket lists serving as the hash map.
1194
+
1168
1195
It also implements all of the deferred procedures of the
1169
1196
` hashmap_type ` and a finalizer for its maps. The type's definition is
1170
1197
as follows:
@@ -1227,14 +1254,20 @@ containing the elements of the table. The type's definition is below:
1227
1254
The ` open_hashmap_type ` derived type extends the ` hashmap_type ` to
1228
1255
implement an open addressing hash map. In addition to the components
1229
1256
of the ` hashmap_type ` it provides the four components:
1257
+
1230
1258
* ` cache ` - a pool of ` open_map_entry_pool ` objects used to reduce
1231
1259
allocation costs;
1260
+
1232
1261
* ` free_list ` - a free list of map entries;
1262
+
1233
1263
* ` index_mask ` - an ` and ` mask used in linear addressing;
1264
+
1234
1265
* ` inverse ` - an array of ` open_map_entry_ptr ` bucket lists
1235
1266
(inverses) storing entries at fixed locations once
1236
1267
entered; and
1268
+
1237
1269
* ` slots ` - an array of bucket lists serving as the hash map.
1270
+
1238
1271
It also implements all of the deferred procedures of the
1239
1272
` hashmap_type ` and a finalizer for its maps. The type's definition is
1240
1273
as follows:
@@ -1332,7 +1365,7 @@ Returns the number of procedure calls on a hash map.
1332
1365
1333
1366
##### Syntax
1334
1367
1335
- ` value = [[stdlib_hashmaps: map % calls]]() `
1368
+ ` value = map % [[hashmap_type(type): calls(bound) ]]() `
1336
1369
1337
1370
##### Class
1338
1371
@@ -1379,7 +1412,7 @@ Returns the number of entries in a hash map.
1379
1412
1380
1413
##### Syntax
1381
1414
1382
- ` value = [[stdlib_hashmaps: map % entries]]() `
1415
+ ` value = map % [[hashmap_type(type): entries(bound) ]]() `
1383
1416
1384
1417
##### Class
1385
1418
@@ -1426,7 +1459,7 @@ Returns the other data associated with the `key`,
1426
1459
1427
1460
##### Syntax
1428
1461
1429
- ` value = [[stdlib_hashmaps: map % get_other_data)]]( key, other [, exists] ) `
1462
+ ` value = map % [[hashmap_type(type): get_other_data(bound )]]( key, other [, exists] ) `
1430
1463
1431
1464
##### Class
1432
1465
@@ -1447,7 +1480,7 @@ Subroutine
1447
1480
with the ` key ` .
1448
1481
1449
1482
` exists ` (optional): shall be a variable of type logical. It is an
1450
- ` intent(out) ` argument. If ` .true. ` an entry with the given ` key `
1483
+ ` intent(out) ` argument. If ` .true. ` an entry with the given ` key `
1451
1484
exists in the map and ` other ` is defined. If ` .false. ` ` other ` is
1452
1485
undefined.
1453
1486
@@ -1457,7 +1490,7 @@ undefined.
1457
1490
associated with a ` key ` :
1458
1491
1459
1492
1460
- ``` Fortran
1493
+ ``` fortran
1461
1494
program demo_get_other_data
1462
1495
use, intrinsic:: iso_fortran_env, only: &
1463
1496
int8
@@ -1494,7 +1527,7 @@ undefined.
1494
1527
```
1495
1528
1496
1529
1497
- #### init - initializes a hash map
1530
+ #### ` init ` - initializes a hash map
1498
1531
1499
1532
##### Status
1500
1533
@@ -1506,9 +1539,9 @@ Initializes a `hashmap_type` object.
1506
1539
1507
1540
##### Syntax
1508
1541
1509
- ` call [[stdlib_hashmaps:map% init]]( hasher [, slots_bits, status ] ) `
1542
+ ` call map % [[hashmap_type(type): init(bound) ]]( hasher [, slots_bits, status ] ) `
1510
1543
1511
- ####@ # Class
1544
+ ##### Class
1512
1545
1513
1546
Subroutine
1514
1547
@@ -1576,7 +1609,7 @@ entry in the map.
1576
1609
1577
1610
##### Syntax
1578
1611
1579
- ` result = call [[stdlib_hashmaps: map % valid_key ]]( key, present ) `
1612
+ ` result = call map % [[hashmap_type(type):key_test(bound) ]]( key, present ) `
1580
1613
1581
1614
##### Class
1582
1615
@@ -1630,7 +1663,7 @@ slots in the hash map.
1630
1663
1631
1664
##### Syntax
1632
1665
1633
- ` value = [[stdlib_hashmaps:map% loading]]( ) `
1666
+ ` value = map % [[hashmap_type(type): loading(bound) ]]( ) `
1634
1667
1635
1668
##### Class
1636
1669
@@ -1677,7 +1710,7 @@ Inserts an entry into the hash map if it is not already present.
1677
1710
1678
1711
##### Syntax
1679
1712
1680
- ` call [[stdlib_hashmaps:map% map_entry]]( key[, other, conflict ] ) `
1713
+ ` call map % [[hashmap_type(type): map_entry(bound) ]]( key[, other, conflict ] ) `
1681
1714
1682
1715
1683
1716
##### Class
@@ -1742,7 +1775,7 @@ Returns the total number of table probes on the hash map.
1742
1775
1743
1776
##### Syntax
1744
1777
1745
- ` Result = [[stdlib_hashmap:map% map_probes]]( )`
1778
+ ` result = map % [[hashmap_type(type): map_probes(bound) ]]( )`
1746
1779
1747
1780
##### Class
1748
1781
@@ -1790,7 +1823,7 @@ Returns the total number of slots on a hash map
1790
1823
1791
1824
##### Syntax
1792
1825
1793
- ` Result = [[stdlib_hashmaps:map% num_slots]]( )`
1826
+ ` result = map % [[hashmap_type(type): num_slots(bound) ]]( )`
1794
1827
1795
1828
##### Class
1796
1829
@@ -1826,7 +1859,7 @@ The result is the number of slots in `map`.
1826
1859
```
1827
1860
1828
1861
1829
- #### rehash - changes the hashing function
1862
+ #### ` rehash ` - changes the hashing function
1830
1863
1831
1864
##### Status
1832
1865
@@ -1838,7 +1871,7 @@ Changes the hashing function for the map entries to that of `hasher`.
1838
1871
1839
1872
##### Syntax
1840
1873
1841
- ` call [[stdlib_hashmaps:map% rehash]]( hasher ) `
1874
+ ` call map % [[hashmap_type(type): rehash(bound) ]]( hasher ) `
1842
1875
1843
1876
##### Class
1844
1877
@@ -1847,7 +1880,7 @@ Subroutine
1847
1880
##### Arguments
1848
1881
1849
1882
` map ` (pass): shall be a scalar variable of class
1850
- ` chaining_hashmap_type ` oe ` open_hashmap_type ` .
1883
+ ` chaining_hashmap_type ` or ` open_hashmap_type ` .
1851
1884
It is an ` intent(inout) ` argument. It is the hash map whose hashing
1852
1885
method is to be changed.
1853
1886
@@ -1886,7 +1919,7 @@ Removes an entry from the hash map, `map`.
1886
1919
1887
1920
##### Syntax
1888
1921
1889
- ` call [[stdlib_hashmaps:map% remove]]( key[, existed ]) `
1922
+ ` call map % [[hashmap_type(type): remove(bound) ]]( key[, existed ]) `
1890
1923
1891
1924
##### Class
1892
1925
@@ -1931,7 +1964,7 @@ absent, the procedure returns with no entry with the given key.
1931
1964
end program demo_remove
1932
1965
```
1933
1966
1934
- #### ` set_other_data ` - replaces the other dataa for an entry
1967
+ #### ` set_other_data ` - replaces the other data for an entry
1935
1968
1936
1969
##### Status
1937
1970
@@ -1944,7 +1977,7 @@ Replaces the other data in the map for the entry with the key value,
1944
1977
1945
1978
##### Syntax
1946
1979
1947
- ` call [[stdlib_hashmaps:map% set_other_data]]( key, other[, exists] ) `
1980
+ ` call map % [[hashmap_type(type): set_other_data(bound) ]]( key, other[, exists] ) `
1948
1981
1949
1982
##### Class
1950
1983
@@ -2008,7 +2041,7 @@ Returns the total number of bits used to address the hash map slots.
2008
2041
2009
2042
##### Syntax
2010
2043
2011
- ` Result = [[stdlib_hashmaps:map% slots_bits]]( )`
2044
+ ` result = map % [[hashmap_type(type): slots_bits(bound) ]]( )`
2012
2045
2013
2046
##### Class
2014
2047
@@ -2057,7 +2090,7 @@ their slot index for a hash map
2057
2090
2058
2091
##### Syntax
2059
2092
2060
- ` Result = [[stdlib_hashmaps:map% total_depth]]( )`
2093
+ ` result = map % [[hashmap_type: total_depth]]( )`
2061
2094
2062
2095
##### Class
2063
2096
0 commit comments