ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
test_pm_matrix.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
24
25!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
28
29 use pm_matrixDet ! LCOV_EXCL_LINE
30 use pm_err, only: err_type
31 use pm_test, only: test_type, LK
32 use pm_kind, only: LK
33
34 implicit none
35
36 private
37 public :: setTest
38 type(test_type) :: test
39
40!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41
42 interface
43 module function test_placeHolder() result(assertion); logical(LK) :: assertion; end function
44 end interface
45
46!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47
48contains
49
50!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51
52 subroutine setTest()
53
54 implicit none
55
57
58 call test%run(test_getDet_1, SK_"test_getDet_1")
59
60 call test%run(test_isPosDef_1, SK_"test_isPosDef_1")
61 call test%run(test_isPosDef_2, SK_"test_isPosDef_2")
62
63 call test%run(test_sortPosDefMat_1, SK_"test_sortPosDefMat_1")
64 call test%run(test_getRegresCoef_1, SK_"test_getRegresCoef_1")
65
66 call test%run(test_getMatDetSqrtPosDefMat_1, SK_"test_getMatDetSqrtPosDefMat_1")
67 call test%run(test_getMatDetSqrtPosDefMat_2, SK_"test_getMatDetSqrtPosDefMat_2")
68
69 call test%run(test_getMatDetSqrtLogPosDefMat_1, SK_"test_getMatDetSqrtLogPosDefMat_1")
70 call test%run(test_getMatDetSqrtLogPosDefMat_2, SK_"test_getMatDetSqrtLogPosDefMat_2")
71
72 call test%summarize()
73
74 end subroutine setTest
75
76!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77
78 function test_getDet_1() result(assertion)
79
80 use pm_kind, only: IK, RK
81 implicit none
82
83 logical(LK) :: assertion
84 integer(IK) , parameter :: nd = 3_IK
85 real(RK) , parameter :: tolerance = 1.e-12_RK
86 real(RK) , parameter :: mat(nd,nd) = reshape([ -1._RK, -0._RK, -1._RK &
87 , -0._RK, -2._RK, -0._RK &
88 , -1._RK, -0._RK, -3._RK ], shape = shape(mat) )
89 real(RK) , parameter :: determinant_ref = -4._RK
90 real(RK) :: determinant, determinant_diff
91
92 determinant = getMatDet(Matrix = mat)
93
94 determinant_diff = abs(determinant - determinant_ref)
95
96 assertion = determinant_diff < tolerance
97
98 if (test%traceable .and. .not. assertion) then
99 ! LCOV_EXCL_START
100 write(test%disp%unit,"(*(g0,:,', '))")
101 write(test%disp%unit,"(*(g0,:,', '))") "determinant_ref = ", determinant_ref
102 write(test%disp%unit,"(*(g0,:,', '))") "determinant = ", determinant
103 write(test%disp%unit,"(*(g0,:,', '))") "determinant_diff = ", determinant_diff
104 write(test%disp%unit,"(*(g0,:,', '))")
105 end if
106 ! LCOV_EXCL_STOP
107
108 end function test_getDet_1
109
110!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111
112 function test_getMatDetSqrtPosDefMat_1() result(assertion)
113
114 use pm_kind, only: IK, RK
115 implicit none
116
117 logical(LK) :: assertion
118 integer(IK) , parameter :: nd = 3_IK
119 real(RK) , parameter :: tolerance = 1.e-12_RK
120 real(RK) , parameter :: mat(nd,nd) = reshape( [ 1._RK, 0._RK, 1._RK &
121 , 0._RK, 2._RK, 0._RK &
122 , 1._RK, 0._RK, 3._RK ], shape = shape(mat) )
123 real(RK) , parameter :: sqrtDetPosDefMat_ref = 2._RK
124 real(RK) :: sqrtDetPosDefMat, sqrtDetPosDefMat_diff
125
126 sqrtDetPosDefMat = getMatDetSqrtPosDefMat(nd = nd, mat = mat)
127
128 sqrtDetPosDefMat_diff = abs(sqrtDetPosDefMat - sqrtDetPosDefMat_ref)
129
130 assertion = sqrtDetPosDefMat_diff < tolerance
131
132 if (test%traceable .and. .not. assertion) then
133 ! LCOV_EXCL_START
134 write(test%disp%unit,"(*(g0,:,', '))")
135 write(test%disp%unit,"(*(g0,:,', '))") "sqrtDetPosDefMat_ref = ", sqrtDetPosDefMat_ref
136 write(test%disp%unit,"(*(g0,:,', '))") "sqrtDetPosDefMat = ", sqrtDetPosDefMat
137 write(test%disp%unit,"(*(g0,:,', '))") "sqrtDetPosDefMat_diff = ", sqrtDetPosDefMat_diff
138 write(test%disp%unit,"(*(g0,:,', '))")
139 end if
140 ! LCOV_EXCL_STOP
141
143
144!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145
148 function test_getMatDetSqrtPosDefMat_2() result(assertion)
149
150 use pm_kind, only: IK, RK
151 implicit none
152
153 logical(LK) :: assertion
154 integer(IK) , parameter :: nd = 3_IK
155 real(RK) , parameter :: tolerance = 1.e-12_RK
156 real(RK) , parameter :: mat(nd,nd) = reshape( [ -1._RK, -0._RK, -1._RK &
157 , -0._RK, -2._RK, -0._RK &
158 , -1._RK, -0._RK, -3._RK ], shape = shape(mat) )
159 real(RK) :: sqrtDetPosDefMat
160
161 sqrtDetPosDefMat = getMatDetSqrtPosDefMat(nd = nd, mat = mat)
162
163 assertion = sqrtDetPosDefMat < 0._RK
164
165 if (test%traceable .and. .not. assertion) then
166 ! LCOV_EXCL_START
167 write(test%disp%unit,"(*(g0,:,', '))")
168 write(test%disp%unit,"(*(g0,:,', '))") "sqrtDetPosDefMat = ", sqrtDetPosDefMat
169 write(test%disp%unit,"(*(g0,:,', '))")
170 ! LCOV_EXCL_STOP
171 end if
172
174
175!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
176
177 function test_getMatDetSqrtLogPosDefMat_1() result(assertion)
178
179 use pm_kind, only: IK, RK
180 implicit none
181
182 logical(LK) :: assertion
183 integer(IK) , parameter :: nd = 3_IK
184 real(RK) , parameter :: tolerance = 1.e-12_RK
185 real(RK) , parameter :: mat(nd,nd) = reshape( [ 1._RK, 0._RK, 1._RK &
186 , 0._RK, 2._RK, 0._RK &
187 , 1._RK, 0._RK, 3._RK ], shape = shape(mat) )
188 real(RK) , parameter :: logSqrtDetPosDefMat_ref = log(2._RK)
189 real(RK) :: logSqrtDetPosDefMat, logSqrtDetPosDefMat_diff
190 real(RK), allocatable :: Matrix(:,:)
191 logical(LK) :: failed
192
193 Matrix = mat
194
195 call getMatDetSqrtLogPosDefMat(nd = nd, mat = Matrix, logSqrtDetPosDefMat = logSqrtDetPosDefMat, failed = failed)
196
197 assertion = .not. failed
198 call test%assert(assertion)
199
200 logSqrtDetPosDefMat_diff = abs(logSqrtDetPosDefMat - logSqrtDetPosDefMat_ref)
201
202 assertion = logSqrtDetPosDefMat_diff < tolerance
203
204 if (test%traceable .and. .not. assertion) then
205 ! LCOV_EXCL_START
206 write(test%disp%unit,"(*(g0,:,', '))")
207 write(test%disp%unit,"(*(g0,:,', '))") "logSqrtDetPosDefMat_ref = ", logSqrtDetPosDefMat_ref
208 write(test%disp%unit,"(*(g0,:,', '))") "logSqrtDetPosDefMat = ", logSqrtDetPosDefMat
209 write(test%disp%unit,"(*(g0,:,', '))") "logSqrtDetPosDefMat_diff = ", logSqrtDetPosDefMat_diff
210 write(test%disp%unit,"(*(g0,:,', '))")
211 end if
212 ! LCOV_EXCL_STOP
213
215
216!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
218 function test_getMatDetSqrtLogPosDefMat_2() result(assertion)
219
220 use pm_kind, only: IK, RK
221 implicit none
222
223 logical(LK) :: assertion
224 integer(IK) , parameter :: nd = 3_IK
225 real(RK) , parameter :: tolerance = 1.e-12_RK
226 real(RK) , parameter :: mat(nd,nd) = reshape( [ 1._RK, 0._RK, 1._RK &
227 , 0._RK, 2._RK, 0._RK &
228 , 1._RK, 0._RK, 3._RK ], shape = shape(mat) )
229 real(RK) , parameter :: logSqrtDetPosDefMat_ref = log(2._RK)
230 real(RK) :: logSqrtDetPosDefMat
231 real(RK), allocatable :: Matrix(:,:)
232 logical(LK) :: failed
233
234 Matrix = -mat
235
236 call getMatDetSqrtLogPosDefMat(nd = nd, mat = Matrix, logSqrtDetPosDefMat = logSqrtDetPosDefMat, failed = failed)
237
238 assertion = failed
239 if (.not. assertion) return
240
242
243!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
244
245 function test_isPosDef_1() result(assertion)
246 use pm_kind, only: IK, RK
247 implicit none
248 logical(LK) :: assertion
249 integer(IK) , parameter :: nd = 3_IK
250 real(RK) , parameter :: mat(nd,nd) = reshape( [ 1._RK, 0._RK, 1._RK &
251 , 0._RK, 2._RK, 0._RK &
252 , 1._RK, 0._RK, 3._RK ], shape = shape(mat) )
253
254 assertion = isPosDef(nd = nd, Matrix = mat)
255 end function test_isPosDef_1
256
257!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
258
259 function test_isPosDef_2() result(assertion)
260 use pm_kind, only: IK, RK
261 implicit none
262 logical(LK) :: assertion
263 integer(IK) , parameter :: nd = 3_IK
264 real(RK) , parameter :: mat(nd,nd) = reshape( [ -1._RK, -0._RK, -1._RK &
265 , -0._RK, -2._RK, -0._RK &
266 , -1._RK, -0._RK, -3._RK ], shape = shape(mat) )
267
268 assertion = .not. isPosDef(nd = nd, Matrix = mat)
269 end function test_isPosDef_2
270
271!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272
273 function test_sortPosDefMat_1() result(assertion)
274
275 use pm_kind, only: RK, IK
276
277 implicit none
278 logical(LK) :: assertion
279 integer(IK), parameter :: ColIndx(*) = [4]
280 integer(IK), parameter :: ColIndxMap(*) = [5]
281 integer(IK) :: rank
282 real(RK), allocatable :: mat(:,:), OutPosDefMat(:,:), OutPosDefMat_ref(:,:)
283 integer(IK) :: i, j
284
285 assertion = .true._LK
286
287 rank = 5
288 allocate(mat(rank,rank))
289 do j = 1,rank
290 do i = 1,j
291 mat(i,j) = i*10 + j
292 end do
293 end do
294
295 ! switch the variable 4 with 5, such that the output remains a positive-definite matrix.
296
297 OutPosDefMat = getSortedPosDefMat(rank, mat, 1_IK, ColIndx, ColIndxMap)
298
299 OutPosDefMat_ref = reshape( [ 11._RK, 12._RK, 13._RK, 15._RK, 14._RK &
300 , 0._RK, 22._RK, 23._RK, 25._RK, 24._RK &
301 , 0._RK, 0._RK, 33._RK, 35._RK, 34._RK &
302 , 0._RK, 0._RK, 0._RK, 55._RK, 45._RK &
303 , 0._RK, 0._RK, 0._RK, 0._RK, 44._RK &
304 ], shape = [rank,rank])
305 OutPosDefMat_ref = transpose(OutPosDefMat_ref)
306 do j = 1, rank
307 do i = 1, j
308 assertion = assertion .and. OutPosDefMat_ref(i,j) == OutPosDefMat(i,j)
309 end do
310 end do
311
312 if (test%traceable .and. .not. assertion) then
313 ! LCOV_EXCL_START
314
315 write(test%disp%unit,"(*(g0))")
316 write(test%disp%unit,"(*(g0))") "OutPosDefMat_ref:"
317 do i = 1,rank
318 write(test%disp%unit,"(*(F7.1))") (OutPosDefMat_ref(i,j),j=1,rank)
319 end do
320 write(test%disp%unit,"(*(g0))")
321
322 write(test%disp%unit,"(*(g0))")
323 write(test%disp%unit,"(*(g0))") "Output Positive-Definite Matrix with variables 4 and 5 swapped:"
324 do i = 1,rank
325 write(test%disp%unit,"(*(F7.1))") (OutPosDefMat(i,j),j=1,rank)
326 end do
327 write(test%disp%unit,"(*(g0))")
328
329 write(test%disp%unit,"(*(g0))")
330 write(test%disp%unit,"(*(g0))") "Original Matrix:"
331 do i = 1,rank
332 write(test%disp%unit,"(*(F7.1))") (mat(i,j),j=1,rank)
333 end do
334
335 end if
336 ! LCOV_EXCL_STOP
337
338 end function test_sortPosDefMat_1
339
340!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341
342 function test_getRegresCoef_1() result(assertion)
343
344 use pm_kind, only: RK, IK
345
346 implicit none
347 logical(LK) :: assertion
348 real(RK) :: normalizedDifference
349 integer , parameter :: rankPDM = 4, rankS11 = 3, rankS22 = 1
350 real(RK), parameter :: mat(rankPDM,rankPDM) = reshape( &
351 [ 4.414182620515998_RK, 1.173760167060120_RK, 0.757607629189287_RK, 5.075277296976230_RK &
352 , 1.173760167060120_RK, 0.866956750091570_RK, 0.310654936099342_RK, 1.621274787164182_RK &
353 , 0.757607629189287_RK, 0.310654936099342_RK, 0.955157221699132_RK, 1.254186231887444_RK &
354 , 5.075277296976230_RK, 1.621274787164182_RK, 1.254186231887444_RK, 6.407791808961157_RK ] &
355 , shape=shape(mat) )
356 real(RK), parameter :: RegresCoefMatRef(rankS11,rankS22) = reshape( &
357 [ 0.792047783119072 &
358 , 0.253016145889269 &
359 , 0.195728305363088 ] &
360 , shape=shape(RegresCoefMatRef) )
361 real(RK), parameter :: SchurComplementRef(rankS11,rankS11) = reshape( &
362 [ 0.3943204887314210_RK, -0.110366933940115_RK, -0.235767795395625_RK &
363 , -0.110366933940115_RK, 0.456748052015843_RK, -0.006674430520204_RK &
364 , -0.235767795395625_RK, -0.006674430520204_RK, 0.709677475922085_RK ] &
365 , shape=shape(SchurComplementRef) )
366 real(RK) :: SchurComplement(rankS11,rankS11)
367 real(RK) :: RegresCoefMat(rankS11,rankS22)
368 integer(IK) :: i,j
369
370 assertion = .true._LK
371
372 call getRegresCoef( rankPDM = rankPDM &
373 , rankS11 = rankS11 &
374 , rankS22 = rankS22 &
375 , mat = mat &
376 , RegresCoefMat = RegresCoefMat &
377 , SchurComplement = SchurComplement &
378 , failed = assertion &
379 )
380 assertion = .not. assertion
381 call test%assert(assertion)
382
383 do i = 1,rankS11
384 !write(test%disp%unit,"(*(F22.15))") (RegresCoefMat(i,j),j=1,rankS22), (RegresCoefMatRef(i,j),j=1,rankS22)
385 do j = 1,rankS22
386 normalizedDifference = abs(RegresCoefMatRef(i,j) - RegresCoefMat(i,j)) / (RegresCoefMatRef(i,j) + RegresCoefMat(i,j))
387 assertion = assertion .and. normalizedDifference < 1.e-5_RK
388 end do
389 end do
390
391 if (test%traceable .and. .not. assertion) then
392 ! LCOV_EXCL_START
393 write(test%disp%unit,"(*(g0))")
394 write(test%disp%unit,"(*(g0))") "Original Covariance Matrix:"
395 do i = 1,rankPDM
396 write(test%disp%unit,"(*(F22.15))") (mat(i,j),j=1,rankPDM)
397 end do
398 write(test%disp%unit,"(*(g0))")
399 write(test%disp%unit,"(*(g0))") "RegresCoefMat, RegresCoefMatRef, difference, normalizedDifference:"
400 write(test%disp%unit,"(*(g0))")
401 write(test%disp%unit,"(*(g0))") "SchurComplement, SchurComplementRef, difference, normalizedDifference:"
402 write(test%disp%unit,"(*(g0))")
403 do i = 1,rankS11
404 do j = 1,rankS22
405 write(test%disp%unit,"(*(F22.15))" ) RegresCoefMat(i,j) &
406 , RegresCoefMatRef(i,j) &
407 , abs(RegresCoefMat(i,j)-RegresCoefMatRef(i,j)) &
408 , normalizedDifference
409 end do
410 end do
411 write(test%disp%unit,"(*(g0))")
412 end if
413 ! LCOV_EXCL_STOP
414 call test%assert(assertion)
415
416 do i = 1,rankS11
417 do j = 1,rankS11
418 normalizedDifference = abs(SchurComplementRef(i,j) - SchurComplement(i,j)) / (SchurComplementRef(i,j) + SchurComplement(i,j))
419 assertion = assertion .and. normalizedDifference < 1.e-6_RK
420 end do
421 end do
422
423 if (test%traceable .and. .not. assertion) then
424 ! LCOV_EXCL_START
425 do i = 1,rankS11
426 do j = 1,rankS11
427 write(test%disp%unit,"(*(F22.15))" ) SchurComplement(i,j) &
428 , SchurComplementRef(i,j) &
429 , abs(SchurComplement(i,j)-SchurComplementRef(i,j)) &
430 , normalizedDifference
431 end do
432 end do
433 end if
434 ! LCOV_EXCL_STOP
435
436 end function test_getRegresCoef_1
437
438!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
439
440end module test_pm_matrix ! LCOV_EXCL_LINE
Generate and return the determinant of the input general square matrix.
This module contains classes and procedures for reporting and handling errors.
Definition: pm_err.F90:52
character(*, SK), parameter MODULE_NAME
Definition: pm_err.F90:58
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
This module contains procedures and generic interfaces relevant to the computation of the determinant...
This module contains a simple unit-testing framework for the Fortran libraries, including the ParaMon...
Definition: pm_test.F90:42
This module contains tests of the module pm_matrixDet.
logical(LK) function test_getMatDetSqrtPosDefMat_2()
The output sqrtDetPosDefMat must be set to a negative value, if the input matrix is non-positive-defi...
type(test_type) test
logical(LK) function test_getDet_1()
logical(LK) function test_getMatDetSqrtPosDefMat_1()
logical(LK) function test_getMatDetSqrtLogPosDefMat_1()
logical(LK) function test_sortPosDefMat_1()
logical(LK) function test_isPosDef_2()
logical(LK) function test_isPosDef_1()
subroutine setTest()
logical(LK) function test_getRegresCoef_1()
logical(LK) function test_getMatDetSqrtLogPosDefMat_2()
This is the derived type for generating objects to gracefully and verbosely handle runtime unexpected...
Definition: pm_err.F90:157
This is the derived type test_type for generating objects that facilitate testing of a series of proc...
Definition: pm_test.F90:209