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.923925519,
+0.795801759,
+0.556083620,
-0.439362645
13-0.923925519,
+1.00000000,
-0.648698449,
-0.243134469,
+0.260473728
14+0.795801759,
-0.648698449,
+1.00000000,
+0.672725320,
-0.362898499
15+0.556083620,
-0.243134469,
+0.672725320,
+1.00000000,
-0.787845373
16-0.439362645,
+0.260473728,
-0.362898499,
-0.787845373,
+1.00000000
26mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
28+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000
29+0.473446935,
+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
30-0.769212842,
-0.875687480,
+1.00000000,
+0.00000000,
+0.00000000
31-0.630960226,
+0.210506231,
+0.242536217E-1,
+1.00000000,
+0.00000000
32+0.357581615,
-0.503823459E-1,
-0.267758846,
-0.109704062E-1,
+1.00000000
42mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
44+1.00000000,
-0.987090841E-1,
-0.388906419,
-0.744392455,
-0.202922136
45+0.00000000,
+1.00000000,
-0.677588224,
-0.128657043,
+0.555987418
46+0.00000000,
+0.00000000,
+1.00000000,
+0.530256510,
-0.634381950
47+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000,
+0.253579259
48+0.00000000,
+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
73mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
85mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
102+1.00000000,
+0.636380613
103+0.636380613,
+1.00000000
113mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
115+1.00000000,
+0.00000000
116+0.708982050,
+1.00000000
126mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
128+1.00000000,
-0.155172020
129+0.00000000,
+1.00000000
144+1.00000000,
-0.998882890,
+0.340588838,
-0.817403376
145-0.998882890,
+1.00000000,
-0.382320315,
+0.831684768
146+0.340588838,
-0.382320315,
+1.00000000,
-0.430089980
147-0.817403376,
+0.831684768,
-0.430089980,
+1.00000000
157mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
159+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
160-0.985799372,
+1.00000000,
+0.00000000,
+0.00000000
161+0.833298504,
-0.911155999,
+1.00000000,
+0.00000000
162+0.430329829,
-0.340287954,
+0.135605678,
+1.00000000
172mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
174+1.00000000,
-0.942418635,
-0.931140065,
+0.504103959
175+0.00000000,
+1.00000000,
+0.832991242,
-0.273008823
176+0.00000000,
+0.00000000,
+1.00000000,
-0.750759542
177+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
192+1.00000000,
-0.749091804,
-0.691371620
193-0.749091804,
+1.00000000,
+0.855242133
194-0.691371620,
+0.855242133,
+1.00000000
204mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
206+1.00000000,
+0.00000000,
+0.00000000
207+0.437291205,
+1.00000000,
+0.00000000
208-0.210297331,
+0.480057687,
+1.00000000
218mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
220+1.00000000,
+0.550339460,
+0.333082527
221+0.00000000,
+1.00000000,
+0.257115960
222+0.00000000,
+0.00000000,
+1.00000000
237+1.00000000,
-0.631532431
238-0.631532431,
+1.00000000
248mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
250+1.00000000,
+0.00000000
251+0.804985464,
+1.00000000
261mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
263+1.00000000,
+0.626405716
264+0.00000000,
+1.00000000
289mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
301mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
318+1.00000000,
-0.605744481,
-0.340187997,
-0.519873261
319-0.605744481,
+1.00000000,
+0.512276530,
+0.256492853
320-0.340187997,
+0.512276530,
+1.00000000,
-0.208593518
321-0.519873261,
+0.256492853,
-0.208593518,
+1.00000000
331mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
333+1.00000000,
+0.00000000,
+0.00000000,
+0.00000000
334-0.740314424,
+1.00000000,
+0.00000000,
+0.00000000
335-0.775035262,
+0.898291111,
+1.00000000,
+0.00000000
336-0.540926516,
+0.859361172,
+0.914804459,
+1.00000000
346mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
348+1.00000000,
-0.161007509,
-0.247560740,
-0.552706540
349+0.00000000,
+1.00000000,
+0.971962869,
+0.697107553
350+0.00000000,
+0.00000000,
+1.00000000,
+0.829490900
351+0.00000000,
+0.00000000,
+0.00000000,
+1.00000000
376mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
388mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
405+1.00000000,
+0.801576301E-2,
-0.388933152
406+0.801576301E-2,
+1.00000000,
+0.116096601
407-0.388933152,
+0.116096601,
+1.00000000
417mat
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= 0._TKG)
419+1.00000000,
+0.00000000,
+0.00000000
420-0.461657077,
+1.00000000,
+0.00000000
421+0.480568051,
+0.289506048,
+1.00000000
431mat
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= 0._TKG)
433+1.00000000,
+0.709700584,
+0.335972309
434+0.00000000,
+1.00000000,
-0.263459623
435+0.00000000,
+0.00000000,
+1.00000000
446(
+9.00000000,
+0.00000000), (
+3.00000000,
+3.00000000), (
+3.00000000,
-3.00000000)
447(
+3.00000000,
-3.00000000), (
+18.0000000,
+0.00000000), (
+8.00000000,
-6.00000000)
448(
+3.00000000,
+3.00000000), (
+8.00000000,
+6.00000000), (
+43.0000000,
+0.00000000)
453(
+4.27666616,
+0.00000000)
457tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
459(
+9.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000)
460(
+3.00000000,
-3.00000000), (
+18.0000000,
+0.00000000), (
+0.00000000,
+0.00000000)
461(
+3.00000000,
+3.00000000), (
+8.00000000,
+6.00000000), (
+43.0000000,
+0.00000000)
466(
+4.27666616,
+0.00000000)
468(
+0.00000000,
+0.00000000)
470tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
472(
+9.00000000,
+0.00000000), (
+3.00000000,
+3.00000000), (
+3.00000000,
-3.00000000)
473(
+0.00000000,
+0.00000000), (
+18.0000000,
+0.00000000), (
+8.00000000,
-6.00000000)
474(
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+43.0000000,
+0.00000000)
479(
+4.27666616,
+0.00000000)
481(
+0.00000000,
+0.00000000)
485(
+25.0000000,
+0.00000000), (
-5.00000000,
-5.00000000), (
+10.0000000,
+5.00000000)
486(
-5.00000000,
+5.00000000), (
+51.0000000,
+0.00000000), (
+4.00000000,
-6.00000000)
487(
+10.0000000,
-5.00000000), (
+4.00000000,
+6.00000000), (
+71.0000000,
+0.00000000)
492(
+5.63478947,
+0.00000000)
496tmp
= getMatCopy(rdpack, mat, rdpack, lowDia, init
= (
0._TKG,
0._TKG))
498(
+25.0000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000)
499(
-5.00000000,
+5.00000000), (
+51.0000000,
+0.00000000), (
+0.00000000,
+0.00000000)
500(
+10.0000000,
-5.00000000), (
+4.00000000,
+6.00000000), (
+71.0000000,
+0.00000000)
505(
+5.63478947,
+0.00000000)
507(
+0.00000000,
+0.00000000)
509tmp
= getMatCopy(rdpack, mat, rdpack, uppDia, init
= (
0._TKG,
0._TKG))
511(
+25.0000000,
+0.00000000), (
-5.00000000,
-5.00000000), (
+10.0000000,
+5.00000000)
512(
+0.00000000,
+0.00000000), (
+51.0000000,
+0.00000000), (
+4.00000000,
-6.00000000)
513(
+0.00000000,
+0.00000000), (
+0.00000000,
+0.00000000), (
+71.0000000,
+0.00000000)
518(
+5.63478947,
+0.00000000)
520(
+0.00000000,
+0.00000000)