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.769710481
13-0.769710481,
+1.00000000
23mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
25+1.00000000,
+0.00000000
26-0.805478334,
+1.00000000
36mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
38+1.00000000,
+0.780387580
39+0.00000000,
+1.00000000
54+1.00000000,
-0.657553613,
+0.756684393E-1
55-0.657553613,
+1.00000000,
-0.712460756
56+0.756684393E-1,
-0.712460756,
+1.00000000
66mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
68+1.00000000,
+0.00000000,
+0.00000000
69-0.170223251,
+1.00000000,
+0.00000000
70+0.764763653,
-0.103227898,
+1.00000000
80mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
82+1.00000000,
+0.389872521,
+0.513094306
83+0.00000000,
+1.00000000,
-0.162081793
84+0.00000000,
+0.00000000,
+1.00000000
99+1.00000000,
+0.169951934E-1,
-0.652485669,
-0.326669872,
+0.265041351
100+0.169951934E-1,
+1.00000000,
+0.715217888,
+0.583260298,
+0.473803759
101-0.652485669,
+0.715217888,
+1.00000000,
+0.546844840,
+0.188181654
102-0.326669872,
+0.583260298,
+0.546844840,
+1.00000000,
-0.150400907
103+0.265041351,
+0.473803759,
+0.188181654,
-0.150400907,
+1.00000000
113mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
115+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
116+0.389324874,
+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
117-0.945386231,
-0.709943175E-1,
+1.00000000,
+0.00000000,
+0.00000000
118-0.788472772,
-0.583545208,
+0.623233497,
+1.00000000,
+0.00000000
119-0.619876146,
-0.204184517,
+0.632815540,
+0.953209102E-1,
+1.00000000
129mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
131+1.00000000,
-0.773320675,
+0.491137594,
+0.563879728,
+0.479513854
132+0.00000000,
+1.00000000,
-0.565559864,
-0.144912094,
-0.666484237
133+0.00000000,
+0.00000000,
+1.00000000,
+0.475127637,
+0.667961717
134+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000,
-0.203014016E-1
135+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
150+1.00000000,
-0.945053518
151-0.945053518,
+1.00000000
161mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
163+1.00000000,
+0.00000000
164-0.679010868,
+1.00000000
174mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
176+1.00000000,
+0.335241526
177+0.00000000,
+1.00000000
192+1.00000000,
+0.985954642,
-0.155992419,
-0.960156500,
+0.104709864
193+0.985954642,
+1.00000000,
-0.844101608E-2,
-0.906984329,
+0.768529624E-1
194-0.155992419,
-0.844101608E-2,
+1.00000000,
+0.310564876,
-0.528498709
195-0.960156500,
-0.906984329,
+0.310564876,
+1.00000000,
-0.118123330
196+0.104709864,
+0.768529624E-1,
-0.528498709,
-0.118123330,
+1.00000000
206mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
208+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
209-0.999829948,
+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
210+0.324458808,
-0.308008075,
+1.00000000,
+0.00000000,
+0.00000000
211-0.250718981,
+0.262643188,
+0.391957313,
+1.00000000,
+0.00000000
212+0.499530770E-1,
-0.393406563E-1,
+0.265812188,
+0.620156586,
+1.00000000
222mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
224+1.00000000,
+0.316341460,
+0.436131597,
-0.646341324,
+0.582020283
225+0.00000000,
+1.00000000,
-0.441888034,
-0.748386204,
+0.689044893
226+0.00000000,
+0.00000000,
+1.00000000,
+0.259849489,
-0.289439380
227+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000,
-0.727643311
228+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
243+1.00000000,
+0.759554446,
-0.321252376
244+0.759554446,
+1.00000000,
-0.651270628
245-0.321252376,
-0.651270628,
+1.00000000
255mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
257+1.00000000,
+0.00000000,
+0.00000000
258-0.818485796,
+1.00000000,
+0.00000000
259+0.103240877,
+0.126732647,
+1.00000000
269mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
271+1.00000000,
-0.339436799,
-0.874218404
272+0.00000000,
+1.00000000,
+0.589697182
273+0.00000000,
+0.00000000,
+1.00000000
288+1.00000000,
-0.801043093
289-0.801043093,
+1.00000000
299mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
301+1.00000000,
+0.00000000
302+0.840460896,
+1.00000000
312mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
314+1.00000000,
+0.999919057
315+0.00000000,
+1.00000000
330+1.00000000,
-0.887362540,
-0.839923441,
+0.942252576E-1,
-0.455317855
331-0.887362540,
+1.00000000,
+0.992714047,
+0.151003286,
+0.887530744E-1
332-0.839923441,
+0.992714047,
+1.00000000,
+0.251991391,
-0.142256729E-2
333+0.942252576E-1,
+0.151003286,
+0.251991391,
+1.00000000,
-0.569754124
334-0.455317855,
+0.887530744E-1,
-0.142256729E-2,
-0.569754124,
+1.00000000
344mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
346+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
347+0.709386289,
+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
348-0.984122574,
-0.815454483,
+1.00000000,
+0.00000000,
+0.00000000
349-0.198942199,
+0.341859162E-1,
+0.195321798,
+1.00000000,
+0.00000000
350-0.421742588,
-0.762103319,
+0.549212575,
-0.593156368E-1,
+1.00000000
360mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
362+1.00000000,
-0.777927637,
+0.596161306,
+0.455557078,
+0.522729397
363+0.00000000,
+1.00000000,
-0.734426975E-1,
-0.745029569,
-0.257589757
364+0.00000000,
+0.00000000,
+1.00000000,
-0.207445621,
+0.488719970
365+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000,
-0.225611702
366+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
391mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
403mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
420+1.00000000,
+0.888132334,
-0.480939627,
-0.556586027,
-0.458889484
421+0.888132334,
+1.00000000,
-0.220319897,
-0.509577692,
-0.179750189
422-0.480939627,
-0.220319897,
+1.00000000,
-0.246100575,
+0.113878071
423-0.556586027,
-0.509577692,
-0.246100575,
+1.00000000,
+0.816105723
424-0.458889484,
-0.179750189,
+0.113878071,
+0.816105723,
+1.00000000
434mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
436+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
437+0.597684562,
+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
438+0.621274710,
+0.810606062,
+1.00000000,
+0.00000000,
+0.00000000
439+0.691059828E-1,
+0.668436289,
+0.816653013,
+1.00000000,
+0.00000000
440+0.509898245,
+0.649358869,
+0.861838222,
+0.682172537,
+1.00000000
450mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
452+1.00000000,
-0.329446524,
+0.820383579E-1,
+0.232297480,
-0.694908261
453+0.00000000,
+1.00000000,
-0.552640676,
-0.634252608,
-0.110254869
454+0.00000000,
+0.00000000,
+1.00000000,
+0.297738194,
+0.580430105E-1
455+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000,
+0.514770687
456+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
467(
+9.00000000,
+0.00000000), (
+3.00000000,
+3.00000000), (
+3.00000000,
-3.00000000)
468(
+3.00000000,
-3.00000000), (
+18.0000000,
+0.00000000), (
+8.00000000,
-6.00000000)
469(
+3.00000000,
+3.00000000), (
+8.00000000,
+6.00000000), (
+43.0000000,
+0.00000000)
474(
+4.27666616,
+0.00000000)
478tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
480(
+9.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000)
481(
+3.00000000,
-3.00000000), (
+18.0000000,
+0.00000000), (
+0.00000000,
+0.00000000)
482(
+3.00000000,
+3.00000000), (
+8.00000000,
+6.00000000), (
+43.0000000,
+0.00000000)
487(
+4.27666616,
+0.00000000)
489(
+0.00000000,
+0.00000000)
491tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
493(
+9.00000000,
+0.00000000), (
+3.00000000,
+3.00000000), (
+3.00000000,
-3.00000000)
494(
+0.00000000,
+0.00000000), (
+18.0000000,
+0.00000000), (
+8.00000000,
-6.00000000)
495(
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+43.0000000,
+0.00000000)
500(
+4.27666616,
+0.00000000)
502(
+0.00000000,
+0.00000000)
506(
+25.0000000,
+0.00000000), (
-5.00000000,
-5.00000000), (
+10.0000000,
+5.00000000)
507(
-5.00000000,
+5.00000000), (
+51.0000000,
+0.00000000), (
+4.00000000,
-6.00000000)
508(
+10.0000000,
-5.00000000), (
+4.00000000,
+6.00000000), (
+71.0000000,
+0.00000000)
513(
+5.63478947,
+0.00000000)
517tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
519(
+25.0000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000)
520(
-5.00000000,
+5.00000000), (
+51.0000000,
+0.00000000), (
+0.00000000,
+0.00000000)
521(
+10.0000000,
-5.00000000), (
+4.00000000,
+6.00000000), (
+71.0000000,
+0.00000000)
526(
+5.63478947,
+0.00000000)
528(
+0.00000000,
+0.00000000)
530tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
532(
+25.0000000,
+0.00000000), (
-5.00000000,
-5.00000000), (
+10.0000000,
+5.00000000)
533(
+0.00000000,
+0.00000000), (
+51.0000000,
+0.00000000), (
+4.00000000,
-6.00000000)
534(
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+71.0000000,
+0.00000000)
539(
+5.63478947,
+0.00000000)
541(
+0.00000000,
+0.00000000)