18 integer(IK) :: ndim, itry, ntry
= 10
19 type(display_type) :: disp
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"! Compute the sqrt of the determinant of the positive definite matrix.")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
31 real(TKG),
allocatable :: mat(:,:)
32 real(TKG) :: detSqrtLog
35 call disp%show(
"ndim = getUnifRand(1, 5)")
39 call disp%show(
"mat = getCovRand(mold = 1._TKG, ndim = ndim)")
43 call disp%show(
"detSqrtLog = getMatDetSqrtLog(mat)")
47 call disp%show(
"getMatMulTraceLog(getMatChol(mat, uppDia)) ! for comparison.")
49 call disp%show(
"detSqrtLog + getMatDetSqrtLog(getMatInv(mat)) ! must be one.")
52 call disp%show(
"mat = getCovRand(mold = 1._TKG, ndim = ndim)")
54 call disp%show(
"mat = getMatCopy(rdpack, mat, rdpack, lowDia, init = 0._TKG) ! reset the upper.")
55 mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
58 call disp%show(
"detSqrtLog = getMatDetSqrtLog(mat, lowDia)")
62 call disp%show(
"getMatMulTraceLog(getMatChol(mat, lowDia)) ! for comparison.")
64 call disp%show(
"detSqrtLog - getMatMulTraceLog(getMatChol(mat, lowDia)) ! must be one.")
67 call disp%show(
"mat = getCovRand(mold = 1._TKG, ndim = ndim)")
69 call disp%show(
"mat = getMatCopy(rdpack, mat, rdpack, uppDia, init = 0._TKG) ! reset the lower.")
70 mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
73 call disp%show(
"detSqrtLog = getMatDetSqrtLog(mat, uppDia)")
77 call disp%show(
"getMatMulTraceLog(getMatChol(mat, uppDia)) ! for comparison.")
79 call disp%show(
"detSqrtLog - getMatMulTraceLog(getMatChol(mat, uppDia)) ! must be one.")
87 complex(TKG),
allocatable :: tmp(:,:)
88 complex(TKG),
parameter :: mat(
*,
*)
= reshape( [ (
9.0,
0.0), (
3.0,
3.0), (
3.0,
-3.0)
&
89 , (
3.0,
-3.0),(
18.0,
0.0), (
8.0,
-6.0)
&
90 , (
3.0,
3.0), (
8.0,
6.0),(
43.0,
0.0)
&
91 ], shape
= [
3,
3], order
= [
2,
1])
92 real(TKG) :: detSqrtLog
96 call disp%show(
"detSqrtLog = getMatDetSqrtLog(mat)")
100 call disp%show(
"getMatMulTraceLog(getMatChol(mat, uppDia)) ! for comparison.")
102 call disp%show(
"detSqrtLog * getMatDetSqrtLog(getMatInv(mat)) ! must be one.")
105 call disp%show(
"tmp = getMatCopy(rdpack, mat, rdpack, lowDia, init = (0._TKG, 0._TKG)) ! reset the upper.")
106 tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
109 call disp%show(
"detSqrtLog = getMatDetSqrtLog(tmp, subset = lowDia)")
113 call disp%show(
"getMatMulTraceLog(getMatChol(tmp, lowDia)) ! for comparison.")
115 call disp%show(
"detSqrtLog - getMatMulTraceLog(getMatChol(tmp, lowDia)) ! must be one")
118 call disp%show(
"tmp = getMatCopy(rdpack, mat, rdpack, uppDia, init = (0._TKG, 0._TKG)) ! reset the upper.")
119 tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
122 call disp%show(
"detSqrtLog = getMatDetSqrtLog(tmp, subset = uppDia)")
126 call disp%show(
"getMatMulTraceLog(getMatChol(tmp, uppDia)) ! for comparison.")
128 call disp%show(
"detSqrtLog - getMatMulTraceLog(getMatChol(tmp, uppDia)) ! must be one.")
135 complex(TKG),
allocatable :: tmp(:,:)
136 complex(TKG),
parameter :: mat(
*,
*)
= reshape( [ (
25.0,
0.0), (
-5.0,
-5.0), (
10.0,
5.0)
&
137 , (
-5.0,
5.0), (
51.0,
0.0), (
4.0,
-6.0)
&
138 , (
10.0,
-5.0), (
4.0,
6.0), (
71.0,
0.0)
&
139 ], shape
= [
3,
3], order
= [
2,
1])
140 real(TKG) :: detSqrtLog
144 call disp%show(
"detSqrtLog = getMatDetSqrtLog(mat)")
148 call disp%show(
"getMatMulTraceLog(getMatChol(mat, uppDia)) ! for comparison.")
150 call disp%show(
"detSqrtLog * getMatDetSqrtLog(getMatInv(mat)) ! must be one.")
153 call disp%show(
"tmp = getMatCopy(rdpack, mat, rdpack, lowDia, init = (0._TKG, 0._TKG)) ! reset the upper.")
154 tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
157 call disp%show(
"detSqrtLog = getMatDetSqrtLog(tmp, subset = lowDia)")
161 call disp%show(
"getMatMulTraceLog(getMatChol(tmp, lowDia)) ! for comparison.")
163 call disp%show(
"detSqrtLog - getMatMulTraceLog(getMatChol(tmp, lowDia)) ! must be one.")
166 call disp%show(
"tmp = getMatCopy(rdpack, mat, rdpack, uppDia, init = (0._TKG, 0._TKG)) ! reset the upper.")
167 tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
170 call disp%show(
"detSqrtLog = getMatDetSqrtLog(tmp, subset = uppDia)")
174 call disp%show(
"getMatMulTraceLog(getMatChol(tmp, uppDia)) ! for comparison.")
176 call disp%show(
"detSqrtLog - getMatMulTraceLog(getMatChol(tmp, uppDia)) ! must be one.")
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
Generate and return a random positive-definite (correlation or covariance) matrix using the Gram meth...
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
Generate and return the upper or the lower Cholesky factorization of the input symmetric positive-def...
Generate and return a copy of a desired subset of the input source matrix of arbitrary shape (:) or (...
Generate and return the full inverse of an input matrix of general or triangular form directly or thr...
Generate and return the natural logarithm of the multiplicative trace of an input square matrix of ty...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
This module contains classes and procedures for generating random matrices distributed on the space o...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter CKS
The single-precision complex kind in Fortran mode. On most platforms, this is a 32-bit real kind.
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
This module contains procedures and generic interfaces for computing the Cholesky factorization of po...
This module contains procedures and generic interfaces relevant to copying (diagonal or upper/lower t...
This module contains abstract and concrete derived types and procedures related to the inversion of s...
This module contains procedures and generic interfaces for computing the additive or multiplicative t...
Generate and return an object of type display_type.
12+1.00000000,
+0.194989108E-1,
-0.992550135,
+0.636948466
13+0.194989108E-1,
+1.00000000,
-0.968626887E-1,
+0.226403967
14-0.992550135,
-0.968626887E-1,
+1.00000000,
-0.610434651
15+0.636948466,
+0.226403967,
-0.610434651,
+1.00000000
25mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
27+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
28+0.942800283,
+1.00000000,
+0.00000000,
+0.00000000
29-0.929292202,
-0.935344517,
+1.00000000,
+0.00000000
30+0.581445456,
+0.564269543,
-0.331789404,
+1.00000000
40mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
42+1.00000000,
+0.655721366,
-0.663232148,
+0.250736684
43+0.00000000,
+1.00000000,
+0.106879979,
-0.486804247
44+0.00000000,
+0.00000000,
+1.00000000,
-0.814963639
45+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
60+1.00000000,
+0.605357707,
+0.885512412
61+0.605357707,
+1.00000000,
+0.250792056
62+0.885512412,
+0.250792056,
+1.00000000
72mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
74+1.00000000,
+0.00000000,
+0.00000000
75+0.319143176,
+1.00000000,
+0.00000000
76-0.372258425,
-0.799992144,
+1.00000000
86mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
88+1.00000000,
+0.378937036,
+0.765523672
89+0.00000000,
+1.00000000,
+0.791987896
90+0.00000000,
+0.00000000,
+1.00000000
115mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
127mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
154mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
166mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
183+1.00000000,
+0.829913080,
+0.426425874,
-0.261845648,
+0.348446034E-1
184+0.829913080,
+1.00000000,
-0.102190375E-1,
-0.181813389,
+0.399501026
185+0.426425874,
-0.102190375E-1,
+1.00000000,
-0.739061296,
-0.177195236
186-0.261845648,
-0.181813389,
-0.739061296,
+1.00000000,
-0.318746984
187+0.348446034E-1,
+0.399501026,
-0.177195236,
-0.318746984,
+1.00000000
197mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
199+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
200-0.649118006,
+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
201+0.391001225,
+0.360414147,
+1.00000000,
+0.00000000,
+0.00000000
202-0.649768710,
+0.904200375,
+0.889530480E-1,
+1.00000000,
+0.00000000
203-0.348328501,
-0.168172196,
-0.471172243,
-0.263199210,
+1.00000000
213mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
215+1.00000000,
-0.941285908,
-0.410704136,
-0.235568985,
+0.383620411
216+0.00000000,
+1.00000000,
+0.593273878,
+0.115311585,
-0.374017388
217+0.00000000,
+0.00000000,
+1.00000000,
+0.179179847,
+0.145443484
218+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000,
+0.599070311
219+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
234+1.00000000,
-0.240141615,
+0.644364297,
+0.111268386
235-0.240141615,
+1.00000000,
+0.795950741E-1,
+0.126492307
236+0.644364297,
+0.795950741E-1,
+1.00000000,
-0.394532293
237+0.111268386,
+0.126492307,
-0.394532293,
+1.00000000
247mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
249+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
250+0.527687669,
+1.00000000,
+0.00000000,
+0.00000000
251+0.167883843,
+0.885345101,
+1.00000000,
+0.00000000
252+0.296970874,
-0.388576269,
-0.438351154,
+1.00000000
262mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
264+1.00000000,
+0.599177122,
-0.455994099,
-0.279145539
265+0.00000000,
+1.00000000,
+0.115580082,
-0.766944706
266+0.00000000,
+0.00000000,
+1.00000000,
-0.680036366
267+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
292mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
304mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
321+1.00000000,
+0.702977657
322+0.702977657,
+1.00000000
332mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
334+1.00000000,
+0.00000000
335-0.963681042,
+1.00000000
345mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
347+1.00000000,
+0.876026988
348+0.00000000,
+1.00000000
363+1.00000000,
-0.606280863
364-0.606280863,
+1.00000000
374mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
376+1.00000000,
+0.00000000
377-0.613612771,
+1.00000000
387mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
389+1.00000000,
+0.799726546
390+0.00000000,
+1.00000000
405+1.00000000,
-0.973335564
406-0.973335564,
+1.00000000
416mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
418+1.00000000,
+0.00000000
419+0.666825354,
+1.00000000
429mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
431+1.00000000,
+0.834811479E-1
432+0.00000000,
+1.00000000
443(
+9.00000000,
+0.00000000), (
+3.00000000,
+3.00000000), (
+3.00000000,
-3.00000000)
444(
+3.00000000,
-3.00000000), (
+18.0000000,
+0.00000000), (
+8.00000000,
-6.00000000)
445(
+3.00000000,
+3.00000000), (
+8.00000000,
+6.00000000), (
+43.0000000,
+0.00000000)
450(
+4.27666616,
+0.00000000)
454tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
456(
+9.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000)
457(
+3.00000000,
-3.00000000), (
+18.0000000,
+0.00000000), (
+0.00000000,
+0.00000000)
458(
+3.00000000,
+3.00000000), (
+8.00000000,
+6.00000000), (
+43.0000000,
+0.00000000)
463(
+4.27666616,
+0.00000000)
465(
+0.00000000,
+0.00000000)
467tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
469(
+9.00000000,
+0.00000000), (
+3.00000000,
+3.00000000), (
+3.00000000,
-3.00000000)
470(
+0.00000000,
+0.00000000), (
+18.0000000,
+0.00000000), (
+8.00000000,
-6.00000000)
471(
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+43.0000000,
+0.00000000)
476(
+4.27666616,
+0.00000000)
478(
+0.00000000,
+0.00000000)
482(
+25.0000000,
+0.00000000), (
-5.00000000,
-5.00000000), (
+10.0000000,
+5.00000000)
483(
-5.00000000,
+5.00000000), (
+51.0000000,
+0.00000000), (
+4.00000000,
-6.00000000)
484(
+10.0000000,
-5.00000000), (
+4.00000000,
+6.00000000), (
+71.0000000,
+0.00000000)
489(
+5.63478947,
+0.00000000)
493tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
495(
+25.0000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000)
496(
-5.00000000,
+5.00000000), (
+51.0000000,
+0.00000000), (
+0.00000000,
+0.00000000)
497(
+10.0000000,
-5.00000000), (
+4.00000000,
+6.00000000), (
+71.0000000,
+0.00000000)
502(
+5.63478947,
+0.00000000)
504(
+0.00000000,
+0.00000000)
506tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
508(
+25.0000000,
+0.00000000), (
-5.00000000,
-5.00000000), (
+10.0000000,
+5.00000000)
509(
+0.00000000,
+0.00000000), (
+51.0000000,
+0.00000000), (
+4.00000000,
-6.00000000)
510(
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+71.0000000,
+0.00000000)
515(
+5.63478947,
+0.00000000)
517(
+0.00000000,
+0.00000000)