forked from johannesgerer/jburkardt-f
-
Notifications
You must be signed in to change notification settings - Fork 1
/
subset.html
1626 lines (1586 loc) · 50.8 KB
/
subset.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<title>
SUBSET - Combinatorial Routines
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
SUBSET <br> Combinatorial Routines
</h1>
<hr>
<p>
<b>SUBSET</b>
is a FORTRAN90 library which
performs various combinatorial operations.
</p>
<p>
These include the enumeration, generation, random
selection, ranking and unranking of
<ul>
<li>
<b>COMP</b>, compositions of an integer N into K parts;
</li>
<li>
<b>COMPNZ</b>, compositions of an integer N into K parts,
with no zero parts;
</li>
<li>
<b>EQUIV</b>'s, partitions of a set of N objects;
</li>
<li>
<b>I4_PARTITION</b>'s, partitions of an integer;
</li>
<li>
<b>I4POLY</b>'s, integer polynomials in factorial, Newton,
power sum, or Taylor form;
</li>
<li>
<b>I4VEC</b>'s, integer vectors;
</li>
<li>
<b>KSUB</b>'s, subsets of size K, from a set of N objects;
</li>
<li>
<b>MULTIPERM</b>'s, permutations of the N objects, some of which
are indistinguishable.
</li>
<li>
<b>PERM</b>'s, permutations of the first N integers;
</li>
<li>
<b>R8POLY</b>'s, real polynomials in factorial, Newton,
power sum, or Taylor form;
</li>
<li>
<b>KSUB</b>'s, subsets of a set of N objects;
</li>
<li>
vectors whose entries range from 1 to N;
</li>
<li>
<b>YTB</b>'s, Young tables;
</li>
</ul>
</p>
<p>
Other objects considered include
<ul>
<li>
the Bell numbers,
</li>
<li>
<b>BVEC</b>'s, binary numbers represented as a vector of 0's and 1's;
</li>
<li>
Catalan numbers,
</li>
<li>
congruence equations.
</li>
<li>
continued fractions,
</li>
<li>
<b>DEC</b>'s, decimal numbers represented as a mantissa and a power of 10;
</li>
<li>
<b>DERANGE</b>'s, derangements (permutations that leave no element in place),
</li>
<li>
<b>DVEC</b>'s, decimal numbers represented as a vector of digits;
</li>
<li>
falling factorials (20*19*18...),
</li>
<li>
<b>GRAY</b>, Gray codes,
</li>
<li>
matrix permanents (similar to determinants, but harder to compute,
if you can believe that),
</li>
<li>
Morse-Thue numbers,
</li>
<li>
pentagonal numbers,
</li>
<li>
Pythagorean triples,
</li>
<li>
<b>RAT</b>'s, rational numbers represented as a pair of integers;
</li>
<li>
rising factorials (7*8*9...).
</li>
</ul>
</p>
<p>
Fortran77 source code for some of the algorithms is
available in the
<a href = "http://www.cs.sunysb.edu/~algorith/">
The Stony Brook Algorithm Archive</a>.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>SUBSET</b> is available in
<a href = "../../c_src/subset/subset.html">a C version</a> and
<a href = "../../cpp_src/subset/subset.html">a C++ version</a> and
<a href = "../../f77_src/subset/subset.html">a FORTRAN77 version</a> and
<a href = "../../f_src/subset/subset.html">a FORTRAN90 version</a> and
<a href = "../../m_src/subset/subset.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/combination_lock/combination_lock.html">
COMBINATION_LOCK</a>,
a FORTRAN90 program which
simulates the process of determining the secret combination of a lock.
</p>
<p>
<a href = "../../f_src/combo/combo.html">
COMBO</a>,
a FORTRAN90 library which
includes many combinatorial routines.
</p>
<p>
<a href = "../../f_src/floyd/floyd.html">
FLOYD</a>,
a FORTRAN90 library which
implements Floyd's algorithm for finding the shortest distance between pairs of
nodes on a directed graph.
</p>
<p>
<a href = "../../f_src/grafpack/grafpack.html">
GRAFPACK</a>,
a FORTRAN90 library which
carries out operations on abstract graphs.
</p>
<p>
<a href = "../../f77_src/knapsack/knapsack.html">
KNAPSACK</a>,
a FORTRAN77 library which
solves a variety of knapsack problems.
</p>
<p>
<a href = "../../f77_src/lamp/lamp.html">
LAMP</a>,
a FORTRAN77 library which
solves linear assignment and matching problems.
</p>
<p>
<a href = "../../f_src/partial_digest/partial_digest.html">
PARTIAL_DIGEST</a>,
a FORTRAN90 library which
solves the partial digest problem.
</p>
<p>
<a href = "../../f_src/partition_problem/partition_problem.html">
PARTITION_PROBLEM</a>,
a FORTRAN90 library which
seeks solutions of the partition problem, splitting a set of integers into
two subsets with equal sum.
</p>
<p>
<a href = "../../f_src/set_theory/set_theory.html">
SET_THEORY</a>,
a FORTRAN90 library which
demonstrates various set theoretic operations using several models of a set.
</p>
<p>
<a href = "../../f_src/select/select.html">
SELECT</a>,
a FORTRAN90 library which
generates various combinatorial objects.
</p>
<p>
<a href = "../../f_src/subset_sum/subset_sum.html">
SUBSET_SUM</a>,
a FORTRAN90 library which
seeks solutions of the subset sum problem.
</p>
<p>
<a href = "../../f_src/unicycle/unicycle.html">
UNICYCLE</a>,
a FORTRAN90 library which
considers permutations containing a single cycle, sometimes called cyclic permutations.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Milton Abramowitz, Irene Stegun,<br>
Handbook of Mathematical Functions,<br>
National Bureau of Standards, 1964,<br>
ISBN: 0-486-61272-4,<br>
LC: QA47.A34.
</li>
<li>
Walter Ball,<br>
Mathematical Recreations and Essays,<br>
Macmillan, 1962,<br>
ISBN: 1417921269,<br>
LC: QA95.B2.
</li>
<li>
Paul Bratley, Bennett Fox, Linus Schrage,<br>
A Guide to Simulation,<br>
Second Edition,<br>
Springer, 1987,<br>
ISBN: 0387964673,<br>
LC: QA76.9.C65.B73.
</li>
<li>
Bill Buckles, Matthew Lybanon,<br>
Algorithm 515:
Generation of a Vector from the Lexicographical Index,<br>
ACM Transactions on Mathematical Software,<br>
Volume 3, Number 2, June 1977, pages 180-182.
</li>
<li>
Tom Christiansen, Nathan Torkington,<br>
Perl Cookbook,<br>
O'Reilly, 2003,<br>
ISBN: 0596003137,<br>
LC: QA76.73.P22.C38.
</li>
<li>
William Cody, Kenneth Hillstrom,<br>
Chebyshev Approximations for the Natural Logarithm of the
Gamma Function,
Mathematics of Computation,<br>
Volume 21, Number 98, April 1967, pages 198-203.
</li>
<li>
John Conway, Richard Guy,<br>
The Book of Numbers,<br>
Springer, 1998,<br>
ISBN: 038797993X,<br>
LC: QA241.C6897.
</li>
<li>
David Crouse,<br>
Remark on Algorithm 515,<br>
ACM Transactions on Mathematical Software,<br>
Volume 33, Number 2, Article 15, June 2007.
</li>
<li>
Bennett Fox,<br>
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,<br>
ACM Transactions on Mathematical Software,<br>
Volume 12, Number 4, December 1986, pages 362-376.
</li>
<li>
Laurent Habsieger, Maxim Kazarian, Sergei Lando,<br>
On the Second Number of Plutarch,<br>
American Mathematical Monthly,<br>
Volume 105, Number 5, May 1998, page 446.
</li>
<li>
John Halton,<br>
On the efficiency of certain quasi-random sequences of points
in evaluating multi-dimensional integrals,<br>
Numerische Mathematik,<br>
Volume 2, Number 1, December 1960, pages 84-90.
</li>
<li>
John Hammersley,<br>
Monte Carlo methods for solving multivariable problems,<br>
Proceedings of the New York Academy of Science,<br>
Volume 86, 1960, pages 844-874.
</li>
<li>
John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
Charles Mesztenyi, John Rice, Henry Thacher,
Christoph Witzgall,<br>
Computer Approximations,<br>
Wiley, 1968,<br>
LC: QA297.C64.
</li>
<li>
Brian Hayes,<br>
Third Base,<br>
American Scientist,<br>
Volume 89, Number 6, November-December 2001, pages 490-494.
</li>
<li>
Mark Herkommer,<br>
Number Theory, A Programmer's Guide,<br>
McGraw Hill, 1999,<br>
ISBN: 0-07-913074-7.
</li>
<li>
Karla Hoffman, Douglas Shier,<br>
Algorithm 564:
A Test Problem Generator for Discrete Linear L1
Approximation Problems,<br>
ACM Transactions on Mathematical Software,<br>
Volume 6, Number 4, December 1980, pages 615-617.
</li>
<li>
Donald Knuth,<br>
The Art of Computer Programming,<br>
Volume 3, Sorting and Searching,<br>
Second Edition,<br>
Addison Wesley, 1998,<br>
ISBN: 0201896850,<br>
LC: QA76.6.K64.
</li>
<li>
Hang Tong Lau,<br>
Algorithms on Graphs,<br>
Tab Books, 1989,<br>
ISBN: 0830634290,<br>
LC: QA166.L38
</li>
<li>
Pierre LEcuyer,<br>
Random Number Generation,<br>
in Handbook of Simulation,<br>
edited by Jerry Banks,<br>
Wiley, 1998,<br>
ISBN: 0471134031,<br>
LC: T57.62.H37.
</li>
<li>
Peter Lewis, Allen Goodman, James Miller,<br>
A Pseudo-Random Number Generator for the System/360,<br>
IBM Systems Journal,<br>
Volume 8, 1969, pages 136-143.
</li>
<li>
Charles Mifsud,<br>
Algorithm 154,
Combination in Lexicographic Order,<br>
Communications of the ACM,<br>
Volume 6, Number 3, March 1963, page 103.
</li>
<li>
mil_std_1753,<br>
Military Standard 1753,<br>
FORTRAN, DoD Supplement To American National Standard X3.9-1978,<br>
9 November 1978.
</li>
<li>
Albert Nijenhuis, Herbert Wilf,<br>
Combinatorial Algorithms for Computers and Calculators,<br>
Second Edition,<br>
Academic Press, 1978,<br>
ISBN: 0-12-519260-6,<br>
LC: QA164.N54.
</li>
<li>
Robert Owens,<br>
Sums of Powers of Integers,<br>
Mathematics Magazine,<br>
Volume 65, Number 1, February 1992, pages 38-40.
</li>
<li>
Norman Richert,<br>
Strang's Strange Figures,<br>
American Mathematical Monthly,<br>
Volume 99, Number 2, February 1992, pages 101-107.
</li>
<li>
James Sandeson,<br>
Testing Ecological Patterns,<br>
American Scientist,<br>
Volume 88, Number 4, July-August 2000, pages 332-339.
</li>
<li>
Ian Saunders,<br>
Algorithm AS 205,<br>
Enumeration of R x C Tables with Repeated Row Totals,<br>
Applied Statistics,<br>
Volume 33, Number 3, 1984, pages 340-352.
</li>
<li>
Robert Sedgewick,<br>
Algorithms in C,<br>
Addison-Wesley, 1990,<br>
ISBN: 0-201-51425-7,<br>
LC: QA76.73.C15S43.
</li>
<li>
Raymond Seroul,<br>
Programming for Mathematicians,<br>
Springer, 2000,<br>
ISBN: 3-540-66422-X,<br>
LC: QA76.6.S465.
</li>
<li>
Mok-Kong Shen,<br>
Algorithm 202:
Generation of Permutations in Lexicographical Order,<br>
Communications of the ACM,<br>
Volume 6, Number 9, September 1963, page 517.
</li>
<li>
Richard Stanley,<br>
Hipparchus, Plutarch, Schroeder, and Hough,<br>
American Mathematical Monthly,<br>
Volume 104, Number 4, April 1997, pages 344-350.
</li>
<li>
Dennis Stanton, Dennis White,<br>
Constructive Combinatorics,<br>
Springer, 1986,<br>
ISBN: 0387963472,<br>
LC: QA164.S79.
</li>
<li>
Ian Stewart,<br>
A Neglected Number,<br>
Scientific American, <br>
Volume 274, pages 102-102, June 1996.
</li>
<li>
Ian Stewart,<br>
Math Hysteria,<br>
Oxford, 2004,<br>
ISBN: 0198613369,<br>
LC: QA95.S7255.
</li>
<li>
James Sylvester,<br>
Question 7382,
Mathematical Questions with their Solutions,<br>
Educational Times,<br>
Volume 41, page 21, 1884.
</li>
<li>
Hale Trotter,<br>
Algorithm 115:
PERM,<br>
Communications of the Association for Computing Machinery,<br>
Volume 5, Number 8, August 1962, pages 434-435.
</li>
<li>
Johannes vanderCorput,<br>
Verteilungsfunktionen I & II,<br>
Proceedings of the Koninklijke Nederlandsche Akademie
van Wetenschappen,<br>
Volume 38, 1935, pages 813-820, pages 1058-1066.
</li>
<li>
Jack vanLint, Richard Wilson,<br>
A Course in Combinatorics,<br>
Cambridge, 1992,<br>
ISBN: 0-521-42260-4,<br>
LC: QA164.L56.
</li>
<li>
Eric Weisstein,<br>
CRC Concise Encyclopedia of Mathematics,<br>
CRC Press, 2002,<br>
Second edition,<br>
ISBN: 1584883472,<br>
LC: QA5.W45
</li>
<li>
Stephen Wolfram,<br>
The Mathematica Book,<br>
Fourth Edition,<br>
Cambridge University Press, 1999,<br>
ISBN: 0-521-64314-7,<br>
LC: QA76.95.W65.
</li>
<li>
ML Wolfson, HV Wright,<br>
ACM Algorithm 160:
Combinatorial of M Things Taken N at a Time,<br>
Communications of the ACM,<br>
Volume 6, Number 4, April 1963, page 161.
</li>
<li>
Daniel Zwillinger, editor,<br>
CRC Standard Mathematical Tables and Formulae,<br>
30th Edition,<br>
CRC Press, 1996,<br>
ISBN: 0-8493-2479-3,<br>
LC: QA47.M315.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "subset.f90">subset.f90</a>, the source code;
</li>
<li>
<a href = "subset.sh">subset.sh</a>,
commands to compile the source code;
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "subset_prb.f90">subset_prb.f90</a>, the calling program;
</li>
<li>
<a href = "subset_prb.sh">subset_prb.sh</a>,
commands to compile, link and run the calling program;
</li>
<li>
<a href = "subset_prb_output.txt">subset_prb_output.txt</a>,
the output file.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>ASM_ENUM</b> returns the number of alternating sign matrices of a given order.
</li>
<li>
<b>ASM_TRIANGLE</b> returns a row of the alternating sign matrix triangle.
</li>
<li>
<b>BELL</b> returns the Bell numbers from 0 to N.
</li>
<li>
<b>BELL_VALUES</b> returns some values of the Bell numbers for testing.
</li>
<li>
<b>BINARY_VECTOR_NEXT</b> generates the next binary vector.
</li>
<li>
<b>BVEC_ADD</b> adds two (signed) binary vectors.
</li>
<li>
<b>BVEC_AND</b> computes the AND of two binary vectors.
</li>
<li>
<b>BVEC_CHECK</b> checks a binary vector.
</li>
<li>
<b>BVEC_COMPLEMENT2</b> computes the two's complement of a binary vector.
</li>
<li>
<b>BVEC_MUL</b> computes the product of two binary vectors.
</li>
<li>
<b>BVEC_NEXT</b> generates the next BVEC.
</li>
<li>
<b>BVEC_NOT</b> "negates" or takes the 1's complement of a binary vector.
</li>
<li>
<b>BVEC_OR</b> computes the inclusive OR of two binary vectors.
</li>
<li>
<b>BVEC_PRINT</b> prints a BVEC, with an optional title.
</li>
<li>
<b>BVEC_REVERSE</b> reverses a binary vector.
</li>
<li>
<b>BVEC_SUB</b> subtracts two binary vectors.
</li>
<li>
<b>BVEC_TO_I4</b> makes an integer from a (signed) binary vector.
</li>
<li>
<b>BVEC_XOR</b> computes the exclusive OR of two binary vectors.
</li>
<li>
<b>CATALAN</b> computes the Catalan numbers, from C(0) to C(N).
</li>
<li>
<b>CATALAN_ROW_NEXT</b> computes row N of Catalan's triangle.
</li>
<li>
<b>CATALAN_VALUES</b> returns some values of the Catalan numbers for testing.
</li>
<li>
<b>CBT_TRAVERSE</b> traverses a complete binary tree of given depth.
</li>
<li>
<b>CFRAC_TO_RAT</b> converts a monic continued fraction to an ordinary fraction.
</li>
<li>
<b>CFRAC_TO_RFRAC</b> converts polynomial fractions from continued to rational form.
</li>
<li>
<b>CH_CAP</b> capitalizes a single character.
</li>
<li>
<b>CHANGE_GREEDY</b> makes change for a given total using the biggest coins first.
</li>
<li>
<b>CHANGE_NEXT</b> computes the next set of change for a given sum.
</li>
<li>
<b>CHINESE_CHECK</b> checks the Chinese remainder moduluses.
</li>
<li>
<b>CHINESE_TO_I4</b> converts a set of Chinese remainders to an equivalent integer.
</li>
<li>
<b>COMB_NEXT</b> computes combinations of K things out of N.
</li>
<li>
<b>COMB_ROW</b> computes row N of Pascal's triangle.
</li>
<li>
<b>COMB_UNRANK</b> returns the RANK-th combination of N things out of M.
</li>
<li>
<b>COMP_ENUM</b> returns the number of compositions of the integer N into K parts.
</li>
<li>
<b>COMP_NEXT</b> computes the compositions of the integer N into K parts.
</li>
<li>
<b>COMP_RANDOM</b> selects a random composition of the integer N into K parts.
</li>
<li>
<b>COMPNZ_ENUM</b> returns the number of nonzero compositions of the N into K parts.
</li>
<li>
<b>COMPNZ_NEXT</b> computes the compositions of the integer N into K nonzero parts.
</li>
<li>
<b>COMPNZ_RANDOM</b> selects a random composition of N into K nonzero parts.
</li>
<li>
<b>CONGRUENCE</b> solves a congruence of the form A * X = C ( mod B ).
</li>
<li>
<b>COUNT_POSE_RANDOM</b> poses a problem for the game "The Count is Good"
</li>
<li>
<b>DEBRUIJN</b> constructs a de Bruijn sequence.
</li>
<li>
<b>DEC_ADD</b> adds two decimal quantities.
</li>
<li>
<b>DEC_DIV</b> divides two decimal values.
</li>
<li>
<b>DEC_MUL</b> multiplies two decimals.
</li>
<li>
<b>DEC_ROUND</b> rounds a decimal fraction to a given number of digits.
</li>
<li>
<b>DEC_TO_R8</b> converts a decimal to an R8.
</li>
<li>
<b>DEC_TO_RAT</b> converts a decimal to a rational representation.
</li>
<li>
<b>DEC_TO_S</b> returns a string representation of a decimal.
</li>
<li>
<b>DEC_WIDTH</b> returns the "width" of a decimal number.
</li>
<li>
<b>DECMAT_DET</b> finds the determinant of an N by N matrix of decimal entries.
</li>
<li>
<b>DECMAT_PRINT</b> prints out decimal vectors and matrices.
</li>
<li>
<b>DERANGE_BACK_CANDIDATE</b> finds values for the K-th entry of a derangement.
</li>
<li>
<b>DERANGE_BACK_NEXT</b> returns the next derangement of N items.
</li>
<li>
<b>DERANGE_CHECK</b> determines whether a permutation is a derangement.
</li>
<li>
<b>DERANGE_ENUM</b> returns the number of derangements of N objects.
</li>
<li>
<b>DERANGE_ENUM2</b> returns the number of derangements of 0 through N objects.
</li>
<li>
<b>DERANGE_ENUM3</b> returns the number of derangements of 0 through N objects.
</li>
<li>
<b>DERANGE_WEED_NEXT</b> computes all derangements of N objects, one at a time.
</li>
<li>
<b>DIGIT_TO_CH</b> returns the character representation of a decimal digit.
</li>
<li>
<b>DIGRAPH_ARC_EULER</b> returns an Euler circuit in a digraph.
</li>
<li>
<b>DIGRAPH_ARC_PRINT</b> prints out a digraph from an edge list.
</li>
<li>
<b>DIOPHANTINE</b> solves a Diophantine equation A * X + B * Y = C.
</li>
<li>
<b>DIOPHANTINE_SOLUTION_MINIMIZE:</b> minimal solution of a Diophantine equation.
</li>
<li>
<b>DVEC_ADD</b> adds two (signed) DVEC's.
</li>
<li>
<b>DVEC_COMPLEMENTX</b> computes the ten's complement of a DVEC.
</li>
<li>
<b>DVEC_MUL</b> computes the product of two DVEC's.
</li>
<li>
<b>DVEC_PRINT</b> prints a DVEC, with an optional title.
</li>
<li>
<b>DVEC_SUB</b> subtracts two DVEC's.
</li>
<li>
<b>DVEC_TO_I4</b> makes an integer from a (signed) DVEC.
</li>
<li>
<b>EQUIV_NEXT</b> computes the partitions of a set one at a time.
</li>
<li>
<b>EQUIV_NEXT2</b> computes, one at a time, the partitions of a set.
</li>
<li>
<b>EQUIV_PRINT</b> prints a partition of a set.
</li>
<li>
<b>EQUIV_PRINT2</b> prints a partition of a set.
</li>
<li>
<b>EQUIV_RANDOM</b> selects a random partition of a set.
</li>
<li>
<b>EULER</b> returns the N-th row of Euler's triangle.
</li>
<li>
<b>FROBENIUS_NUMBER_ORDER2</b> returns the Frobenius number for order 2.
</li>
<li>
<b>FROBENIUS_NUMBER_ORDER2_VALUES:</b> values of the order 2 Frobenius number.
</li>
<li>
<b>GAMMA_LOG_VALUES</b> returns some values of the Log Gamma function.
</li>
<li>
<b>GET_SEED</b> returns a seed for the random number generator.
</li>
<li>
<b>GRAY_NEXT</b> generates the next Gray code by switching one item at a time.
</li>
<li>
<b>GRAY_RANK</b> ranks a Gray code.
</li>
<li>
<b>GRAY_RANK2</b> ranks a Gray code.
</li>
<li>
<b>GRAY_UNRANK</b> unranks a Gray code.
</li>
<li>
<b>GRAY_UNRANK2</b> unranks a Gray code.
</li>
<li>
<b>I4_BCLR</b> returns a copy of an I4 in which the POS-th bit is set to 0.
</li>
<li>
<b>I4_BSET</b> returns a copy of an I4 in which the POS-th bit is set to 1.
</li>
<li>
<b>I4_BTEST</b> returns TRUE if the POS-th bit of an I4 is 1.
</li>
<li>
<b>I4_CHOOSE</b> computes the binomial coefficient C(N,K).
</li>
<li>
<b>I4_FACTOR</b> factors an I4 into prime factors.
</li>
<li>
<b>I4_FACTORIAL</b> computes the factorial of N.
</li>
<li>
<b>I4_FALL</b> computes the falling factorial function [X]_N.
</li>
<li>
<b>I4_GCD</b> finds the greatest common divisor of two I4's.
</li>
<li>
<b>I4_HUGE</b> returns a "huge" I4.
</li>
<li>
<b>I4_LOG_10</b> returns the integer part of the logarithm base 10 of an I4.
</li>
<li>
<b>I4_MODP</b> returns the nonnegative remainder of I4 division.
</li>
<li>
<b>I4_MOEBIUS</b> returns the value of MU(N), the Moebius function of N.
</li>
<li>
<b>I4_PARTITION_CONJ</b> computes the conjugate of a partition.
</li>
<li>
<b>I4_PARTITION_COUNT</b> computes the number of partitions of an I4.
</li>
<li>
<b>I4_PARTITION_COUNT2</b> computes the number of partitions of an I4.
</li>
<li>
<b>I4_PARTITION_COUNT_VALUES</b> returns some values of the integer partition count.
</li>
<li>
<b>I4_PARTITION_NEXT</b> generates the partitions of an I4, one at a time.
</li>
<li>
<b>I4_PARTITION_NEXT2</b> computes the partitions of the integer N one at a time.
</li>
<li>
<b>I4_PARTITION_PRINT</b> prints a partition of an I4.
</li>
<li>
<b>I4_PARTITION_RANDOM</b> selects a random partition of the integer N.
</li>
<li>
<b>I4_PARTITIONS_NEXT:</b> next partition into S parts.
</li>
<li>
<b>I4_RISE</b> computes the rising factorial function [X]^N.
</li>
<li>
<b>I4_SQRT</b> finds the integer square root of N by solving N = Q**2 + R.
</li>
<li>
<b>I4_SQRT_CF:</b> continued fraction representation of a square root of an integer.
</li>
<li>
<b>I4_SWAP</b> switches two I4's.
</li>
<li>
<b>I4_TO_BVEC</b> makes a signed binary vector from an I4.
</li>
<li>
<b>I4_TO_CHINESE</b> converts an I4 to its Chinese remainder form.
</li>
<li>
<b>I4_TO_DVEC</b> makes a signed DVEC from an I4.
</li>
<li>
<b>I4_TO_I4POLY</b> converts an I4 to an I4POLY in a given base.
</li>
<li>
<b>I4_TO_S_LEFT</b> converts an I4 to a left-justified string.
</li>
<li>
<b>I4_TO_VAN_DER_CORPUT</b> computes an element of a van der Corput sequence.
</li>
<li>
<b>I4_UNIFORM</b> returns a scaled pseudorandom I4.
</li>
<li>
<b>I4MAT_01_ROWCOLSUM</b> creates a 0/1 I4MAT with given row and column sums.
</li>
<li>
<b>I4MAT_01_ROWCOLSUM2</b> creates a 0/1 I4MAT with given row and column sums.
</li>
<li>
<b>I4MAT_PERM</b> permutes the rows and columns of a square I4MAT.
</li>
<li>
<b>I4MAT_PERM2</b> permutes the rows and columns of a rectangular I4MAT.
</li>
<li>
<b>I4MAT_PRINT</b> prints an I4MAT.
</li>
<li>
<b>I4MAT_PRINT_SOME</b> prints some of an I4MAT.
</li>
<li>
<b>I4MAT_U1_INVERSE</b> inverts a unit upper triangular I4MAT.
</li>
<li>
<b>I4POLY</b> performs operations on I4POLY's in power or factorial form.
</li>
<li>
<b>I4POLY_CYCLO</b> computes a cyclotomic polynomial.
</li>
<li>
<b>I4POLY_DEGREE</b> returns the degree of an I4POLY.
</li>
<li>
<b>I4POLY_DIV</b> computes the quotient and remainder of two I4POLY's.
</li>
<li>
<b>I4POLY_MUL</b> computes the product of two I4POLY's.
</li>
<li>
<b>I4POLY_PRINT</b> prints an I4POLY.
</li>
<li>
<b>I4POLY_TO_I4</b> evaluates an I4POLY.
</li>
<li>
<b>I4VEC_ASCENDS</b> determines if an I4VEC is (weakly) ascending.
</li>
<li>
<b>I4VEC_BACKTRACK</b> supervises a backtrack search for an I4VEC.
</li>
<li>
<b>I4VEC_DESCENDS</b> determines if an I4VEC is decreasing.
</li>
<li>
<b>I4VEC_FRAC</b> searches for the K-th smallest element in an I4VEC.
</li>
<li>
<b>I4VEC_HEAP_D</b> reorders an I4VEC into an descending heap.
</li>
<li>
<b>I4VEC_INDICATOR</b> sets an I4VEC to the indicator vector.
</li>