10 type(tester_t) :: test
14 double precision :: x0, x1
15 double precision,
allocatable :: x(:)
18 integer,
parameter :: nloop = 100
20 integer :: seed_size, clock
21 integer,
allocatable :: seed(:)
23 call random_seed(
size = seed_size)
24 allocate(seed(seed_size))
26 seed = clock + 37 * [ (i - 1, i = 1, seed_size) ]
27 call random_seed(put = seed)
35 call test% init(tolerance64=x1/sqrt(dble(nloop)))
37 call p% init(x0, x1, n)
39 allocate(x(
size(p% data)))
42 x(i) =
flin( (dble(i)-0.5d0)/dble(n) )
45 call test% assert_positive(p% dx)
46 call test% assert_positive(p% count)
49 call random_number(x0)
54 call test% assert_positive(p% count)
55 call test% assert_equal(sum(p% count), nloop)
59 call test% assert_close(p% data, x)
63 x(i) = cos(
flin((dble(i)-0.5d0)/dble(n)) )
67 call random_number(x0)
78 call test% assert_close(p% data, x)
84 double precision elemental function flin(x)
85 double precision,
intent(in) :: x
87 flin = 7.d0 + x * 3.d0
double precision elemental function flin(x)
Container for a profile, e.g. v(x)