Skip to content

Commit f57248a

Browse files
committed
Changed procedures to elemental
In reponse to gareth-nx's question as to whether some procedures could be elemental I changed the documentation in stdlib_hash_procedures.md. 1. All fibonacci and universal_mult_hash became elemental 2. The incorrect description of spooky_hash as pure was removed 3. Most hash functions acting on character string were described as elemental, the exception being spooky_hash. [ticket: X]
1 parent f05df9c commit f57248a

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

doc/specs/stdlib_hash_procedures.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ Experimental
510510

511511
##### Description
512512

513-
Calculates an `nbits` hash code from a 64 bit integer. This is useful
513+
Calculates an `nbits` hash code from a 32 bit integer. This is useful
514514
in mapping hash codes into small arrays.
515515

516516
##### Syntax
@@ -519,7 +519,7 @@ in mapping hash codes into small arrays.
519519

520520
##### Class
521521

522-
Pure function
522+
Elemental function
523523

524524
##### Arguments
525525

@@ -576,7 +576,7 @@ character string.
576576

577577
##### Class
578578

579-
Pure function
579+
Pure/elemental function
580580

581581
##### Argument
582582

@@ -603,6 +603,8 @@ applications.
603603
This code does not pass any of the SMHasher tests, but the resulting
604604
degradation in performance due to its larger number of collisions is
605605
expected to be minor compared to its faster hashing rate.
606+
It is a *pure* function for integer arrays, and an *elemental*
607+
function for character strings.
606608

607609

608610
##### Example
@@ -636,7 +638,7 @@ character string.
636638

637639
##### Class
638640

639-
Pure function
641+
Pure/elemental function
640642

641643
##### Argument
642644

@@ -663,6 +665,8 @@ applications.
663665
This code does not pass any of the SMHasher tests, but the resulting
664666
degradation in performance due to its larger number of collisions is
665667
expected to be minor compared to its faster hashing rate.
668+
It is a *pure* function for integer arrays, and an *elemental*
669+
function for character strings.
666670

667671
##### Example
668672

@@ -810,7 +814,7 @@ character string, and the input `seed`.
810814

811815
##### Class
812816

813-
Pure function
817+
Pure/elemental function
814818

815819
##### Arguments
816820

@@ -835,6 +839,8 @@ performance on short keys.
835839
As a result it should give fair performance for typical hash table
836840
applications.
837841
This code passes the SMHasher tests, and has no known bad seeds.
842+
It is a *pure* function for integer arrays, and an *elemental*
843+
function for character strings.
838844

839845
##### Example
840846

@@ -870,7 +876,7 @@ character string, and the input `seed`.
870876

871877
##### Class
872878

873-
Pure function
879+
Pure/elemental function
874880

875881
##### Arguments
876882

@@ -895,6 +901,8 @@ performance on short keys.
895901
As a result it should give fair performance for typical hash table
896902
applications.
897903
This code passes the SMHasher tests, and has no known bad seeds.
904+
It is a *pure* function for integer arrays, and an *elemental*
905+
function for character strings.
898906

899907
##### Example
900908

@@ -964,7 +972,7 @@ in mapping a hash value to a range 0 to `2**nbits-1`.
964972

965973
##### Class
966974

967-
Pure function
975+
Elemental function
968976

969977
##### Arguments
970978

@@ -1029,7 +1037,7 @@ character string, and the input `seed`.
10291037

10301038
##### Class
10311039

1032-
Pure function
1040+
Pure/elemental function
10331041

10341042
##### Arguments
10351043

@@ -1061,6 +1069,8 @@ so far testing has not found any bad seeds for `waterhash`.
10611069
It can have undefined behavior if the key is not word aligned,
10621070
i.e. some computer processors can only process a given size integer if
10631071
the address of the integer is a multiple of the integer size.
1072+
It is a *pure* function for integer arrays, and an *elemental*
1073+
function for character strings.
10641074

10651075
##### Example
10661076

@@ -1141,7 +1151,7 @@ in mapping hash codes into small arrays.
11411151

11421152
##### Class
11431153

1144-
Pure function
1154+
Elemental function
11451155

11461156
##### Arguments
11471157

@@ -1198,7 +1208,7 @@ character string.
11981208

11991209
##### Class
12001210

1201-
Pure function
1211+
Pure/elemental function
12021212

12031213
##### Argument
12041214

@@ -1225,6 +1235,8 @@ applications, although it is rare for them to need 64 bits.
12251235
This code does not pass any of the SMHasher tests, but the resulting
12261236
degradation in performance due to its larger number of collisions is
12271237
expected to be minor compared to its faster hashing rate.
1238+
It is a *pure* function for integer arrays, and an *elemental*
1239+
function for character strings.
12281240

12291241

12301242
##### Example
@@ -1260,7 +1272,7 @@ character string.
12601272

12611273
##### Class
12621274

1263-
Pure function
1275+
Pure/elemental function
12641276

12651277
##### Argument
12661278

@@ -1287,6 +1299,8 @@ applications.
12871299
This code does not pass any of the SMHasher tests, but the resulting
12881300
degradation in performance due to its larger number of collisions is
12891301
expected to be minor compared to its faster hashing rate.
1302+
It is a *pure* function for integer arrays, and an *elemental*
1303+
function for character strings.
12901304

12911305
##### Example
12921306

@@ -1433,7 +1447,7 @@ value also depends on a scalar 32 bit integer, `seed`.
14331447

14341448
##### Class
14351449

1436-
Pure function
1450+
Pure/elemental function
14371451

14381452
##### Arguments
14391453

@@ -1454,6 +1468,8 @@ The result is an integer of kind `INT64`.
14541468
Fajardo. The hash has acceptable performance on small keys, and good
14551469
performance on long keys. It passes all the SMHasher tests, and has
14561470
no known bad seeds.
1471+
It is a *pure* function for integer arrays, and an *elemental*
1472+
function for character strings.
14571473

14581474
##### Exampl
14591475

@@ -1491,7 +1507,7 @@ value also depends on a two element vector, `seed`.
14911507

14921508
##### Class
14931509

1494-
Pure function
1510+
Function
14951511

14961512
##### Arguments
14971513

@@ -1552,7 +1568,7 @@ in mapping a hash value to a range 0 to `2**nbits-1`.
15521568

15531569
##### Class
15541570

1555-
Pure function
1571+
Elemental function
15561572

15571573
##### Arguments
15581574

0 commit comments

Comments
 (0)