ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_matrixInv::setMatInv Interface Reference

Generate and return the full inverse of a general or triangular matrix or a subset of the inverse of a positive-definite matrix complementary to its specified Cholesky factorization subset.
More...

Detailed Description

Generate and return the full inverse of a general or triangular matrix or a subset of the inverse of a positive-definite matrix complementary to its specified Cholesky factorization subset.

Parameters
[in,out]inv: The output or input/output matrix of the same type, kind, and shape as the input mat containing the full inverse matrix or a subset of it:
  1. If the specified input mat is a,
    1. lower-diagonal triangular matrix,
    2. upper-diagonal triangular matrix,
    3. lower-unit-diagonal triangular matrix,
    4. upper-unit-diagonal triangular matrix,
    5. LUP factorization of a general square matrix,
    6. Cholesky factorization of a positive-definite square matrix while the optional input argument subset is missing,
    then inv has intent(out) and shall contain the full inverse of the matrix corresponding to the specified mat.
  2. If the specified input mat is a Cholesky factorization, and the input argument subset is present, then inv has intent(inout).
    On output, only the specified subset of inv shall be updated with the corresponding inverse matrix triangle while the opposite triangle of inv remains untouched.
    This storage scheme for the inverse matrix is very useful for efficient packing both the Cholesky factorization and inverse of a matrix in a single contiguous almost-squqare-shaped matrix (e.g., inv(1 : ndim, 0 : ndim)).
[in]mat: The input array of rank 2 of square shape (1 : ndim, 1 : ndim) of,
  1. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128),
  2. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing a.
  1. upper-diagonal triangular matrix,
  2. lower-diagonal triangular matrix,
  3. upper-unit-diagonal triangular matrix,
  4. lower-unit-diagonal triangular matrix,
  5. LUP factorization of a general square matrix,
  6. lower Cholesky factorization of a positive-definite matrix,
  7. upper Cholesky factorization of a positive-definite matrix,
whose inverse must be computed.
The class of the input mat is determined by the input argument auxil.
[in,out]auxil: The input scalar constant that can be:
  1. The input scalar constant upperDiag implying that the input mat is an upper-diagonal triangular matrix whose inverse is to be computed.
  2. The input scalar constant lowerDiag implying that the input mat is an lower-diagonal triangular matrix whose inverse is to be computed.
  3. The input contiguous vector of shape (1 : ndim) containing the row permutations corresponding to the LU factorization of the matrix whose inverse is to be computed.
    This argument is automatically returned as rperm along with the LU factorization from the generic interfaces of pm_matrixLUP.
    This value must be specified if and only if the input argument mat contains the LU factorization of the matrix whose inverse must be computed.
  4. The input scalar constant choUpp implying that only the upper-diagonal Cholesky factorization of the positive-definite matrix whose inverse is to be computed.
  5. The input scalar constant choLow implying that only the lower-diagonal Cholesky factorization of the positive-definite matrix whose inverse is to be computed.
[in]subset: The input scalar that can be either,
  1. the constant uppDia implying that only the upper-diagonal triangular block of inv should be returned on output while the lower triangular part of inv is not referenced within the algorithm.
  2. the constant lowDia implying that the lower-diagonal triangular block of inv should be returned on output while the lower triangular part of inv is not referenced within the algorithm.
This argument is merely a convenience to differentiate the different procedure functionalities within this generic interface.
(optional. It can be present only if auxil is set to either choLow or choUpp.)


Possible calling interfaces

use pm_matrixInv, only: choLow, choUpp
use pm_matrixInv, only: upperDiag, lowerDiag
call setMatInv(inv(1:ndim, 1:ndim), mat(1:ndim, 1:ndim), auxil)
call setMatInv(inv(1:ndim, 1:ndim), mat(1:ndim, 1:ndim), auxil, subset) ! only if subset = choLow, choUpp.
!
Generate and return the full inverse of a general or triangular matrix or a subset of the inverse of ...
This module contains abstract and concrete derived types and procedures related to the inversion of s...
Warning
The condition size(mat, 1) == size(mat, 2)) must hold for the corresponding input arguments.
The condition all(shape(inv) == shape(mat)) must hold for the corresponding input arguments.
The condition size(auxil) == shape(mat, 1, IK) must hold for the corresponding input arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.
See also
getMatInv
setMatInv
getMatChol
setMatChol
setMatLUP
lowDia
uppDia
Intel Fortran LAPACK documentation
BLAS/LAPACK equivalent:
The procedures under discussion combine, modernize, and extend the interface and functionalities of Version 3.11 of BLAS/LAPACK routine(s): SGETRI, DGETRI, CGETRI, and ZGETRI.
SPFTRI, DPFTRI, CPFTRI, and ZPFTRI.
SPOTRI, DPOTRI, CPOTRI, and ZPOTRI.
STRTRI, DTRTRI, CTRTRI, and ZTRTRI.


Example usage

1program example
2
3 use pm_io, only: getFormat
4 use pm_kind, only: SK, IK, LK, TKG => RKS
5 use pm_io, only: display_type
6 use pm_distUnif, only: getUnifRand
7 use pm_matrixInv, only: setMatInv
8 use pm_matrixInv, only: choUpp, choLow
9 use pm_matrixInv, only: upperDiag, lowerDiag
10 use pm_matrixInv, only: upperUnit, lowerUnit
11 use pm_matrixChol, only: getMatChol, uppDia, lowDia
12 use pm_matrixInit, only: getMatInit, uppLowDia
13 use pm_distCov, only: getCovRand
14 use pm_matrixCopy, only: rdpack, uppDia
15 use pm_arrayResize, only: setResized
16 use pm_matrixCopy, only: setMatCopy
17 use pm_matrixCopy, only: transHerm
18 use pm_matrixInit, only: setMatInit
19 use pm_arrayFill, only: getFilled
20 use pm_matrixLUP, only: setMatLUP
21 use pm_err, only: setAsserted
22 use pm_val2str, only: getStr
23
24 implicit none
25
26 integer(IK):: itry, info, ndim, ntry = 10
27 character(:, SK), allocatable :: cform, rform
28
29 type(display_type) :: disp
30 disp = display_type(file = "main.out.F90")
31
32 cform = getFormat(mold = [(0._TKG, 0._TKG)], ed = SK_"f", ndigit = 2_IK, signed = .true._LK)
33 rform = getFormat(mold = [0._TKG], ed = SK_"f", ndigit = 2_IK, signed = .true._LK)
34
35 call disp%skip()
36 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
37 call disp%show("! Compute inverse of an upperDiag triangular real matrix.")
38 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
39 call disp%skip()
40
41 block
42 use pm_kind, only: TKG => RKS
43 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
44 do itry = 1, ntry
45 call disp%skip
46 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
47 ndim = getUnifRand(1_IK, 6_IK)
48 call disp%show("ndim ! matrix rank")
49 call disp%show( ndim )
50 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
51 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
52 call disp%show("call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)")
53 call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
54 call disp%show("mat")
55 call disp%show( mat , format = rform )
56 call disp%show("call setResized(inv, shape(mat, IK))")
57 call setResized(inv, shape(mat, IK))
58 call disp%show("call setMatInv(inv, mat, upperDiag)")
59 call setMatInv(inv, mat, upperDiag)
60 call disp%show("inv")
61 call disp%show( inv , format = rform )
62 call disp%show("mul = matmul(mat, inv)")
63 mul = matmul(mat, inv)
64 call disp%show("mul")
65 call disp%show( mul , format = rform )
66 call disp%skip
67 end do
68 end block
69
70 call disp%skip()
71 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
72 call disp%show("! Compute inverse of a upperDiag triangular complex matrix.")
73 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
74 call disp%skip()
75
76 block
77 use pm_kind, only: TKG => RKS
78 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
79 do itry = 1, ntry
80 call disp%skip
81 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
82 ndim = getUnifRand(1_IK, 6_IK)
83 call disp%show("ndim ! matrix rank")
84 call disp%show( ndim )
85 call disp%show("mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)")
86 mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
87 call disp%show("call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))")
88 call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
89 call disp%show("mat")
90 call disp%show( mat , format = cform )
91 call disp%show("call setResized(inv, shape(mat, IK))")
92 call setResized(inv, shape(mat, IK))
93 call disp%show("call setMatInv(inv, mat, upperDiag)")
94 call setMatInv(inv, mat, upperDiag)
95 call disp%show("inv")
96 call disp%show( inv , format = cform )
97 call disp%show("mul = matmul(mat, inv)")
98 mul = matmul(mat, inv)
99 call disp%show("mul")
100 call disp%show( mul , format = cform )
101 call disp%skip
102 end do
103 end block
104
105 call disp%skip()
106 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
107 call disp%show("! Compute inverse of a lowerDiag triangular real matrix.")
108 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
109 call disp%skip()
110
111 block
112 use pm_kind, only: TKG => RKS
113 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
114 do itry = 1, ntry
115 call disp%skip
116 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
117 ndim = getUnifRand(1_IK, 6_IK)
118 call disp%show("ndim ! matrix rank")
119 call disp%show( ndim )
120 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
121 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
122 call disp%show("call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)")
123 call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
124 call disp%show("mat")
125 call disp%show( mat , format = rform )
126 call disp%show("call setResized(inv, shape(mat, IK))")
127 call setResized(inv, shape(mat, IK))
128 call disp%show("call setMatInv(inv, mat, lowerDiag)")
129 call setMatInv(inv, mat, lowerDiag)
130 call disp%show("inv")
131 call disp%show( inv , format = rform )
132 call disp%show("mul = matmul(mat, inv)")
133 mul = matmul(mat, inv)
134 call disp%show("mul")
135 call disp%show( mul , format = rform )
136 call disp%skip
137 end do
138 end block
139
140 call disp%skip()
141 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
142 call disp%show("! Compute inverse of a lowerDiag triangular complex matrix.")
143 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
144 call disp%skip()
145
146 block
147 use pm_kind, only: TKG => RKS
148 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
149 do itry = 1, ntry
150 call disp%skip
151 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
152 ndim = getUnifRand(1_IK, 6_IK)
153 call disp%show("ndim ! matrix rank")
154 call disp%show( ndim )
155 call disp%show("mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)")
156 mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
157 call disp%show("call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))")
158 call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
159 call disp%show("mat")
160 call disp%show( mat , format = cform )
161 call disp%show("call setResized(inv, shape(mat, IK))")
162 call setResized(inv, shape(mat, IK))
163 call disp%show("call setMatInv(inv, mat, lowerDiag)")
164 call setMatInv(inv, mat, lowerDiag)
165 call disp%show("inv")
166 call disp%show( inv , format = cform )
167 call disp%show("mul = matmul(mat, inv)")
168 mul = matmul(mat, inv)
169 call disp%show("mul")
170 call disp%show( mul , format = cform )
171 call disp%skip
172 end do
173 end block
174
175 call disp%skip()
176 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
177 call disp%show("! Compute inverse of a upperUnit triangular real matrix.")
178 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
179 call disp%skip()
180
181 block
182 use pm_kind, only: TKG => RKS
183 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
184 do itry = 1, ntry
185 call disp%skip
186 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
187 ndim = getUnifRand(1_IK, 6_IK)
188 call disp%show("ndim ! matrix rank")
189 call disp%show( ndim )
190 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
191 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
192 call disp%show("call setMatInit(mat, lowDia, 0._TKG, 1._TKG)")
193 call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
194 call disp%show("mat")
195 call disp%show( mat , format = rform )
196 call disp%show("call setResized(inv, shape(mat, IK))")
197 call setResized(inv, shape(mat, IK))
198 call disp%show("call setMatInv(inv, mat, upperUnit)")
199 call setMatInv(inv, mat, upperUnit)
200 call disp%show("inv")
201 call disp%show( inv , format = rform )
202 call disp%show("mul = matmul(mat, inv)")
203 mul = matmul(mat, inv)
204 call disp%show("mul")
205 call disp%show( mul , format = rform )
206 call disp%skip
207 end do
208 end block
209
210 call disp%skip()
211 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
212 call disp%show("! Compute inverse of a upperUnit triangular complex matrix.")
213 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
214 call disp%skip()
215
216 block
217 use pm_kind, only: TKG => RKS
218 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
219 do itry = 1, ntry
220 call disp%skip
221 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
222 ndim = getUnifRand(1_IK, 6_IK)
223 call disp%show("ndim ! matrix rank")
224 call disp%show( ndim )
225 call disp%show("mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)")
226 mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
227 call disp%show("call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))")
228 call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
229 call disp%show("mat")
230 call disp%show( mat , format = cform )
231 call disp%show("call setResized(inv, shape(mat, IK))")
232 call setResized(inv, shape(mat, IK))
233 call disp%show("call setMatInv(inv, mat, upperUnit)")
234 call setMatInv(inv, mat, upperUnit)
235 call disp%show("inv")
236 call disp%show( inv , format = cform )
237 call disp%show("mul = matmul(mat, inv)")
238 mul = matmul(mat, inv)
239 call disp%show("mul")
240 call disp%show( mul , format = cform )
241 call disp%skip
242 end do
243 end block
244
245 call disp%skip()
246 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
247 call disp%show("! Compute inverse of a lowerUnit triangular real matrix.")
248 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
249 call disp%skip()
250
251 block
252 use pm_kind, only: TKG => RKS
253 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
254 do itry = 1, ntry
255 call disp%skip
256 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
257 ndim = getUnifRand(1_IK, 6_IK)
258 call disp%show("ndim ! matrix rank")
259 call disp%show( ndim )
260 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
261 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
262 call disp%show("call setMatInit(mat, uppDia, 0._TKG, 1._TKG)")
263 call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
264 call disp%show("mat")
265 call disp%show( mat , format = rform )
266 call disp%show("call setResized(inv, shape(mat, IK))")
267 call setResized(inv, shape(mat, IK))
268 call disp%show("call setMatInv(inv, mat, lowerUnit)")
269 call setMatInv(inv, mat, lowerUnit)
270 call disp%show("inv")
271 call disp%show( inv , format = rform )
272 call disp%show("mul = matmul(mat, inv)")
273 mul = matmul(mat, inv)
274 call disp%show("mul")
275 call disp%show( mul , format = rform )
276 call disp%skip
277 end do
278 end block
279
280 call disp%skip()
281 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
282 call disp%show("! Compute inverse of a lowerUnit triangular complex matrix.")
283 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
284 call disp%skip()
285
286 block
287 use pm_kind, only: TKG => RKS
288 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
289 do itry = 1, ntry
290 call disp%skip
291 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
292 ndim = getUnifRand(1_IK, 6_IK)
293 call disp%show("ndim ! matrix rank")
294 call disp%show( ndim )
295 call disp%show("mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)")
296 mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
297 call disp%show("call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))")
298 call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
299 call disp%show("mat")
300 call disp%show( mat , format = cform )
301 call disp%show("call setResized(inv, shape(mat, IK))")
302 call setResized(inv, shape(mat, IK))
303 call disp%show("call setMatInv(inv, mat, lowerUnit)")
304 call setMatInv(inv, mat, lowerUnit)
305 call disp%show("inv")
306 call disp%show( inv , format = cform )
307 call disp%show("mul = matmul(mat, inv)")
308 mul = matmul(mat, inv)
309 call disp%show("mul")
310 call disp%show( mul , format = cform )
311 call disp%skip
312 end do
313 end block
314
315 call disp%skip()
316 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
317 call disp%show("! Compute inverse of a general real matrix by passing its LUP factorization.")
318 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
319 call disp%skip()
320
321 block
322 use pm_kind, only: TKG => RKS
323 integer(IK), allocatable :: rperm(:)
324 real(TKG), allocatable :: mat(:,:), lup(:,:), inv(:,:), mul(:,:)
325 do itry = 1, ntry
326 call disp%skip
327 call disp%show("mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])")
328 mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
329 call disp%show("mat")
330 call disp%show( mat , format = rform )
331 call disp%show("call setResized(rperm, size(mat, 1, IK))")
332 call setResized(rperm, size(mat, 1, IK))
333 call disp%show("lup = mat")
334 lup = mat
335 call disp%show("lup")
336 call disp%show( lup , format = rform )
337 call disp%show("call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.")
338 call setMatLUP(lup, rperm, info)
339 call disp%show("if (info /= 0) error stop 'LUP factorization failed.'")
340 if (info /= 0) error stop 'LUP factorization failed.'
341 call disp%show("lup")
342 call disp%show( lup , format = rform )
343 call disp%show("call setResized(inv, shape(mat, IK))")
344 call setResized(inv, shape(mat, IK))
345 call disp%show("call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.")
346 call setMatInv(inv, lup, rperm)
347 call disp%show("inv")
348 call disp%show( inv , format = rform )
349 call disp%show("mul = matmul(mat, inv)")
350 mul = matmul(mat, inv)
351 call disp%show("mul")
352 call disp%show( mul , format = rform )
353 call disp%skip
354 end do
355 end block
356
357 call disp%skip()
358 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
359 call disp%show("! Compute inverse of a general complex matrix by passing its LUP factorization.")
360 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
361 call disp%skip()
362
363 block
364 use pm_kind, only: TKG => RKS
365 integer(IK), allocatable :: rperm(:)
366 complex(TKG), parameter :: mat(*,*) = reshape( &
367 [ (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0), (5.2,-1.0) &
368 , (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0), (4.8,-1.0) &
369 , (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0), (4.4,-1.0) &
370 , (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0), (4.0,-1.0) &
371 , (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0), (3.6,-1.0) &
372 , (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0), (3.2,-1.0) &
373 , (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0), (2.8,-1.0) &
374 , (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0), (2.4,-1.0) &
375 , (5.2, 1.0), (4.8, 1.0), (4.4, 1.0), (4.0, 1.0), (3.6, 1.0), (3.2, 1.0), (2.8, 1.0), (2.4, 1.0), (2.0, 1.0) &
376 ], shape = [9, 9], order = [2, 1])
377 complex(TKG), dimension(size(mat,1), size(mat,2)) :: inv, lup, mul
378 call disp%skip
379 call disp%show("call setResized(rperm, size(mat, 1, IK))")
380 call setResized(rperm, size(mat, 1, IK))
381 call disp%show("lup = mat")
382 lup = mat
383 call disp%show("lup")
384 call disp%show( lup , format = cform )
385 call disp%show("call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.")
386 call setMatLUP(lup, rperm, info)
387 call disp%show("if (info /= 0) error stop 'LUP factorization failed.'")
388 if (info /= 0) error stop 'LUP factorization failed.'
389 call disp%show("lup")
390 call disp%show( lup , format = cform )
391 call disp%show("call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.")
392 call setMatInv(inv, lup, rperm)
393 call disp%show("inv")
394 call disp%show( inv , format = cform )
395 call disp%show("mul = matmul(mat, inv)")
396 mul = matmul(mat, inv)
397 call disp%show("mul")
398 call disp%show( mul , format = cform )
399 call disp%skip
400 end block
401
402 call disp%skip()
403 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
404 call disp%show("! Compute the inverse of a positive-definite real matrix by passing its Cholesky factorization.")
405 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
406 call disp%skip()
407
408 block
409 use pm_kind, only: TKG => RKS
410 real(TKG), allocatable :: mat(:,:), chol(:,:), inv(:,:), mul(:,:)
411 do itry = 1, ntry
412 call disp%skip
413 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
414 ndim = getUnifRand(1_IK, 6_IK)
415 call disp%show("ndim ! matrix rank")
416 call disp%show( ndim )
417 call disp%show("mat = getCovRand(mold = 1._TKG, ndim = ndim)")
418 mat = getCovRand(mold = 1._TKG, ndim = ndim)
419 call disp%show("mat")
420 call disp%show( mat , format = rform )
421 call disp%show("chol = getMatChol(mat, subset = lowDia)")
422 chol = getMatChol(mat, subset = lowDia)
423 call disp%show("chol")
424 call disp%show( chol , format = rform )
425 call disp%show("call setResized(inv, shape(mat, IK))")
426 call setResized(inv, shape(mat, IK))
427 call disp%show("call setMatInv(inv, chol, auxil = choLow)")
428 call setMatInv(inv, chol, auxil = choLow)
429 call disp%show("inv")
430 call disp%show( inv , format = rform )
431 call disp%show("mul = matmul(mat, inv)")
432 mul = matmul(mat, inv)
433 call disp%show("mul")
434 call disp%show( mul , format = rform )
435 call disp%skip
436 end do
437 end block
438
439 call disp%skip()
440 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
441 call disp%show("! Compute the inverse of a positive-definite complex matrix by passing its Cholesky factorization.")
442 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
443 call disp%skip()
444
445 block
446 use pm_kind, only: TKG => RKS
447 integer(IK), parameter :: ndim = 3_IK
448 complex(TKG), allocatable :: chol(:,:), inv(:,:), mul(:,:)
449 complex(TKG), parameter :: mat(*,*) = reshape( [ (9.0, 0.0), (3.0, 3.0), (3.0, -3.0) &
450 , (3.0, -3.0),(18.0, 0.0), (8.0, -6.0) &
451 , (3.0, 3.0), (8.0, 6.0),(43.0, 0.0) &
452 ], shape = [ndim, ndim], order = [2, 1])
453 call disp%skip
454 call disp%show("mat")
455 call disp%show( mat , format = cform )
456 call disp%show("chol = getMatChol(mat, subset = lowDia)")
457 chol = getMatChol(mat, subset = lowDia)
458 call disp%show("chol")
459 call disp%show( chol , format = cform )
460 call disp%show("call setResized(inv, shape(mat, IK))")
461 call setResized(inv, shape(mat, IK))
462 call disp%show("call setMatInv(inv, chol, auxil = choLow)")
463 call setMatInv(inv, chol, auxil = choLow)
464 call disp%show("inv")
465 call disp%show( inv , format = cform )
466 call disp%show("mul = matmul(mat, inv)")
467 mul = matmul(mat, inv)
468 call disp%show("mul")
469 call disp%show( mul , format = cform )
470 call disp%skip
471 end block
472
473 block
474 use pm_kind, only: TKG => RKS
475 integer(IK), parameter :: ndim = 3_IK
476 complex(TKG), allocatable :: chol(:,:), inv(:,:), mul(:,:)
477 complex(TKG), parameter :: mat(*,*) = reshape( [ (9.0, 0.0), (3.0, 3.0), (3.0, -3.0) &
478 , (3.0, -3.0),(18.0, 0.0), (8.0, -6.0) &
479 , (3.0, 3.0), (8.0, 6.0),(43.0, 0.0) &
480 ], shape = [ndim, ndim], order = [2, 1])
481 call disp%skip
482 call disp%show("mat")
483 call disp%show( mat , format = cform )
484 call disp%show("chol = getMatChol(mat, subset = uppDia)")
485 chol = getMatChol(mat, subset = uppDia)
486 call disp%show("chol")
487 call disp%show( chol , format = cform )
488 call disp%show("call setResized(inv, shape(mat, IK))")
489 call setResized(inv, shape(mat, IK))
490 call disp%show("call setMatInv(inv, chol, auxil = choUpp)")
491 call setMatInv(inv, chol, auxil = choUpp)
492 call disp%show("inv")
493 call disp%show( inv , format = cform )
494 call disp%show("mul = matmul(mat, inv)")
495 mul = matmul(mat, inv)
496 call disp%show("mul")
497 call disp%show( mul , format = cform )
498 call disp%skip
499 end block
500
501 call disp%skip()
502 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
503 call disp%show("! Compute a subset of the inverse of a positive-definite real matrix by passing its Cholesky factorization.")
504 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
505 call disp%skip()
506
507 block
508 use pm_kind, only: TKG => RKS
509 real(TKG), allocatable :: mat(:,:), chol(:,:), inv(:,:), mul(:,:)
510 do itry = 1, ntry
511 call disp%skip
512 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
513 ndim = getUnifRand(1_IK, 6_IK)
514 call disp%show("ndim ! matrix rank")
515 call disp%show( ndim )
516 call disp%show("mat = getCovRand(mold = 1._TKG, ndim = ndim)")
517 mat = getCovRand(mold = 1._TKG, ndim = ndim)
518 call disp%show("mat")
519 call disp%show( mat , format = rform )
520 call disp%show("chol = getMatChol(mat, subset = lowDia)")
521 chol = getMatChol(mat, subset = lowDia)
522 call disp%show("chol")
523 call disp%show( chol , format = rform )
524 call disp%show("call setResized(inv, shape(mat, IK))")
525 call setResized(inv, shape(mat, IK))
526 call disp%skip
527 call disp%show("inv = 0")
528 inv = 0
529 call disp%show("call setMatInv(inv, chol, auxil = choLow, subset = uppDia)")
530 call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
531 call disp%show("inv")
532 call disp%show( inv , format = rform )
533 call disp%show("call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.")
534 call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm)
535 call disp%show("inv")
536 call disp%show( inv , format = rform )
537 call disp%show("mul = matmul(mat, inv)")
538 mul = matmul(mat, inv)
539 call disp%show("mul")
540 call disp%show( mul , format = rform )
541 call disp%skip
542 call disp%show("inv = 0")
543 inv = 0
544 call disp%show("call setMatInv(inv, chol, auxil = choLow, subset = lowDia)")
545 call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
546 call disp%show("inv")
547 call disp%show( inv , format = rform )
548 call disp%show("call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.")
549 call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm)
550 call disp%show("inv")
551 call disp%show( inv , format = rform )
552 call disp%show("mul = matmul(mat, inv)")
553 mul = matmul(mat, inv)
554 call disp%show("mul")
555 call disp%show( mul , format = rform )
556 call disp%skip
557 end do
558 end block
559
560 block
561 use pm_kind, only: TKG => RKS
562 real(TKG), allocatable :: mat(:,:), chol(:,:), inv(:,:), mul(:,:)
563 do itry = 1, ntry
564 call disp%skip
565 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
566 ndim = getUnifRand(1_IK, 6_IK)
567 call disp%show("ndim ! matrix rank")
568 call disp%show( ndim )
569 call disp%show("mat = getCovRand(mold = 1._TKG, ndim = ndim)")
570 mat = getCovRand(mold = 1._TKG, ndim = ndim)
571 call disp%show("mat")
572 call disp%show( mat , format = rform )
573 call disp%show("chol = getMatChol(mat, subset = uppDia)")
574 chol = getMatChol(mat, subset = uppDia)
575 call disp%show("chol")
576 call disp%show( chol , format = rform )
577 call disp%show("call setResized(inv, shape(mat, IK))")
578 call setResized(inv, shape(mat, IK))
579 call disp%skip
580 call disp%show("inv = 0")
581 inv = 0
582 call disp%show("call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)")
583 call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
584 call disp%show("inv")
585 call disp%show( inv , format = rform )
586 call disp%show("call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.")
587 call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm)
588 call disp%show("inv")
589 call disp%show( inv , format = rform )
590 call disp%show("mul = matmul(mat, inv)")
591 mul = matmul(mat, inv)
592 call disp%show("mul")
593 call disp%show( mul , format = rform )
594 call disp%skip
595 call disp%show("inv = 0")
596 inv = 0
597 call disp%show("call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)")
598 call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
599 call disp%show("inv")
600 call disp%show( inv , format = rform )
601 call disp%show("call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.")
602 call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm)
603 call disp%show("inv")
604 call disp%show( inv , format = rform )
605 call disp%show("mul = matmul(mat, inv)")
606 mul = matmul(mat, inv)
607 call disp%show("mul")
608 call disp%show( mul , format = rform )
609 call disp%skip
610 end do
611 end block
612
613 call disp%skip()
614 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
615 call disp%show("! Compute a subset of the inverse of a positive-definite complex matrix by passing its Cholesky factorization.")
616 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
617 call disp%skip()
618
619 block
620 use pm_kind, only: TKG => RKS
621 integer(IK), parameter :: ndim = 3_IK
622 complex(TKG), allocatable :: chol(:,:), inv(:,:), mul(:,:)
623 complex(TKG), parameter :: mat(*,*) = reshape( [ (9.0, 0.0), (3.0, 3.0), (3.0, -3.0) &
624 , (3.0, -3.0),(18.0, 0.0), (8.0, -6.0) &
625 , (3.0, 3.0), (8.0, 6.0),(43.0, 0.0) &
626 ], shape = [ndim, ndim], order = [2, 1])
627 call disp%skip
628 call disp%show("mat")
629 call disp%show( mat , format = cform )
630 call disp%show("chol = getMatChol(mat, subset = lowDia)")
631 chol = getMatChol(mat, subset = lowDia)
632 call disp%show("chol")
633 call disp%show( chol , format = cform )
634 call disp%show("call setResized(inv, shape(mat, IK))")
635 call setResized(inv, shape(mat, IK))
636 call disp%show("inv = 0")
637 inv = 0
638 call disp%show("call setMatInv(inv, chol, auxil = choLow, subset = uppDia)")
639 call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
640 call disp%show("inv")
641 call disp%show( inv , format = cform )
642 call disp%show("call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.")
643 call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm)
644 call disp%show("inv")
645 call disp%show( inv , format = cform )
646 call disp%show("mul = matmul(mat, inv)")
647 mul = matmul(mat, inv)
648 call disp%show("mul")
649 call disp%show( mul , format = cform )
650 call disp%skip
651 call disp%show("inv = 0")
652 inv = 0
653 call disp%show("call setMatInv(inv, chol, auxil = choLow, subset = lowDia)")
654 call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
655 call disp%show("inv")
656 call disp%show( inv , format = cform )
657 call disp%show("call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.")
658 call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm)
659 call disp%show("inv")
660 call disp%show( inv , format = cform )
661 call disp%show("mul = matmul(mat, inv)")
662 mul = matmul(mat, inv)
663 call disp%show("mul")
664 call disp%show( mul , format = cform )
665 call disp%skip
666 end block
667
668 block
669 use pm_kind, only: TKG => RKS
670 integer(IK), parameter :: ndim = 3_IK
671 complex(TKG), allocatable :: chol(:,:), inv(:,:), mul(:,:)
672 complex(TKG), parameter :: mat(*,*) = reshape( [ (9.0, 0.0), (3.0, 3.0), (3.0, -3.0) &
673 , (3.0, -3.0),(18.0, 0.0), (8.0, -6.0) &
674 , (3.0, 3.0), (8.0, 6.0),(43.0, 0.0) &
675 ], shape = [ndim, ndim], order = [2, 1])
676 call disp%skip
677 call disp%show("mat")
678 call disp%show( mat , format = cform )
679 call disp%show("chol = getMatChol(mat, subset = uppDia)")
680 chol = getMatChol(mat, subset = uppDia)
681 call disp%show("chol")
682 call disp%show( chol , format = cform )
683 call disp%show("call setResized(inv, shape(mat, IK))")
684 call setResized(inv, shape(mat, IK))
685 call disp%show("inv = 0")
686 inv = 0
687 call disp%show("call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)")
688 call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
689 call disp%show("inv")
690 call disp%show( inv , format = cform )
691 call disp%show("call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.")
692 call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm)
693 call disp%show("inv")
694 call disp%show( inv , format = cform )
695 call disp%show("mul = matmul(mat, inv)")
696 mul = matmul(mat, inv)
697 call disp%show("mul")
698 call disp%show( mul , format = cform )
699 call disp%skip
700 call disp%show("inv = 0")
701 inv = 0
702 call disp%show("call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)")
703 call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
704 call disp%show("inv")
705 call disp%show( inv , format = cform )
706 call disp%show("call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.")
707 call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm)
708 call disp%show("inv")
709 call disp%show( inv , format = cform )
710 call disp%show("mul = matmul(mat, inv)")
711 mul = matmul(mat, inv)
712 call disp%show("mul")
713 call disp%show( mul , format = cform )
714 call disp%skip
715 end block
716
717 block
718 use pm_kind, only: TKG => RKS
719 complex(TKG), allocatable :: low(:,:), upp(:,:), mat(:,:), chol(:,:), inv(:,:), mul(:,:)
720 do itry = 1, ntry
721 call disp%skip
722 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
723 ndim = getUnifRand(1_IK, 6_IK)
724 call disp%show("ndim ! matrix rank")
725 call disp%show( ndim )
726 low = getUnifRand((1._TKG, -1._TKG), (+2._TKG, +1._TKG), ndim, ndim)
727 call setMatInit(low, uppDia, (0._TKG, 0._TKG), cmplx(getUnifRand(1._TKG, 2._TKG, ndim), 0._TKG, TKG))
728 upp = transpose(conjg(low))
729 mat = matmul(low, upp)
730 call disp%show("mat")
731 call disp%show( mat , format = cform )
732 call disp%show("chol = getMatChol(mat, subset = uppDia)")
733 chol = getMatChol(mat, subset = uppDia)
734 call disp%show("chol")
735 call disp%show( chol , format = cform )
736 call disp%show("call setResized(inv, shape(mat, IK))")
737 call setResized(inv, shape(mat, IK))
738 call disp%show("inv = 0")
739 inv = 0
740 call disp%show("call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)")
741 call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
742 call disp%show("inv")
743 call disp%show( inv , format = cform )
744 call disp%show("call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.")
745 call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm)
746 call disp%show("inv")
747 call disp%show( inv , format = cform )
748 call disp%show("mul = matmul(mat, inv)")
749 mul = matmul(mat, inv)
750 call disp%show("mul")
751 call disp%show( mul , format = cform )
752 call disp%skip
753 call disp%show("inv = 0")
754 inv = 0
755 call disp%show("call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)")
756 call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
757 call disp%show("inv")
758 call disp%show( inv , format = cform )
759 call disp%show("call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.")
760 call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm)
761 call disp%show("inv")
762 call disp%show( inv , format = cform )
763 call disp%show("mul = matmul(mat, inv)")
764 mul = matmul(mat, inv)
765 call disp%show("mul")
766 call disp%show( mul , format = cform )
767 call disp%skip
768 end do
769 end block
770
771end program example
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
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...
Definition: pm_distCov.F90:394
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
Verify the input assertion holds and if it does not, print the (optional) input message on stdout and...
Definition: pm_err.F90:735
Generate and return an object of type stop_type with the user-specified input attributes.
Definition: pm_err.F90:1618
Generate and return a generic or type/kind-specific IO format with the requested specifications that ...
Definition: pm_io.F90:18485
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Generate and return the upper or the lower Cholesky factorization of the input symmetric positive-def...
Copy a desired subset of the input source matrix of arbitrary shape (:) or (:,:) to the target subset...
Generate and return a matrix of shape (shape(1), shape(2)) with the upper/lower triangle and the diag...
Set the upper/lower triangle and the diagonal elements of the input matrix of arbitrary shape (:,...
Return the LU-Pivoted decomposition of the input square matrix mat(ndim,ndim).
Generate and return the conversion of the input value to an output Fortran string,...
Definition: pm_val2str.F90:167
This module contains procedures and generic interfaces for convenient allocation and filling of array...
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...
Definition: pm_distCov.F90:72
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for reporting and handling errors.
Definition: pm_err.F90:52
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
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
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Definition: pm_kind.F90:567
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 procedures and generic interfaces relevant to generating and initializing matric...
This module contains procedures and generic interfaces relevant to the partially LU Pivoted decomposi...
This module contains the generic procedures for converting values of different types and kinds to For...
Definition: pm_val2str.F90:58
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3! Compute inverse of an upperDiag triangular real matrix.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7ndim = getUnifRand(1_IK, 6_IK)
8ndim ! matrix rank
9+2
10mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
11call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
12mat
13 +3.00, +3.00
14 +0.00, +7.00
15call setResized(inv, shape(mat, IK))
16call setMatInv(inv, mat, upperDiag)
17inv
18 +0.33, -0.14
19 +0.00, +0.14
20mul = matmul(mat, inv)
21mul
22 +1.00, +0.00
23 +0.00, +1.00
24
25
26ndim = getUnifRand(1_IK, 6_IK)
27ndim ! matrix rank
28+1
29mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
30call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
31mat
32 +8.00
33call setResized(inv, shape(mat, IK))
34call setMatInv(inv, mat, upperDiag)
35inv
36 +0.12
37mul = matmul(mat, inv)
38mul
39 +1.00
40
41
42ndim = getUnifRand(1_IK, 6_IK)
43ndim ! matrix rank
44+5
45mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
46call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
47mat
48 +7.00, +9.00, +2.00, +4.00, +3.00
49 +0.00, +6.00, +1.00, +8.00, +1.00
50 +0.00, +0.00, +5.00, +6.00, +1.00
51 +0.00, +0.00, +0.00, +8.00, +7.00
52 +0.00, +0.00, +0.00, +0.00, +4.00
53call setResized(inv, shape(mat, IK))
54call setMatInv(inv, mat, upperDiag)
55inv
56 +0.14, -0.21, -0.01, +0.15, -0.32
57 +0.00, +0.17, -0.03, -0.14, +0.21
58 +0.00, +0.00, +0.20, -0.15, +0.21
59 +0.00, +0.00, +0.00, +0.12, -0.22
60 +0.00, +0.00, +0.00, +0.00, +0.25
61mul = matmul(mat, inv)
62mul
63 +1.00, -0.00, +0.00, +0.00, -0.00
64 +0.00, +1.00, -0.00, +0.00, +0.00
65 +0.00, +0.00, +1.00, +0.00, +0.00
66 +0.00, +0.00, +0.00, +1.00, +0.00
67 +0.00, +0.00, +0.00, +0.00, +1.00
68
69
70ndim = getUnifRand(1_IK, 6_IK)
71ndim ! matrix rank
72+4
73mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
74call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
75mat
76 +6.00, +9.00, +3.00, +3.00
77 +0.00, +7.00, +4.00, +7.00
78 +0.00, +0.00, +5.00, +4.00
79 +0.00, +0.00, +0.00, +3.00
80call setResized(inv, shape(mat, IK))
81call setMatInv(inv, mat, upperDiag)
82inv
83 +0.17, -0.21, +0.07, +0.24
84 +0.00, +0.14, -0.11, -0.18
85 +0.00, +0.00, +0.20, -0.27
86 +0.00, +0.00, +0.00, +0.33
87mul = matmul(mat, inv)
88mul
89 +1.00, +0.00, +0.00, +0.00
90 +0.00, +1.00, -0.00, +0.00
91 +0.00, +0.00, +1.00, +0.00
92 +0.00, +0.00, +0.00, +1.00
93
94
95ndim = getUnifRand(1_IK, 6_IK)
96ndim ! matrix rank
97+6
98mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
99call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
100mat
101 +3.00, +7.00, +2.00, +6.00, +3.00, +7.00
102 +0.00, +9.00, +7.00, +6.00, +8.00, +1.00
103 +0.00, +0.00, +5.00, +7.00, +8.00, +3.00
104 +0.00, +0.00, +0.00, +1.00, +5.00, +4.00
105 +0.00, +0.00, +0.00, +0.00, +1.00, +2.00
106 +0.00, +0.00, +0.00, +0.00, +0.00, +8.00
107call setResized(inv, shape(mat, IK))
108call setMatInv(inv, mat, upperDiag)
109inv
110 +0.33, -0.26, +0.23, -2.05, +9.50, -1.69
111 +0.00, +0.11, -0.16, +0.42, -1.76, +0.27
112 +0.00, +0.00, +0.20, -1.40, +5.40, -0.73
113 +0.00, +0.00, +0.00, +1.00, -5.00, +0.75
114 +0.00, +0.00, +0.00, +0.00, +1.00, -0.25
115 +0.00, +0.00, +0.00, +0.00, +0.00, +0.12
116mul = matmul(mat, inv)
117mul
118 +1.00, -0.00, +0.00, +0.00, +0.00, -0.00
119 +0.00, +1.00, -0.00, -0.00, +0.00, -0.00
120 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
121 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
122 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
123 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
124
125
126ndim = getUnifRand(1_IK, 6_IK)
127ndim ! matrix rank
128+5
129mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
130call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
131mat
132 +5.00, +7.00, +3.00, +5.00, +8.00
133 +0.00, +6.00, +3.00, +1.00, +4.00
134 +0.00, +0.00, +8.00, +7.00, +7.00
135 +0.00, +0.00, +0.00, +9.00, +6.00
136 +0.00, +0.00, +0.00, +0.00, +7.00
137call setResized(inv, shape(mat, IK))
138call setMatInv(inv, mat, upperDiag)
139inv
140 +0.20, -0.23, +0.01, -0.09, -0.03
141 +0.00, +0.17, -0.06, +0.03, -0.06
142 +0.00, +0.00, +0.12, -0.10, -0.04
143 +0.00, +0.00, +0.00, +0.11, -0.10
144 +0.00, +0.00, +0.00, +0.00, +0.14
145mul = matmul(mat, inv)
146mul
147 +1.00, +0.00, -0.00, +0.00, +0.00
148 +0.00, +1.00, +0.00, -0.00, +0.00
149 +0.00, +0.00, +1.00, +0.00, +0.00
150 +0.00, +0.00, +0.00, +1.00, +0.00
151 +0.00, +0.00, +0.00, +0.00, +1.00
152
153
154ndim = getUnifRand(1_IK, 6_IK)
155ndim ! matrix rank
156+3
157mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
158call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
159mat
160 +5.00, +4.00, +1.00
161 +0.00, +4.00, +4.00
162 +0.00, +0.00, +8.00
163call setResized(inv, shape(mat, IK))
164call setMatInv(inv, mat, upperDiag)
165inv
166 +0.20, -0.20, +0.08
167 +0.00, +0.25, -0.12
168 +0.00, +0.00, +0.12
169mul = matmul(mat, inv)
170mul
171 +1.00, +0.00, +0.00
172 +0.00, +1.00, +0.00
173 +0.00, +0.00, +1.00
174
175
176ndim = getUnifRand(1_IK, 6_IK)
177ndim ! matrix rank
178+3
179mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
180call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
181mat
182 +8.00, +3.00, +9.00
183 +0.00, +4.00, +1.00
184 +0.00, +0.00, +1.00
185call setResized(inv, shape(mat, IK))
186call setMatInv(inv, mat, upperDiag)
187inv
188 +0.12, -0.09, -1.03
189 +0.00, +0.25, -0.25
190 +0.00, +0.00, +1.00
191mul = matmul(mat, inv)
192mul
193 +1.00, +0.00, +0.00
194 +0.00, +1.00, +0.00
195 +0.00, +0.00, +1.00
196
197
198ndim = getUnifRand(1_IK, 6_IK)
199ndim ! matrix rank
200+3
201mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
202call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
203mat
204 +1.00, +6.00, +3.00
205 +0.00, +7.00, +3.00
206 +0.00, +0.00, +7.00
207call setResized(inv, shape(mat, IK))
208call setMatInv(inv, mat, upperDiag)
209inv
210 +1.00, -0.86, -0.06
211 +0.00, +0.14, -0.06
212 +0.00, +0.00, +0.14
213mul = matmul(mat, inv)
214mul
215 +1.00, +0.00, +0.00
216 +0.00, +1.00, -0.00
217 +0.00, +0.00, +1.00
218
219
220ndim = getUnifRand(1_IK, 6_IK)
221ndim ! matrix rank
222+4
223mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
224call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
225mat
226 +2.00, +9.00, +9.00, +1.00
227 +0.00, +7.00, +4.00, +4.00
228 +0.00, +0.00, +2.00, +1.00
229 +0.00, +0.00, +0.00, +7.00
230call setResized(inv, shape(mat, IK))
231call setMatInv(inv, mat, upperDiag)
232inv
233 +0.50, -0.64, -0.96, +0.43
234 +0.00, +0.14, -0.29, -0.04
235 +0.00, +0.00, +0.50, -0.07
236 +0.00, +0.00, +0.00, +0.14
237mul = matmul(mat, inv)
238mul
239 +1.00, +0.00, +0.00, -0.00
240 +0.00, +1.00, +0.00, +0.00
241 +0.00, +0.00, +1.00, +0.00
242 +0.00, +0.00, +0.00, +1.00
243
244
245!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246! Compute inverse of a upperDiag triangular complex matrix.
247!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
248
249
250ndim = getUnifRand(1_IK, 6_IK)
251ndim ! matrix rank
252+1
253mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
254call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
255mat
256( +1.17, +1.98)
257call setResized(inv, shape(mat, IK))
258call setMatInv(inv, mat, upperDiag)
259inv
260( +0.22, -0.37)
261mul = matmul(mat, inv)
262mul
263( +1.00, -0.00)
264
265
266ndim = getUnifRand(1_IK, 6_IK)
267ndim ! matrix rank
268+1
269mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
270call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
271mat
272( +1.88, +1.59)
273call setResized(inv, shape(mat, IK))
274call setMatInv(inv, mat, upperDiag)
275inv
276( +0.31, -0.26)
277mul = matmul(mat, inv)
278mul
279( +1.00, +0.00)
280
281
282ndim = getUnifRand(1_IK, 6_IK)
283ndim ! matrix rank
284+1
285mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
286call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
287mat
288( +1.61, +1.26)
289call setResized(inv, shape(mat, IK))
290call setMatInv(inv, mat, upperDiag)
291inv
292( +0.39, -0.30)
293mul = matmul(mat, inv)
294mul
295( +1.00, +0.00)
296
297
298ndim = getUnifRand(1_IK, 6_IK)
299ndim ! matrix rank
300+2
301mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
302call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
303mat
304( +1.35, +1.60), ( +1.87, +1.77)
305( +0.00, +0.00), ( +1.42, +1.20)
306call setResized(inv, shape(mat, IK))
307call setMatInv(inv, mat, upperDiag)
308inv
309( +0.31, -0.36), ( -0.45, +0.48)
310( +0.00, +0.00), ( +0.41, -0.35)
311mul = matmul(mat, inv)
312mul
313( +1.00, +0.00), ( +0.00, -0.00)
314( +0.00, +0.00), ( +1.00, +0.00)
315
316
317ndim = getUnifRand(1_IK, 6_IK)
318ndim ! matrix rank
319+5
320mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
321call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
322mat
323( +1.52, +1.72), ( +1.59, +1.66), ( +1.27, +1.72), ( +1.84, +1.17), ( +1.82, +1.09)
324( +0.00, +0.00), ( +1.70, +1.45), ( +1.08, +1.77), ( +1.16, +1.75), ( +1.11, +1.45)
325( +0.00, +0.00), ( +0.00, +0.00), ( +1.41, +1.96), ( +1.22, +1.04), ( +1.12, +1.97)
326( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.34, +1.20), ( +1.71, +1.51)
327( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.38, +1.20)
328call setResized(inv, shape(mat, IK))
329call setMatInv(inv, mat, upperDiag)
330inv
331( +0.29, -0.33), ( -0.33, +0.30), ( +0.05, +0.05), ( +0.13, +0.15), ( -0.08, -0.08)
332( +0.00, +0.00), ( +0.34, -0.29), ( -0.31, +0.23), ( -0.20, +0.02), ( +0.31, +0.06)
333( +0.00, +0.00), ( +0.00, +0.00), ( +0.24, -0.34), ( -0.21, +0.30), ( -0.16, -0.08)
334( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.41, -0.37), ( -0.52, +0.46)
335( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.41, -0.36)
336mul = matmul(mat, inv)
337mul
338( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00)
339( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
340( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
341( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00)
342( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
343
344
345ndim = getUnifRand(1_IK, 6_IK)
346ndim ! matrix rank
347+1
348mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
349call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
350mat
351( +1.01, +1.05)
352call setResized(inv, shape(mat, IK))
353call setMatInv(inv, mat, upperDiag)
354inv
355( +0.48, -0.50)
356mul = matmul(mat, inv)
357mul
358( +1.00, +0.00)
359
360
361ndim = getUnifRand(1_IK, 6_IK)
362ndim ! matrix rank
363+1
364mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
365call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
366mat
367( +1.24, +1.55)
368call setResized(inv, shape(mat, IK))
369call setMatInv(inv, mat, upperDiag)
370inv
371( +0.31, -0.39)
372mul = matmul(mat, inv)
373mul
374( +1.00, +0.00)
375
376
377ndim = getUnifRand(1_IK, 6_IK)
378ndim ! matrix rank
379+6
380mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
381call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
382mat
383( +1.21, +1.81), ( +1.24, +1.08), ( +1.74, +1.67), ( +1.68, +1.36), ( +1.68, +1.82), ( +1.48, +1.24)
384( +0.00, +0.00), ( +1.46, +1.53), ( +1.52, +1.20), ( +1.09, +1.63), ( +1.70, +1.38), ( +1.22, +1.45)
385( +0.00, +0.00), ( +0.00, +0.00), ( +1.31, +1.66), ( +1.55, +1.03), ( +1.61, +1.21), ( +1.44, +1.64)
386( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.91, +1.66), ( +1.60, +1.93), ( +1.85, +1.55)
387( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.43, +1.08), ( +1.74, +1.62)
388( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.82, +1.40)
389call setResized(inv, shape(mat, IK))
390call setMatInv(inv, mat, upperDiag)
391inv
392( +0.26, -0.38), ( -0.17, +0.31), ( -0.15, +0.16), ( +0.08, +0.01), ( -0.16, -0.13), ( +0.20, +0.11)
393( +0.00, +0.00), ( +0.33, -0.34), ( -0.22, +0.37), ( -0.19, -0.11), ( +0.06, +0.19), ( +0.11, -0.17)
394( +0.00, +0.00), ( +0.00, +0.00), ( +0.29, -0.37), ( -0.18, +0.30), ( +0.01, +0.07), ( -0.14, -0.09)
395( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.30, -0.26), ( -0.49, +0.26), ( +0.20, +0.05)
396( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.45, -0.34), ( -0.49, +0.30)
397( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.35, -0.27)
398mul = matmul(mat, inv)
399mul
400( +1.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
401( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
402( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00)
403( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
404( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
405( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
406
407
408ndim = getUnifRand(1_IK, 6_IK)
409ndim ! matrix rank
410+4
411mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
412call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
413mat
414( +1.85, +1.11), ( +1.95, +1.50), ( +1.24, +1.55), ( +1.43, +1.41)
415( +0.00, +0.00), ( +1.62, +1.98), ( +1.00, +1.65), ( +1.79, +1.38)
416( +0.00, +0.00), ( +0.00, +0.00), ( +1.64, +1.13), ( +1.14, +1.87)
417( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.07, +1.06)
418call setResized(inv, shape(mat, IK))
419call setMatInv(inv, mat, upperDiag)
420inv
421( +0.40, -0.24), ( -0.32, +0.31), ( -0.04, -0.03), ( -0.06, -0.14)
422( +0.00, +0.00), ( +0.25, -0.30), ( -0.34, +0.17), ( +0.22, +0.38)
423( +0.00, +0.00), ( +0.00, +0.00), ( +0.41, -0.28), ( -0.68, +0.26)
424( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.47, -0.47)
425mul = matmul(mat, inv)
426mul
427( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00)
428( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00)
429( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00)
430( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
431
432
433ndim = getUnifRand(1_IK, 6_IK)
434ndim ! matrix rank
435+6
436mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
437call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
438mat
439( +1.24, +1.36), ( +1.39, +1.85), ( +1.38, +1.12), ( +1.90, +1.62), ( +1.92, +1.42), ( +1.14, +1.85)
440( +0.00, +0.00), ( +1.52, +1.43), ( +1.04, +1.28), ( +1.44, +1.90), ( +1.01, +1.47), ( +1.57, +1.81)
441( +0.00, +0.00), ( +0.00, +0.00), ( +1.22, +1.44), ( +1.82, +1.80), ( +1.90, +1.10), ( +1.17, +1.05)
442( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +2.00, +1.37), ( +1.62, +1.09), ( +1.75, +1.60)
443( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +1.52), ( +2.00, +1.69)
444( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.83, +1.81)
445call setResized(inv, shape(mat, IK))
446call setMatInv(inv, mat, upperDiag)
447inv
448( +0.37, -0.40), ( -0.48, +0.37), ( +0.15, +0.12), ( +0.00, +0.02), ( -0.05, +0.22), ( +0.02, -0.37)
449( +0.00, +0.00), ( +0.35, -0.33), ( -0.31, +0.28), ( -0.05, -0.04), ( -0.08, -0.13), ( -0.02, +0.25)
450( +0.00, +0.00), ( +0.00, +0.00), ( +0.34, -0.41), ( -0.43, +0.36), ( +0.13, +0.09), ( +0.05, -0.17)
451( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.34, -0.23), ( -0.24, +0.37), ( -0.09, -0.17)
452( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.30, -0.46), ( -0.27, +0.49)
453( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.28, -0.27)
454mul = matmul(mat, inv)
455mul
456( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00), ( -0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00)
457( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00)
458( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00)
459( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00)
460( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00)
461( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
462
463
464!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
465! Compute inverse of a lowerDiag triangular real matrix.
466!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
467
468
469ndim = getUnifRand(1_IK, 6_IK)
470ndim ! matrix rank
471+2
472mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
473call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
474mat
475 +9.00, +0.00
476 +2.00, +4.00
477call setResized(inv, shape(mat, IK))
478call setMatInv(inv, mat, lowerDiag)
479inv
480 +0.11, +0.00
481 -0.06, +0.25
482mul = matmul(mat, inv)
483mul
484 +1.00, +0.00
485 +0.00, +1.00
486
487
488ndim = getUnifRand(1_IK, 6_IK)
489ndim ! matrix rank
490+4
491mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
492call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
493mat
494 +4.00, +0.00, +0.00, +0.00
495 +6.00, +5.00, +0.00, +0.00
496 +5.00, +2.00, +6.00, +0.00
497 +4.00, +1.00, +6.00, +7.00
498call setResized(inv, shape(mat, IK))
499call setMatInv(inv, mat, lowerDiag)
500inv
501 +0.25, +0.00, +0.00, +0.00
502 -0.30, +0.20, +0.00, +0.00
503 -0.11, -0.07, +0.17, +0.00
504 -0.01, +0.03, -0.14, +0.14
505mul = matmul(mat, inv)
506mul
507 +1.00, +0.00, +0.00, +0.00
508 +0.00, +1.00, +0.00, +0.00
509 +0.00, -0.00, +1.00, +0.00
510 +0.00, +0.00, +0.00, +1.00
511
512
513ndim = getUnifRand(1_IK, 6_IK)
514ndim ! matrix rank
515+1
516mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
517call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
518mat
519 +2.00
520call setResized(inv, shape(mat, IK))
521call setMatInv(inv, mat, lowerDiag)
522inv
523 +0.50
524mul = matmul(mat, inv)
525mul
526 +1.00
527
528
529ndim = getUnifRand(1_IK, 6_IK)
530ndim ! matrix rank
531+3
532mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
533call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
534mat
535 +5.00, +0.00, +0.00
536 +4.00, +7.00, +0.00
537 +9.00, +5.00, +3.00
538call setResized(inv, shape(mat, IK))
539call setMatInv(inv, mat, lowerDiag)
540inv
541 +0.20, +0.00, +0.00
542 -0.11, +0.14, +0.00
543 -0.41, -0.24, +0.33
544mul = matmul(mat, inv)
545mul
546 +1.00, +0.00, +0.00
547 -0.00, +1.00, +0.00
548 +0.00, +0.00, +1.00
549
550
551ndim = getUnifRand(1_IK, 6_IK)
552ndim ! matrix rank
553+1
554mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
555call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
556mat
557 +6.00
558call setResized(inv, shape(mat, IK))
559call setMatInv(inv, mat, lowerDiag)
560inv
561 +0.17
562mul = matmul(mat, inv)
563mul
564 +1.00
565
566
567ndim = getUnifRand(1_IK, 6_IK)
568ndim ! matrix rank
569+2
570mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
571call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
572mat
573 +3.00, +0.00
574 +6.00, +8.00
575call setResized(inv, shape(mat, IK))
576call setMatInv(inv, mat, lowerDiag)
577inv
578 +0.33, +0.00
579 -0.25, +0.12
580mul = matmul(mat, inv)
581mul
582 +1.00, +0.00
583 +0.00, +1.00
584
585
586ndim = getUnifRand(1_IK, 6_IK)
587ndim ! matrix rank
588+1
589mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
590call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
591mat
592 +4.00
593call setResized(inv, shape(mat, IK))
594call setMatInv(inv, mat, lowerDiag)
595inv
596 +0.25
597mul = matmul(mat, inv)
598mul
599 +1.00
600
601
602ndim = getUnifRand(1_IK, 6_IK)
603ndim ! matrix rank
604+2
605mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
606call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
607mat
608 +9.00, +0.00
609 +1.00, +6.00
610call setResized(inv, shape(mat, IK))
611call setMatInv(inv, mat, lowerDiag)
612inv
613 +0.11, +0.00
614 -0.02, +0.17
615mul = matmul(mat, inv)
616mul
617 +1.00, +0.00
618 +0.00, +1.00
619
620
621ndim = getUnifRand(1_IK, 6_IK)
622ndim ! matrix rank
623+4
624mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
625call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
626mat
627 +2.00, +0.00, +0.00, +0.00
628 +5.00, +3.00, +0.00, +0.00
629 +8.00, +6.00, +1.00, +0.00
630 +4.00, +5.00, +3.00, +7.00
631call setResized(inv, shape(mat, IK))
632call setMatInv(inv, mat, lowerDiag)
633inv
634 +0.50, +0.00, +0.00, +0.00
635 -0.83, +0.33, +0.00, +0.00
636 +1.00, -2.00, +1.00, +0.00
637 -0.12, +0.62, -0.43, +0.14
638mul = matmul(mat, inv)
639mul
640 +1.00, +0.00, +0.00, +0.00
641 +0.00, +1.00, +0.00, +0.00
642 +0.00, +0.00, +1.00, +0.00
643 -0.00, +0.00, -0.00, +1.00
644
645
646ndim = getUnifRand(1_IK, 6_IK)
647ndim ! matrix rank
648+2
649mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
650call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
651mat
652 +5.00, +0.00
653 +5.00, +9.00
654call setResized(inv, shape(mat, IK))
655call setMatInv(inv, mat, lowerDiag)
656inv
657 +0.20, +0.00
658 -0.11, +0.11
659mul = matmul(mat, inv)
660mul
661 +1.00, +0.00
662 +0.00, +1.00
663
664
665!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
666! Compute inverse of a lowerDiag triangular complex matrix.
667!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
668
669
670ndim = getUnifRand(1_IK, 6_IK)
671ndim ! matrix rank
672+1
673mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
674call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
675mat
676( +1.11, +1.92)
677call setResized(inv, shape(mat, IK))
678call setMatInv(inv, mat, lowerDiag)
679inv
680( +0.22, -0.39)
681mul = matmul(mat, inv)
682mul
683( +1.00, +0.00)
684
685
686ndim = getUnifRand(1_IK, 6_IK)
687ndim ! matrix rank
688+1
689mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
690call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
691mat
692( +1.83, +1.51)
693call setResized(inv, shape(mat, IK))
694call setMatInv(inv, mat, lowerDiag)
695inv
696( +0.32, -0.27)
697mul = matmul(mat, inv)
698mul
699( +1.00, +0.00)
700
701
702ndim = getUnifRand(1_IK, 6_IK)
703ndim ! matrix rank
704+6
705mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
706call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
707mat
708( +1.33, +1.66), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
709( +1.73, +1.11), ( +1.15, +1.61), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
710( +1.79, +1.84), ( +1.41, +1.63), ( +1.22, +1.68), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
711( +1.93, +1.62), ( +1.68, +1.30), ( +1.44, +1.40), ( +1.25, +1.33), ( +0.00, +0.00), ( +0.00, +0.00)
712( +1.38, +1.76), ( +1.55, +1.03), ( +1.14, +1.10), ( +1.26, +1.15), ( +1.62, +1.94), ( +0.00, +0.00)
713( +1.92, +1.77), ( +1.70, +1.73), ( +1.38, +1.78), ( +1.18, +1.76), ( +1.94, +1.53), ( +1.81, +1.76)
714call setResized(inv, shape(mat, IK))
715call setMatInv(inv, mat, lowerDiag)
716inv
717( +0.29, -0.37), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
718( -0.14, +0.47), ( +0.29, -0.41), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
719( -0.19, +0.01), ( -0.27, +0.45), ( +0.28, -0.39), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
720( -0.06, -0.03), ( +0.01, +0.02), ( -0.29, +0.44), ( +0.38, -0.40), ( +0.00, +0.00), ( +0.00, +0.00)
721( -0.11, -0.05), ( +0.01, +0.04), ( +0.01, -0.06), ( -0.22, +0.30), ( +0.25, -0.30), ( +0.00, +0.00)
722( +0.18, +0.03), ( -0.01, -0.03), ( +0.02, +0.06), ( -0.20, -0.05), ( -0.22, +0.32), ( +0.28, -0.28)
723mul = matmul(mat, inv)
724mul
725( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
726( -0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
727( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
728( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
729( -0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
730( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, -0.00)
731
732
733ndim = getUnifRand(1_IK, 6_IK)
734ndim ! matrix rank
735+2
736mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
737call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
738mat
739( +1.19, +1.09), ( +0.00, +0.00)
740( +1.50, +1.06), ( +1.97, +1.03)
741call setResized(inv, shape(mat, IK))
742call setMatInv(inv, mat, lowerDiag)
743inv
744( +0.46, -0.42), ( +0.00, +0.00)
745( -0.42, +0.29), ( +0.40, -0.21)
746mul = matmul(mat, inv)
747mul
748( +1.00, +0.00), ( +0.00, +0.00)
749( +0.00, +0.00), ( +1.00, -0.00)
750
751
752ndim = getUnifRand(1_IK, 6_IK)
753ndim ! matrix rank
754+2
755mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
756call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
757mat
758( +1.70, +1.45), ( +0.00, +0.00)
759( +1.86, +1.93), ( +1.41, +1.57)
760call setResized(inv, shape(mat, IK))
761call setMatInv(inv, mat, lowerDiag)
762inv
763( +0.34, -0.29), ( +0.00, +0.00)
764( -0.42, +0.38), ( +0.32, -0.35)
765mul = matmul(mat, inv)
766mul
767( +1.00, +0.00), ( +0.00, +0.00)
768( +0.00, +0.00), ( +1.00, +0.00)
769
770
771ndim = getUnifRand(1_IK, 6_IK)
772ndim ! matrix rank
773+2
774mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
775call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
776mat
777( +1.70, +1.35), ( +0.00, +0.00)
778( +1.78, +1.51), ( +1.64, +1.63)
779call setResized(inv, shape(mat, IK))
780call setMatInv(inv, mat, lowerDiag)
781inv
782( +0.36, -0.29), ( +0.00, +0.00)
783( -0.34, +0.32), ( +0.31, -0.30)
784mul = matmul(mat, inv)
785mul
786( +1.00, +0.00), ( +0.00, +0.00)
787( +0.00, +0.00), ( +1.00, -0.00)
788
789
790ndim = getUnifRand(1_IK, 6_IK)
791ndim ! matrix rank
792+3
793mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
794call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
795mat
796( +1.96, +1.20), ( +0.00, +0.00), ( +0.00, +0.00)
797( +1.87, +1.57), ( +1.81, +1.64), ( +0.00, +0.00)
798( +1.16, +1.13), ( +1.57, +1.32), ( +1.66, +1.55)
799call setResized(inv, shape(mat, IK))
800call setMatInv(inv, mat, lowerDiag)
801inv
802( +0.37, -0.23), ( +0.00, +0.00), ( +0.00, +0.00)
803( -0.36, +0.24), ( +0.30, -0.27), ( +0.00, +0.00)
804( +0.05, -0.08), ( -0.26, +0.26), ( +0.32, -0.30)
805mul = matmul(mat, inv)
806mul
807( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
808( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00)
809( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00)
810
811
812ndim = getUnifRand(1_IK, 6_IK)
813ndim ! matrix rank
814+1
815mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
816call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
817mat
818( +1.65, +1.92)
819call setResized(inv, shape(mat, IK))
820call setMatInv(inv, mat, lowerDiag)
821inv
822( +0.26, -0.30)
823mul = matmul(mat, inv)
824mul
825( +1.00, +0.00)
826
827
828ndim = getUnifRand(1_IK, 6_IK)
829ndim ! matrix rank
830+1
831mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
832call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
833mat
834( +1.59, +1.97)
835call setResized(inv, shape(mat, IK))
836call setMatInv(inv, mat, lowerDiag)
837inv
838( +0.25, -0.31)
839mul = matmul(mat, inv)
840mul
841( +1.00, -0.00)
842
843
844ndim = getUnifRand(1_IK, 6_IK)
845ndim ! matrix rank
846+2
847mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
848call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
849mat
850( +1.01, +1.91), ( +0.00, +0.00)
851( +1.13, +1.04), ( +1.07, +1.38)
852call setResized(inv, shape(mat, IK))
853call setMatInv(inv, mat, lowerDiag)
854inv
855( +0.22, -0.41), ( +0.00, +0.00)
856( -0.13, +0.39), ( +0.35, -0.45)
857mul = matmul(mat, inv)
858mul
859( +1.00, -0.00), ( +0.00, +0.00)
860( +0.00, +0.00), ( +1.00, +0.00)
861
862
863!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
864! Compute inverse of a upperUnit triangular real matrix.
865!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
866
867
868ndim = getUnifRand(1_IK, 6_IK)
869ndim ! matrix rank
870+1
871mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
872call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
873mat
874 +1.00
875call setResized(inv, shape(mat, IK))
876call setMatInv(inv, mat, upperUnit)
877inv
878 +1.00
879mul = matmul(mat, inv)
880mul
881 +1.00
882
883
884ndim = getUnifRand(1_IK, 6_IK)
885ndim ! matrix rank
886+2
887mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
888call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
889mat
890 +1.00, +9.00
891 +0.00, +1.00
892call setResized(inv, shape(mat, IK))
893call setMatInv(inv, mat, upperUnit)
894inv
895 +1.00, -9.00
896 +0.00, +1.00
897mul = matmul(mat, inv)
898mul
899 +1.00, +0.00
900 +0.00, +1.00
901
902
903ndim = getUnifRand(1_IK, 6_IK)
904ndim ! matrix rank
905+2
906mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
907call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
908mat
909 +1.00, +2.00
910 +0.00, +1.00
911call setResized(inv, shape(mat, IK))
912call setMatInv(inv, mat, upperUnit)
913inv
914 +1.00, -2.00
915 +0.00, +1.00
916mul = matmul(mat, inv)
917mul
918 +1.00, +0.00
919 +0.00, +1.00
920
921
922ndim = getUnifRand(1_IK, 6_IK)
923ndim ! matrix rank
924+1
925mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
926call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
927mat
928 +1.00
929call setResized(inv, shape(mat, IK))
930call setMatInv(inv, mat, upperUnit)
931inv
932 +1.00
933mul = matmul(mat, inv)
934mul
935 +1.00
936
937
938ndim = getUnifRand(1_IK, 6_IK)
939ndim ! matrix rank
940+3
941mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
942call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
943mat
944 +1.00, +4.00, +9.00
945 +0.00, +1.00, +5.00
946 +0.00, +0.00, +1.00
947call setResized(inv, shape(mat, IK))
948call setMatInv(inv, mat, upperUnit)
949inv
950 +1.00, -4.00, +11.00
951 +0.00, +1.00, -5.00
952 +0.00, +0.00, +1.00
953mul = matmul(mat, inv)
954mul
955 +1.00, +0.00, +0.00
956 +0.00, +1.00, +0.00
957 +0.00, +0.00, +1.00
958
959
960ndim = getUnifRand(1_IK, 6_IK)
961ndim ! matrix rank
962+2
963mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
964call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
965mat
966 +1.00, +6.00
967 +0.00, +1.00
968call setResized(inv, shape(mat, IK))
969call setMatInv(inv, mat, upperUnit)
970inv
971 +1.00, -6.00
972 +0.00, +1.00
973mul = matmul(mat, inv)
974mul
975 +1.00, +0.00
976 +0.00, +1.00
977
978
979ndim = getUnifRand(1_IK, 6_IK)
980ndim ! matrix rank
981+3
982mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
983call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
984mat
985 +1.00, +3.00, +5.00
986 +0.00, +1.00, +8.00
987 +0.00, +0.00, +1.00
988call setResized(inv, shape(mat, IK))
989call setMatInv(inv, mat, upperUnit)
990inv
991 +1.00, -3.00, +19.00
992 +0.00, +1.00, -8.00
993 +0.00, +0.00, +1.00
994mul = matmul(mat, inv)
995mul
996 +1.00, +0.00, +0.00
997 +0.00, +1.00, +0.00
998 +0.00, +0.00, +1.00
999
1000
1001ndim = getUnifRand(1_IK, 6_IK)
1002ndim ! matrix rank
1003+5
1004mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1005call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1006mat
1007 +1.00, +5.00, +8.00, +5.00, +7.00
1008 +0.00, +1.00, +1.00, +7.00, +7.00
1009 +0.00, +0.00, +1.00, +7.00, +7.00
1010 +0.00, +0.00, +0.00, +1.00, +9.00
1011 +0.00, +0.00, +0.00, +0.00, +1.00
1012call setResized(inv, shape(mat, IK))
1013call setMatInv(inv, mat, upperUnit)
1014inv
1015 +1.00, -5.00, -3.00, +51.00, -410.00
1016 +0.00, +1.00, -1.00, -0.00, -0.00
1017 +0.00, +0.00, +1.00, -7.00, +56.00
1018 +0.00, +0.00, +0.00, +1.00, -9.00
1019 +0.00, +0.00, +0.00, +0.00, +1.00
1020mul = matmul(mat, inv)
1021mul
1022 +1.00, +0.00, +0.00, +0.00, +0.00
1023 +0.00, +1.00, +0.00, +0.00, +0.00
1024 +0.00, +0.00, +1.00, +0.00, +0.00
1025 +0.00, +0.00, +0.00, +1.00, +0.00
1026 +0.00, +0.00, +0.00, +0.00, +1.00
1027
1028
1029ndim = getUnifRand(1_IK, 6_IK)
1030ndim ! matrix rank
1031+6
1032mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1033call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1034mat
1035 +1.00, +7.00, +9.00, +6.00, +9.00, +6.00
1036 +0.00, +1.00, +6.00, +4.00, +2.00, +7.00
1037 +0.00, +0.00, +1.00, +9.00, +9.00, +4.00
1038 +0.00, +0.00, +0.00, +1.00, +7.00, +7.00
1039 +0.00, +0.00, +0.00, +0.00, +1.00, +1.00
1040 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1041call setResized(inv, shape(mat, IK))
1042call setMatInv(inv, mat, upperUnit)
1043inv
1044 +1.00, -7.00, +33.00, -275.00, +1633.00, +203.00
1045 +0.00, +1.00, -6.00, +50.00, -298.00, -35.00
1046 +0.00, +0.00, +1.00, -9.00, +54.00, +5.00
1047 +0.00, +0.00, +0.00, +1.00, -7.00, -0.00
1048 +0.00, +0.00, +0.00, +0.00, +1.00, -1.00
1049 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1050mul = matmul(mat, inv)
1051mul
1052 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1053 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
1054 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
1055 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
1056 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
1057 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1058
1059
1060ndim = getUnifRand(1_IK, 6_IK)
1061ndim ! matrix rank
1062+3
1063mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1064call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1065mat
1066 +1.00, +9.00, +9.00
1067 +0.00, +1.00, +2.00
1068 +0.00, +0.00, +1.00
1069call setResized(inv, shape(mat, IK))
1070call setMatInv(inv, mat, upperUnit)
1071inv
1072 +1.00, -9.00, +9.00
1073 +0.00, +1.00, -2.00
1074 +0.00, +0.00, +1.00
1075mul = matmul(mat, inv)
1076mul
1077 +1.00, +0.00, +0.00
1078 +0.00, +1.00, +0.00
1079 +0.00, +0.00, +1.00
1080
1081
1082!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1083! Compute inverse of a upperUnit triangular complex matrix.
1084!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1085
1086
1087ndim = getUnifRand(1_IK, 6_IK)
1088ndim ! matrix rank
1089+6
1090mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1091call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1092mat
1093( +1.00, +0.00), ( -0.90, +0.64), ( +0.91, -0.30), ( -0.46, -0.88), ( -0.27, +0.89), ( -0.53, -0.47)
1094( +0.00, +0.00), ( +1.00, +0.00), ( +0.86, +0.77), ( -0.61, +0.95), ( -0.04, -0.57), ( +0.83, +0.86)
1095( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.39, -0.06), ( +0.44, -0.99), ( +0.86, +0.23)
1096( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.41, -0.48), ( -0.73, +0.04)
1097( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.15, -0.76)
1098( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1099call setResized(inv, shape(mat, IK))
1100call setMatInv(inv, mat, upperUnit)
1101inv
1102( +1.00, +0.00), ( +0.90, -0.64), ( -2.18, +0.16), ( -0.46, -0.43), ( +1.86, -2.69), ( +3.13, +1.29)
1103( +0.00, +0.00), ( +1.00, +0.00), ( -0.86, -0.77), ( +0.32, -1.30), ( +1.68, +0.73), ( -0.38, +0.43)
1104( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.39, +0.06), ( -0.62, +1.16), ( -1.55, -0.50)
1105( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.41, +0.48), ( +0.30, -0.27)
1106( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.15, +0.76)
1107( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1108mul = matmul(mat, inv)
1109mul
1110( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00)
1111( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
1112( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1113( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1114( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1115( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1116
1117
1118ndim = getUnifRand(1_IK, 6_IK)
1119ndim ! matrix rank
1120+5
1121mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1122call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1123mat
1124( +1.00, +0.00), ( +0.89, +0.08), ( +0.06, +0.02), ( -0.88, -0.59), ( -0.35, +0.52)
1125( +0.00, +0.00), ( +1.00, +0.00), ( -0.80, +0.06), ( -0.18, +0.87), ( -0.15, +0.37)
1126( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.84, -0.13), ( -0.50, -0.46)
1127( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.91, +0.68)
1128( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1129call setResized(inv, shape(mat, IK))
1130call setMatInv(inv, mat, upperUnit)
1131inv
1132( +1.00, +0.00), ( -0.89, -0.08), ( -0.78, -0.02), ( +1.32, +1.26), ( -0.54, -2.62)
1133( +0.00, +0.00), ( +1.00, +0.00), ( +0.80, -0.06), ( -0.49, -0.71), ( +0.55, +0.95)
1134( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.84, +0.13), ( +1.36, +0.91)
1135( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.91, -0.68)
1136( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1137mul = matmul(mat, inv)
1138mul
1139( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00)
1140( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00)
1141( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1142( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1143( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1144
1145
1146ndim = getUnifRand(1_IK, 6_IK)
1147ndim ! matrix rank
1148+6
1149mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1150call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1151mat
1152( +1.00, +0.00), ( -0.72, +0.40), ( +0.07, +0.51), ( +0.12, +0.93), ( +0.68, +0.66), ( -0.38, -0.11)
1153( +0.00, +0.00), ( +1.00, +0.00), ( -0.80, -0.80), ( +0.92, -0.78), ( +0.15, +0.61), ( -0.17, -0.14)
1154( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.53, -0.32), ( -0.65, -0.67), ( -0.22, +0.33)
1155( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.76, -0.07), ( -0.57, +0.62)
1156( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.44, +0.85)
1157( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1158call setResized(inv, shape(mat, IK))
1159call setMatInv(inv, mat, upperUnit)
1160inv
1161( +1.00, +0.00), ( +0.72, -0.40), ( +0.83, -0.26), ( -0.84, +0.41), ( +0.28, -1.02), ( -0.31, -0.14)
1162( +0.00, +0.00), ( +1.00, +0.00), ( +0.80, +0.80), ( -1.60, +0.61), ( +1.01, -0.13), ( +0.42, +0.47)
1163( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.53, +0.32), ( +1.03, +0.39), ( +0.91, -0.53)
1164( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.76, +0.07), ( +0.29, +0.06)
1165( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.44, -0.85)
1166( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1167mul = matmul(mat, inv)
1168mul
1169( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( -0.00, -0.00)
1170( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
1171( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
1172( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1173( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1174( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1175
1176
1177ndim = getUnifRand(1_IK, 6_IK)
1178ndim ! matrix rank
1179+5
1180mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1181call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1182mat
1183( +1.00, +0.00), ( +0.00, +0.51), ( -0.34, +0.44), ( +0.93, -0.98), ( +0.87, -0.36)
1184( +0.00, +0.00), ( +1.00, +0.00), ( +0.30, +0.87), ( +0.39, -0.70), ( +0.79, +0.38)
1185( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.22, -0.66), ( -0.40, -0.32)
1186( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.04, +0.69)
1187( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1188call setResized(inv, shape(mat, IK))
1189call setMatInv(inv, mat, upperUnit)
1190inv
1191( +1.00, +0.00), ( -0.00, -0.51), ( -0.10, -0.28), ( -0.36, +1.17), ( -0.22, +0.91)
1192( +0.00, +0.00), ( +1.00, +0.00), ( -0.30, -0.87), ( +0.26, +0.70), ( -0.14, -0.98)
1193( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.22, +0.66), ( +0.85, +0.50)
1194( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.04, -0.69)
1195( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1196mul = matmul(mat, inv)
1197mul
1198( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
1199( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1200( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
1201( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1202( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1203
1204
1205ndim = getUnifRand(1_IK, 6_IK)
1206ndim ! matrix rank
1207+1
1208mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1209call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1210mat
1211( +1.00, +0.00)
1212call setResized(inv, shape(mat, IK))
1213call setMatInv(inv, mat, upperUnit)
1214inv
1215( +1.00, +0.00)
1216mul = matmul(mat, inv)
1217mul
1218( +1.00, +0.00)
1219
1220
1221ndim = getUnifRand(1_IK, 6_IK)
1222ndim ! matrix rank
1223+4
1224mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1225call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1226mat
1227( +1.00, +0.00), ( +0.08, +0.57), ( +0.93, -0.60), ( +0.26, -0.06)
1228( +0.00, +0.00), ( +1.00, +0.00), ( -0.38, +0.30), ( -0.36, -0.87)
1229( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.32, +0.21)
1230( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1231call setResized(inv, shape(mat, IK))
1232call setMatInv(inv, mat, upperUnit)
1233inv
1234( +1.00, +0.00), ( -0.08, -0.57), ( -1.13, +0.41), ( -0.06, +0.15)
1235( +0.00, +0.00), ( +1.00, +0.00), ( +0.38, -0.30), ( +0.42, +0.70)
1236( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.32, -0.21)
1237( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1238mul = matmul(mat, inv)
1239mul
1240( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
1241( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1242( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1243( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1244
1245
1246ndim = getUnifRand(1_IK, 6_IK)
1247ndim ! matrix rank
1248+2
1249mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1250call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1251mat
1252( +1.00, +0.00), ( +0.72, -0.80)
1253( +0.00, +0.00), ( +1.00, +0.00)
1254call setResized(inv, shape(mat, IK))
1255call setMatInv(inv, mat, upperUnit)
1256inv
1257( +1.00, +0.00), ( -0.72, +0.80)
1258( +0.00, +0.00), ( +1.00, +0.00)
1259mul = matmul(mat, inv)
1260mul
1261( +1.00, +0.00), ( +0.00, +0.00)
1262( +0.00, +0.00), ( +1.00, +0.00)
1263
1264
1265ndim = getUnifRand(1_IK, 6_IK)
1266ndim ! matrix rank
1267+5
1268mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1269call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1270mat
1271( +1.00, +0.00), ( +0.56, +0.68), ( +0.30, -0.20), ( -0.24, +0.58), ( +0.08, +0.24)
1272( +0.00, +0.00), ( +1.00, +0.00), ( -0.47, +0.53), ( -0.52, +0.41), ( -0.19, -0.81)
1273( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.17, +0.05), ( +0.85, +0.39)
1274( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.82, +0.91)
1275( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1276call setResized(inv, shape(mat, IK))
1277call setMatInv(inv, mat, upperUnit)
1278inv
1279( +1.00, +0.00), ( -0.56, -0.68), ( -0.93, +0.18), ( -0.48, -0.63), ( +0.26, -0.69)
1280( +0.00, +0.00), ( +1.00, +0.00), ( +0.47, -0.53), ( +0.57, -0.52), ( -0.43, +0.13)
1281( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.17, -0.05), ( -0.76, -0.58)
1282( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.82, -0.91)
1283( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1284mul = matmul(mat, inv)
1285mul
1286( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( -0.00, -0.00)
1287( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1288( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1289( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1290( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1291
1292
1293ndim = getUnifRand(1_IK, 6_IK)
1294ndim ! matrix rank
1295+4
1296mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1297call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1298mat
1299( +1.00, +0.00), ( +0.29, -0.20), ( +0.78, +0.90), ( +0.12, -0.05)
1300( +0.00, +0.00), ( +1.00, +0.00), ( +0.76, +0.42), ( -0.80, -0.38)
1301( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.81, +0.15)
1302( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1303call setResized(inv, shape(mat, IK))
1304call setMatInv(inv, mat, upperUnit)
1305inv
1306( +1.00, +0.00), ( -0.29, +0.20), ( -0.48, -0.93), ( -0.18, +0.93)
1307( +0.00, +0.00), ( +1.00, +0.00), ( -0.76, -0.42), ( +1.35, +0.83)
1308( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.81, -0.15)
1309( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1310mul = matmul(mat, inv)
1311mul
1312( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1313( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1314( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1315( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1316
1317
1318ndim = getUnifRand(1_IK, 6_IK)
1319ndim ! matrix rank
1320+3
1321mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1322call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1323mat
1324( +1.00, +0.00), ( -0.43, +0.31), ( +0.78, +0.34)
1325( +0.00, +0.00), ( +1.00, +0.00), ( +0.07, +0.21)
1326( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1327call setResized(inv, shape(mat, IK))
1328call setMatInv(inv, mat, upperUnit)
1329inv
1330( +1.00, +0.00), ( +0.43, -0.31), ( -0.88, -0.41)
1331( +0.00, +0.00), ( +1.00, +0.00), ( -0.07, -0.21)
1332( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1333mul = matmul(mat, inv)
1334mul
1335( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1336( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1337( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1338
1339
1340!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1341! Compute inverse of a lowerUnit triangular real matrix.
1342!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1343
1344
1345ndim = getUnifRand(1_IK, 6_IK)
1346ndim ! matrix rank
1347+3
1348mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1349call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1350mat
1351 +1.00, +0.00, +0.00
1352 +7.00, +1.00, +0.00
1353 +5.00, +2.00, +1.00
1354call setResized(inv, shape(mat, IK))
1355call setMatInv(inv, mat, lowerUnit)
1356inv
1357 +1.00, +0.00, +0.00
1358 -7.00, +1.00, +0.00
1359 +9.00, -2.00, +1.00
1360mul = matmul(mat, inv)
1361mul
1362 +1.00, +0.00, +0.00
1363 +0.00, +1.00, +0.00
1364 +0.00, +0.00, +1.00
1365
1366
1367ndim = getUnifRand(1_IK, 6_IK)
1368ndim ! matrix rank
1369+4
1370mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1371call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1372mat
1373 +1.00, +0.00, +0.00, +0.00
1374 +9.00, +1.00, +0.00, +0.00
1375 +9.00, +6.00, +1.00, +0.00
1376 +6.00, +4.00, +4.00, +1.00
1377call setResized(inv, shape(mat, IK))
1378call setMatInv(inv, mat, lowerUnit)
1379inv
1380 +1.00, +0.00, +0.00, +0.00
1381 -9.00, +1.00, +0.00, +0.00
1382 +45.00, -6.00, +1.00, +0.00
1383 -150.00, +20.00, -4.00, +1.00
1384mul = matmul(mat, inv)
1385mul
1386 +1.00, +0.00, +0.00, +0.00
1387 +0.00, +1.00, +0.00, +0.00
1388 +0.00, +0.00, +1.00, +0.00
1389 +0.00, +0.00, +0.00, +1.00
1390
1391
1392ndim = getUnifRand(1_IK, 6_IK)
1393ndim ! matrix rank
1394+3
1395mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1396call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1397mat
1398 +1.00, +0.00, +0.00
1399 +6.00, +1.00, +0.00
1400 +2.00, +4.00, +1.00
1401call setResized(inv, shape(mat, IK))
1402call setMatInv(inv, mat, lowerUnit)
1403inv
1404 +1.00, +0.00, +0.00
1405 -6.00, +1.00, +0.00
1406 +22.00, -4.00, +1.00
1407mul = matmul(mat, inv)
1408mul
1409 +1.00, +0.00, +0.00
1410 +0.00, +1.00, +0.00
1411 +0.00, +0.00, +1.00
1412
1413
1414ndim = getUnifRand(1_IK, 6_IK)
1415ndim ! matrix rank
1416+2
1417mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1418call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1419mat
1420 +1.00, +0.00
1421 +5.00, +1.00
1422call setResized(inv, shape(mat, IK))
1423call setMatInv(inv, mat, lowerUnit)
1424inv
1425 +1.00, +0.00
1426 -5.00, +1.00
1427mul = matmul(mat, inv)
1428mul
1429 +1.00, +0.00
1430 +0.00, +1.00
1431
1432
1433ndim = getUnifRand(1_IK, 6_IK)
1434ndim ! matrix rank
1435+1
1436mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1437call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1438mat
1439 +1.00
1440call setResized(inv, shape(mat, IK))
1441call setMatInv(inv, mat, lowerUnit)
1442inv
1443 +1.00
1444mul = matmul(mat, inv)
1445mul
1446 +1.00
1447
1448
1449ndim = getUnifRand(1_IK, 6_IK)
1450ndim ! matrix rank
1451+4
1452mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1453call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1454mat
1455 +1.00, +0.00, +0.00, +0.00
1456 +6.00, +1.00, +0.00, +0.00
1457 +9.00, +8.00, +1.00, +0.00
1458 +6.00, +9.00, +4.00, +1.00
1459call setResized(inv, shape(mat, IK))
1460call setMatInv(inv, mat, lowerUnit)
1461inv
1462 +1.00, +0.00, +0.00, +0.00
1463 -6.00, +1.00, +0.00, +0.00
1464 +39.00, -8.00, +1.00, +0.00
1465 -108.00, +23.00, -4.00, +1.00
1466mul = matmul(mat, inv)
1467mul
1468 +1.00, +0.00, +0.00, +0.00
1469 +0.00, +1.00, +0.00, +0.00
1470 +0.00, +0.00, +1.00, +0.00
1471 +0.00, +0.00, +0.00, +1.00
1472
1473
1474ndim = getUnifRand(1_IK, 6_IK)
1475ndim ! matrix rank
1476+2
1477mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1478call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1479mat
1480 +1.00, +0.00
1481 +7.00, +1.00
1482call setResized(inv, shape(mat, IK))
1483call setMatInv(inv, mat, lowerUnit)
1484inv
1485 +1.00, +0.00
1486 -7.00, +1.00
1487mul = matmul(mat, inv)
1488mul
1489 +1.00, +0.00
1490 +0.00, +1.00
1491
1492
1493ndim = getUnifRand(1_IK, 6_IK)
1494ndim ! matrix rank
1495+4
1496mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1497call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1498mat
1499 +1.00, +0.00, +0.00, +0.00
1500 +4.00, +1.00, +0.00, +0.00
1501 +3.00, +2.00, +1.00, +0.00
1502 +2.00, +8.00, +1.00, +1.00
1503call setResized(inv, shape(mat, IK))
1504call setMatInv(inv, mat, lowerUnit)
1505inv
1506 +1.00, +0.00, +0.00, +0.00
1507 -4.00, +1.00, +0.00, +0.00
1508 +5.00, -2.00, +1.00, +0.00
1509 +25.00, -6.00, -1.00, +1.00
1510mul = matmul(mat, inv)
1511mul
1512 +1.00, +0.00, +0.00, +0.00
1513 +0.00, +1.00, +0.00, +0.00
1514 +0.00, +0.00, +1.00, +0.00
1515 +0.00, +0.00, +0.00, +1.00
1516
1517
1518ndim = getUnifRand(1_IK, 6_IK)
1519ndim ! matrix rank
1520+2
1521mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1522call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1523mat
1524 +1.00, +0.00
1525 +2.00, +1.00
1526call setResized(inv, shape(mat, IK))
1527call setMatInv(inv, mat, lowerUnit)
1528inv
1529 +1.00, +0.00
1530 -2.00, +1.00
1531mul = matmul(mat, inv)
1532mul
1533 +1.00, +0.00
1534 +0.00, +1.00
1535
1536
1537ndim = getUnifRand(1_IK, 6_IK)
1538ndim ! matrix rank
1539+2
1540mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1541call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1542mat
1543 +1.00, +0.00
1544 +2.00, +1.00
1545call setResized(inv, shape(mat, IK))
1546call setMatInv(inv, mat, lowerUnit)
1547inv
1548 +1.00, +0.00
1549 -2.00, +1.00
1550mul = matmul(mat, inv)
1551mul
1552 +1.00, +0.00
1553 +0.00, +1.00
1554
1555
1556!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1557! Compute inverse of a lowerUnit triangular complex matrix.
1558!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1559
1560
1561ndim = getUnifRand(1_IK, 6_IK)
1562ndim ! matrix rank
1563+2
1564mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1565call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1566mat
1567( +1.00, +0.00), ( +0.00, +0.00)
1568( -0.25, +0.08), ( +1.00, +0.00)
1569call setResized(inv, shape(mat, IK))
1570call setMatInv(inv, mat, lowerUnit)
1571inv
1572( +1.00, +0.00), ( +0.00, +0.00)
1573( +0.25, -0.08), ( +1.00, +0.00)
1574mul = matmul(mat, inv)
1575mul
1576( +1.00, +0.00), ( +0.00, +0.00)
1577( +0.00, +0.00), ( +1.00, +0.00)
1578
1579
1580ndim = getUnifRand(1_IK, 6_IK)
1581ndim ! matrix rank
1582+5
1583mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1584call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1585mat
1586( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1587( +0.89, -0.85), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1588( -0.71, -0.07), ( +0.86, +0.67), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1589( +0.91, -0.44), ( +0.81, -0.25), ( -0.17, -0.61), ( +1.00, +0.00), ( +0.00, +0.00)
1590( -0.93, +0.52), ( -0.37, +0.70), ( -0.33, +0.09), ( +0.75, +0.93), ( +1.00, +0.00)
1591call setResized(inv, shape(mat, IK))
1592call setMatInv(inv, mat, lowerUnit)
1593inv
1594( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1595( -0.89, +0.85), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1596( +2.05, -0.07), ( -0.86, -0.67), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1597( -0.00, +0.77), ( -0.55, -0.39), ( +0.17, +0.61), ( +1.00, +0.00), ( +0.00, +0.00)
1598( +2.60, -0.37), ( +0.07, -0.04), ( +0.77, -0.71), ( -0.75, -0.93), ( +1.00, +0.00)
1599mul = matmul(mat, inv)
1600mul
1601( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1602( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1603( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1604( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1605( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1606
1607
1608ndim = getUnifRand(1_IK, 6_IK)
1609ndim ! matrix rank
1610+2
1611mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1612call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1613mat
1614( +1.00, +0.00), ( +0.00, +0.00)
1615( -0.73, -0.67), ( +1.00, +0.00)
1616call setResized(inv, shape(mat, IK))
1617call setMatInv(inv, mat, lowerUnit)
1618inv
1619( +1.00, +0.00), ( +0.00, +0.00)
1620( +0.73, +0.67), ( +1.00, +0.00)
1621mul = matmul(mat, inv)
1622mul
1623( +1.00, +0.00), ( +0.00, +0.00)
1624( +0.00, +0.00), ( +1.00, +0.00)
1625
1626
1627ndim = getUnifRand(1_IK, 6_IK)
1628ndim ! matrix rank
1629+6
1630mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1631call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1632mat
1633( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1634( +0.83, -0.65), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1635( +0.68, +0.59), ( +0.26, +0.03), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1636( -0.23, +0.46), ( -0.73, -0.67), ( -0.12, +0.06), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1637( -0.52, +0.86), ( -0.28, +0.53), ( -0.97, +0.25), ( -0.69, -0.96), ( +1.00, +0.00), ( +0.00, +0.00)
1638( +0.79, -0.97), ( -0.57, +0.03), ( +0.08, -0.50), ( +0.51, -0.20), ( +0.42, -0.80), ( +1.00, +0.00)
1639call setResized(inv, shape(mat, IK))
1640call setMatInv(inv, mat, lowerUnit)
1641inv
1642( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1643( -0.83, +0.65), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1644( -0.45, -0.74), ( -0.26, -0.03), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1645( -0.91, -0.59), ( +0.70, +0.68), ( +0.12, -0.06), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1646( -0.05, -2.12), ( -0.15, +0.64), ( +1.11, -0.18), ( +0.69, +0.96), ( +1.00, +0.00), ( +0.00, +0.00)
1647( +1.46, +2.16), ( -0.34, -0.75), ( -0.44, +1.52), ( -1.56, +0.35), ( -0.42, +0.80), ( +1.00, +0.00)
1648mul = matmul(mat, inv)
1649mul
1650( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1651( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1652( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1653( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1654( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1655( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1656
1657
1658ndim = getUnifRand(1_IK, 6_IK)
1659ndim ! matrix rank
1660+3
1661mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1662call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1663mat
1664( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1665( -0.69, -0.99), ( +1.00, +0.00), ( +0.00, +0.00)
1666( -0.70, -0.75), ( -0.61, -0.42), ( +1.00, +0.00)
1667call setResized(inv, shape(mat, IK))
1668call setMatInv(inv, mat, lowerUnit)
1669inv
1670( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1671( +0.69, +0.99), ( +1.00, +0.00), ( +0.00, +0.00)
1672( +0.71, +1.64), ( +0.61, +0.42), ( +1.00, +0.00)
1673mul = matmul(mat, inv)
1674mul
1675( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1676( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1677( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1678
1679
1680ndim = getUnifRand(1_IK, 6_IK)
1681ndim ! matrix rank
1682+2
1683mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1684call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1685mat
1686( +1.00, +0.00), ( +0.00, +0.00)
1687( -0.15, +0.92), ( +1.00, +0.00)
1688call setResized(inv, shape(mat, IK))
1689call setMatInv(inv, mat, lowerUnit)
1690inv
1691( +1.00, +0.00), ( +0.00, +0.00)
1692( +0.15, -0.92), ( +1.00, +0.00)
1693mul = matmul(mat, inv)
1694mul
1695( +1.00, +0.00), ( +0.00, +0.00)
1696( +0.00, +0.00), ( +1.00, +0.00)
1697
1698
1699ndim = getUnifRand(1_IK, 6_IK)
1700ndim ! matrix rank
1701+2
1702mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1703call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1704mat
1705( +1.00, +0.00), ( +0.00, +0.00)
1706( +0.72, +0.26), ( +1.00, +0.00)
1707call setResized(inv, shape(mat, IK))
1708call setMatInv(inv, mat, lowerUnit)
1709inv
1710( +1.00, +0.00), ( +0.00, +0.00)
1711( -0.72, -0.26), ( +1.00, +0.00)
1712mul = matmul(mat, inv)
1713mul
1714( +1.00, +0.00), ( +0.00, +0.00)
1715( +0.00, +0.00), ( +1.00, +0.00)
1716
1717
1718ndim = getUnifRand(1_IK, 6_IK)
1719ndim ! matrix rank
1720+1
1721mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1722call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1723mat
1724( +1.00, +0.00)
1725call setResized(inv, shape(mat, IK))
1726call setMatInv(inv, mat, lowerUnit)
1727inv
1728( +1.00, +0.00)
1729mul = matmul(mat, inv)
1730mul
1731( +1.00, +0.00)
1732
1733
1734ndim = getUnifRand(1_IK, 6_IK)
1735ndim ! matrix rank
1736+3
1737mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1738call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1739mat
1740( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1741( +0.86, +0.50), ( +1.00, +0.00), ( +0.00, +0.00)
1742( +0.56, +0.92), ( +0.16, -0.14), ( +1.00, +0.00)
1743call setResized(inv, shape(mat, IK))
1744call setMatInv(inv, mat, lowerUnit)
1745inv
1746( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1747( -0.86, -0.50), ( +1.00, +0.00), ( +0.00, +0.00)
1748( -0.35, -0.96), ( -0.16, +0.14), ( +1.00, +0.00)
1749mul = matmul(mat, inv)
1750mul
1751( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1752( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1753( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1754
1755
1756ndim = getUnifRand(1_IK, 6_IK)
1757ndim ! matrix rank
1758+6
1759mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1760call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1761mat
1762( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1763( -0.12, -0.09), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1764( -0.82, +0.26), ( +0.41, -0.99), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1765( -0.57, +0.69), ( +0.77, +0.43), ( -0.45, +0.44), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1766( +0.77, -0.42), ( +0.37, -0.81), ( +0.33, +0.69), ( -0.38, -0.34), ( +1.00, +0.00), ( +0.00, +0.00)
1767( +0.09, +0.68), ( +0.83, +0.06), ( +0.65, +0.12), ( +0.08, -0.06), ( +0.94, -0.59), ( +1.00, +0.00)
1768call setResized(inv, shape(mat, IK))
1769call setMatInv(inv, mat, lowerUnit)
1770inv
1771( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1772( +0.12, +0.09), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1773( +0.68, -0.17), ( -0.41, +0.99), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1774( +0.74, -1.19), ( -0.52, +0.19), ( +0.45, -0.44), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1775( -0.54, -0.13), ( +0.19, +0.66), ( -0.01, -0.71), ( +0.38, +0.34), ( +1.00, +0.00), ( +0.00, +0.00)
1776( -0.04, -0.79), ( -0.99, -1.21), ( -0.23, +0.61), ( -0.64, -0.03), ( -0.94, +0.59), ( +1.00, +0.00)
1777mul = matmul(mat, inv)
1778mul
1779( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1780( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1781( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1782( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1783( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1784( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1785
1786
1787!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1788! Compute inverse of a general real matrix by passing its LUP factorization.
1789!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1790
1791
1792mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1793mat
1794 +1.00, +0.00, +2.00
1795 -1.00, +5.00, +0.00
1796 +0.00, +3.00, -9.00
1797call setResized(rperm, size(mat, 1, IK))
1798lup = mat
1799lup
1800 +1.00, +0.00, +2.00
1801 -1.00, +5.00, +0.00
1802 +0.00, +3.00, -9.00
1803call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1804if (info /= 0) error stop 'LUP factorization failed.'
1805lup
1806 +1.00, +0.00, +2.00
1807 -1.00, +5.00, +2.00
1808 +0.00, +0.60, -10.20
1809call setResized(inv, shape(mat, IK))
1810call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1811inv
1812 +0.88, -0.12, +0.20
1813 +0.18, +0.18, +0.04
1814 +0.06, +0.06, -0.10
1815mul = matmul(mat, inv)
1816mul
1817 +1.00, +0.00, +0.00
1818 +0.00, +1.00, +0.00
1819 +0.00, +0.00, +1.00
1820
1821
1822mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1823mat
1824 +1.00, +0.00, +2.00
1825 -1.00, +5.00, +0.00
1826 +0.00, +3.00, -9.00
1827call setResized(rperm, size(mat, 1, IK))
1828lup = mat
1829lup
1830 +1.00, +0.00, +2.00
1831 -1.00, +5.00, +0.00
1832 +0.00, +3.00, -9.00
1833call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1834if (info /= 0) error stop 'LUP factorization failed.'
1835lup
1836 +1.00, +0.00, +2.00
1837 -1.00, +5.00, +2.00
1838 +0.00, +0.60, -10.20
1839call setResized(inv, shape(mat, IK))
1840call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1841inv
1842 +0.88, -0.12, +0.20
1843 +0.18, +0.18, +0.04
1844 +0.06, +0.06, -0.10
1845mul = matmul(mat, inv)
1846mul
1847 +1.00, +0.00, +0.00
1848 +0.00, +1.00, +0.00
1849 +0.00, +0.00, +1.00
1850
1851
1852mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1853mat
1854 +1.00, +0.00, +2.00
1855 -1.00, +5.00, +0.00
1856 +0.00, +3.00, -9.00
1857call setResized(rperm, size(mat, 1, IK))
1858lup = mat
1859lup
1860 +1.00, +0.00, +2.00
1861 -1.00, +5.00, +0.00
1862 +0.00, +3.00, -9.00
1863call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1864if (info /= 0) error stop 'LUP factorization failed.'
1865lup
1866 +1.00, +0.00, +2.00
1867 -1.00, +5.00, +2.00
1868 +0.00, +0.60, -10.20
1869call setResized(inv, shape(mat, IK))
1870call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1871inv
1872 +0.88, -0.12, +0.20
1873 +0.18, +0.18, +0.04
1874 +0.06, +0.06, -0.10
1875mul = matmul(mat, inv)
1876mul
1877 +1.00, +0.00, +0.00
1878 +0.00, +1.00, +0.00
1879 +0.00, +0.00, +1.00
1880
1881
1882mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1883mat
1884 +1.00, +0.00, +2.00
1885 -1.00, +5.00, +0.00
1886 +0.00, +3.00, -9.00
1887call setResized(rperm, size(mat, 1, IK))
1888lup = mat
1889lup
1890 +1.00, +0.00, +2.00
1891 -1.00, +5.00, +0.00
1892 +0.00, +3.00, -9.00
1893call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1894if (info /= 0) error stop 'LUP factorization failed.'
1895lup
1896 +1.00, +0.00, +2.00
1897 -1.00, +5.00, +2.00
1898 +0.00, +0.60, -10.20
1899call setResized(inv, shape(mat, IK))
1900call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1901inv
1902 +0.88, -0.12, +0.20
1903 +0.18, +0.18, +0.04
1904 +0.06, +0.06, -0.10
1905mul = matmul(mat, inv)
1906mul
1907 +1.00, +0.00, +0.00
1908 +0.00, +1.00, +0.00
1909 +0.00, +0.00, +1.00
1910
1911
1912mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1913mat
1914 +1.00, +0.00, +2.00
1915 -1.00, +5.00, +0.00
1916 +0.00, +3.00, -9.00
1917call setResized(rperm, size(mat, 1, IK))
1918lup = mat
1919lup
1920 +1.00, +0.00, +2.00
1921 -1.00, +5.00, +0.00
1922 +0.00, +3.00, -9.00
1923call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1924if (info /= 0) error stop 'LUP factorization failed.'
1925lup
1926 +1.00, +0.00, +2.00
1927 -1.00, +5.00, +2.00
1928 +0.00, +0.60, -10.20
1929call setResized(inv, shape(mat, IK))
1930call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1931inv
1932 +0.88, -0.12, +0.20
1933 +0.18, +0.18, +0.04
1934 +0.06, +0.06, -0.10
1935mul = matmul(mat, inv)
1936mul
1937 +1.00, +0.00, +0.00
1938 +0.00, +1.00, +0.00
1939 +0.00, +0.00, +1.00
1940
1941
1942mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1943mat
1944 +1.00, +0.00, +2.00
1945 -1.00, +5.00, +0.00
1946 +0.00, +3.00, -9.00
1947call setResized(rperm, size(mat, 1, IK))
1948lup = mat
1949lup
1950 +1.00, +0.00, +2.00
1951 -1.00, +5.00, +0.00
1952 +0.00, +3.00, -9.00
1953call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1954if (info /= 0) error stop 'LUP factorization failed.'
1955lup
1956 +1.00, +0.00, +2.00
1957 -1.00, +5.00, +2.00
1958 +0.00, +0.60, -10.20
1959call setResized(inv, shape(mat, IK))
1960call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1961inv
1962 +0.88, -0.12, +0.20
1963 +0.18, +0.18, +0.04
1964 +0.06, +0.06, -0.10
1965mul = matmul(mat, inv)
1966mul
1967 +1.00, +0.00, +0.00
1968 +0.00, +1.00, +0.00
1969 +0.00, +0.00, +1.00
1970
1971
1972mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1973mat
1974 +1.00, +0.00, +2.00
1975 -1.00, +5.00, +0.00
1976 +0.00, +3.00, -9.00
1977call setResized(rperm, size(mat, 1, IK))
1978lup = mat
1979lup
1980 +1.00, +0.00, +2.00
1981 -1.00, +5.00, +0.00
1982 +0.00, +3.00, -9.00
1983call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1984if (info /= 0) error stop 'LUP factorization failed.'
1985lup
1986 +1.00, +0.00, +2.00
1987 -1.00, +5.00, +2.00
1988 +0.00, +0.60, -10.20
1989call setResized(inv, shape(mat, IK))
1990call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1991inv
1992 +0.88, -0.12, +0.20
1993 +0.18, +0.18, +0.04
1994 +0.06, +0.06, -0.10
1995mul = matmul(mat, inv)
1996mul
1997 +1.00, +0.00, +0.00
1998 +0.00, +1.00, +0.00
1999 +0.00, +0.00, +1.00
2000
2001
2002mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2003mat
2004 +1.00, +0.00, +2.00
2005 -1.00, +5.00, +0.00
2006 +0.00, +3.00, -9.00
2007call setResized(rperm, size(mat, 1, IK))
2008lup = mat
2009lup
2010 +1.00, +0.00, +2.00
2011 -1.00, +5.00, +0.00
2012 +0.00, +3.00, -9.00
2013call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2014if (info /= 0) error stop 'LUP factorization failed.'
2015lup
2016 +1.00, +0.00, +2.00
2017 -1.00, +5.00, +2.00
2018 +0.00, +0.60, -10.20
2019call setResized(inv, shape(mat, IK))
2020call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2021inv
2022 +0.88, -0.12, +0.20
2023 +0.18, +0.18, +0.04
2024 +0.06, +0.06, -0.10
2025mul = matmul(mat, inv)
2026mul
2027 +1.00, +0.00, +0.00
2028 +0.00, +1.00, +0.00
2029 +0.00, +0.00, +1.00
2030
2031
2032mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2033mat
2034 +1.00, +0.00, +2.00
2035 -1.00, +5.00, +0.00
2036 +0.00, +3.00, -9.00
2037call setResized(rperm, size(mat, 1, IK))
2038lup = mat
2039lup
2040 +1.00, +0.00, +2.00
2041 -1.00, +5.00, +0.00
2042 +0.00, +3.00, -9.00
2043call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2044if (info /= 0) error stop 'LUP factorization failed.'
2045lup
2046 +1.00, +0.00, +2.00
2047 -1.00, +5.00, +2.00
2048 +0.00, +0.60, -10.20
2049call setResized(inv, shape(mat, IK))
2050call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2051inv
2052 +0.88, -0.12, +0.20
2053 +0.18, +0.18, +0.04
2054 +0.06, +0.06, -0.10
2055mul = matmul(mat, inv)
2056mul
2057 +1.00, +0.00, +0.00
2058 +0.00, +1.00, +0.00
2059 +0.00, +0.00, +1.00
2060
2061
2062mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2063mat
2064 +1.00, +0.00, +2.00
2065 -1.00, +5.00, +0.00
2066 +0.00, +3.00, -9.00
2067call setResized(rperm, size(mat, 1, IK))
2068lup = mat
2069lup
2070 +1.00, +0.00, +2.00
2071 -1.00, +5.00, +0.00
2072 +0.00, +3.00, -9.00
2073call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2074if (info /= 0) error stop 'LUP factorization failed.'
2075lup
2076 +1.00, +0.00, +2.00
2077 -1.00, +5.00, +2.00
2078 +0.00, +0.60, -10.20
2079call setResized(inv, shape(mat, IK))
2080call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2081inv
2082 +0.88, -0.12, +0.20
2083 +0.18, +0.18, +0.04
2084 +0.06, +0.06, -0.10
2085mul = matmul(mat, inv)
2086mul
2087 +1.00, +0.00, +0.00
2088 +0.00, +1.00, +0.00
2089 +0.00, +0.00, +1.00
2090
2091
2092!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2093! Compute inverse of a general complex matrix by passing its LUP factorization.
2094!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2095
2096
2097call setResized(rperm, size(mat, 1, IK))
2098lup = mat
2099lup
2100( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00), ( +3.20, -1.00), ( +3.60, -1.00), ( +4.00, -1.00), ( +4.40, -1.00), ( +4.80, -1.00), ( +5.20, -1.00)
2101( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00), ( +3.20, -1.00), ( +3.60, -1.00), ( +4.00, -1.00), ( +4.40, -1.00), ( +4.80, -1.00)
2102( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00), ( +3.20, -1.00), ( +3.60, -1.00), ( +4.00, -1.00), ( +4.40, -1.00)
2103( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00), ( +3.20, -1.00), ( +3.60, -1.00), ( +4.00, -1.00)
2104( +3.60, +1.00), ( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00), ( +3.20, -1.00), ( +3.60, -1.00)
2105( +4.00, +1.00), ( +3.60, +1.00), ( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00), ( +3.20, -1.00)
2106( +4.40, +1.00), ( +4.00, +1.00), ( +3.60, +1.00), ( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00), ( +2.80, -1.00)
2107( +4.80, +1.00), ( +4.40, +1.00), ( +4.00, +1.00), ( +3.60, +1.00), ( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00), ( +2.40, -1.00)
2108( +5.20, +1.00), ( +4.80, +1.00), ( +4.40, +1.00), ( +4.00, +1.00), ( +3.60, +1.00), ( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00)
2109call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2110if (info /= 0) error stop 'LUP factorization failed.'
2111lup
2112( +5.20, +1.00), ( +4.80, +1.00), ( +4.40, +1.00), ( +4.00, +1.00), ( +3.60, +1.00), ( +3.20, +1.00), ( +2.80, +1.00), ( +2.40, +1.00), ( +2.00, +1.00)
2113( +0.41, +0.11), ( +0.56, -1.95), ( +1.13, -1.91), ( +1.69, -1.86), ( +2.25, -1.82), ( +2.81, -1.77), ( +3.38, -1.73), ( +3.94, -1.68), ( +4.50, -1.63)
2114( +0.48, +0.10), ( -0.05, -0.09), ( +0.61, -1.91), ( +1.23, -1.81), ( +1.84, -1.72), ( +2.46, -1.62), ( +3.07, -1.53), ( +3.69, -1.43), ( +4.30, -1.34)
2115( +0.55, +0.09), ( -0.04, -0.08), ( -0.06, -0.06), ( +0.67, -1.87), ( +1.35, -1.75), ( +2.02, -1.62), ( +2.69, -1.50), ( +3.37, -1.37), ( +4.04, -1.25)
2116( +0.63, +0.07), ( -0.03, -0.07), ( -0.05, -0.05), ( -0.07, -0.03), ( +0.74, -1.87), ( +1.47, -1.73), ( +2.21, -1.60), ( +2.94, -1.46), ( +3.68, -1.33)
2117( +0.70, +0.06), ( -0.03, -0.05), ( -0.04, -0.04), ( -0.05, -0.03), ( -0.06, -0.00), ( +0.79, -1.88), ( +1.58, -1.76), ( +2.38, -1.64), ( +3.17, -1.53)
2118( +0.78, +0.04), ( -0.02, -0.04), ( -0.03, -0.03), ( -0.04, -0.02), ( -0.04, -0.00), ( -0.04, +0.01), ( +0.83, -1.92), ( +1.66, -1.83), ( +2.49, -1.75)
2119( +0.85, +0.03), ( -0.01, -0.03), ( -0.02, -0.02), ( -0.03, -0.01), ( -0.03, -0.00), ( -0.03, +0.01), ( -0.02, +0.02), ( +0.84, -1.96), ( +1.68, -1.92)
2120( +0.93, +0.01), ( -0.01, -0.01), ( -0.01, -0.01), ( -0.01, -0.01), ( -0.01, -0.00), ( -0.01, +0.00), ( -0.01, +0.01), ( -0.01, +0.01), ( +0.82, -1.99)
2121call setMatInv(inv, lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2122inv
2123( -0.17, -0.42), ( -0.12, +0.13), ( -0.06, +0.15), ( +0.00, +0.15), ( +0.05, +0.13), ( +0.09, +0.09), ( +0.11, +0.05), ( +0.11, +0.00), ( +0.04, -0.28)
2124( +0.18, +0.43), ( -0.04, -0.55), ( -0.06, -0.03), ( -0.06, -0.01), ( -0.05, +0.01), ( -0.04, +0.03), ( -0.03, +0.04), ( -0.01, +0.04), ( +0.11, +0.00)
2125( +0.01, +0.00), ( +0.18, +0.43), ( -0.04, -0.55), ( -0.06, -0.03), ( -0.06, -0.01), ( -0.05, +0.01), ( -0.04, +0.03), ( -0.03, +0.04), ( +0.11, +0.05)
2126( +0.01, +0.00), ( +0.01, +0.00), ( +0.18, +0.43), ( -0.04, -0.55), ( -0.06, -0.03), ( -0.06, -0.01), ( -0.05, +0.01), ( -0.04, +0.03), ( +0.09, +0.09)
2127( +0.00, +0.01), ( +0.01, +0.00), ( +0.01, +0.00), ( +0.18, +0.43), ( -0.04, -0.55), ( -0.06, -0.03), ( -0.06, -0.01), ( -0.05, +0.01), ( +0.05, +0.13)
2128( +0.00, +0.01), ( +0.00, +0.01), ( +0.01, +0.00), ( +0.01, +0.00), ( +0.18, +0.43), ( -0.04, -0.55), ( -0.06, -0.03), ( -0.06, -0.01), ( +0.00, +0.15)
2129( +0.00, +0.01), ( +0.00, +0.01), ( +0.00, +0.01), ( +0.01, +0.00), ( +0.01, +0.00), ( +0.18, +0.43), ( -0.04, -0.55), ( -0.06, -0.03), ( -0.06, +0.15)
2130( -0.00, +0.01), ( +0.00, +0.01), ( +0.00, +0.01), ( +0.00, +0.01), ( +0.01, +0.00), ( +0.01, +0.00), ( +0.18, +0.43), ( -0.04, -0.55), ( -0.12, +0.13)
2131( -0.01, +0.01), ( -0.00, +0.01), ( +0.00, +0.01), ( +0.00, +0.01), ( +0.00, +0.01), ( +0.01, +0.00), ( +0.01, +0.00), ( +0.18, +0.43), ( -0.17, -0.42)
2132mul = matmul(mat, inv)
2133mul
2134( +1.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00)
2135( -0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( -0.00, +0.00)
2136( -0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00)
2137( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( +1.00, -0.00), ( -0.00, -0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
2138( -0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( -0.00, -0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
2139( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
2140( +0.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00)
2141( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( -0.00, -0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00)
2142( -0.00, -0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
2143
2144
2145!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2146! Compute the inverse of a positive-definite real matrix by passing its Cholesky factorization.
2147!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2148
2149
2150ndim = getUnifRand(1_IK, 6_IK)
2151ndim ! matrix rank
2152+4
2153mat = getCovRand(mold = 1._TKG, ndim = ndim)
2154mat
2155 +1.00, -0.91, +0.82, +0.33
2156 -0.91, +1.00, -0.93, -0.46
2157 +0.82, -0.93, +1.00, +0.14
2158 +0.33, -0.46, +0.14, +1.00
2159chol = getMatChol(mat, subset = lowDia)
2160chol
2161 +1.00, +0.00, +0.00, +0.00
2162 -0.91, +0.41, +0.00, +0.00
2163 +0.82, -0.45, +0.37, +0.00
2164 +0.33, -0.39, -0.83, +0.21
2165call setResized(inv, shape(mat, IK))
2166call setMatInv(inv, chol, auxil = choLow)
2167inv
2168 +25.49, +79.28, +49.81, +21.28
2169 +79.28, +285.91, +189.55, +79.55
2170 +49.81, +189.55, +128.85, +53.21
2171 +21.28, +79.55, +53.21, +23.32
2172mul = matmul(mat, inv)
2173mul
2174 +1.00, +0.00, +0.00, -0.00
2175 +0.00, +1.00, -0.00, +0.00
2176 -0.00, -0.00, +1.00, -0.00
2177 -0.00, +0.00, +0.00, +1.00
2178
2179
2180ndim = getUnifRand(1_IK, 6_IK)
2181ndim ! matrix rank
2182+4
2183mat = getCovRand(mold = 1._TKG, ndim = ndim)
2184mat
2185 +1.00, +0.08, +0.25, -0.49
2186 +0.08, +1.00, -0.88, -0.76
2187 +0.25, -0.88, +1.00, +0.57
2188 -0.49, -0.76, +0.57, +1.00
2189chol = getMatChol(mat, subset = lowDia)
2190chol
2191 +1.00, +0.00, +0.00, +0.00
2192 +0.08, +1.00, +0.00, +0.00
2193 +0.25, -0.90, +0.36, +0.00
2194 -0.49, -0.72, +0.13, +0.48
2195call setResized(inv, shape(mat, IK))
2196call setMatInv(inv, chol, auxil = choLow)
2197inv
2198 +3.11, -1.37, -3.36, +2.39
2199 -1.37, +7.94, +6.32, +1.72
2200 -3.36, +6.32, +8.30, -1.60
2201 +2.39, +1.72, -1.60, +4.37
2202mul = matmul(mat, inv)
2203mul
2204 +1.00, +0.00, +0.00, +0.00
2205 -0.00, +1.00, +0.00, +0.00
2206 +0.00, +0.00, +1.00, +0.00
2207 +0.00, +0.00, -0.00, +1.00
2208
2209
2210ndim = getUnifRand(1_IK, 6_IK)
2211ndim ! matrix rank
2212+1
2213mat = getCovRand(mold = 1._TKG, ndim = ndim)
2214mat
2215 +1.00
2216chol = getMatChol(mat, subset = lowDia)
2217chol
2218 +1.00
2219call setResized(inv, shape(mat, IK))
2220call setMatInv(inv, chol, auxil = choLow)
2221inv
2222 +1.00
2223mul = matmul(mat, inv)
2224mul
2225 +1.00
2226
2227
2228ndim = getUnifRand(1_IK, 6_IK)
2229ndim ! matrix rank
2230+4
2231mat = getCovRand(mold = 1._TKG, ndim = ndim)
2232mat
2233 +1.00, +0.24, +0.60, +0.39
2234 +0.24, +1.00, +0.83, +0.64
2235 +0.60, +0.83, +1.00, +0.79
2236 +0.39, +0.64, +0.79, +1.00
2237chol = getMatChol(mat, subset = lowDia)
2238chol
2239 +1.00, +0.00, +0.00, +0.00
2240 +0.24, +0.97, +0.00, +0.00
2241 +0.60, +0.71, +0.37, +0.00
2242 +0.39, +0.56, +0.42, +0.60
2243call setResized(inv, shape(mat, IK))
2244call setMatInv(inv, chol, auxil = choLow)
2245inv
2246 +2.50, +2.16, -3.79, +0.64
2247 +2.16, +5.14, -6.13, +0.72
2248 -3.79, -6.13, +10.85, -3.16
2249 +0.64, +0.72, -3.16, +2.78
2250mul = matmul(mat, inv)
2251mul
2252 +1.00, +0.00, -0.00, +0.00
2253 +0.00, +1.00, -0.00, +0.00
2254 +0.00, +0.00, +1.00, +0.00
2255 +0.00, +0.00, -0.00, +1.00
2256
2257
2258ndim = getUnifRand(1_IK, 6_IK)
2259ndim ! matrix rank
2260+3
2261mat = getCovRand(mold = 1._TKG, ndim = ndim)
2262mat
2263 +1.00, +0.82, +0.76
2264 +0.82, +1.00, +0.94
2265 +0.76, +0.94, +1.00
2266chol = getMatChol(mat, subset = lowDia)
2267chol
2268 +1.00, +0.00, +0.00
2269 +0.82, +0.57, +0.00
2270 +0.76, +0.56, +0.33
2271call setResized(inv, shape(mat, IK))
2272call setMatInv(inv, chol, auxil = choLow)
2273inv
2274 +3.09, -2.88, +0.37
2275 -2.88, +11.63, -8.77
2276 +0.37, -8.77, +8.99
2277mul = matmul(mat, inv)
2278mul
2279 +1.00, +0.00, +0.00
2280 +0.00, +1.00, +0.00
2281 +0.00, +0.00, +1.00
2282
2283
2284ndim = getUnifRand(1_IK, 6_IK)
2285ndim ! matrix rank
2286+4
2287mat = getCovRand(mold = 1._TKG, ndim = ndim)
2288mat
2289 +1.00, -0.53, -0.80, -0.74
2290 -0.53, +1.00, +0.07, +0.87
2291 -0.80, +0.07, +1.00, +0.21
2292 -0.74, +0.87, +0.21, +1.00
2293chol = getMatChol(mat, subset = lowDia)
2294chol
2295 +1.00, +0.00, +0.00, +0.00
2296 -0.53, +0.85, +0.00, +0.00
2297 -0.80, -0.42, +0.43, +0.00
2298 -0.74, +0.56, -0.37, +0.00
2299call setResized(inv, shape(mat, IK))
2300call setMatInv(inv, chol, auxil = choLow)
2301inv
2302+1198849.75, -216577.14, +786819.25, +915451.44
2303 -216577.14, +39129.80, -142141.64, -165383.86
2304 +786819.25, -142141.64, +516399.94, +600821.00
2305 +915451.44, -165383.86, +600821.00, +699050.62
2306mul = matmul(mat, inv)
2307mul
2308 +0.94, -0.01, -0.12, -0.03
2309 +0.06, +0.98, +0.09, +0.06
2310 -0.03, +0.01, +1.02, +0.00
2311 +0.00, +0.02, +0.06, +1.00
2312
2313
2314ndim = getUnifRand(1_IK, 6_IK)
2315ndim ! matrix rank
2316+3
2317mat = getCovRand(mold = 1._TKG, ndim = ndim)
2318mat
2319 +1.00, +0.72, -0.21
2320 +0.72, +1.00, +0.25
2321 -0.21, +0.25, +1.00
2322chol = getMatChol(mat, subset = lowDia)
2323chol
2324 +1.00, +0.00, +0.00
2325 +0.72, +0.70, +0.00
2326 -0.21, +0.57, +0.80
2327call setResized(inv, shape(mat, IK))
2328call setMatInv(inv, chol, auxil = choLow)
2329inv
2330 +3.03, -2.48, +1.25
2331 -2.48, +3.09, -1.28
2332 +1.25, -1.28, +1.58
2333mul = matmul(mat, inv)
2334mul
2335 +1.00, +0.00, +0.00
2336 +0.00, +1.00, +0.00
2337 +0.00, +0.00, +1.00
2338
2339
2340ndim = getUnifRand(1_IK, 6_IK)
2341ndim ! matrix rank
2342+1
2343mat = getCovRand(mold = 1._TKG, ndim = ndim)
2344mat
2345 +1.00
2346chol = getMatChol(mat, subset = lowDia)
2347chol
2348 +1.00
2349call setResized(inv, shape(mat, IK))
2350call setMatInv(inv, chol, auxil = choLow)
2351inv
2352 +1.00
2353mul = matmul(mat, inv)
2354mul
2355 +1.00
2356
2357
2358ndim = getUnifRand(1_IK, 6_IK)
2359ndim ! matrix rank
2360+2
2361mat = getCovRand(mold = 1._TKG, ndim = ndim)
2362mat
2363 +1.00, -0.04
2364 -0.04, +1.00
2365chol = getMatChol(mat, subset = lowDia)
2366chol
2367 +1.00, +0.00
2368 -0.04, +1.00
2369call setResized(inv, shape(mat, IK))
2370call setMatInv(inv, chol, auxil = choLow)
2371inv
2372 +1.00, +0.04
2373 +0.04, +1.00
2374mul = matmul(mat, inv)
2375mul
2376 +1.00, +0.00
2377 +0.00, +1.00
2378
2379
2380ndim = getUnifRand(1_IK, 6_IK)
2381ndim ! matrix rank
2382+3
2383mat = getCovRand(mold = 1._TKG, ndim = ndim)
2384mat
2385 +1.00, +0.32, -0.10
2386 +0.32, +1.00, -0.18
2387 -0.10, -0.18, +1.00
2388chol = getMatChol(mat, subset = lowDia)
2389chol
2390 +1.00, +0.00, +0.00
2391 +0.32, +0.95, +0.00
2392 -0.10, -0.16, +0.98
2393call setResized(inv, shape(mat, IK))
2394call setMatInv(inv, chol, auxil = choLow)
2395inv
2396 +1.12, -0.35, +0.05
2397 -0.35, +1.14, +0.17
2398 +0.05, +0.17, +1.04
2399mul = matmul(mat, inv)
2400mul
2401 +1.00, -0.00, +0.00
2402 -0.00, +1.00, +0.00
2403 +0.00, +0.00, +1.00
2404
2405
2406!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2407! Compute the inverse of a positive-definite complex matrix by passing its Cholesky factorization.
2408!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2409
2410
2411mat
2412( +9.00, +0.00), ( +3.00, +3.00), ( +3.00, -3.00)
2413( +3.00, -3.00), ( +18.00, +0.00), ( +8.00, -6.00)
2414( +3.00, +3.00), ( +8.00, +6.00), ( +43.00, +0.00)
2415chol = getMatChol(mat, subset = lowDia)
2416chol
2417( +3.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
2418( +1.00, -1.00), ( +4.00, +0.00), ( +0.00, +0.00)
2419( +1.00, +1.00), ( +2.00, +1.00), ( +6.00, +0.00)
2420call setResized(inv, shape(mat, IK))
2421call setMatInv(inv, chol, auxil = choLow)
2422inv
2423( +0.13, -0.00), ( -0.02, -0.03), ( -0.00, +0.01)
2424( -0.02, +0.03), ( +0.07, -0.00), ( -0.01, +0.01)
2425( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, -0.00)
2426mul = matmul(mat, inv)
2427mul
2428( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
2429( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
2430( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
2431
2432
2433mat
2434( +9.00, +0.00), ( +3.00, +3.00), ( +3.00, -3.00)
2435( +3.00, -3.00), ( +18.00, +0.00), ( +8.00, -6.00)
2436( +3.00, +3.00), ( +8.00, +6.00), ( +43.00, +0.00)
2437chol = getMatChol(mat, subset = uppDia)
2438chol
2439( +3.00, +0.00), ( +1.00, +1.00), ( +1.00, -1.00)
2440( +0.00, +0.00), ( +4.00, +0.00), ( +2.00, -1.00)
2441( +0.00, +0.00), ( +0.00, +0.00), ( +6.00, +0.00)
2442call setResized(inv, shape(mat, IK))
2443call setMatInv(inv, chol, auxil = choUpp)
2444inv
2445( +0.13, -0.00), ( -0.02, -0.03), ( -0.00, +0.01)
2446( -0.02, +0.03), ( +0.07, -0.00), ( -0.01, +0.01)
2447( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, -0.00)
2448mul = matmul(mat, inv)
2449mul
2450( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
2451( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
2452( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
2453
2454
2455!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2456! Compute a subset of the inverse of a positive-definite real matrix by passing its Cholesky factorization.
2457!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2458
2459
2460ndim = getUnifRand(1_IK, 6_IK)
2461ndim ! matrix rank
2462+1
2463mat = getCovRand(mold = 1._TKG, ndim = ndim)
2464mat
2465 +1.00
2466chol = getMatChol(mat, subset = lowDia)
2467chol
2468 +1.00
2469call setResized(inv, shape(mat, IK))
2470
2471inv = 0
2472call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2473inv
2474 +1.00
2475call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2476inv
2477 +1.00
2478mul = matmul(mat, inv)
2479mul
2480 +1.00
2481
2482inv = 0
2483call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2484inv
2485 +1.00
2486call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2487inv
2488 +1.00
2489mul = matmul(mat, inv)
2490mul
2491 +1.00
2492
2493
2494ndim = getUnifRand(1_IK, 6_IK)
2495ndim ! matrix rank
2496+5
2497mat = getCovRand(mold = 1._TKG, ndim = ndim)
2498mat
2499 +1.00, -0.70, +0.82, +0.01, +0.26
2500 -0.70, +1.00, -0.24, -0.58, -0.30
2501 +0.82, -0.24, +1.00, -0.34, +0.38
2502 +0.01, -0.58, -0.34, +1.00, +0.33
2503 +0.26, -0.30, +0.38, +0.33, +1.00
2504chol = getMatChol(mat, subset = lowDia)
2505chol
2506 +1.00, +0.00, +0.00, +0.00, +0.00
2507 -0.70, +0.72, +0.00, +0.00, +0.00
2508 +0.82, +0.47, +0.34, +0.00, +0.00
2509 +0.01, -0.81, +0.08, +0.58, +0.00
2510 +0.26, -0.17, +0.74, +0.23, +0.55
2511call setResized(inv, shape(mat, IK))
2512
2513inv = 0
2514call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2515inv
2516 +35.64, +20.92, -26.81, +0.33, +7.25
2517 +0.00, +14.73, -14.20, +2.35, +3.68
2518 +0.00, +0.00, +22.79, +1.98, -6.74
2519 +0.00, +0.00, +0.00, +3.48, -1.30
2520 +0.00, +0.00, +0.00, +0.00, +3.25
2521call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2522inv
2523 +35.64, +20.92, -26.81, +0.33, +7.25
2524 +20.92, +14.73, -14.20, +2.35, +3.68
2525 -26.81, -14.20, +22.79, +1.98, -6.74
2526 +0.33, +2.35, +1.98, +3.48, -1.30
2527 +7.25, +3.68, -6.74, -1.30, +3.25
2528mul = matmul(mat, inv)
2529mul
2530 +1.00, +0.00, -0.00, -0.00, +0.00
2531 -0.00, +1.00, +0.00, -0.00, -0.00
2532 +0.00, +0.00, +1.00, -0.00, +0.00
2533 -0.00, -0.00, +0.00, +1.00, -0.00
2534 +0.00, -0.00, -0.00, -0.00, +1.00
2535
2536inv = 0
2537call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2538inv
2539 +35.64, +0.00, +0.00, +0.00, +0.00
2540 +20.92, +14.73, +0.00, +0.00, +0.00
2541 -26.81, -14.20, +22.79, +0.00, +0.00
2542 +0.33, +2.35, +1.98, +3.48, +0.00
2543 +7.25, +3.68, -6.74, -1.30, +3.25
2544call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2545inv
2546 +35.64, +20.92, -26.81, +0.33, +7.25
2547 +20.92, +14.73, -14.20, +2.35, +3.68
2548 -26.81, -14.20, +22.79, +1.98, -6.74
2549 +0.33, +2.35, +1.98, +3.48, -1.30
2550 +7.25, +3.68, -6.74, -1.30, +3.25
2551mul = matmul(mat, inv)
2552mul
2553 +1.00, +0.00, -0.00, -0.00, +0.00
2554 -0.00, +1.00, +0.00, -0.00, -0.00
2555 +0.00, +0.00, +1.00, -0.00, +0.00
2556 -0.00, -0.00, +0.00, +1.00, -0.00
2557 +0.00, -0.00, -0.00, -0.00, +1.00
2558
2559
2560ndim = getUnifRand(1_IK, 6_IK)
2561ndim ! matrix rank
2562+3
2563mat = getCovRand(mold = 1._TKG, ndim = ndim)
2564mat
2565 +1.00, +0.98, +0.92
2566 +0.98, +1.00, +0.82
2567 +0.92, +0.82, +1.00
2568chol = getMatChol(mat, subset = lowDia)
2569chol
2570 +1.00, +0.00, +0.00
2571 +0.98, +0.22, +0.00
2572 +0.92, -0.34, +0.21
2573call setResized(inv, shape(mat, IK))
2574
2575inv = 0
2576call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2577inv
2578 +153.95, -105.27, -54.66
2579 +0.00, +75.09, +34.81
2580 +0.00, +0.00, +22.51
2581call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2582inv
2583 +153.95, -105.27, -54.66
2584 -105.27, +75.09, +34.81
2585 -54.66, +34.81, +22.51
2586mul = matmul(mat, inv)
2587mul
2588 +1.00, -0.00, +0.00
2589 -0.00, +1.00, +0.00
2590 -0.00, +0.00, +1.00
2591
2592inv = 0
2593call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2594inv
2595 +153.95, +0.00, +0.00
2596 -105.27, +75.09, +0.00
2597 -54.66, +34.81, +22.51
2598call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2599inv
2600 +153.95, -105.27, -54.66
2601 -105.27, +75.09, +34.81
2602 -54.66, +34.81, +22.51
2603mul = matmul(mat, inv)
2604mul
2605 +1.00, -0.00, +0.00
2606 -0.00, +1.00, +0.00
2607 -0.00, +0.00, +1.00
2608
2609
2610ndim = getUnifRand(1_IK, 6_IK)
2611ndim ! matrix rank
2612+5
2613mat = getCovRand(mold = 1._TKG, ndim = ndim)
2614mat
2615 +1.00, -0.49, +0.23, -0.57, +0.38
2616 -0.49, +1.00, -0.23, +0.75, -0.41
2617 +0.23, -0.23, +1.00, +0.17, +0.87
2618 -0.57, +0.75, +0.17, +1.00, -0.03
2619 +0.38, -0.41, +0.87, -0.03, +1.00
2620chol = getMatChol(mat, subset = lowDia)
2621chol
2622 +1.00, +0.00, +0.00, +0.00, +0.00
2623 -0.49, +0.87, +0.00, +0.00, +0.00
2624 +0.23, -0.13, +0.96, +0.00, +0.00
2625 -0.57, +0.54, +0.38, +0.49, +0.00
2626 +0.38, -0.26, +0.77, +0.06, +0.43
2627call setResized(inv, shape(mat, IK))
2628
2629inv = 0
2630call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2631inv
2632 +1.90, -0.51, -0.09, +1.45, -0.81
2633 +0.00, +3.60, +0.28, -2.99, +1.33
2634 +0.00, +0.00, +4.73, -1.18, -3.99
2635 +0.00, +0.00, +0.00, +4.24, -0.62
2636 +0.00, +0.00, +0.00, +0.00, +5.29
2637call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2638inv
2639 +1.90, -0.51, -0.09, +1.45, -0.81
2640 -0.51, +3.60, +0.28, -2.99, +1.33
2641 -0.09, +0.28, +4.73, -1.18, -3.99
2642 +1.45, -2.99, -1.18, +4.24, -0.62
2643 -0.81, +1.33, -3.99, -0.62, +5.29
2644mul = matmul(mat, inv)
2645mul
2646 +1.00, +0.00, +0.00, +0.00, -0.00
2647 -0.00, +1.00, -0.00, +0.00, +0.00
2648 -0.00, +0.00, +1.00, -0.00, -0.00
2649 +0.00, +0.00, +0.00, +1.00, +0.00
2650 -0.00, +0.00, +0.00, -0.00, +1.00
2651
2652inv = 0
2653call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2654inv
2655 +1.90, +0.00, +0.00, +0.00, +0.00
2656 -0.51, +3.60, +0.00, +0.00, +0.00
2657 -0.09, +0.28, +4.73, +0.00, +0.00
2658 +1.45, -2.99, -1.18, +4.24, +0.00
2659 -0.81, +1.33, -3.99, -0.62, +5.29
2660call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2661inv
2662 +1.90, -0.51, -0.09, +1.45, -0.81
2663 -0.51, +3.60, +0.28, -2.99, +1.33
2664 -0.09, +0.28, +4.73, -1.18, -3.99
2665 +1.45, -2.99, -1.18, +4.24, -0.62
2666 -0.81, +1.33, -3.99, -0.62, +5.29
2667mul = matmul(mat, inv)
2668mul
2669 +1.00, +0.00, +0.00, +0.00, -0.00
2670 -0.00, +1.00, -0.00, +0.00, +0.00
2671 -0.00, +0.00, +1.00, -0.00, -0.00
2672 +0.00, +0.00, +0.00, +1.00, +0.00
2673 -0.00, +0.00, +0.00, -0.00, +1.00
2674
2675
2676ndim = getUnifRand(1_IK, 6_IK)
2677ndim ! matrix rank
2678+5
2679mat = getCovRand(mold = 1._TKG, ndim = ndim)
2680mat
2681 +1.00, -0.43, -0.16, +0.81, -0.90
2682 -0.43, +1.00, -0.37, -0.09, +0.66
2683 -0.16, -0.37, +1.00, -0.46, +0.15
2684 +0.81, -0.09, -0.46, +1.00, -0.61
2685 -0.90, +0.66, +0.15, -0.61, +1.00
2686chol = getMatChol(mat, subset = lowDia)
2687chol
2688 +1.00, +0.00, +0.00, +0.00, +0.00
2689 -0.43, +0.90, +0.00, +0.00, +0.00
2690 -0.16, -0.48, +0.86, +0.00, +0.00
2691 +0.81, +0.29, -0.22, +0.46, +0.00
2692 -0.90, +0.30, +0.18, +0.18, +0.18
2693call setResized(inv, shape(mat, IK))
2694
2695inv = 0
2696call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2697inv
2698 +35.04, -9.76, -9.88, -15.69, +30.04
2699 +0.00, +6.04, +4.01, +3.48, -11.30
2700 +0.00, +0.00, +4.56, +4.83, -9.32
2701 +0.00, +0.00, +0.00, +9.28, -11.55
2702 +0.00, +0.00, +0.00, +0.00, +29.97
2703call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2704inv
2705 +35.04, -9.76, -9.88, -15.69, +30.04
2706 -9.76, +6.04, +4.01, +3.48, -11.30
2707 -9.88, +4.01, +4.56, +4.83, -9.32
2708 -15.69, +3.48, +4.83, +9.28, -11.55
2709 +30.04, -11.30, -9.32, -11.55, +29.97
2710mul = matmul(mat, inv)
2711mul
2712 +1.00, +0.00, -0.00, +0.00, -0.00
2713 +0.00, +1.00, +0.00, +0.00, +0.00
2714 -0.00, -0.00, +1.00, -0.00, +0.00
2715 +0.00, +0.00, +0.00, +1.00, -0.00
2716 +0.00, -0.00, +0.00, -0.00, +1.00
2717
2718inv = 0
2719call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2720inv
2721 +35.04, +0.00, +0.00, +0.00, +0.00
2722 -9.76, +6.04, +0.00, +0.00, +0.00
2723 -9.88, +4.01, +4.56, +0.00, +0.00
2724 -15.69, +3.48, +4.83, +9.28, +0.00
2725 +30.04, -11.30, -9.32, -11.55, +29.97
2726call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2727inv
2728 +35.04, -9.76, -9.88, -15.69, +30.04
2729 -9.76, +6.04, +4.01, +3.48, -11.30
2730 -9.88, +4.01, +4.56, +4.83, -9.32
2731 -15.69, +3.48, +4.83, +9.28, -11.55
2732 +30.04, -11.30, -9.32, -11.55, +29.97
2733mul = matmul(mat, inv)
2734mul
2735 +1.00, +0.00, -0.00, +0.00, -0.00
2736 +0.00, +1.00, +0.00, +0.00, +0.00
2737 -0.00, -0.00, +1.00, -0.00, +0.00
2738 +0.00, +0.00, +0.00, +1.00, -0.00
2739 +0.00, -0.00, +0.00, -0.00, +1.00
2740
2741
2742ndim = getUnifRand(1_IK, 6_IK)
2743ndim ! matrix rank
2744+6
2745mat = getCovRand(mold = 1._TKG, ndim = ndim)
2746mat
2747 +1.00, -0.62, -0.87, -0.53, -0.57, -0.32
2748 -0.62, +1.00, +0.28, +0.53, -0.13, +0.40
2749 -0.87, +0.28, +1.00, +0.19, +0.67, +0.02
2750 -0.53, +0.53, +0.19, +1.00, -0.13, +0.16
2751 -0.57, -0.13, +0.67, -0.13, +1.00, +0.40
2752 -0.32, +0.40, +0.02, +0.16, +0.40, +1.00
2753chol = getMatChol(mat, subset = lowDia)
2754chol
2755 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
2756 -0.62, +0.79, +0.00, +0.00, +0.00, +0.00
2757 -0.87, -0.33, +0.38, +0.00, +0.00, +0.00
2758 -0.53, +0.26, -0.49, +0.64, +0.00, +0.00
2759 -0.57, -0.62, -0.06, -0.48, +0.26, +0.00
2760 -0.32, +0.26, -0.45, -0.46, +0.51, +0.40
2761call setResized(inv, shape(mat, IK))
2762
2763inv = 0
2764call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2765inv
2766 +149.61, +68.18, +56.56, +44.01, +68.09, -14.84
2767 +0.00, +35.89, +20.89, +19.78, +36.49, -10.71
2768 +0.00, +0.00, +29.21, +15.84, +17.67, -0.49
2769 +0.00, +0.00, +0.00, +14.43, +20.90, -4.82
2770 +0.00, +0.00, +0.00, +0.00, +40.64, -12.74
2771 +0.00, +0.00, +0.00, +0.00, +0.00, +6.40
2772call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2773inv
2774 +149.61, +68.18, +56.56, +44.01, +68.09, -14.84
2775 +68.18, +35.89, +20.89, +19.78, +36.49, -10.71
2776 +56.56, +20.89, +29.21, +15.84, +17.67, -0.49
2777 +44.01, +19.78, +15.84, +14.43, +20.90, -4.82
2778 +68.09, +36.49, +17.67, +20.90, +40.64, -12.74
2779 -14.84, -10.71, -0.49, -4.82, -12.74, +6.40
2780mul = matmul(mat, inv)
2781mul
2782 +1.00, +0.00, +0.00, +0.00, +0.00, -0.00
2783 -0.00, +1.00, -0.00, -0.00, -0.00, +0.00
2784 -0.00, -0.00, +1.00, -0.00, -0.00, -0.00
2785 +0.00, -0.00, -0.00, +1.00, -0.00, +0.00
2786 -0.00, -0.00, -0.00, -0.00, +1.00, -0.00
2787 +0.00, -0.00, -0.00, -0.00, -0.00, +1.00
2788
2789inv = 0
2790call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2791inv
2792 +149.61, +0.00, +0.00, +0.00, +0.00, +0.00
2793 +68.18, +35.89, +0.00, +0.00, +0.00, +0.00
2794 +56.56, +20.89, +29.21, +0.00, +0.00, +0.00
2795 +44.01, +19.78, +15.84, +14.43, +0.00, +0.00
2796 +68.09, +36.49, +17.67, +20.90, +40.64, +0.00
2797 -14.84, -10.71, -0.49, -4.82, -12.74, +6.40
2798call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2799inv
2800 +149.61, +68.18, +56.56, +44.01, +68.09, -14.84
2801 +68.18, +35.89, +20.89, +19.78, +36.49, -10.71
2802 +56.56, +20.89, +29.21, +15.84, +17.67, -0.49
2803 +44.01, +19.78, +15.84, +14.43, +20.90, -4.82
2804 +68.09, +36.49, +17.67, +20.90, +40.64, -12.74
2805 -14.84, -10.71, -0.49, -4.82, -12.74, +6.40
2806mul = matmul(mat, inv)
2807mul
2808 +1.00, +0.00, +0.00, +0.00, +0.00, -0.00
2809 -0.00, +1.00, -0.00, -0.00, -0.00, +0.00
2810 -0.00, -0.00, +1.00, -0.00, -0.00, -0.00
2811 +0.00, -0.00, -0.00, +1.00, -0.00, +0.00
2812 -0.00, -0.00, -0.00, -0.00, +1.00, -0.00
2813 +0.00, -0.00, -0.00, -0.00, -0.00, +1.00
2814
2815
2816ndim = getUnifRand(1_IK, 6_IK)
2817ndim ! matrix rank
2818+6
2819mat = getCovRand(mold = 1._TKG, ndim = ndim)
2820mat
2821 +1.00, +0.94, -0.38, -0.35, +0.12, +0.29
2822 +0.94, +1.00, -0.16, -0.53, +0.05, +0.38
2823 -0.38, -0.16, +1.00, -0.53, -0.63, -0.10
2824 -0.35, -0.53, -0.53, +1.00, +0.41, -0.46
2825 +0.12, +0.05, -0.63, +0.41, +1.00, +0.51
2826 +0.29, +0.38, -0.10, -0.46, +0.51, +1.00
2827chol = getMatChol(mat, subset = lowDia)
2828chol
2829 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
2830 +0.94, +0.33, +0.00, +0.00, +0.00, +0.00
2831 -0.38, +0.62, +0.69, +0.00, +0.00, +0.00
2832 -0.35, -0.61, -0.42, +0.58, +0.00, +0.00
2833 +0.12, -0.20, -0.67, +0.08, +0.70, +0.00
2834 +0.29, +0.33, -0.29, -0.47, +0.55, +0.44
2835call setResized(inv, shape(mat, IK))
2836
2837inv = 0
2838call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2839inv
2840 +24.17, -21.82, +7.49, +1.23, +1.35, +2.02
2841 +0.00, +22.09, -5.35, +1.68, -2.06, -0.89
2842 +0.00, +0.00, +5.09, +2.61, +0.94, +1.12
2843 +0.00, +0.00, +0.00, +7.66, -4.22, +4.93
2844 +0.00, +0.00, +0.00, +0.00, +5.39, -4.19
2845 +0.00, +0.00, +0.00, +0.00, +0.00, +5.27
2846call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2847inv
2848 +24.17, -21.82, +7.49, +1.23, +1.35, +2.02
2849 -21.82, +22.09, -5.35, +1.68, -2.06, -0.89
2850 +7.49, -5.35, +5.09, +2.61, +0.94, +1.12
2851 +1.23, +1.68, +2.61, +7.66, -4.22, +4.93
2852 +1.35, -2.06, +0.94, -4.22, +5.39, -4.19
2853 +2.02, -0.89, +1.12, +4.93, -4.19, +5.27
2854mul = matmul(mat, inv)
2855mul
2856 +1.00, +0.00, +0.00, +0.00, -0.00, +0.00
2857 +0.00, +1.00, +0.00, +0.00, -0.00, +0.00
2858 -0.00, -0.00, +1.00, -0.00, +0.00, -0.00
2859 +0.00, -0.00, +0.00, +1.00, +0.00, -0.00
2860 +0.00, -0.00, +0.00, +0.00, +1.00, +0.00
2861 +0.00, -0.00, +0.00, +0.00, -0.00, +1.00
2862
2863inv = 0
2864call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2865inv
2866 +24.17, +0.00, +0.00, +0.00, +0.00, +0.00
2867 -21.82, +22.09, +0.00, +0.00, +0.00, +0.00
2868 +7.49, -5.35, +5.09, +0.00, +0.00, +0.00
2869 +1.23, +1.68, +2.61, +7.66, +0.00, +0.00
2870 +1.35, -2.06, +0.94, -4.22, +5.39, +0.00
2871 +2.02, -0.89, +1.12, +4.93, -4.19, +5.27
2872call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2873inv
2874 +24.17, -21.82, +7.49, +1.23, +1.35, +2.02
2875 -21.82, +22.09, -5.35, +1.68, -2.06, -0.89
2876 +7.49, -5.35, +5.09, +2.61, +0.94, +1.12
2877 +1.23, +1.68, +2.61, +7.66, -4.22, +4.93
2878 +1.35, -2.06, +0.94, -4.22, +5.39, -4.19
2879 +2.02, -0.89, +1.12, +4.93, -4.19, +5.27
2880mul = matmul(mat, inv)
2881mul
2882 +1.00, +0.00, +0.00, +0.00, -0.00, +0.00
2883 +0.00, +1.00, +0.00, +0.00, -0.00, +0.00
2884 -0.00, -0.00, +1.00, -0.00, +0.00, -0.00
2885 +0.00, -0.00, +0.00, +1.00, +0.00, -0.00
2886 +0.00, -0.00, +0.00, +0.00, +1.00, +0.00
2887 +0.00, -0.00, +0.00, +0.00, -0.00, +1.00
2888
2889
2890ndim = getUnifRand(1_IK, 6_IK)
2891ndim ! matrix rank
2892+2
2893mat = getCovRand(mold = 1._TKG, ndim = ndim)
2894mat
2895 +1.00, +0.42
2896 +0.42, +1.00
2897chol = getMatChol(mat, subset = lowDia)
2898chol
2899 +1.00, +0.00
2900 +0.42, +0.91
2901call setResized(inv, shape(mat, IK))
2902
2903inv = 0
2904call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2905inv
2906 +1.21, -0.50
2907 +0.00, +1.21
2908call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2909inv
2910 +1.21, -0.50
2911 -0.50, +1.21
2912mul = matmul(mat, inv)
2913mul
2914 +1.00, +0.00
2915 +0.00, +1.00
2916
2917inv = 0
2918call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2919inv
2920 +1.21, +0.00
2921 -0.50, +1.21
2922call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2923inv
2924 +1.21, -0.50
2925 -0.50, +1.21
2926mul = matmul(mat, inv)
2927mul
2928 +1.00, +0.00
2929 +0.00, +1.00
2930
2931
2932ndim = getUnifRand(1_IK, 6_IK)
2933ndim ! matrix rank
2934+1
2935mat = getCovRand(mold = 1._TKG, ndim = ndim)
2936mat
2937 +1.00
2938chol = getMatChol(mat, subset = lowDia)
2939chol
2940 +1.00
2941call setResized(inv, shape(mat, IK))
2942
2943inv = 0
2944call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2945inv
2946 +1.00
2947call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2948inv
2949 +1.00
2950mul = matmul(mat, inv)
2951mul
2952 +1.00
2953
2954inv = 0
2955call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
2956inv
2957 +1.00
2958call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
2959inv
2960 +1.00
2961mul = matmul(mat, inv)
2962mul
2963 +1.00
2964
2965
2966ndim = getUnifRand(1_IK, 6_IK)
2967ndim ! matrix rank
2968+5
2969mat = getCovRand(mold = 1._TKG, ndim = ndim)
2970mat
2971 +1.00, -0.42, +0.35, -0.17, +0.64
2972 -0.42, +1.00, -0.95, +0.65, -0.13
2973 +0.35, -0.95, +1.00, -0.82, -0.11
2974 -0.17, +0.65, -0.82, +1.00, +0.47
2975 +0.64, -0.13, -0.11, +0.47, +1.00
2976chol = getMatChol(mat, subset = lowDia)
2977chol
2978 +1.00, +0.00, +0.00, +0.00, +0.00
2979 -0.42, +0.91, +0.00, +0.00, +0.00
2980 +0.35, -0.89, +0.29, +0.00, +0.00
2981 -0.17, +0.64, -0.66, +0.36, +0.00
2982 +0.64, +0.15, -0.66, +0.11, +0.33
2983call setResized(inv, shape(mat, IK))
2984
2985inv = 0
2986call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
2987inv
2988 +4.22, -6.49, -6.68, +1.85, -5.17
2989 +0.00, +52.16, +59.34, +7.07, +14.26
2990 +0.00, +0.00, +72.06, +12.96, +13.97
2991 +0.00, +0.00, +0.00, +8.71, -2.92
2992 +0.00, +0.00, +0.00, +0.00, +9.11
2993call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
2994inv
2995 +4.22, -6.49, -6.68, +1.85, -5.17
2996 -6.49, +52.16, +59.34, +7.07, +14.26
2997 -6.68, +59.34, +72.06, +12.96, +13.97
2998 +1.85, +7.07, +12.96, +8.71, -2.92
2999 -5.17, +14.26, +13.97, -2.92, +9.11
3000mul = matmul(mat, inv)
3001mul
3002 +1.00, +0.00, +0.00, +0.00, -0.00
3003 +0.00, +1.00, -0.00, -0.00, -0.00
3004 -0.00, +0.00, +1.00, +0.00, +0.00
3005 +0.00, -0.00, -0.00, +1.00, -0.00
3006 +0.00, -0.00, -0.00, -0.00, +1.00
3007
3008inv = 0
3009call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
3010inv
3011 +4.22, +0.00, +0.00, +0.00, +0.00
3012 -6.49, +52.16, +0.00, +0.00, +0.00
3013 -6.68, +59.34, +72.06, +0.00, +0.00
3014 +1.85, +7.07, +12.96, +8.71, +0.00
3015 -5.17, +14.26, +13.97, -2.92, +9.11
3016call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3017inv
3018 +4.22, -6.49, -6.68, +1.85, -5.17
3019 -6.49, +52.16, +59.34, +7.07, +14.26
3020 -6.68, +59.34, +72.06, +12.96, +13.97
3021 +1.85, +7.07, +12.96, +8.71, -2.92
3022 -5.17, +14.26, +13.97, -2.92, +9.11
3023mul = matmul(mat, inv)
3024mul
3025 +1.00, +0.00, +0.00, +0.00, -0.00
3026 +0.00, +1.00, -0.00, -0.00, -0.00
3027 -0.00, +0.00, +1.00, +0.00, +0.00
3028 +0.00, -0.00, -0.00, +1.00, -0.00
3029 +0.00, -0.00, -0.00, -0.00, +1.00
3030
3031
3032ndim = getUnifRand(1_IK, 6_IK)
3033ndim ! matrix rank
3034+6
3035mat = getCovRand(mold = 1._TKG, ndim = ndim)
3036mat
3037 +1.00, +0.93, -0.85, +0.83, -0.56, -0.41
3038 +0.93, +1.00, -0.73, +0.82, -0.52, -0.26
3039 -0.85, -0.73, +1.00, -0.87, +0.31, +0.28
3040 +0.83, +0.82, -0.87, +1.00, -0.60, -0.42
3041 -0.56, -0.52, +0.31, -0.60, +1.00, +0.81
3042 -0.41, -0.26, +0.28, -0.42, +0.81, +1.00
3043chol = getMatChol(mat, subset = uppDia)
3044chol
3045 +1.00, +0.93, -0.85, +0.83, -0.56, -0.41
3046 +0.00, +0.36, +0.18, +0.12, +0.02, +0.37
3047 +0.00, +0.00, +0.50, -0.37, -0.35, -0.27
3048 +0.00, +0.00, +0.00, +0.40, -0.68, -0.55
3049 +0.00, +0.00, +0.00, +0.00, +0.31, +0.31
3050 +0.00, +0.00, +0.00, +0.00, +0.00, +0.47
3051call setResized(inv, shape(mat, IK))
3052
3053inv = 0
3054call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3055inv
3056 +73.94, -52.67, +55.33, +44.08, +22.38, +1.78
3057 +0.00, +41.25, -37.70, -32.34, -13.72, -2.97
3058 +0.00, +0.00, +49.69, +40.87, +22.40, -1.84
3059 +0.00, +0.00, +0.00, +37.35, +19.15, -1.48
3060 +0.00, +0.00, +0.00, +0.00, +14.76, -4.51
3061 +0.00, +0.00, +0.00, +0.00, +0.00, +4.52
3062call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3063inv
3064 +73.94, -52.67, +55.33, +44.08, +22.38, +1.78
3065 -52.67, +41.25, -37.70, -32.34, -13.72, -2.97
3066 +55.33, -37.70, +49.69, +40.87, +22.40, -1.84
3067 +44.08, -32.34, +40.87, +37.35, +19.15, -1.48
3068 +22.38, -13.72, +22.40, +19.15, +14.76, -4.51
3069 +1.78, -2.97, -1.84, -1.48, -4.51, +4.52
3070mul = matmul(mat, inv)
3071mul
3072 +1.00, +0.00, -0.00, +0.00, -0.00, -0.00
3073 -0.00, +1.00, -0.00, +0.00, -0.00, -0.00
3074 +0.00, -0.00, +1.00, -0.00, +0.00, +0.00
3075 -0.00, -0.00, +0.00, +1.00, -0.00, -0.00
3076 +0.00, -0.00, +0.00, -0.00, +1.00, +0.00
3077 +0.00, -0.00, +0.00, -0.00, +0.00, +1.00
3078
3079inv = 0
3080call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3081inv
3082 +73.94, +0.00, +0.00, +0.00, +0.00, +0.00
3083 -52.67, +41.25, +0.00, +0.00, +0.00, +0.00
3084 +55.33, -37.70, +49.69, +0.00, +0.00, +0.00
3085 +44.08, -32.34, +40.87, +37.35, +0.00, +0.00
3086 +22.38, -13.72, +22.40, +19.15, +14.76, +0.00
3087 +1.78, -2.97, -1.84, -1.48, -4.51, +4.52
3088call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3089inv
3090 +73.94, -52.67, +55.33, +44.08, +22.38, +1.78
3091 -52.67, +41.25, -37.70, -32.34, -13.72, -2.97
3092 +55.33, -37.70, +49.69, +40.87, +22.40, -1.84
3093 +44.08, -32.34, +40.87, +37.35, +19.15, -1.48
3094 +22.38, -13.72, +22.40, +19.15, +14.76, -4.51
3095 +1.78, -2.97, -1.84, -1.48, -4.51, +4.52
3096mul = matmul(mat, inv)
3097mul
3098 +1.00, +0.00, -0.00, +0.00, -0.00, -0.00
3099 -0.00, +1.00, -0.00, +0.00, -0.00, -0.00
3100 +0.00, -0.00, +1.00, -0.00, +0.00, +0.00
3101 -0.00, -0.00, +0.00, +1.00, -0.00, -0.00
3102 +0.00, -0.00, +0.00, -0.00, +1.00, +0.00
3103 +0.00, -0.00, +0.00, -0.00, +0.00, +1.00
3104
3105
3106ndim = getUnifRand(1_IK, 6_IK)
3107ndim ! matrix rank
3108+1
3109mat = getCovRand(mold = 1._TKG, ndim = ndim)
3110mat
3111 +1.00
3112chol = getMatChol(mat, subset = uppDia)
3113chol
3114 +1.00
3115call setResized(inv, shape(mat, IK))
3116
3117inv = 0
3118call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3119inv
3120 +1.00
3121call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3122inv
3123 +1.00
3124mul = matmul(mat, inv)
3125mul
3126 +1.00
3127
3128inv = 0
3129call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3130inv
3131 +1.00
3132call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3133inv
3134 +1.00
3135mul = matmul(mat, inv)
3136mul
3137 +1.00
3138
3139
3140ndim = getUnifRand(1_IK, 6_IK)
3141ndim ! matrix rank
3142+3
3143mat = getCovRand(mold = 1._TKG, ndim = ndim)
3144mat
3145 +1.00, -0.99, +0.92
3146 -0.99, +1.00, -0.92
3147 +0.92, -0.92, +1.00
3148chol = getMatChol(mat, subset = uppDia)
3149chol
3150 +1.00, -0.99, +0.92
3151 +0.00, +0.13, -0.09
3152 +0.00, +0.00, +0.38
3153call setResized(inv, shape(mat, IK))
3154
3155inv = 0
3156call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3157inv
3158 +63.31, +61.69, -1.21
3159 +0.00, +66.98, +5.17
3160 +0.00, +0.00, +6.90
3161call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3162inv
3163 +63.31, +61.69, -1.21
3164 +61.69, +66.98, +5.17
3165 -1.21, +5.17, +6.90
3166mul = matmul(mat, inv)
3167mul
3168 +1.00, +0.00, +0.00
3169 -0.00, +1.00, +0.00
3170 +0.00, +0.00, +1.00
3171
3172inv = 0
3173call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3174inv
3175 +63.31, +0.00, +0.00
3176 +61.69, +66.98, +0.00
3177 -1.21, +5.17, +6.90
3178call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3179inv
3180 +63.31, +61.69, -1.21
3181 +61.69, +66.98, +5.17
3182 -1.21, +5.17, +6.90
3183mul = matmul(mat, inv)
3184mul
3185 +1.00, +0.00, +0.00
3186 -0.00, +1.00, +0.00
3187 +0.00, +0.00, +1.00
3188
3189
3190ndim = getUnifRand(1_IK, 6_IK)
3191ndim ! matrix rank
3192+1
3193mat = getCovRand(mold = 1._TKG, ndim = ndim)
3194mat
3195 +1.00
3196chol = getMatChol(mat, subset = uppDia)
3197chol
3198 +1.00
3199call setResized(inv, shape(mat, IK))
3200
3201inv = 0
3202call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3203inv
3204 +1.00
3205call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3206inv
3207 +1.00
3208mul = matmul(mat, inv)
3209mul
3210 +1.00
3211
3212inv = 0
3213call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3214inv
3215 +1.00
3216call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3217inv
3218 +1.00
3219mul = matmul(mat, inv)
3220mul
3221 +1.00
3222
3223
3224ndim = getUnifRand(1_IK, 6_IK)
3225ndim ! matrix rank
3226+3
3227mat = getCovRand(mold = 1._TKG, ndim = ndim)
3228mat
3229 +1.00, -0.85, -0.43
3230 -0.85, +1.00, +0.05
3231 -0.43, +0.05, +1.00
3232chol = getMatChol(mat, subset = uppDia)
3233chol
3234 +1.00, -0.85, -0.43
3235 +0.00, +0.53, -0.60
3236 +0.00, +0.00, +0.68
3237call setResized(inv, shape(mat, IK))
3238
3239inv = 0
3240call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3241inv
3242 +7.67, +6.34, +3.02
3243 +0.00, +6.24, +2.44
3244 +0.00, +0.00, +2.19
3245call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3246inv
3247 +7.67, +6.34, +3.02
3248 +6.34, +6.24, +2.44
3249 +3.02, +2.44, +2.19
3250mul = matmul(mat, inv)
3251mul
3252 +1.00, -0.00, -0.00
3253 -0.00, +1.00, +0.00
3254 -0.00, +0.00, +1.00
3255
3256inv = 0
3257call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3258inv
3259 +7.67, +0.00, +0.00
3260 +6.34, +6.24, +0.00
3261 +3.02, +2.44, +2.19
3262call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3263inv
3264 +7.67, +6.34, +3.02
3265 +6.34, +6.24, +2.44
3266 +3.02, +2.44, +2.19
3267mul = matmul(mat, inv)
3268mul
3269 +1.00, -0.00, -0.00
3270 -0.00, +1.00, +0.00
3271 -0.00, +0.00, +1.00
3272
3273
3274ndim = getUnifRand(1_IK, 6_IK)
3275ndim ! matrix rank
3276+3
3277mat = getCovRand(mold = 1._TKG, ndim = ndim)
3278mat
3279 +1.00, -0.67, +0.21
3280 -0.67, +1.00, +0.55
3281 +0.21, +0.55, +1.00
3282chol = getMatChol(mat, subset = uppDia)
3283chol
3284 +1.00, -0.67, +0.21
3285 +0.00, +0.74, +0.93
3286 +0.00, +0.00, +0.29
3287call setResized(inv, shape(mat, IK))
3288
3289inv = 0
3290call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3291inv
3292 +15.01, +16.90, -12.42
3293 +0.00, +20.46, -14.76
3294 +0.00, +0.00, +11.69
3295call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3296inv
3297 +15.01, +16.90, -12.42
3298 +16.90, +20.46, -14.76
3299 -12.42, -14.76, +11.69
3300mul = matmul(mat, inv)
3301mul
3302 +1.00, -0.00, +0.00
3303 +0.00, +1.00, -0.00
3304 +0.00, +0.00, +1.00
3305
3306inv = 0
3307call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3308inv
3309 +15.01, +0.00, +0.00
3310 +16.90, +20.46, +0.00
3311 -12.42, -14.76, +11.69
3312call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3313inv
3314 +15.01, +16.90, -12.42
3315 +16.90, +20.46, -14.76
3316 -12.42, -14.76, +11.69
3317mul = matmul(mat, inv)
3318mul
3319 +1.00, -0.00, +0.00
3320 +0.00, +1.00, -0.00
3321 +0.00, +0.00, +1.00
3322
3323
3324ndim = getUnifRand(1_IK, 6_IK)
3325ndim ! matrix rank
3326+2
3327mat = getCovRand(mold = 1._TKG, ndim = ndim)
3328mat
3329 +1.00, +0.86
3330 +0.86, +1.00
3331chol = getMatChol(mat, subset = uppDia)
3332chol
3333 +1.00, +0.86
3334 +0.00, +0.50
3335call setResized(inv, shape(mat, IK))
3336
3337inv = 0
3338call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3339inv
3340 +3.94, -3.40
3341 +0.00, +3.94
3342call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3343inv
3344 +3.94, -3.40
3345 -3.40, +3.94
3346mul = matmul(mat, inv)
3347mul
3348 +1.00, +0.00
3349 +0.00, +1.00
3350
3351inv = 0
3352call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3353inv
3354 +3.94, +0.00
3355 -3.40, +3.94
3356call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3357inv
3358 +3.94, -3.40
3359 -3.40, +3.94
3360mul = matmul(mat, inv)
3361mul
3362 +1.00, +0.00
3363 +0.00, +1.00
3364
3365
3366ndim = getUnifRand(1_IK, 6_IK)
3367ndim ! matrix rank
3368+2
3369mat = getCovRand(mold = 1._TKG, ndim = ndim)
3370mat
3371 +1.00, -0.99
3372 -0.99, +1.00
3373chol = getMatChol(mat, subset = uppDia)
3374chol
3375 +1.00, -0.99
3376 +0.00, +0.17
3377call setResized(inv, shape(mat, IK))
3378
3379inv = 0
3380call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3381inv
3382 +35.18, +34.67
3383 +0.00, +35.18
3384call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3385inv
3386 +35.18, +34.67
3387 +34.67, +35.18
3388mul = matmul(mat, inv)
3389mul
3390 +1.00, +0.00
3391 +0.00, +1.00
3392
3393inv = 0
3394call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3395inv
3396 +35.18, +0.00
3397 +34.67, +35.18
3398call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3399inv
3400 +35.18, +34.67
3401 +34.67, +35.18
3402mul = matmul(mat, inv)
3403mul
3404 +1.00, +0.00
3405 +0.00, +1.00
3406
3407
3408ndim = getUnifRand(1_IK, 6_IK)
3409ndim ! matrix rank
3410+1
3411mat = getCovRand(mold = 1._TKG, ndim = ndim)
3412mat
3413 +1.00
3414chol = getMatChol(mat, subset = uppDia)
3415chol
3416 +1.00
3417call setResized(inv, shape(mat, IK))
3418
3419inv = 0
3420call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3421inv
3422 +1.00
3423call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3424inv
3425 +1.00
3426mul = matmul(mat, inv)
3427mul
3428 +1.00
3429
3430inv = 0
3431call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3432inv
3433 +1.00
3434call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3435inv
3436 +1.00
3437mul = matmul(mat, inv)
3438mul
3439 +1.00
3440
3441
3442ndim = getUnifRand(1_IK, 6_IK)
3443ndim ! matrix rank
3444+6
3445mat = getCovRand(mold = 1._TKG, ndim = ndim)
3446mat
3447 +1.00, +0.63, +0.89, -0.38, +0.09, +0.34
3448 +0.63, +1.00, +0.24, -0.67, +0.37, -0.20
3449 +0.89, +0.24, +1.00, -0.01, -0.06, +0.49
3450 -0.38, -0.67, -0.01, +1.00, -0.04, +0.10
3451 +0.09, +0.37, -0.06, -0.04, +1.00, -0.71
3452 +0.34, -0.20, +0.49, +0.10, -0.71, +1.00
3453chol = getMatChol(mat, subset = uppDia)
3454chol
3455 +1.00, +0.63, +0.89, -0.38, +0.09, +0.34
3456 +0.00, +0.78, -0.41, -0.55, +0.41, -0.54
3457 +0.00, +0.00, +0.18, +0.61, +0.16, -0.18
3458 +0.00, +0.00, +0.00, +0.43, +0.28, +0.09
3459 +0.00, +0.00, +0.00, +0.00, +0.85, -0.60
3460 +0.00, +0.00, +0.00, +0.00, +0.00, +0.44
3461call setResized(inv, shape(mat, IK))
3462
3463inv = 0
3464call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3465inv
3466 +219.38, -70.11, -170.01, +37.19, -15.98, -19.77
3467 +0.00, +25.15, +53.56, -10.10, +4.20, +6.44
3468 +0.00, +0.00, +133.66, -29.20, +11.67, +13.76
3469 +0.00, +0.00, +0.00, +8.48, -3.42, -3.51
3470 +0.00, +0.00, +0.00, +0.00, +4.01, +3.68
3471 +0.00, +0.00, +0.00, +0.00, +0.00, +5.17
3472call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3473inv
3474 +219.38, -70.11, -170.01, +37.19, -15.98, -19.77
3475 -70.11, +25.15, +53.56, -10.10, +4.20, +6.44
3476 -170.01, +53.56, +133.66, -29.20, +11.67, +13.76
3477 +37.19, -10.10, -29.20, +8.48, -3.42, -3.51
3478 -15.98, +4.20, +11.67, -3.42, +4.01, +3.68
3479 -19.77, +6.44, +13.76, -3.51, +3.68, +5.17
3480mul = matmul(mat, inv)
3481mul
3482 +1.00, +0.00, +0.00, -0.00, -0.00, -0.00
3483 +0.00, +1.00, -0.00, +0.00, -0.00, -0.00
3484 +0.00, -0.00, +1.00, -0.00, -0.00, -0.00
3485 -0.00, -0.00, -0.00, +1.00, +0.00, +0.00
3486 +0.00, +0.00, +0.00, -0.00, +1.00, +0.00
3487 +0.00, -0.00, +0.00, -0.00, +0.00, +1.00
3488
3489inv = 0
3490call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3491inv
3492 +219.38, +0.00, +0.00, +0.00, +0.00, +0.00
3493 -70.11, +25.15, +0.00, +0.00, +0.00, +0.00
3494 -170.01, +53.56, +133.66, +0.00, +0.00, +0.00
3495 +37.19, -10.10, -29.20, +8.48, +0.00, +0.00
3496 -15.98, +4.20, +11.67, -3.42, +4.01, +0.00
3497 -19.77, +6.44, +13.76, -3.51, +3.68, +5.17
3498call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3499inv
3500 +219.38, -70.11, -170.01, +37.19, -15.98, -19.77
3501 -70.11, +25.15, +53.56, -10.10, +4.20, +6.44
3502 -170.01, +53.56, +133.66, -29.20, +11.67, +13.76
3503 +37.19, -10.10, -29.20, +8.48, -3.42, -3.51
3504 -15.98, +4.20, +11.67, -3.42, +4.01, +3.68
3505 -19.77, +6.44, +13.76, -3.51, +3.68, +5.17
3506mul = matmul(mat, inv)
3507mul
3508 +1.00, +0.00, +0.00, -0.00, -0.00, -0.00
3509 +0.00, +1.00, -0.00, +0.00, -0.00, -0.00
3510 +0.00, -0.00, +1.00, -0.00, -0.00, -0.00
3511 -0.00, -0.00, -0.00, +1.00, +0.00, +0.00
3512 +0.00, +0.00, +0.00, -0.00, +1.00, +0.00
3513 +0.00, -0.00, +0.00, -0.00, +0.00, +1.00
3514
3515
3516!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3517! Compute a subset of the inverse of a positive-definite complex matrix by passing its Cholesky factorization.
3518!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3519
3520
3521mat
3522( +9.00, +0.00), ( +3.00, +3.00), ( +3.00, -3.00)
3523( +3.00, -3.00), ( +18.00, +0.00), ( +8.00, -6.00)
3524( +3.00, +3.00), ( +8.00, +6.00), ( +43.00, +0.00)
3525chol = getMatChol(mat, subset = lowDia)
3526chol
3527( +3.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3528( +1.00, -1.00), ( +4.00, +0.00), ( +0.00, +0.00)
3529( +1.00, +1.00), ( +2.00, +1.00), ( +6.00, +0.00)
3530call setResized(inv, shape(mat, IK))
3531inv = 0
3532call setMatInv(inv, chol, auxil = choLow, subset = uppDia)
3533inv
3534( +0.13, +0.00), ( -0.02, -0.03), ( -0.00, +0.01)
3535( +0.00, +0.00), ( +0.07, +0.00), ( -0.01, +0.01)
3536( +0.00, +0.00), ( +0.00, +0.00), ( +0.03, +0.00)
3537call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3538inv
3539( +0.13, +0.00), ( -0.02, -0.03), ( -0.00, +0.01)
3540( -0.02, +0.03), ( +0.07, +0.00), ( -0.01, +0.01)
3541( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, +0.00)
3542mul = matmul(mat, inv)
3543mul
3544( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
3545( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
3546( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
3547
3548inv = 0
3549call setMatInv(inv, chol, auxil = choLow, subset = lowDia)
3550inv
3551( +0.13, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3552( -0.02, +0.03), ( +0.07, +0.00), ( +0.00, +0.00)
3553( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, +0.00)
3554call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3555inv
3556( +0.13, +0.00), ( -0.02, -0.03), ( -0.00, +0.01)
3557( -0.02, +0.03), ( +0.07, +0.00), ( -0.01, +0.01)
3558( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, +0.00)
3559mul = matmul(mat, inv)
3560mul
3561( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
3562( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
3563( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
3564
3565
3566mat
3567( +9.00, +0.00), ( +3.00, +3.00), ( +3.00, -3.00)
3568( +3.00, -3.00), ( +18.00, +0.00), ( +8.00, -6.00)
3569( +3.00, +3.00), ( +8.00, +6.00), ( +43.00, +0.00)
3570chol = getMatChol(mat, subset = uppDia)
3571chol
3572( +3.00, +0.00), ( +1.00, +1.00), ( +1.00, -1.00)
3573( +0.00, +0.00), ( +4.00, +0.00), ( +2.00, -1.00)
3574( +0.00, +0.00), ( +0.00, +0.00), ( +6.00, +0.00)
3575call setResized(inv, shape(mat, IK))
3576inv = 0
3577call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3578inv
3579( +0.13, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3580( -0.02, +0.03), ( +0.07, +0.00), ( +0.00, +0.00)
3581( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, +0.00)
3582call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3583inv
3584( +0.13, +0.00), ( -0.02, -0.03), ( -0.00, +0.01)
3585( -0.02, +0.03), ( +0.07, +0.00), ( -0.01, +0.01)
3586( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, +0.00)
3587mul = matmul(mat, inv)
3588mul
3589( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
3590( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
3591( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
3592
3593inv = 0
3594call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3595inv
3596( +0.13, +0.00), ( -0.02, -0.03), ( -0.00, +0.01)
3597( +0.00, +0.00), ( +0.07, +0.00), ( -0.01, +0.01)
3598( +0.00, +0.00), ( +0.00, +0.00), ( +0.03, +0.00)
3599call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3600inv
3601( +0.13, +0.00), ( -0.02, -0.03), ( -0.00, +0.01)
3602( -0.02, +0.03), ( +0.07, +0.00), ( -0.01, +0.01)
3603( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, +0.00)
3604mul = matmul(mat, inv)
3605mul
3606( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
3607( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
3608( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
3609
3610
3611ndim = getUnifRand(1_IK, 6_IK)
3612ndim ! matrix rank
3613+1
3614mat
3615( +1.93, +0.00)
3616chol = getMatChol(mat, subset = uppDia)
3617chol
3618( +1.39, +0.00)
3619call setResized(inv, shape(mat, IK))
3620inv = 0
3621call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3622inv
3623( +0.52, +0.00)
3624call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3625inv
3626( +0.52, +0.00)
3627mul = matmul(mat, inv)
3628mul
3629( +1.00, +0.00)
3630
3631inv = 0
3632call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3633inv
3634( +0.52, +0.00)
3635call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3636inv
3637( +0.52, +0.00)
3638mul = matmul(mat, inv)
3639mul
3640( +1.00, +0.00)
3641
3642
3643ndim = getUnifRand(1_IK, 6_IK)
3644ndim ! matrix rank
3645+3
3646mat
3647( +1.76, +0.00), ( +1.47, -0.73), ( +1.77, -0.83)
3648( +1.47, +0.73), ( +3.16, +0.00), ( +3.14, -1.05)
3649( +1.77, +0.83), ( +3.14, +1.05), ( +5.03, +0.00)
3650chol = getMatChol(mat, subset = uppDia)
3651chol
3652( +1.33, +0.00), ( +1.11, -0.55), ( +1.34, -0.63)
3653( +0.00, +0.00), ( +1.28, +0.00), ( +1.03, -0.85)
3654( +0.00, +0.00), ( +0.00, +0.00), ( +1.04, +0.00)
3655call setResized(inv, shape(mat, IK))
3656inv = 0
3657call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3658inv
3659( +1.60, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3660( -0.30, -0.94), ( +1.62, +0.00), ( +0.00, +0.00)
3661( -0.57, +0.38), ( -0.75, -0.62), ( +0.93, +0.00)
3662call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3663inv
3664( +1.60, +0.00), ( -0.30, +0.94), ( -0.57, -0.38)
3665( -0.30, -0.94), ( +1.62, +0.00), ( -0.75, +0.62)
3666( -0.57, +0.38), ( -0.75, -0.62), ( +0.93, +0.00)
3667mul = matmul(mat, inv)
3668mul
3669( +1.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00)
3670( -0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
3671( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00)
3672
3673inv = 0
3674call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3675inv
3676( +1.60, +0.00), ( -0.30, +0.94), ( -0.57, -0.38)
3677( +0.00, +0.00), ( +1.62, +0.00), ( -0.75, +0.62)
3678( +0.00, +0.00), ( +0.00, +0.00), ( +0.93, +0.00)
3679call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3680inv
3681( +1.60, +0.00), ( -0.30, +0.94), ( -0.57, -0.38)
3682( -0.30, -0.94), ( +1.62, +0.00), ( -0.75, +0.62)
3683( -0.57, +0.38), ( -0.75, -0.62), ( +0.93, +0.00)
3684mul = matmul(mat, inv)
3685mul
3686( +1.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00)
3687( -0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
3688( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00)
3689
3690
3691ndim = getUnifRand(1_IK, 6_IK)
3692ndim ! matrix rank
3693+4
3694mat
3695( +2.12, +0.00), ( +1.95, +0.42), ( +2.01, -1.20), ( +2.19, +0.16)
3696( +1.95, -0.42), ( +5.43, +0.00), ( +3.63, -3.20), ( +4.45, +0.83)
3697( +2.01, +1.20), ( +3.63, +3.20), ( +5.55, +0.00), ( +4.49, +3.85)
3698( +2.19, -0.16), ( +4.45, -0.83), ( +4.49, -3.85), ( +8.94, +0.00)
3699chol = getMatChol(mat, subset = uppDia)
3700chol
3701( +1.46, +0.00), ( +1.34, +0.29), ( +1.38, -0.82), ( +1.50, +0.11)
3702( +0.00, +0.00), ( +1.89, +0.00), ( +1.07, -0.91), ( +1.28, +0.59)
3703( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +1.67, +0.68)
3704( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.21, +0.00)
3705call setResized(inv, shape(mat, IK))
3706inv = 0
3707call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3708inv
3709( +0.94, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3710( +0.05, -0.16), ( +1.44, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3711( -0.69, -0.14), ( -0.91, -1.59), ( +3.23, +0.00), ( +0.00, +0.00)
3712( +0.17, -0.12), ( +0.41, +0.50), ( -1.15, +0.47), ( +0.69, +0.00)
3713call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3714inv
3715( +0.94, +0.00), ( +0.05, +0.16), ( -0.69, +0.14), ( +0.17, +0.12)
3716( +0.05, -0.16), ( +1.44, +0.00), ( -0.91, +1.59), ( +0.41, -0.50)
3717( -0.69, -0.14), ( -0.91, -1.59), ( +3.23, +0.00), ( -1.15, -0.47)
3718( +0.17, -0.12), ( +0.41, +0.50), ( -1.15, +0.47), ( +0.69, +0.00)
3719mul = matmul(mat, inv)
3720mul
3721( +1.00, -0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
3722( -0.00, +0.00), ( +1.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00)
3723( -0.00, +0.00), ( +0.00, -0.00), ( +1.00, -0.00), ( -0.00, +0.00)
3724( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00), ( +1.00, +0.00)
3725
3726inv = 0
3727call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3728inv
3729( +0.94, +0.00), ( +0.05, +0.16), ( -0.69, +0.14), ( +0.17, +0.12)
3730( +0.00, +0.00), ( +1.44, +0.00), ( -0.91, +1.59), ( +0.41, -0.50)
3731( +0.00, +0.00), ( +0.00, +0.00), ( +3.23, +0.00), ( -1.15, -0.47)
3732( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.69, +0.00)
3733call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3734inv
3735( +0.94, +0.00), ( +0.05, +0.16), ( -0.69, +0.14), ( +0.17, +0.12)
3736( +0.05, -0.16), ( +1.44, +0.00), ( -0.91, +1.59), ( +0.41, -0.50)
3737( -0.69, -0.14), ( -0.91, -1.59), ( +3.23, +0.00), ( -1.15, -0.47)
3738( +0.17, -0.12), ( +0.41, +0.50), ( -1.15, +0.47), ( +0.69, +0.00)
3739mul = matmul(mat, inv)
3740mul
3741( +1.00, -0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
3742( -0.00, +0.00), ( +1.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00)
3743( -0.00, +0.00), ( +0.00, -0.00), ( +1.00, -0.00), ( -0.00, +0.00)
3744( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00), ( +1.00, +0.00)
3745
3746
3747ndim = getUnifRand(1_IK, 6_IK)
3748ndim ! matrix rank
3749+1
3750mat
3751( +3.49, +0.00)
3752chol = getMatChol(mat, subset = uppDia)
3753chol
3754( +1.87, +0.00)
3755call setResized(inv, shape(mat, IK))
3756inv = 0
3757call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3758inv
3759( +0.29, +0.00)
3760call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3761inv
3762( +0.29, +0.00)
3763mul = matmul(mat, inv)
3764mul
3765( +1.00, +0.00)
3766
3767inv = 0
3768call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3769inv
3770( +0.29, +0.00)
3771call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3772inv
3773( +0.29, +0.00)
3774mul = matmul(mat, inv)
3775mul
3776( +1.00, +0.00)
3777
3778
3779ndim = getUnifRand(1_IK, 6_IK)
3780ndim ! matrix rank
3781+3
3782mat
3783( +1.12, +0.00), ( +1.77, +0.56), ( +1.45, -0.17)
3784( +1.77, -0.56), ( +6.26, +0.00), ( +5.66, -0.72)
3785( +1.45, +0.17), ( +5.66, +0.72), ( +6.74, +0.00)
3786chol = getMatChol(mat, subset = uppDia)
3787chol
3788( +1.06, +0.00), ( +1.68, +0.52), ( +1.37, -0.16)
3789( +0.00, +0.00), ( +1.78, +0.00), ( +1.93, +0.15)
3790( +0.00, +0.00), ( +0.00, +0.00), ( +1.03, +0.00)
3791call setResized(inv, shape(mat, IK))
3792inv = 0
3793call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3794inv
3795( +2.53, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3796( -0.94, +0.97), ( +1.42, +0.00), ( +0.00, +0.00)
3797( +0.35, -0.78), ( -1.02, +0.08), ( +0.94, +0.00)
3798call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3799inv
3800( +2.53, +0.00), ( -0.94, -0.97), ( +0.35, +0.78)
3801( -0.94, +0.97), ( +1.42, +0.00), ( -1.02, -0.08)
3802( +0.35, -0.78), ( -1.02, +0.08), ( +0.94, +0.00)
3803mul = matmul(mat, inv)
3804mul
3805( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3806( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
3807( -0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
3808
3809inv = 0
3810call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3811inv
3812( +2.53, +0.00), ( -0.94, -0.97), ( +0.35, +0.78)
3813( +0.00, +0.00), ( +1.42, +0.00), ( -1.02, -0.08)
3814( +0.00, +0.00), ( +0.00, +0.00), ( +0.94, +0.00)
3815call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3816inv
3817( +2.53, +0.00), ( -0.94, -0.97), ( +0.35, +0.78)
3818( -0.94, +0.97), ( +1.42, +0.00), ( -1.02, -0.08)
3819( +0.35, -0.78), ( -1.02, +0.08), ( +0.94, +0.00)
3820mul = matmul(mat, inv)
3821mul
3822( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3823( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
3824( -0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
3825
3826
3827ndim = getUnifRand(1_IK, 6_IK)
3828ndim ! matrix rank
3829+4
3830mat
3831( +3.30, +0.00), ( +3.47, +1.56), ( +2.85, +1.35), ( +3.57, +1.12)
3832( +3.47, -1.56), ( +6.36, +0.00), ( +5.48, -0.75), ( +6.80, -0.45)
3833( +2.85, -1.35), ( +5.48, +0.75), ( +7.08, +0.00), ( +7.44, +1.21)
3834( +3.57, -1.12), ( +6.80, +0.45), ( +7.44, -1.21), ( +10.01, +0.00)
3835chol = getMatChol(mat, subset = uppDia)
3836chol
3837( +1.82, +0.00), ( +1.91, +0.86), ( +1.57, +0.74), ( +1.97, +0.61)
3838( +0.00, +0.00), ( +1.40, +0.00), ( +1.31, -0.59), ( +1.79, +0.04)
3839( +0.00, +0.00), ( +0.00, +0.00), ( +1.41, +0.00), ( +1.11, +0.42)
3840( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.07, +0.00)
3841call setResized(inv, shape(mat, IK))
3842inv = 0
3843call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3844inv
3845( +1.36, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3846( -0.76, +0.31), ( +1.19, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3847( +0.11, +0.59), ( -0.16, -0.16), ( +1.11, +0.00), ( +0.00, +0.00)
3848( -0.11, -0.45), ( -0.36, +0.07), ( -0.68, +0.26), ( +0.87, +0.00)
3849call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3850inv
3851( +1.36, +0.00), ( -0.76, -0.31), ( +0.11, -0.59), ( -0.11, +0.45)
3852( -0.76, +0.31), ( +1.19, +0.00), ( -0.16, +0.16), ( -0.36, -0.07)
3853( +0.11, +0.59), ( -0.16, -0.16), ( +1.11, +0.00), ( -0.68, -0.26)
3854( -0.11, -0.45), ( -0.36, +0.07), ( -0.68, +0.26), ( +0.87, +0.00)
3855mul = matmul(mat, inv)
3856mul
3857( +1.00, -0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00)
3858( -0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00)
3859( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00)
3860( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +1.00, -0.00)
3861
3862inv = 0
3863call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3864inv
3865( +1.36, +0.00), ( -0.76, -0.31), ( +0.11, -0.59), ( -0.11, +0.45)
3866( +0.00, +0.00), ( +1.19, +0.00), ( -0.16, +0.16), ( -0.36, -0.07)
3867( +0.00, +0.00), ( +0.00, +0.00), ( +1.11, +0.00), ( -0.68, -0.26)
3868( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.87, +0.00)
3869call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3870inv
3871( +1.36, +0.00), ( -0.76, -0.31), ( +0.11, -0.59), ( -0.11, +0.45)
3872( -0.76, +0.31), ( +1.19, +0.00), ( -0.16, +0.16), ( -0.36, -0.07)
3873( +0.11, +0.59), ( -0.16, -0.16), ( +1.11, +0.00), ( -0.68, -0.26)
3874( -0.11, -0.45), ( -0.36, +0.07), ( -0.68, +0.26), ( +0.87, +0.00)
3875mul = matmul(mat, inv)
3876mul
3877( +1.00, -0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00)
3878( -0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00)
3879( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00)
3880( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +1.00, -0.00)
3881
3882
3883ndim = getUnifRand(1_IK, 6_IK)
3884ndim ! matrix rank
3885+1
3886mat
3887( +1.99, +0.00)
3888chol = getMatChol(mat, subset = uppDia)
3889chol
3890( +1.41, +0.00)
3891call setResized(inv, shape(mat, IK))
3892inv = 0
3893call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3894inv
3895( +0.50, +0.00)
3896call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3897inv
3898( +0.50, +0.00)
3899mul = matmul(mat, inv)
3900mul
3901( +1.00, +0.00)
3902
3903inv = 0
3904call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3905inv
3906( +0.50, +0.00)
3907call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3908inv
3909( +0.50, +0.00)
3910mul = matmul(mat, inv)
3911mul
3912( +1.00, +0.00)
3913
3914
3915ndim = getUnifRand(1_IK, 6_IK)
3916ndim ! matrix rank
3917+5
3918mat
3919( +1.10, +0.00), ( +1.96, -0.08), ( +1.92, +0.96), ( +1.18, +1.04), ( +1.81, +0.67)
3920( +1.96, +0.08), ( +5.46, +0.00), ( +4.79, +0.67), ( +4.08, +1.40), ( +5.86, +0.17)
3921( +1.92, -0.96), ( +4.79, -0.67), ( +9.60, +0.00), ( +8.43, +2.10), ( +9.43, -0.81)
3922( +1.18, -1.04), ( +4.08, -1.40), ( +8.43, -2.10), ( +11.51, +0.00), ( +11.15, -4.08)
3923( +1.81, -0.67), ( +5.86, -0.17), ( +9.43, +0.81), ( +11.15, +4.08), ( +16.59, +0.00)
3924chol = getMatChol(mat, subset = uppDia)
3925chol
3926( +1.05, +0.00), ( +1.87, -0.08), ( +1.83, +0.91), ( +1.13, +0.99), ( +1.73, +0.64)
3927( +0.00, +0.00), ( +1.39, +0.00), ( +1.03, -0.85), ( +1.47, -0.39), ( +1.92, -0.83)
3928( +0.00, +0.00), ( +0.00, +0.00), ( +1.91, +0.00), ( +1.90, +0.24), ( +1.57, -0.62)
3929( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.81, +0.00), ( +1.43, -0.58)
3930( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.89, +0.00)
3931call setResized(inv, shape(mat, IK))
3932inv = 0
3933call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
3934inv
3935( +4.39, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3936( -1.44, -0.64), ( +0.94, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3937( -0.47, +0.71), ( -0.12, -0.25), ( +0.59, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
3938( +0.08, -0.17), ( +0.08, -0.00), ( -0.30, +0.06), ( +0.51, +0.00), ( +0.00, +0.00)
3939( +0.24, +0.11), ( -0.20, +0.01), ( +0.00, -0.03), ( -0.22, -0.09), ( +0.28, +0.00)
3940call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
3941inv
3942( +4.39, +0.00), ( -1.44, +0.64), ( -0.47, -0.71), ( +0.08, +0.17), ( +0.24, -0.11)
3943( -1.44, -0.64), ( +0.94, +0.00), ( -0.12, +0.25), ( +0.08, +0.00), ( -0.20, -0.01)
3944( -0.47, +0.71), ( -0.12, -0.25), ( +0.59, +0.00), ( -0.30, -0.06), ( +0.00, +0.03)
3945( +0.08, -0.17), ( +0.08, -0.00), ( -0.30, +0.06), ( +0.51, +0.00), ( -0.22, +0.09)
3946( +0.24, +0.11), ( -0.20, +0.01), ( +0.00, -0.03), ( -0.22, -0.09), ( +0.28, +0.00)
3947mul = matmul(mat, inv)
3948mul
3949( +1.00, -0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00), ( +0.00, +0.00)
3950( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, -0.00), ( -0.00, -0.00), ( +0.00, +0.00)
3951( +0.00, -0.00), ( -0.00, +0.00), ( +1.00, -0.00), ( -0.00, -0.00), ( +0.00, -0.00)
3952( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, -0.00)
3953( +0.00, -0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00)
3954
3955inv = 0
3956call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
3957inv
3958( +4.39, +0.00), ( -1.44, +0.64), ( -0.47, -0.71), ( +0.08, +0.17), ( +0.24, -0.11)
3959( +0.00, +0.00), ( +0.94, +0.00), ( -0.12, +0.25), ( +0.08, +0.00), ( -0.20, -0.01)
3960( +0.00, +0.00), ( +0.00, +0.00), ( +0.59, +0.00), ( -0.30, -0.06), ( +0.00, +0.03)
3961( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.51, +0.00), ( -0.22, +0.09)
3962( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.28, +0.00)
3963call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
3964inv
3965( +4.39, +0.00), ( -1.44, +0.64), ( -0.47, -0.71), ( +0.08, +0.17), ( +0.24, -0.11)
3966( -1.44, -0.64), ( +0.94, +0.00), ( -0.12, +0.25), ( +0.08, +0.00), ( -0.20, -0.01)
3967( -0.47, +0.71), ( -0.12, -0.25), ( +0.59, +0.00), ( -0.30, -0.06), ( +0.00, +0.03)
3968( +0.08, -0.17), ( +0.08, -0.00), ( -0.30, +0.06), ( +0.51, +0.00), ( -0.22, +0.09)
3969( +0.24, +0.11), ( -0.20, +0.01), ( +0.00, -0.03), ( -0.22, -0.09), ( +0.28, +0.00)
3970mul = matmul(mat, inv)
3971mul
3972( +1.00, -0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00), ( +0.00, +0.00)
3973( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, -0.00), ( -0.00, -0.00), ( +0.00, +0.00)
3974( +0.00, -0.00), ( -0.00, +0.00), ( +1.00, -0.00), ( -0.00, -0.00), ( +0.00, -0.00)
3975( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, -0.00)
3976( +0.00, -0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00)
3977
3978
3979ndim = getUnifRand(1_IK, 6_IK)
3980ndim ! matrix rank
3981+6
3982mat
3983( +2.42, +0.00), ( +2.19, -0.41), ( +2.54, +1.18), ( +1.65, +0.59), ( +2.11, -0.71), ( +2.12, -1.47)
3984( +2.19, +0.41), ( +4.49, +0.00), ( +4.96, +0.14), ( +3.19, +1.28), ( +4.50, +0.39), ( +4.97, -1.42)
3985( +2.54, -1.18), ( +4.96, -0.14), ( +9.55, +0.00), ( +5.89, +1.71), ( +6.88, -0.38), ( +7.98, -2.94)
3986( +1.65, -0.59), ( +3.19, -1.28), ( +5.89, -1.71), ( +6.03, +0.00), ( +6.86, -2.84), ( +7.89, -4.66)
3987( +2.11, +0.71), ( +4.50, -0.39), ( +6.88, +0.38), ( +6.86, +2.84), ( +11.06, +0.00), ( +13.37, -1.69)
3988( +2.12, +1.47), ( +4.97, +1.42), ( +7.98, +2.94), ( +7.89, +4.66), ( +13.37, +1.69), ( +19.56, +0.00)
3989chol = getMatChol(mat, subset = uppDia)
3990chol
3991( +1.56, +0.00), ( +1.40, -0.26), ( +1.63, +0.76), ( +1.06, +0.38), ( +1.36, -0.46), ( +1.36, -0.95)
3992( +0.00, +0.00), ( +1.57, +0.00), ( +1.83, -0.86), ( +1.15, +0.30), ( +1.58, +0.43), ( +1.79, -0.29)
3993( +0.00, +0.00), ( +0.00, +0.00), ( +1.49, +0.00), ( +1.36, +0.24), ( +1.68, -0.50), ( +1.98, -0.93)
3994( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.20, +0.00), ( +1.24, -0.65), ( +1.96, -0.45)
3995( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.15, +0.00), ( +1.64, +0.04)
3996( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.42, +0.00)
3997call setResized(inv, shape(mat, IK))
3998inv = 0
3999call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
4000inv
4001( +2.77, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
4002( -1.53, -1.02), ( +1.87, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
4003( -0.19, +1.45), ( -0.68, -0.85), ( +1.27, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
4004( +0.18, -0.17), ( +0.04, +0.03), ( -0.69, +0.04), ( +1.82, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
4005( -0.24, -1.06), ( +0.25, +0.75), ( -0.34, +0.38), ( -0.68, -0.68), ( +1.78, +0.00), ( +0.00, +0.00)
4006( +0.28, +0.37), ( -0.20, -0.24), ( +0.18, -0.27), ( -0.07, +0.19), ( -0.71, +0.02), ( +0.50, +0.00)
4007call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
4008inv
4009( +2.77, +0.00), ( -1.53, +1.02), ( -0.19, -1.45), ( +0.18, +0.17), ( -0.24, +1.06), ( +0.28, -0.37)
4010( -1.53, -1.02), ( +1.87, +0.00), ( -0.68, +0.85), ( +0.04, -0.03), ( +0.25, -0.75), ( -0.20, +0.24)
4011( -0.19, +1.45), ( -0.68, -0.85), ( +1.27, +0.00), ( -0.69, -0.04), ( -0.34, -0.38), ( +0.18, +0.27)
4012( +0.18, -0.17), ( +0.04, +0.03), ( -0.69, +0.04), ( +1.82, +0.00), ( -0.68, +0.68), ( -0.07, -0.19)
4013( -0.24, -1.06), ( +0.25, +0.75), ( -0.34, +0.38), ( -0.68, -0.68), ( +1.78, +0.00), ( -0.71, -0.02)
4014( +0.28, +0.37), ( -0.20, -0.24), ( +0.18, -0.27), ( -0.07, +0.19), ( -0.71, +0.02), ( +0.50, +0.00)
4015mul = matmul(mat, inv)
4016mul
4017( +1.00, -0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, -0.00)
4018( -0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
4019( -0.00, -0.00), ( -0.00, +0.00), ( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
4020( -0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00)
4021( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
4022( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00)
4023
4024inv = 0
4025call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
4026inv
4027( +2.77, +0.00), ( -1.53, +1.02), ( -0.19, -1.45), ( +0.18, +0.17), ( -0.24, +1.06), ( +0.28, -0.37)
4028( +0.00, +0.00), ( +1.87, +0.00), ( -0.68, +0.85), ( +0.04, -0.03), ( +0.25, -0.75), ( -0.20, +0.24)
4029( +0.00, +0.00), ( +0.00, +0.00), ( +1.27, +0.00), ( -0.69, -0.04), ( -0.34, -0.38), ( +0.18, +0.27)
4030( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.82, +0.00), ( -0.68, +0.68), ( -0.07, -0.19)
4031( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.78, +0.00), ( -0.71, -0.02)
4032( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.50, +0.00)
4033call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
4034inv
4035( +2.77, +0.00), ( -1.53, +1.02), ( -0.19, -1.45), ( +0.18, +0.17), ( -0.24, +1.06), ( +0.28, -0.37)
4036( -1.53, -1.02), ( +1.87, +0.00), ( -0.68, +0.85), ( +0.04, -0.03), ( +0.25, -0.75), ( -0.20, +0.24)
4037( -0.19, +1.45), ( -0.68, -0.85), ( +1.27, +0.00), ( -0.69, -0.04), ( -0.34, -0.38), ( +0.18, +0.27)
4038( +0.18, -0.17), ( +0.04, +0.03), ( -0.69, +0.04), ( +1.82, +0.00), ( -0.68, +0.68), ( -0.07, -0.19)
4039( -0.24, -1.06), ( +0.25, +0.75), ( -0.34, +0.38), ( -0.68, -0.68), ( +1.78, +0.00), ( -0.71, -0.02)
4040( +0.28, +0.37), ( -0.20, -0.24), ( +0.18, -0.27), ( -0.07, +0.19), ( -0.71, +0.02), ( +0.50, +0.00)
4041mul = matmul(mat, inv)
4042mul
4043( +1.00, -0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, -0.00)
4044( -0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
4045( -0.00, -0.00), ( -0.00, +0.00), ( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00)
4046( -0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, -0.00), ( -0.00, +0.00)
4047( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
4048( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( +1.00, +0.00)
4049
4050
4051ndim = getUnifRand(1_IK, 6_IK)
4052ndim ! matrix rank
4053+1
4054mat
4055( +1.35, +0.00)
4056chol = getMatChol(mat, subset = uppDia)
4057chol
4058( +1.16, +0.00)
4059call setResized(inv, shape(mat, IK))
4060inv = 0
4061call setMatInv(inv, chol, auxil = choUpp, subset = lowDia)
4062inv
4063( +0.74, +0.00)
4064call setMatCopy(inv(1:,2:), rdpack, inv(2:,1:), rdpack, lowDia, transHerm) ! symmetrize `inv` for multiplication.
4065inv
4066( +0.74, +0.00)
4067mul = matmul(mat, inv)
4068mul
4069( +1.00, +0.00)
4070
4071inv = 0
4072call setMatInv(inv, chol, auxil = choUpp, subset = uppDia)
4073inv
4074( +0.74, +0.00)
4075call setMatCopy(inv(2:,1:), rdpack, inv(1:,2:), rdpack, uppDia, transHerm) ! symmetrize `inv` for multiplication.
4076inv
4077( +0.74, +0.00)
4078mul = matmul(mat, inv)
4079mul
4080( +1.00, +0.00)
4081
4082
Test:
test_pm_matrixInv
Todo:
High Priority: The functionality of this generic interface must be extended to fully dispatch to LAPACK inverse matrix routines where appropriate.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Apr 21, 2017, 1:54 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 1788 of file pm_matrixInv.F90.


The documentation for this interface was generated from the following file: