38 real(RK),
parameter ::
SortedX(
*)
= [
+3.178053830347950_RK &
39 ,
+3.218875824868200_RK &
40 ,
+3.295836866004330_RK &
41 ,
+3.433987204485150_RK &
42 ,
+3.663561646129650_RK &
43 ,
+4.007333185232470_RK &
44 ,
+4.465908118654580_RK &
45 ,
+5.017279836814920_RK &
46 ,
+5.631211781821370_RK &
47 ,
+6.282266746896010_RK &
48 ,
+6.953684210870540_RK &
49 ,
+7.635786861395590_RK &
50 ,
+8.323365694436080_RK &
51 ,
+9.013717030471370_RK &
52 ,
+9.705463352014880_RK ]
53 real(RK),
parameter ::
SortedY(
*)
= [
+1.426588681046810_RK &
54 ,
+1.168902956625920_RK &
55 ,
+0.882431985413412_RK &
56 ,
+0.587833620221075_RK &
57 ,
+0.229810034869442_RK &
58 ,
-0.174864514871957_RK &
59 ,
-0.605947339379271_RK &
60 ,
-1.074884950466410_RK &
61 ,
-1.510025316819630_RK &
62 ,
-1.948747191172130_RK &
63 ,
-2.382173017436780_RK &
64 ,
-2.805304379208950_RK &
65 ,
-3.199663563773090_RK &
66 ,
-3.602191628213170_RK &
67 ,
-3.989064786493580_RK ]
91 logical(
LK) :: assertion
92 real(
RK),
parameter :: TOLERANCE
= 1.e-10_RK
93 real(
RK),
parameter :: QueryX(
*)
= [
+3.17805383034795_RK &
94 ,
+7.61283103040736_RK &
95 ,
+8.30003171177958_RK &
96 ,
+8.70350676947973_RK &
97 ,
+8.99019232964177_RK &
98 ,
+9.21273749657591_RK &
99 ,
+9.39465993143281_RK &
100 ,
+9.54852542660107_RK &
101 ,
+9.68184287734565_RK &
102 ,
+9.79945948211208_RK ]
103 real(
RK),
parameter :: QueryY_ref(
*)
= [
+1.42658868104681_RK &
104 ,
-2.79106410024333_RK &
105 ,
-3.18628041418956_RK &
106 ,
-3.42131512460047_RK &
107 ,
-3.58847491355328_RK &
108 ,
-3.71349785982781_RK &
109 ,
-3.81524167073542_RK &
110 ,
-3.90129406915411_RK &
111 ,
-3.97585455703407_RK &
112 ,
-4.04163402840252_RK ]
113 real(
RK) :: QueryY(
size(QueryX))
114 type(InterpLinear_type) :: Interp
117 QueryY
= Interp
%predict(QueryX)
118 assertion
= all(abs(QueryY
- QueryY_ref)
<= TOLERANCE)
120 if (
test%traceable
.and. .not. assertion)
then
122 write(
test%disp
%unit,
"(*(g0,:,', '))")
123 write(
test%disp
%unit,
"(*(g0,:,', '))")
"QueryY_ref ", QueryY_ref
124 write(
test%disp
%unit,
"(*(g0,:,', '))")
"QueryY ", QueryY
125 write(
test%disp
%unit,
"(*(g0,:,', '))")
"diff ", QueryY_ref
- QueryY
126 write(
test%disp
%unit,
"(*(g0,:,', '))")
134end module test_pm_polation
This module contains classes and procedures for reporting and handling errors.
character(*, SK), parameter MODULE_NAME
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
This module contains procedures and data types for interpolation of finite samples of data.
This module contains a simple unit-testing framework for the Fortran libraries, including the ParaMon...
This module contains tests of the module pm_polation.
real(RK), dimension(*), parameter SortedY
logical(LK) function test_InterpLinear_type_1()
real(RK), dimension(*), parameter SortedX
This is the derived type for generating objects to gracefully and verbosely handle runtime unexpected...
This is the derived type test_type for generating objects that facilitate testing of a series of proc...