-
Notifications
You must be signed in to change notification settings - Fork 57
/
random_data.html
1231 lines (1177 loc) · 41.3 KB
/
random_data.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>
RANDOM_DATA - Generation of random data
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
RANDOM_DATA <br> Generation of random data
</h1>
<hr>
<p>
<b>RANDOM_DATA</b>
is a MATLAB library which
uses a random number generator (RNG) to sample points for
various probability distributions, spatial dimensions, and geometries,
including the M-dimensional cube, ellipsoid, simplex and sphere.
</p>
<p>
Most of these routines assume that there is an available source
of pseudorandom numbers, distributed uniformly in the unit
interval [0,1]. In this package, that role is played by the
routine <b>R8_UNIFORM_01</b>, which allows us some portability.
We can get the same results in C, FORTRAN or MATLAB, for instance.
In general, however, it would be more efficient to use the
language-specific random number generator for this purpose.
</p>
<p>
If we have a source of pseudorandom values in [0,1], it's trivial
to generate pseudorandom points in any line segment; it's easy to
take pairs of pseudorandom values to sample a square, or triples to
sample a cube. It's easy to see how to deal with square region that
is translated from the origin, or scaled by different amounts in
either axis, or given a rigid rotation. The same simple transformations
can be applied to higher dimensional cubes, without giving us any
concern.
</p>
<p>
For all these simple shapes, which are just generalizations of
a square, we can easily see how to generate sample points that
we can guarantee will lie inside the region; in most cases, we
can also guarantee that these points will tend to be <i>uniformly
distributed</i>, that is, every subregion can expect to contain
a number of points proportional to its share of the total area.
</p>
<p>
However, we will <b>not</b> achieve uniform distribution in the
simple case of a rectangle of nonequal sides <b>[0,A]</b> x <b>[0,B]</b>,
if we naively scale the random values <b>(u1,u2)</b> to
<b>(A*u1,B*u2)</b>. In that case, the expected point density of
a wide, short region will differ from that of a narrow tall region.
The absence of uniformity is most obvious if the points are plotted.
</p>
<p>
If you realize that uniformity is desirable, and easily lost,
it is possible to adjust the approach so that rectangles are
properly handled.
</p>
<p>
But rectangles are much too simple. We are interested in circles,
triangles, and other shapes. Once the geometry of the region
becomes more "interesting", there are two common ways to continue.
</p>
<p>
In the <i>acceptance-rejection method</i>,
uniform points are generated in a superregion that encloses the
region. Then, points that do not lie within the region are rejected.
More points are generated until enough have been accepted to satisfy the
needs. If a circle was the region of interest, for instance, we
could surround it with a box, generate points in the box, and throw
away those points that don't actually lie in the circle. The resulting
set of samples will be a uniform sampling of the circle.
</p>
<p>
In the <i>direct mapping</i> method, a formula or mapping
is determined so that each time a set of values is taken from
the pseudorandom number generator, it is guaranteed to correspond
to a point in the region. For the circle problem, we can use
one uniform random number to choose an angle between 0 and 2 PI,
the other to choose a radius. (The radius must be chosen in
an appropriate way to guarantee uniformity, however.) Thus,
every time we input two uniform random values, we get a pair
(R,T) that corresponds to a point in the circle.
</p>
<p>
The acceptance-rejection method can be simple to program, and
can handle arbitrary regions. The direct mapping method is
less sensitive to variations in the aspect ratio of a region
and other irregularities. However, direct mappings are only
known for certain common mathematical shapes.
</p>
<p>
Points may also be generated according to a nonuniform density.
This creates an additional complication in programming. However,
there are some cases in which it is possible to use direct mapping
to turn a stream of scalar uniform random values into a set of
multivariate data that is governed by a normal distribution.
</p>
<p>
Another way to generate points replaces the uniform pseudorandom number
generator by a <i>quasirandom number generator</i>. The main difference
is that successive elements of a quasirandom sequence may be highly
correlated (bad for certain Monte Carlo applications) but will tend
to cover the region in a much more regular way than pseudorandom
numbers. Any process that uses uniform random numbers to carry out
sampling can easily be modified to do the same sampling with
a quasirandom sequence like the Halton sequence, for instance.
</p>
<p>
The library includes a routine that can write the resulting
data points to a file.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files 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>RANDOM_DATA</b> is available in
<a href = "../../c_src/random_data/random_data.html">a C version</a> and
<a href = "../../cpp_src/random_data/random_data.html">a C++ version</a> and
<a href = "../../f77_src/random_data/random_data.html">a FORTRAN77 version</a> and
<a href = "../../f_src/random_data/random_data.html">a FORTRAN90 version</a> and
<a href = "../../m_src/random_data/random_data.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../m_src/asa183/asa183.html">
ASA183</a>,
a MATLAB library which
implements the Wichman-Hill pseudorandom number generator.
</p>
<p>
<a href = "../../m_src/ball_grid/ball_grid.html">
BALL_GRID</a>,
a MATLAB library which
computes grid points that lie inside a ball.
</p>
<p>
<a href = "../../m_src/circle_grid/circle_grid.html">
CIRCLE_GRID</a>,
a MATLAB library which
computes grid points that lie inside a circle.
</p>
<p>
<a href = "../../m_src/discrete_pdf_sample_2d/discrete_pdf_sample_2d.html">
DISCRETE_PDF_SAMPLE_2D</a>,
a MATLAB program which
demonstrates how to construct a Probability Density Function (PDF)
from a table of sample data, and then to use that PDF to create new
samples.
</p>
<p>
<a href = "../../c_src/rbox/rbox.html">
RBOX</a>,
a C program which
produces random data from a number of regions.
</p>
<p>
<a href = "../../cpp_src/rsites/rsites.html">
RSITES</a>,
a C++ program which
produces random data in an M-dimensional box.
</p>
<p>
<a href = "../../m_src/simplex_coordinates/simplex_coordinates.html">
SIMPLEX_COORDINATES</a>,
a MATLAB library which
computes the Cartesian coordinates of the vertices of a regular
simplex in M dimensions.
</p>
<p>
<a href = "../../m_src/tetrahedron_grid/tetrahedron_grid.html">
TETRAHEDRON_GRID</a>,
a MATLAB library which
computes a tetrahedral grid of points.
</p>
<p>
<a href = "../../m_src/tetrahedron_monte_carlo/tetrahedron_monte_carlo.html">
TETRAHEDRON_MONTE_CARLO</a>,
a MATLAB program which
uses the Monte Carlo method to estimate integrals over a tetrahedron.
</p>
<p>
<a href = "../../datasets/tetrahedron_samples/tetrahedron_samples.html">
TETRAHEDRON_SAMPLES</a>,
a dataset directory which
contains examples of sets of sample points from the unit tetrahedron.
</p>
<p>
<a href = "../../m_src/triangle_grid/triangle_grid.html">
TRIANGLE_GRID</a>,
a MATLAB library which
computes a triangular grid of points.
</p>
<p>
<a href = "../../m_src/triangle_histogram/triangle_histogram.html">
TRIANGLE_HISTOGRAM</a>,
a MATLAB program which
computes histograms of data on the unit triangle.
</p>
<p>
<a href = "../../m_src/triangle_monte_carlo/triangle_monte_carlo.html">
TRIANGLE_MONTE_CARLO</a>,
a MATLAB program which
uses the Monte Carlo method to estimate integrals over a triangle.
</p>
<p>
<a href = "../../datasets/triangle_samples/triangle_samples.html">
TRIANGLE_SAMPLES</a>,
a dataset directory which
contains examples of sets of sample points from the unit triangle.
</p>
<p>
<a href = "../../m_src/uniform/uniform.html">
UNIFORM</a>,
a MATLAB library which
samples the uniform random distribution.
</p>
<p>
<a href = "../../m_src/xyz_display/xyz_display.html">
XYZ_DISPLAY</a>,
a MATLAB program which
reads XYZ information defining points in 3D,
and displays an image in the MATLAB graphics window.
</p>
<p>
<a href = "../../cpp_src/xyz_display_opengl/xyz_display_opengl.html">
XYZ_DISPLAY_OPENGL</a>,
a C++ program which
reads XYZ information defining points in 3D,
and displays an image using OpenGL.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<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>
James Arvo,<br>
Stratified sampling of spherical triangles,<br>
Computer Graphics Proceedings, Annual Conference Series, <br>
ACM SIGGRAPH '95, pages 437-438, 1995.
</li>
<li>
Gerard Bashein, Paul Detmer,<br>
Centroid of a Polygon,<br>
in Graphics Gems IV,<br>
edited by Paul Heckbert,<br>
AP Professional, 1994,<br>
ISBN: 0123361559,<br>
LC: T385.G6974.
</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>
Russell Cheng,<br>
Random Variate Generation,<br>
in Handbook of Simulation,<br>
edited by Jerry Banks,<br>
Wiley, 1998,<br>
ISBN: 0471134031,<br>
LC: T57.62.H37.
</li>
<li>
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,<br>
LINPACK User's Guide,<br>
SIAM, 1979,<br>
ISBN13: 978-0-898711-72-1,<br>
LC: QA214.L56.
</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 Halton, GB Smith,<br>
Algorithm 247:
Radical-Inverse Quasi-Random Point Sequence,<br>
Communications of the ACM,<br>
Volume 7, Number 12, December 1964, pages 701-702.
</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>
Ladislav Kocis, William Whiten,<br>
Computational Investigations of Low-Discrepancy Sequences,<br>
ACM Transactions on Mathematical Software,<br>
Volume 23, Number 2, June 1997, pages 266-294.
</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>
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>
Reuven Rubinstein,<br>
Monte Carlo Optimization, Simulation and Sensitivity of
Queueing Networks,<br>
Krieger, 1992,<br>
ISBN: 0894647644,<br>
LC: QA298.R79.
</li>
<li>
Peter Shirley,<br>
Nonuniform Random Point Sets Via Warping,<br>
in Graphics Gems III,<br>
edited by David Kirk,<br>
Academic Press, 1992,<br>
ISBN: 0124096735,<br>
LC: T385.G6973
</li>
<li>
Greg Turk,<br>
Generating Random Points in a Triangle,<br>
in Graphics Gems I,<br>
edited by Andrew Glassner,<br>
AP Professional, 1990,<br>
ISBN: 0122861663,<br>
LC: T385.G697
</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 = "arc_cosine.m">arc_cosine.m</a>
evaluates the arc cosine function, with argument truncation.
</li>
<li>
<a href = "bad_in_simplex01.m">bad_in_simplex01.m</a>
is a "bad" (nonuniform) sampling of the unit simplex.
</li>
<li>
<a href = "brownian.m">brownian.m</a>
creates Brownian motion points.
</li>
<li>
<a href = "dpo_fa.m">dpo_fa.m</a>
factors a real symmetric positive definite matrix.
</li>
<li>
<a href = "dpo_sl.m">dpo_sl.m</a>
solves a linear system factored by DPO_CO or DPO_FA.
</li>
<li>
<a href = "direction_uniform_nd.m">direction_uniform_nd.m</a>
generates a random direction vector.
</li>
<li>
<a href = "grid_in_cube01.m">grid_in_cube01.m</a>
generates grid points in the unit hypercube.
</li>
<li>
<a href = "grid_side.m">grid_side.m</a>
finds the smallest grid containing at least N points.
</li>
<li>
<a href = "halham_dim_num_check.m">halham_dim_num_check.m</a>
checks DIM_NUM for a Halton or Hammersley sequence.
</li>
<li>
<a href = "halham_leap_check.m">halham_leap_check.m</a>
checks LEAP for a Halton or Hammersley sequence.
</li>
<li>
<a href = "halham_n_check.m">halham_n_check.m</a>
checks N for a Halton or Hammersley sequence.
</li>
<li>
<a href = "halham_seed_check.m">halham_seed_check.m</a>
checks SEED for a Halton or Hammersley sequence.
</li>
<li>
<a href = "halham_step_check.m">halham_step_check.m</a>
checks STEP for a Halton or Hammersley sequence.
</li>
<li>
<a href = "halton_base_check.m">halton_base_check.m</a>
checks BASE for a Halton sequence.
</li>
<li>
<a href = "halton_in_circle01_accept.m">halton_in_circle01_accept.m</a>
accepts Halton points in the unit circle.
</li>
<li>
<a href = "halton_in_circle01_map.m">halton_in_circle01_map.m</a>
maps Halton points into the unit circle.
</li>
<li>
<a href = "halton_in_cube01.m">halton_in_cube01.m</a>
generates Halton points in the unit hypercube.
</li>
<li>
<a href = "hammersley_base_check.m">hammersley_base_check.m</a>
is TRUE if BASE is legal.
</li>
<li>
<a href = "hammersley_in_cube01.m">hammersley_in_cube01.m</a>
generates Hammersley points in the unit hypercube.
</li>
<li>
<a href = "i4_factorial.m">i4_factorial.m</a>
computes the factorial N!
</li>
<li>
<a href = "i4_modp.m">i4_modp.m</a>
returns the nonnegative remainder of integer division.
</li>
<li>
<a href = "i4_to_halton.m">i4_to_halton.m</a>
computes one element of a leaped Halton subsequence.
</li>
<li>
<a href = "i4_to_halton_sequence.m">i4_to_halton_sequence.m</a>
computes N elements of a leaped Halton subsequence.
</li>
<li>
<a href = "i4_to_hammersley.m">i4_to_hammersley.m</a>
computes one element of a leaped Hammersley subsequence.
</li>
<li>
<a href = "i4_to_hammersley_sequence.m">i4_to_hammersley_sequence.m</a>
computes N elements of a leaped Hammersley subsequence.
</li>
<li>
<a href = "i4_uniform_ab.m">i4_uniform_ab.m</a>
returns a pseudorandom I4 between A and B.
</li>
<li>
<a href = "i4vec_transpose_print.m">i4vec_transpose_print.m</a>
prints an integer vector "transposed".
</li>
<li>
<a href = "ksub_random2.m">ksub_random2.m</a>
selects a random subset of size K from a set of size N.
</li>
<li>
<a href = "normal.m">normal.m</a>
creates normally distributed points.
</li>
<li>
<a href = "normal_circular.m">normal_circular.m</a>
creates circularly normal points.
</li>
<li>
<a href = "normal_multivariate.m">normal_multivariate.m</a>
samples a multivariate normal distribution.
</li>
<li>
<a href = "normal_simple.m">normal_simple.m</a>
creates normally distributed points.
</li>
<li>
<a href = "polygon_centroid_2d.m">polygon_centroid_2d.m</a>
computes the centroid of a polygon in 2D.
</li>
<li>
<a href = "prime.m">prime.m</a>
returns any of the first PRIME_MAX prime numbers.
</li>
<li>
<a href = "r8_normal_01.m">r8_normal_01.m</a>
returns a unit pseudonormal R8.
</li>
<li>
<a href = "r8_uniform_01.m">r8_uniform_01.m</a>
returns a unit pseudorandom R8.
</li>
<li>
<a href = "r8mat_normal_01.m">r8mat_normal_01.m</a>
returns a unit pseudonormal R8MAT.
</li>
<li>
<a href = "r8mat_print.m">r8mat_print.m</a>
prints an R8MAT, with an optional title.
</li>
<li>
<a href = "r8mat_print_some.m">r8mat_print_some.m</a>
prints some of an R8MAT, with an optional title.
</li>
<li>
<a href = "r8mat_write.m">r8mat_write.m</a>
writes an R8MAT file.
</li>
<li>
<a href = "r8mat_uniform_01.m">r8mat_uniform_01.m</a>
returns a unit pseudorandom R8MAT.
</li>
<li>
<a href = "r8vec_normal_01.m">r8vec_normal_01.m</a>
returns a unit pseudonormal R8VEC.
</li>
<li>
<a href = "r8vec_print.m">r8vec_print.m</a>
prints an R8VEC.
</li>
<li>
<a href = "r8vec_uniform_01.m">r8vec_uniform_01.m</a>
returns a unit pseudorandom R8VEC.
</li>
<li>
<a href = "s_len_trim.m">s_len_trim.m</a>
returns the length of a string to the last nonblank.
</li>
<li>
<a href = "scale_from_simplex01.m">scale_from_simplex01.m</a>
rescales data from a unit to non-unit simplex.
</li>
<li>
<a href = "scale_to_ball01.m">scale_to_ball01.m</a>
translates and rescales data to fit within the unit ball.
</li>
<li>
<a href = "scale_to_block01.m">scale_to_block01.m</a>
translates and rescales data to fit in the unit block.
</li>
<li>
<a href = "scale_to_cube01.m">scale_to_cube01.m</a>
translates and rescales data to the unit hypercube.
</li>
<li>
<a href = "stri_angles_to_area.m">
stri_angles_to_area.m</a>,
computes the area of a spherical triangle;
</li>
<li>
<a href = "stri_sides_to_angles.m">
stri_sides_to_angles.m</a>,
computes the angles of a spherical triangle from its sides;
</li>
<li>
<a href = "stri_vertices_to_sides.m">
stri_vertices_to_sides.m</a>,
computes the sides of a spherical triangle from its sides;
</li>
<li>
<a href = "timestamp.m">timestamp.m</a>
prints the current YMDHMS date as a time stamp.
</li>
<li>
<a href = "triangle_area_2d.m">triangle_area_2d.m</a>
computes the area of a triangle in 2D.
</li>
<li>
<a href = "tuple_next_fast.m">tuple_next_fast.m</a>
computes the next element of a tuple space, "fast".
</li>
<li>
<a href = "uniform_in_annulus.m">uniform_in_annulus.m</a>
samples a circular annulus.
</li>
<li>
<a href = "uniform_in_annulus_accept.m">uniform_in_annulus_accept.m</a>
accepts points in an annulus.
</li>
<li>
<a href = "uniform_in_annulus_accept.m">uniform_in_annulus_accept.m</a>
samples an annular sector in 2D.
</li>
<li>
<a href = "uniform_in_circle01_map.m">uniform_in_circle01_map.m</a>
maps uniform points into the unit circle.
</li>
<li>
<a href = "uniform_in_cube01.m">uniform_in_cube01.m</a>
creates uniform points in the unit hypercube.
</li>
<li>
<a href = "uniform_in_ellipsoid_map.m">uniform_in_ellipsoid_map.m</a>
maps uniform points into an ellipsoid.
</li>
<li>
<a href = "uniform_in_parallelogram_map.m">uniform_in_parallelogram_map.m</a>
maps uniform points into a parallelogram.
</li>
<li>
<a href = "uniform_in_polygon_map.m">uniform_in_polygon_map.m</a>
maps uniform points into a polygon.
</li>
<li>
<a href = "uniform_in_sector_map.m">uniform_in_sector_map.m</a>
maps uniform points into a circular sector.
</li>
<li>
<a href = "uniform_in_simplex01_map.m">uniform_in_simplex01_map.m</a>
maps uniform points into the unit simplex.
</li>
<li>
<a href = "uniform_in_sphere01_map.m">uniform_in_sphere01_map.m</a>
maps uniform points into the unit sphere.
</li>
<li>
<a href = "uniform_in_tetrahedron.m">uniform_in_tetrahedron.m</a>
maps uniform points into a tetrahedron.
</li>
<li>
<a href = "uniform_in_triangle_map1.m">uniform_in_triangle_map1.m</a>
maps uniform points into a triangle.
</li>
<li>
<a href = "uniform_in_triangle_map2.m">uniform_in_triangle_map2.m</a>
maps uniform points into a triangle.
</li>
<li>
<a href = "uniform_in_triangle01_map.m">uniform_in_triangle01_map.m</a>
maps uniform points into the unit triangle.
</li>
<li>
<a href = "uniform_on_cube.m">uniform_on_cube.m</a>
maps uniform points onto the surface of a cube.
</li>
<li>
<a href = "uniform_on_cube01.m">uniform_on_cube01.m</a>
maps uniform points onto the surface of the unit cube.
</li>
<li>
<a href = "uniform_on_ellipsoid_map.m">uniform_on_ellipsoid_map.m</a>
maps uniform points onto an ellipsoid.
</li>
<li>
<a href = "uniform_on_hemisphere01_phong.m">
uniform_on_hemisphere01_phong.m</a>
maps uniform points onto the unit hemisphere, with the Phong
distribution.
</li>
<li>
<a href = "uniform_on_simplex01_map.m">uniform_on_simplex01_map.m</a>
maps uniform points onto the unit simplex.
</li>
<li>
<a href = "uniform_on_sphere01_map.m">uniform_on_sphere01_map.m</a>
maps uniform points onto the unit sphere.
</li>
<li>
<a href = "uniform_on_sphere01_patch_tp.m">uniform_on_sphere01_patch_tp.m</a>
maps uniform points onto a unit sphere TP (THETA,PHI) patch in 3D.
</li>
<li>
<a href = "uniform_on_sphere01_patch_xyz.m">uniform_on_sphere01_patch_xyz.m</a>
maps uniform points onto a unit sphere XYZ patch in 3D.
</li>
<li>
<a href = "uniform_on_sphere01_triangle_xyz.m">uniform_on_sphere01_triangle_xyz.m</a>
maps uniform points onto a spherical triangle on the unit sphere, using
XYZ coordinates.
</li>
<li>
<a href = "uniform_on_triangle.m">uniform_on_triangle.m</a>
maps uniform points onto the boundary of a triangle.
</li>
<li>
<a href = "uniform_on_triangle01.m">uniform_on_triangle01.m</a>
maps uniform points onto the boundary of the unit triangle (0,0), (1,0), (0,1).
</li>
<li>
<a href = "uniform_walk.m">uniform_walk.m</a>
generates points on a uniform random walk.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "random_data_test.m">random_data_test.m</a>,
calls all the test programs.
</li>
<li>
<a href = "random_data_test_output.txt">random_data_test_output.txt</a>,
output from the sample calling program.
</li>
<li>
<a href = "random_data_test005.m">random_data_test005.m</a>,
tests BAD_IN_SIMPLEX01.
</li>
<li>
<a href = "random_data_test01.m">random_data_test01.m</a>,
tests BROWNIAN.
</li>
<li>
<a href = "random_data_test02.m">random_data_test02.m</a>,
tests R8_NORMAL_01.
</li>
<li>
<a href = "random_data_test03.m">random_data_test03.m</a>,
tests R8_UNIFORM_01.
</li>
<li>
<a href = "random_data_test04.m">random_data_test04.m</a>,
tests GRID_IN_CUBE01.
</li>
<li>
<a href = "random_data_test05.m">random_data_test05.m</a>,
tests HALTON_IN_CIRCLE01_ACCEPT.
</li>
<li>
<a href = "random_data_test06.m">random_data_test06.m</a>,
tests HALTON_IN_CIRCLE01_MAP.
</li>
<li>
<a href = "random_data_test07.m">random_data_test07.m</a>,
tests HALTON_IN_CUBE01.
</li>
<li>
<a href = "random_data_test08.m">random_data_test08.m</a>,
tests HAMMERSLEY_IN_CUBE01.
</li>
<li>
<a href = "random_data_test09.m">random_data_test09.m</a>,
tests NORMAL.
</li>
<li>
<a href = "random_data_test10.m">random_data_test10.m</a>,
tests NORMAL_CIRCULAR.
</li>
<li>
<a href = "random_data_test11.m">random_data_test11.m</a>,
tests NORMAL_SIMPLE.
</li>
<li>
<a href = "random_data_test115.m">random_data_test115.m</a>,
tests UNIFORM_IN_ANNULUS.
</li>
<li>
<a href = "random_data_test12.m">random_data_test12.m</a>,
tests UNIFORM_IN_ANNULUS_ACCEPT.
</li>
<li>
<a href = "random_data_test125.m">random_data_test125.m</a>,
tests UNIFORM_IN_ANNULUS_SECTOR.
</li>
<li>
<a href = "random_data_test13.m">random_data_test13.m</a>,
tests UNIFORM_IN_CIRCLE01_MAP.
</li>
<li>
<a href = "random_data_test14.m">random_data_test14.m</a>,
tests UNIFORM_IN_CUBE01.
</li>
<li>
<a href = "random_data_test15.m">random_data_test15.m</a>,
tests UNIFORM_IN_ELLIPSOID_MAP.
</li>
<li>
<a href = "random_data_test16.m">random_data_test16.m</a>,
tests UNIFORM_IN_PARALLELOGRAM_MAP.
</li>
<li>
<a href = "random_data_test17.m">random_data_test17.m</a>,
tests UNIFORM_IN_POLYGON_MAP.
</li>
<li>
<a href = "random_data_test18.m">random_data_test18.m</a>,
tests UNIFORM_IN_SECTOR_MAP.
</li>
<li>
<a href = "random_data_test19.m">random_data_test19.m</a>,
tests UNIFORM_IN_SIMPLEX01_MAP.
</li>
<li>
<a href = "random_data_test20.m">random_data_test20.m</a>,
tests UNIFORM_IN_SPHERE01_MAP.
</li>
<li>
<a href = "random_data_test21.m">random_data_test21.m</a>,
tests UNIFORM_IN_TRIANGLE_MAP1.
</li>
<li>
<a href = "random_data_test22.m">random_data_test22.m</a>,
tests UNIFORM_IN_TRIANGLE_MAP2.
</li>
<li>
<a href = "random_data_test23.m">random_data_test23.m</a>,
tests UNIFORM_IN_TRIANGLE01_MAP.
</li>
<li>
<a href = "random_data_test24.m">random_data_test24.m</a>,
tests UNIFORM_ON_ELLIPSOID_MAP.
</li>
<li>
<a href = "random_data_test245.m">random_data_test245.m</a>,
tests UNIFORM_ON_HEMISPHERE01_PHONG.
</li>
<li>
<a href = "random_data_test25.m">random_data_test25.m</a>,
tests UNIFORM_ON_SIMPLEX01_MAP.
</li>
<li>
<a href = "random_data_test26.m">random_data_test26.m</a>,
tests UNIFORM_ON_SPHERE01_MAP.
</li>
<li>
<a href = "random_data_test264.m">random_data_test264.m</a>,
tests UNIFORM_ON_SPHERE01_PATCH_TP.
</li>
<li>
<a href = "random_data_test265.m">random_data_test265.m</a>,
tests UNIFORM_ON_SPHERE01_PATCH_XYZ.
</li>
<li>
<a href = "random_data_test267.m">random_data_test267.m</a>,
tests UNIFORM_ON_SPHERE01_TRIANGLE_XYZ.
</li>
<li>
<a href = "random_data_test27.m">random_data_test27.m</a>,
tests UNIFORM_WALK.
</li>
</ul>
</p>
<p>
The sample calling program generates sets of points:
<ul>
<li>
<a href = "bad_in_tetrahedron.txt">bad_in_tetrahedron.txt</a>,
points in the unit tetrahedron, not uniformly chosen.
</li>
<li>
<a href = "bad_in_triangle.txt">bad_in_triangle.txt</a>,
points in the unit triangle, not uniformly chosen.
</li>
<li>
<a href = "brownian.txt">brownian.txt</a>, Brownian motion.
</li>
<li>
<a href = "grid_in_cube01.txt">grid_in_cube01.txt</a>,
grid points in the unit hypercube, with CENTER = 1.
</li>
<li>
<a href = "halton_in_circle01_accept.txt">
halton_in_circle01_accept.txt</a>,
Halton points in the unit circle by acceptance/rejection.
</li>
<li>
<a href = "halton_in_circle01_map.txt">
halton_in_circle01_map.txt</a>,
Halton points in the unit circle by direct mapping.
</li>
<li>
<a href = "halton_in_cube01.txt">halton_in_cube01.txt</a>,
Halton points in the unit hypercube.
</li>
<li>
<a href = "hammersley_in_cube01.txt">
hammersley_in_cube01.txt</a>, Hammersley points in the unit hypercube.
</li>
<li>
<a href = "normal.txt">normal.txt</a>, normal points, with
strong correlation between the two coordinates.
</li>
<li>
<a href = "normal_circular.txt">normal_circular.txt</a>,
circular normal points.
</li>
<li>
<a href = "normal_simple.txt">normal_simple.txt</a>,
normal points in which there is no correlation between the
X and Y coordinates.
</li>
<li>
<a href = "polygon_vertices.txt">polygon_vertices.txt</a>,
the vertices of a polygon to be filled by random points.
</li>
<li>
<a href = "uniform_in_annulus.txt">
uniform_in_annulus.txt</a>,
uniform random points in an annulus, mappint.
</li>
<li>
<a href = "uniform_in_annulus_accept.txt">
uniform_in_annulus_accept.txt</a>,
uniform random points in an annulus, acceptance/rejection.
</li>
<li>
<a href = "uniform_in_annulus_sector.txt">
uniform_in_annulus_sector.txt</a>,
uniform random points in an annulus sector, mapping.
</li>
<li>
<a href = "uniform_in_cube.txt">uniform_in_cube.txt</a>,
uniform random points in the unit hypercube.
</li>
<li>
<a href = "uniform_in_circle01_map.txt">
uniform_in_circle01_map.txt</a>,
uniform random points in the unit circle.
</li>
<li>
<a href = "uniform_in_ellipsoid.txt">uniform_in_ellipsoid.txt</a>,
uniform random points in an ellipsoid.
</li>
<li>
<a href = "uniform_in_parallelogram_map.txt">
uniform_in_parallelogram_map.txt</a>,
uniform random points in a parallelogram.
</li>
<li>
<a href = "uniform_in_polygon_map.txt">
uniform_in_polygon_map.txt</a>,
uniform random points in a polygon (a star, in this case).