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

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

Definition at line 1786 of file pm_matrixInv.F90.


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