program main !*****************************************************************************80 ! !! random_data_test() tests random_data(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 21 January 2016 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) call timestamp ( ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'RANDOM_DATA_TEST' write ( *, '(a)' ) ' FORTRAN90 version' write ( *, '(a)' ) ' Test RANDOM_DATA().' call test005 ( ) call test01 ( ) call grid_in_cube01_test ( ) call test09 ( ) call test10 ( ) call test11 ( ) call test115 ( ) call test12 ( ) call test125 ( ) call test13 ( ) call test14 ( ) call test15 ( ) call test16 ( ) call test17 ( ) call test18 ( ) call test19 ( ) call test20 ( ) call test205 ( ) call uniform_in_triangle_map1_test ( ) call test22 ( ) call test23 ( ) call test235 ( ) call test24 ( ) call test245 ( ) call test25 ( ) call test26 ( ) call test264 ( ) call test265 ( ) call test267 ( ) call test27 ( ) ! ! Terminate. ! write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'RANDOM_DATA_TEST' write ( *, '(a)' ) ' Normal end of execution.' write ( *, '(a)' ) ' ' call timestamp ( ) stop 0 end subroutine test005 ( ) !*****************************************************************************80 ! !! TEST005 tests BAD_IN_SIMPLEX01. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 14 August 2009 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer dim_num integer n character ( len = 255 ) output_filename real ( kind = rk ), allocatable :: x(:,:) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST005:' write ( *, '(a)' ) ' BAD_IN_SIMPLEX01 is a "bad" sampling technique' write ( *, '(a)' ) ' for the unit simplex.' do dim_num = 2, 3 n = 10000 if ( dim_num == 2 ) then output_filename = 'bad_in_triangle.txt' else if ( dim_num == 3 ) then output_filename = 'bad_in_tetrahedron.txt' end if write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n allocate ( x(1:dim_num,1:n) ) call bad_in_simplex01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to "' // trim ( output_filename ) // '".' deallocate ( x ) end do return end subroutine test01 ( ) !*****************************************************************************80 ! !! TEST01 tests BROWNIAN. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 100 character ( len = 80 ) :: output_filename = 'brownian.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST01:' write ( *, '(a)' ) ' BROWNIAN generates Brownian motion points.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call brownian ( dim_num, n, x ) call scale_to_block01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to "' // trim ( output_filename ) // '".' return end subroutine grid_in_cube01_test ( ) !*****************************************************************************80 ! !! grid_in_cube01_test() tests grid_in_cube01(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 85 integer, parameter :: center = 1 character ( len = 80 ) :: output_filename = 'grid_in_cube01.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'grid_in_cube01_test():' write ( *, '(a)' ) ' grid_in_cube01() generates grid points' write ( *, '(a)' ) ' in the unit hypercube.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,i8)' ) ' CENTER option = ', center call grid_in_cube01 ( dim_num, n, center, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test09 ( ) !*****************************************************************************80 ! !! TEST09 tests NORMAL. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 25 September 2005 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'normal.txt' integer info real ( kind = rk ), dimension ( dim_num ) :: mu = (/ 6.0D+00, 100.0D+00 /) real ( kind = rk ) r(dim_num,dim_num) real ( kind = rk ), dimension ( dim_num, dim_num ) :: v = reshape ( (/ & 1.0D+00, 0.3D+00, 0.3D+00, 1.0D+00 /), (/ 2, 2 /) ) real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST09' write ( *, '(a)' ) ' NORMAL generates normal points' write ( *, '(a)' ) ' in M dimensions, using a nonzero mean, and with' write ( *, '(a)' ) ' user-specified variance-covariance matrix.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call r8vec_print ( dim_num, mu, ' Mean vector MU:' ) call r8mat_print ( dim_num, dim_num, v, ' Variance-covariance matrix V:' ) r(1:dim_num,1:dim_num) = v(1:dim_num,1:dim_num) call r8po_fa ( dim_num, r, info ) if ( info /= 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST04 - Fatal error!' write ( *, '(a)' ) ' Variance-covariance matrix factorization failed.' write ( *, '(a,i8)' ) ' INFO = ', info stop end if call r8mat_print ( dim_num, dim_num, r, ' Cholesky factor R:' ) call normal ( dim_num, n, r, mu, x ) call scale_to_block01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test10 ( ) !*****************************************************************************80 ! !! TEST10 tests NORMAL_CIRCULAR. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 2000 character ( len = 80 ) :: output_filename = 'normal_circular.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST10' write ( *, '(a)' ) ' NORMAL_CIRCULAR generates points in 2D' write ( *, '(a)' ) ' distributed according to a circular normal.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call normal_circular ( dim_num, n, x ) call scale_to_block01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test11 ( ) !*****************************************************************************80 ! !! TEST11 tests NORMAL_SIMPLE. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'normal_simple.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST11' write ( *, '(a)' ) ' NORMAL_SIMPLE generates normal points' write ( *, '(a)' ) ' in M dimensions, using a zero mean, and with' write ( *, '(a)' ) ' the identity as the variance-covariance matrix.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call normal_simple ( dim_num, n, x ) call scale_to_block01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test115 ( ) !*****************************************************************************80 ! !! TEST115 tests UNIFORM_IN_ANNULUS. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 400 character ( len = 80 ) :: output_filename = 'uniform_in_annulus.txt' real ( kind = rk ), dimension ( 2 ) :: pc = (/ 10.0D+00, 5.0D+00 /) real ( kind = rk ), parameter :: r1 = 1.0D+00 real ( kind = rk ), parameter :: r2 = 3.0D+00 real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST115' write ( *, '(a)' ) ' UNIFORM_IN_ANNULUS generates uniform ' write ( *, '(a)' ) ' points in an annulus by mapping.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,2g14.6)' ) ' Center PC(1:2) = ', pc(1:2) write ( *, '(a,g14.6)' ) ' Inner radius is R1 = ', r1 write ( *, '(a,g14.6)' ) ' Outer radius is R2 = ', r2 call uniform_in_annulus ( pc, r1, r2, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test12 ( ) !*****************************************************************************80 ! !! TEST12 tests UNIFORM_IN_ANNULUS_ACCEPT. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 400 character ( len = 80 ) :: output_filename = 'uniform_in_annulus_accept.txt' real ( kind = rk ), dimension ( 2 ) :: pc = (/ 10.0D+00, 5.0D+00 /) real ( kind = rk ), parameter :: r1 = 1.0D+00 real ( kind = rk ), parameter :: r2 = 3.0D+00 real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST12' write ( *, '(a)' ) ' UNIFORM_IN_ANNULUS_ACCEPT generates uniform ' write ( *, '(a)' ) ' points in an annulus by acceptance/rejection.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,2g14.6)' ) ' Center PC(1:2) = ', pc(1:2) write ( *, '(a,g14.6)' ) ' Inner radius is R1 = ', r1 write ( *, '(a,g14.6)' ) ' Outer radius is R2 = ', r2 call uniform_in_annulus_accept ( pc, r1, r2, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test125 ( ) !*****************************************************************************80 ! !! TEST125 tests UNIFORM_IN_ANNULUS_SECTOR. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 400 character ( len = 80 ) :: output_filename = 'uniform_in_annulus_sector.txt' real ( kind = rk ), dimension ( 2 ) :: pc = (/ 10.0D+00, 5.0D+00 /) real ( kind = rk ), parameter :: r1 = 1.0D+00 real ( kind = rk ), parameter :: r2 = 3.0D+00 real ( kind = rk ), parameter :: theta1 = 0.0D+00 real ( kind = rk ), parameter :: theta2 = 1.5707964D+00 real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST125' write ( *, '(a)' ) ' UNIFORM_IN_ANNULUS_SECTOR generates uniform ' write ( *, '(a)' ) ' points in an annular sector by mapping.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,2g14.6)' ) ' Center PC(1:2) = ', pc(1:2) write ( *, '(a,g14.6)' ) ' Inner radius is R1 = ', r1 write ( *, '(a,g14.6)' ) ' Outer radius is R2 = ', r2 write ( *, '(a,g14.6)' ) ' THETA1 = ', theta1 write ( *, '(a,g14.6)' ) ' THETA2 = ', theta2 call uniform_in_annulus_sector ( pc, r1, r2, theta1, theta2, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test13 ( ) !*****************************************************************************80 ! !! TEST13 tests UNIFORM_IN_CIRCLE01_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 07 August 2005 ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 400 character ( len = 80 ) :: output_filename = 'uniform_in_circle01_map.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST13' write ( *, '(a)' ) ' UNIFORM_IN_CIRCLE01_MAP maps uniform ' write ( *, '(a)' ) ' points into a unit circle.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_circle01_map ( n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test14 ( ) !*****************************************************************************80 ! !! TEST14 tests UNIFORM_IN_CUBE01. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'uniform_in_cube01.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST14' write ( *, '(a)' ) ' UNIFORM_IN_CUBE01 generates uniform ' write ( *, '(a)' ) ' points in the unit hypercube.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_cube01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test15 ( ) !*****************************************************************************80 ! !! TEST15 tests UNIFORM_IN_ELLIPSOID_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 12 April 2006 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 real ( kind = rk ), dimension(dim_num,dim_num) :: a = reshape ( (/ & 3.0D+00, 1.0D+00, 1.0D+00, 2.0D+00 /), (/ 2, 2 /) ) integer fail_num character ( len = 80 ) :: output_filename = 'uniform_in_ellipisoid_map.txt' integer j real ( kind = rk ) :: r = 1.0D+00 real ( kind = rk ) r2 integer success_num real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST15' write ( *, '(a)' ) ' UNIFORM_IN_ELLIPSOID_MAP maps uniform ' write ( *, '(a)' ) ' points into an ellipsoid.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_ellipsoid_map ( dim_num, n, a, r, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' ! ! Test the data. ! fail_num = 0 success_num = 0 do j = 1, n r2 = sqrt ( dot_product ( x(1:dim_num,j), & matmul ( a(1:dim_num,1:dim_num), x(1:dim_num,j) ) ) ) if ( r < r2 ) then fail_num = fail_num + 1 else success_num = success_num + 1 end if end do write ( *, '(a)' ) ' ' write ( *, '(2x,i8,a)' ) fail_num, ' points failed the ellipsoid test.' write ( *, '(2x,i8,a)' ) success_num, ' points satisfy the ellipsoid test.' return end subroutine test16 ( ) !*****************************************************************************80 ! !! TEST16 tests UNIFORM_IN_PARALLELOGRAM_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'uniform_in_parallelogram_map.txt' real ( kind = rk ), dimension ( dim_num ) :: v1 = (/ & 0.75D+00, 0.90D+00 /) real ( kind = rk ), dimension ( dim_num ) :: v2 = (/ & 0.00D+00, 0.20D+00 /) real ( kind = rk ), dimension ( dim_num ) :: v3 = (/ & 1.10D+00, 0.65D+00 /) real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST16' write ( *, '(a)' ) ' UNIFORM_IN_PARALLELOGRAM_MAP maps uniform' write ( *, '(a)' ) ' points into an arbitrary parallelogram.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a)' ) ' ' write ( *, '(a,2f8.2)' ) ' V1 = ', v1(1:2) write ( *, '(a,2f8.2)' ) ' V2 = ', v2(1:2) write ( *, '(a,2f8.2)' ) ' V3 = ', v3(1:2) write ( *, '(a,2f8.2)' ) ' V4 = ', v3(1:2)+v2(1:2)-v1(1:2) call uniform_in_parallelogram_map ( v1, v2, v3, n, x ) call scale_to_block01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test17 ( ) !*****************************************************************************80 ! !! TEST17 tests UNIFORM_IN_POLYGON_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 integer, parameter :: nv = 10 character ( len = 80 ) :: output_filename = 'uniform_in_polygon_map.txt' real ( kind = rk ), dimension ( dim_num, nv ) :: v = reshape ( (/ & 0.0D+00, 0.0D+00, & 0.5D+00, 0.3D+00, & 1.0D+00, 0.0D+00, & 0.7D+00, 0.4D+00, & 1.0D+00, 0.6D+00, & 0.6D+00, 0.6D+00, & 0.5D+00, 1.0D+00, & 0.4D+00, 0.6D+00, & 0.0D+00, 0.6D+00, & 0.3D+00, 0.4D+00 /), (/ dim_num, nv /) ) real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST17' write ( *, '(a)' ) ' UNIFORM_IN_POLYGON_MAP maps uniform ' write ( *, '(a)' ) ' points into a polygon.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call r8mat_print ( dim_num, nv, v, ' Polygonal vertices:' ) call uniform_in_polygon_map ( nv, v, n, x ) call r8mat_write ( 'polygon_vertices.txt', dim_num, nv, v ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test18 ( ) !*****************************************************************************80 ! !! TEST18 tests UNIFORM_IN_SECTOR_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 300 character ( len = 80 ) :: output_filename = 'uniform_in_sector_map.txt' real ( kind = rk ), parameter :: r1 = 1.0D+00 real ( kind = rk ), parameter :: r2 = 2.0D+00 real ( kind = rk ), parameter :: t1 = 0.78D+00 real ( kind = rk ), parameter :: t2 = 2.35D+00 real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST18' write ( *, '(a)' ) ' UNIFORM_IN_SECTOR_MAP maps uniform ' write ( *, '(a)' ) ' points into a circular sector.' write ( *, '(a)' ) ' ' write ( *, '(a,g14.6)' ) ' R1 = ', r1 write ( *, '(a,g14.6)' ) ' R2 = ', r2 write ( *, '(a,g14.6)' ) ' T1 = ', t1 write ( *, '(a,g14.6)' ) ' T2 = ', t2 write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_sector_map ( r1, r2, t1, t2, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test19 ( ) !*****************************************************************************80 ! !! TEST19 tests UNIFORM_IN_SIMPLEX01_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 10000 character ( len = 80 ) :: output_filename = 'uniform_in_simplex01_map.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST19' write ( *, '(a)' ) ' UNIFORM_IN_SIMPLEX01_MAP maps uniform ' write ( *, '(a)' ) ' points into the unit simplex.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_simplex01_map ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to "' // trim ( output_filename ) // '".' return end subroutine test20 ( ) !*****************************************************************************80 ! !! TEST20 tests UNIFORM_IN_SPHERE01_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'uniform_in_sphere01_map.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST20' write ( *, '(a)' ) ' UNIFORM_IN_SPHERE01_MAP maps uniform ' write ( *, '(a)' ) ' points into the unit sphere.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_sphere01_map ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test205 ( ) !*****************************************************************************80 ! !! TEST205 tests UNIFORM_IN_TETRAHEDRON. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 August 2009 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'uniform_in_tetrahedron.txt' real ( kind = rk ), dimension ( 3,4 ) :: v = reshape ( (/ & 1.0D+00, 2.0D+00, 3.0D+00, & 4.0D+00, 1.0D+00, 2.0D+00, & 2.0D+00, 4.0D+00, 4.0D+00, & 3.0D+00, 2.0D+00, 5.0D+00 /), (/ 3, 4 /) ) real ( kind = rk ) x(3,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST205' write ( *, '(a)' ) ' UNIFORM_IN_TETRAHEDRON returns uniform ' write ( *, '(a)' ) ' points from a tetrahedron.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', 3 write ( *, '(a,i8)' ) ' Number of points N = ', n call r8mat_print ( 3, 4, v, ' Tetrahedron vertices:' ) call uniform_in_tetrahedron ( v, n, x ) call r8mat_write ( output_filename, 3, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine uniform_in_triangle_map1_test ( ) !*****************************************************************************80 ! !! UNIFORM_IN_TRIANGLE_MAP1_TEST tests UNIFORM_IN_TRIANGLE_MAP1. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 19 January 2016 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'uniform_in_triangle_map1.txt' real ( kind = rk ), dimension ( dim_num ) :: v1 = (/ & 0.75D+00, 0.90D+00 /) real ( kind = rk ), dimension ( dim_num ) :: v2 = (/ & 0.00D+00, 0.20D+00 /) real ( kind = rk ), dimension ( dim_num ) :: v3 = (/ & 0.95D+00, 0.65D+00 /) real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'UNIFORM_IN_TRIANGLE_MAP1_TEST' write ( *, '(a)' ) ' UNIFORM_IN_TRIANGLE_MAP1 maps uniform ' write ( *, '(a)' ) ' points into a triangle.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a)' ) ' ' write ( *, '(a,2f8.2)' ) ' V1 = ', v1(1:2) write ( *, '(a,2f8.2)' ) ' V2 = ', v2(1:2) write ( *, '(a,2f8.2)' ) ' V3 = ', v3(1:2) call uniform_in_triangle_map1 ( v1, v2, v3, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test22 ( ) !*****************************************************************************80 ! !! TEST22 tests UNIFORM_IN_TRIANGLE_MAP2. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 1000 character ( len = 80 ) :: output_filename = 'uniform_in_triangle_map2.txt' real ( kind = rk ), dimension ( dim_num ) :: v1 = (/ & 0.75D+00, 0.90D+00 /) real ( kind = rk ), dimension ( dim_num ) :: v2 = (/ & 0.00D+00, 0.20D+00 /) real ( kind = rk ), dimension ( dim_num ) :: v3 = (/ & 0.95D+00, 0.65D+00 /) real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST22' write ( *, '(a)' ) ' UNIFORM_IN_TRIANGLE_MAP maps uniform ' write ( *, '(a)' ) ' points into a triangle.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a)' ) ' ' write ( *, '(a,2f8.2)' ) ' V1 = ', v1(1:2) write ( *, '(a,2f8.2)' ) ' V2 = ', v2(1:2) write ( *, '(a,2f8.2)' ) ' V3 = ', v3(1:2) call uniform_in_triangle_map2 ( v1, v2, v3, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test23 ( ) !*****************************************************************************80 ! !! TEST23 tests UNIFORM_IN_TRIANGLE01_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 2000 character ( len = 80 ) :: output_filename = 'uniform_in_triangle01_map.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST23' write ( *, '(a)' ) ' UNIFORM_IN_TRIANGLE01_MAP maps uniform ' write ( *, '(a)' ) ' points into the unit triangle.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_in_triangle01_map ( n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test235 ( ) !*****************************************************************************80 ! !! TEST235 tests UNIFORM_ON_CUBE01. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 20 April 2013 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: m = 3 integer, parameter :: n = 200 character ( len = 80 ) :: output_filename = 'uniform_on_cube01.txt' real ( kind = rk ) x(m,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST235' write ( *, '(a)' ) ' UNIFORM_ON_CUBE01 samples N uniform points on' write ( *, '(a)' ) ' the surface of the unit M-dimensional cube.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', m write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_on_cube01 ( m, n, x ) call r8mat_write ( output_filename, m, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test24 ( ) !*****************************************************************************80 ! !! TEST24 tests UNIFORM_ON_ELLIPSOID_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 200 character ( len = 80 ) :: output_filename = 'uniform_on_ellipsoid_map.txt' real ( kind = rk ) a(dim_num,dim_num) real ( kind = rk ) r real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST24' write ( *, '(a)' ) ' UNIFORM_ON_ELLIPSOID_MAP maps uniform ' write ( *, '(a)' ) ' points onto an ellipsoid.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n a(1:dim_num,1:dim_num) = reshape ( (/ & 3.0D+00, 1.0D+00, & 1.0D+00, 2.0D+00 /), (/ 2, 2 /) ) r = 1.0D+00 call uniform_on_ellipsoid_map ( dim_num, n, a, r, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test245 ( ) !*****************************************************************************80 ! !! TEST245 tests UNIFORM_ON_HEMISPHERE01_PHONG. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 06 August 2005 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 3 integer, parameter :: n = 50 character ( len = 80 ) :: output_filename = 'uniform_on_hemisphere01_phong.txt' integer, parameter :: m = 2 real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST245' write ( *, '(a)' ) ' UNIFORM_ON_HEMISPHERE01_PHONG maps uniform ' write ( *, '(a)' ) ' points onto the unit hemisphere with Phong density.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,i8)' ) ' Phong exponent M = ', m call uniform_on_hemisphere01_phong ( n, m, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test25 ( ) !*****************************************************************************80 ! !! TEST25 tests UNIFORM_ON_SIMPLEX01_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 50 character ( len = 80 ) :: output_filename = 'uniform_on_simplex01_map.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST25' write ( *, '(a)' ) ' UNIFORM_ON_SIMPLEX01_MAP maps uniform ' write ( *, '(a)' ) ' points onto the unit simplex.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_on_simplex01_map ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test26 ( ) !*****************************************************************************80 ! !! TEST26 tests UNIFORM_ON_SPHERE01_MAP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 50 character ( len = 80 ) :: output_filename = 'uniform_on_sphere01_map.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST26' write ( *, '(a)' ) ' UNIFORM_ON_SPHERE01_MAP maps uniform ' write ( *, '(a)' ) ' points onto the unit sphere, in any dimension.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_on_sphere01_map ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test264 ( ) !*****************************************************************************80 ! !! TEST264 tests UNIFORM_ON_SPHERE01_PATCH_TP. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 18 August 2010 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: n = 5000 character ( len = 80 ) :: output_filename = 'uniform_on_sphere01_patch_tp.txt' real ( kind = rk ) phi1 real ( kind = rk ) phi2 real ( kind = rk ), parameter :: pi = 3.141592653589793D+00 real ( kind = rk ) theta1 real ( kind = rk ) theta2 real ( kind = rk ) tp(2,n) phi1 = 0.0D+00 * ( pi / 180.0D+00 ) phi2 = 180.0D+00 * ( pi / 180.0D+00 ) theta1 = 0.0D+00 * ( pi / 360.0D+00 ) theta2 = 30.0D+00 * ( pi / 360.0D+00 ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST264' write ( *, '(a)' ) ' UNIFORM_ON_SPHERE01_PATCH_TP maps uniform ' write ( *, '(a)' ) ' points onto a TP (THETA,PHI) patch of the unit sphere.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', 3 write ( *, '(a,i8)' ) ' Data dimension = ', 2 write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,g14.6)' ) ' Latitudinal angle PHI1 = ', phi1 write ( *, '(a,g14.6)' ) ' Latitudinal angle PHI2 = ', phi2 write ( *, '(a,g14.6)' ) ' Longitudinal angle THETA1 = ', theta1 write ( *, '(a,g14.6)' ) ' Longitudinal angle THETA2 = ', theta2 call uniform_on_sphere01_patch_tp ( n, phi1, phi2, theta1, theta2, tp ) call r8mat_write ( output_filename, 2, n, tp ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test265 ( ) !*****************************************************************************80 ! !! TEST265 tests UNIFORM_ON_SPHERE01_PATCH_XYZ. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 07 August 2005 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 3 integer, parameter :: n = 50 character ( len = 80 ) :: output_filename = 'uniform_on_sphere01_patch_xyz.txt' real ( kind = rk ) phi1 real ( kind = rk ) phi2 real ( kind = rk ), parameter :: pi = 3.141592653589793D+00 real ( kind = rk ) theta1 real ( kind = rk ) theta2 real ( kind = rk ) x(dim_num,n) phi1 = 75.0D+00 * ( pi / 180.0D+00 ) phi2 = 90.0D+00 * ( pi / 180.0D+00 ) theta1 = 0.0D+00 * ( pi / 360.0D+00 ) theta2 = 30.0D+00 * ( pi / 360.0D+00 ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST265' write ( *, '(a)' ) ' UNIFORM_ON_SPHERE01_PATCH_XYZ maps uniform ' write ( *, '(a)' ) ' points onto an XYZ patch of the unit sphere.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n write ( *, '(a,g14.6)' ) ' Latitudinal angle PHI1 = ', phi1 write ( *, '(a,g14.6)' ) ' Latitudinal angle PHI2 = ', phi2 write ( *, '(a,g14.6)' ) ' Longitudinal angle THETA1 = ', theta1 write ( *, '(a,g14.6)' ) ' Longitudinal angle THETA2 = ', theta2 call uniform_on_sphere01_patch_xyz ( n, phi1, phi2, theta1, theta2, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test267 ( ) !*****************************************************************************80 ! !! TEST267 tests UNIFORM_ON_SPHERE01_TRIANGLE_XYZ. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 24 August 2005 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: n = 500 character ( len = 80 ) :: output_filename = 'uniform_on_sphere01_triangle_xyz.txt' real ( kind = rk ) v1(3) real ( kind = rk ) v2(3) real ( kind = rk ) v3(3) real ( kind = rk ) x(3,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST267' write ( *, '(a)' ) ' UNIFORM_ON_SPHERE01_TRIANGLE_XYZ maps uniform ' write ( *, '(a)' ) ' points onto a spherical triangle using XYZ coordinates.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', 3 write ( *, '(a,i8)' ) ' Number of points N = ', n if ( .true. ) then call uniform_on_sphere01_map ( 3, 1, v1 ) call uniform_on_sphere01_map ( 3, 1, v2 ) call uniform_on_sphere01_map ( 3, 1, v3 ) else v1 = (/ 1.0D+00, 0.0D+00, 0.0D+00 /) v2 = (/ 0.0D+00, 1.0D+00, 0.0D+00 /) v3 = (/ 0.0D+00, 0.0D+00, 1.0D+00 /) end if write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Vertices of spherical triangle:' write ( *, '(a)' ) ' ' write ( *, '(a,3g14.6)' ) ' V1:', v1(1:3) write ( *, '(a,3g14.6)' ) ' V2:', v2(1:3) write ( *, '(a,3g14.6)' ) ' V3:', v3(1:3) call uniform_on_sphere01_triangle_xyz ( n, v1, v2, v3, x ) call r8mat_write ( output_filename, 3, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end subroutine test27 ( ) !*****************************************************************************80 ! !! TEST27 tests UNIFORM_WALK. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 08 July 2007 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: dim_num = 2 integer, parameter :: n = 400 character ( len = 80 ) :: output_filename = 'uniform_walk.txt' real ( kind = rk ) x(dim_num,n) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST27:' write ( *, '(a)' ) ' UNIFORM_WALK generates points on a uniform random walk' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) ' Spatial dimension DIM_NUM = ', dim_num write ( *, '(a,i8)' ) ' Number of points N = ', n call uniform_walk ( dim_num, n, x ) call scale_to_block01 ( dim_num, n, x ) call r8mat_write ( output_filename, dim_num, n, x ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Data written to file "' // trim ( output_filename ) & // '".' return end