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

Generate and return the full inverse of an input matrix of general or triangular form directly or through its input the LU/Cholesky factorization.
More...

Detailed Description

Generate and return the full inverse of an input matrix of general or triangular form directly or through its input the LU/Cholesky factorization.

Parameters
[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 matrix or a factorization of a matrix whose inverse must be computed.
The nature of the input mat is determined by the optional input argument auxil.
[in,out]auxil: The input scalar constant that can be:
  1. The output scalar of type integer of default kind IK that is 0 is if and only if the algorithm succeeds to compute the inverse of the input general matrix.
    No assumption is made about the input mat other than being given in full square form.
    See the info argument of setMatLUP for the possible meanings of a non-zero output value for auxil.
  2. The output scalar of the same type and kind as the input mat containing the determinant of the output inverse matrix inv.
    No assumption is made about the input mat other than being given in full square form.
  3. The input scalar constant upperDiag implying that the input mat is an upper-diagonal triangular matrix whose inverse is to be computed.
  4. The input scalar constant lowerDiag implying that the input mat is an lower-diagonal triangular matrix whose inverse is to be computed.
  5. 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.
  6. The input scalar constant choUpp implying that only the upper-diagonal Cholesky factorization of the positive-definite matrix whose inverse is to be computed.
  7. The input scalar constant choLow implying that only the lower-diagonal Cholesky factorization of the positive-definite matrix whose inverse is to be computed.
(optional. If missing, the input matrix is assumed to be a general square matrix whose inverse is to be computed. If the algorithm fails, the program will halt by calling error stop.)
Returns
inv : The output matrix of the same type, kind, and shape as the input mat containing the full inverse matrix.


Possible calling interfaces

inv(1:ndim, 1:ndim) = getMatInv(mat(1:ndim, 1:ndim))
inv(1:ndim, 1:ndim) = getMatInv(mat(1:ndim, 1:ndim), auxil)
Generate and return the full inverse of an input matrix of general or triangular form directly or thr...
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(size(auxil) == shape(mat)) 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. The procedures of this generic interface are always impure when the argument auxil has intent(out).
See also
getMatInv
setMatInv
getMatChol
setMatChol
setMatLUP
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: getMatInv
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_arrayResize, only: setResized
15 use pm_matrixInit, only: setMatInit
16 use pm_arrayFill, only: getFilled
17 use pm_matrixLUP, only: setMatLUP
18 use pm_err, only: setAsserted
19 use pm_val2str, only: getStr
20
21 implicit none
22
23 integer(IK):: i, info, ndim, ntry = 10
24 character(:, SK), allocatable :: cform, rform
25
26 type(display_type) :: disp
27 disp = display_type(file = "main.out.F90")
28
29 cform = getFormat(mold = [(0._TKG, 0._TKG)], ed = SK_"f", ndigit = 2_IK, signed = .true._LK)
30 rform = getFormat(mold = [0._TKG], ed = SK_"f", ndigit = 2_IK, signed = .true._LK)
31
32 call disp%skip()
33 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
34 call disp%show("! Compute inverse of a general real matrix.")
35 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
36 call disp%skip()
37
38 block
39 use pm_kind, only: TKG => RKS
40 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
41 real(TKG) :: invDetSqrt
42 do i = 1, 1
43 call disp%skip
44 call disp%show("mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])")
45 mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
46 call disp%show("mat")
47 call disp%show( mat , format = rform )
48 call disp%show("inv = getMatInv(mat)")
49 inv = getMatInv(mat)
50 call disp%show("inv")
51 call disp%show( inv , format = rform )
52 call disp%show("inv = getMatInv(mat, info) ! gracefully catch inversion errors.")
53 inv = getMatInv(mat, info)
54 call disp%show("if (info /= 0) error stop 'inversion failed.'")
55 if (info /= 0) error stop 'inversion failed.'
56 call disp%show("inv")
57 call disp%show( inv , format = rform )
58 call disp%show("inv = getMatInv(mat, invDetSqrt) ! compute the sqrt of the determinant of the inverse of the general matrix along with the inverse.")
59 inv = getMatInv(mat, invDetSqrt)
60 call disp%show("invDetSqrt")
61 call disp%show( invDetSqrt )
62 call disp%show("inv")
63 call disp%show( inv , format = rform )
64 call disp%show("mul = matmul(mat, inv)")
65 mul = matmul(mat, inv)
66 call disp%show("mul")
67 call disp%show( mul, format = rform )
68 call disp%skip
69 end do
70 end block
71
72 call disp%skip()
73 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
74 call disp%show("! Compute inverse of a general complex matrix.")
75 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
76 call disp%skip()
77
78 block
79 use pm_kind, only: TKG => RKS
80 complex(TKG) :: invDetSqrt
81 complex(TKG), allocatable :: inv(:,:), mul(:,:)
82 complex(TKG), parameter :: mat(*,*) = reshape( &
83 [ (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) &
84 , (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) &
85 , (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) &
86 , (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) &
87 , (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) &
88 , (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) &
89 , (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) &
90 , (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) &
91 , (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) &
92 ], shape = [9, 9], order = [2, 1])
93 call disp%skip
94 call disp%show("mat")
95 call disp%show( mat , format = cform )
96 call disp%show("inv = getMatInv(mat)")
97 inv = getMatInv(mat)
98 call disp%show("inv")
99 call disp%show( inv , format = cform )
100 call disp%show("inv = getMatInv(mat, info) ! gracefully catch inversion errors.")
101 inv = getMatInv(mat, info)
102 call disp%show("if (info /= 0) error stop 'inversion failed.'")
103 if (info /= 0) error stop 'inversion failed.'
104 call disp%show("inv")
105 call disp%show( inv , format = cform )
106 call disp%show("inv = getMatInv(mat, invDetSqrt) ! compute the sqrt of the determinant of the inverse of the general matrix along with the inverse.")
107 inv = getMatInv(mat, invDetSqrt)
108 call disp%show("invDetSqrt")
109 call disp%show( invDetSqrt )
110 call disp%show("inv")
111 call disp%show( inv , format = cform )
112 call disp%show("mul = matmul(mat, inv)")
113 mul = matmul(mat, inv)
114 call disp%show("mul")
115 call disp%show( mul, format = cform )
116 call disp%skip
117 end block
118
119 call disp%skip()
120 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
121 call disp%show("! Compute inverse of an upperDiag triangular real matrix.")
122 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
123 call disp%skip()
124
125 block
126 use pm_kind, only: TKG => RKS
127 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
128 do i = 1, ntry
129 call disp%skip
130 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
131 ndim = getUnifRand(1_IK, 6_IK)
132 call disp%show("ndim ! matrix rank")
133 call disp%show( ndim )
134 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
135 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
136 call disp%show("call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)")
137 call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
138 call disp%show("mat")
139 call disp%show( mat , format = rform )
140 call disp%show("inv = getMatInv(mat, upperDiag)")
141 inv = getMatInv(mat, upperDiag)
142 call disp%show("inv")
143 call disp%show( inv , format = rform )
144 call disp%show("mul = matmul(mat, inv)")
145 mul = matmul(mat, inv)
146 call disp%show("mul")
147 call disp%show( mul , format = rform )
148 call disp%skip
149 end do
150 end block
151
152 call disp%skip()
153 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
154 call disp%show("! Compute inverse of a upperDiag triangular complex matrix.")
155 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
156 call disp%skip()
157
158 block
159 use pm_kind, only: TKG => RKS
160 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
161 do i = 1, ntry
162 call disp%skip
163 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
164 ndim = getUnifRand(1_IK, 6_IK)
165 call disp%show("ndim ! matrix rank")
166 call disp%show( ndim )
167 call disp%show("mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)")
168 mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
169 call disp%show("call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))")
170 call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
171 call disp%show("mat")
172 call disp%show( mat , format = cform )
173 call disp%show("inv = getMatInv(mat, upperDiag)")
174 inv = getMatInv(mat, upperDiag)
175 call disp%show("inv")
176 call disp%show( inv , format = cform )
177 call disp%show("mul = matmul(mat, inv)")
178 mul = matmul(mat, inv)
179 call disp%show("mul")
180 call disp%show( mul , format = cform )
181 call disp%skip
182 end do
183 end block
184
185 call disp%skip()
186 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
187 call disp%show("! Compute inverse of a lowerDiag triangular real matrix.")
188 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
189 call disp%skip()
190
191 block
192 use pm_kind, only: TKG => RKS
193 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
194 do i = 1, ntry
195 call disp%skip
196 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
197 ndim = getUnifRand(1_IK, 6_IK)
198 call disp%show("ndim ! matrix rank")
199 call disp%show( ndim )
200 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
201 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
202 call disp%show("call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)")
203 call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
204 call disp%show("mat")
205 call disp%show( mat , format = rform )
206 call disp%show("inv = getMatInv(mat, lowerDiag)")
207 inv = getMatInv(mat, lowerDiag)
208 call disp%show("inv")
209 call disp%show( inv , format = rform )
210 call disp%show("mul = matmul(mat, inv)")
211 mul = matmul(mat, inv)
212 call disp%show("mul")
213 call disp%show( mul , format = rform )
214 call disp%skip
215 end do
216 end block
217
218 call disp%skip()
219 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
220 call disp%show("! Compute inverse of a lowerDiag triangular complex matrix.")
221 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
222 call disp%skip()
223
224 block
225 use pm_kind, only: TKG => RKS
226 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
227 do i = 1, ntry
228 call disp%skip
229 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
230 ndim = getUnifRand(1_IK, 6_IK)
231 call disp%show("ndim ! matrix rank")
232 call disp%show( ndim )
233 call disp%show("mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)")
234 mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
235 call disp%show("call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))")
236 call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
237 call disp%show("mat")
238 call disp%show( mat , format = cform )
239 call disp%show("inv = getMatInv(mat, lowerDiag)")
240 inv = getMatInv(mat, lowerDiag)
241 call disp%show("inv")
242 call disp%show( inv , format = cform )
243 call disp%show("mul = matmul(mat, inv)")
244 mul = matmul(mat, inv)
245 call disp%show("mul")
246 call disp%show( mul , format = cform )
247 call disp%skip
248 end do
249 end block
250
251 call disp%skip()
252 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
253 call disp%show("! Compute inverse of a upperUnit triangular real matrix.")
254 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
255 call disp%skip()
256
257 block
258 use pm_kind, only: TKG => RKS
259 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
260 do i = 1, ntry
261 call disp%skip
262 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
263 ndim = getUnifRand(1_IK, 6_IK)
264 call disp%show("ndim ! matrix rank")
265 call disp%show( ndim )
266 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
267 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
268 call disp%show("call setMatInit(mat, lowDia, 0._TKG, 1._TKG)")
269 call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
270 call disp%show("mat")
271 call disp%show( mat , format = rform )
272 call disp%show("inv = getMatInv(mat, upperUnit)")
273 inv = getMatInv(mat, upperUnit)
274 call disp%show("inv")
275 call disp%show( inv , format = rform )
276 call disp%show("mul = matmul(mat, inv)")
277 mul = matmul(mat, inv)
278 call disp%show("mul")
279 call disp%show( mul , format = rform )
280 call disp%skip
281 end do
282 end block
283
284 call disp%skip()
285 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
286 call disp%show("! Compute inverse of a upperUnit triangular complex matrix.")
287 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
288 call disp%skip()
289
290 block
291 use pm_kind, only: TKG => RKS
292 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
293 do i = 1, ntry
294 call disp%skip
295 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
296 ndim = getUnifRand(1_IK, 6_IK)
297 call disp%show("ndim ! matrix rank")
298 call disp%show( ndim )
299 call disp%show("mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)")
300 mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
301 call disp%show("call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))")
302 call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
303 call disp%show("mat")
304 call disp%show( mat , format = cform )
305 call disp%show("inv = getMatInv(mat, upperUnit)")
306 inv = getMatInv(mat, upperUnit)
307 call disp%show("inv")
308 call disp%show( inv , format = cform )
309 call disp%show("mul = matmul(mat, inv)")
310 mul = matmul(mat, inv)
311 call disp%show("mul")
312 call disp%show( mul , format = cform )
313 call disp%skip
314 end do
315 end block
316
317 call disp%skip()
318 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
319 call disp%show("! Compute inverse of a lowerUnit triangular real matrix.")
320 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
321 call disp%skip()
322
323 block
324 use pm_kind, only: TKG => RKS
325 real(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
326 do i = 1, ntry
327 call disp%skip
328 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
329 ndim = getUnifRand(1_IK, 6_IK)
330 call disp%show("ndim ! matrix rank")
331 call disp%show( ndim )
332 call disp%show("mat = getUnifRand(1_IK, 9_IK, ndim, ndim)")
333 mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
334 call disp%show("call setMatInit(mat, uppDia, 0._TKG, 1._TKG)")
335 call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
336 call disp%show("mat")
337 call disp%show( mat , format = rform )
338 call disp%show("inv = getMatInv(mat, lowerUnit)")
339 inv = getMatInv(mat, lowerUnit)
340 call disp%show("inv")
341 call disp%show( inv , format = rform )
342 call disp%show("mul = matmul(mat, inv)")
343 mul = matmul(mat, inv)
344 call disp%show("mul")
345 call disp%show( mul , format = rform )
346 call disp%skip
347 end do
348 end block
349
350 call disp%skip()
351 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
352 call disp%show("! Compute inverse of a lowerUnit triangular complex matrix.")
353 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
354 call disp%skip()
355
356 block
357 use pm_kind, only: TKG => RKS
358 complex(TKG), allocatable :: mat(:,:), inv(:,:), mul(:,:)
359 do i = 1, ntry
360 call disp%skip
361 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
362 ndim = getUnifRand(1_IK, 6_IK)
363 call disp%show("ndim ! matrix rank")
364 call disp%show( ndim )
365 call disp%show("mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)")
366 mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
367 call disp%show("call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))")
368 call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
369 call disp%show("mat")
370 call disp%show( mat , format = cform )
371 call disp%show("inv = getMatInv(mat, lowerUnit)")
372 inv = getMatInv(mat, lowerUnit)
373 call disp%show("inv")
374 call disp%show( inv , format = cform )
375 call disp%show("mul = matmul(mat, inv)")
376 mul = matmul(mat, inv)
377 call disp%show("mul")
378 call disp%show( mul , format = cform )
379 call disp%skip
380 end do
381 end block
382
383 call disp%skip()
384 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
385 call disp%show("! Compute inverse of a general real matrix by passing its LUP factorization.")
386 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
387 call disp%skip()
388
389 block
390 use pm_kind, only: TKG => RKS
391 integer(IK), allocatable :: rperm(:)
392 real(TKG), allocatable :: mat(:,:), lup(:,:), inv(:,:), mul(:,:)
393 do i = 1, ntry
394 call disp%skip
395 call disp%show("mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])")
396 mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
397 call disp%show("mat")
398 call disp%show( mat , format = rform )
399 call disp%show("call setResized(rperm, size(mat, 1, IK))")
400 call setResized(rperm, size(mat, 1, IK))
401 call disp%show("lup = mat")
402 lup = mat
403 call disp%show("lup")
404 call disp%show( lup , format = rform )
405 call disp%show("call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.")
406 call setMatLUP(lup, rperm, info)
407 call disp%show("if (info /= 0) error stop 'LUP factorization failed.'")
408 if (info /= 0) error stop 'LUP factorization failed.'
409 call disp%show("lup")
410 call disp%show( lup , format = rform )
411 call disp%show("inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.")
412 inv = getMatInv(lup, rperm)
413 call disp%show("inv")
414 call disp%show( inv , format = rform )
415 call disp%show("mul = matmul(mat, inv)")
416 mul = matmul(mat, inv)
417 call disp%show("mul")
418 call disp%show( mul , format = rform )
419 call disp%skip
420 end do
421 end block
422
423 call disp%skip()
424 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
425 call disp%show("! Compute inverse of a general complex matrix by passing its LUP factorization.")
426 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
427 call disp%skip()
428
429 block
430 use pm_kind, only: TKG => RKS
431 integer(IK), allocatable :: rperm(:)
432 complex(TKG), parameter :: mat(*,*) = reshape( &
433 [ (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) &
434 , (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) &
435 , (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) &
436 , (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) &
437 , (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) &
438 , (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) &
439 , (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) &
440 , (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) &
441 , (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) &
442 ], shape = [9, 9], order = [2, 1])
443 complex(TKG), dimension(size(mat,1), size(mat,2)) :: inv, lup, mul
444 call disp%skip
445 call disp%show("call setResized(rperm, size(mat, 1, IK))")
446 call setResized(rperm, size(mat, 1, IK))
447 call disp%show("lup = mat")
448 lup = mat
449 call disp%show("lup")
450 call disp%show( lup , format = cform )
451 call disp%show("call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.")
452 call setMatLUP(lup, rperm, info)
453 call disp%show("if (info /= 0) error stop 'LUP factorization failed.'")
454 if (info /= 0) error stop 'LUP factorization failed.'
455 call disp%show("lup")
456 call disp%show( lup , format = cform )
457 call disp%show("inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.")
458 inv = getMatInv(lup, rperm)
459 call disp%show("inv")
460 call disp%show( inv , format = cform )
461 call disp%show("mul = matmul(mat, inv)")
462 mul = matmul(mat, inv)
463 call disp%show("mul")
464 call disp%show( mul , format = cform )
465 call disp%skip
466 end block
467
468 call disp%skip()
469 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
470 call disp%show("! Compute the inverse of a positive-definite real matrix by passing its Cholesky factorization.")
471 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
472 call disp%skip()
473
474 block
475 use pm_kind, only: TKG => RKS
476 real(TKG), allocatable :: mat(:,:), chol(:,:), inv(:,:), mul(:,:)
477 do i = 1, ntry
478 call disp%skip
479 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
480 ndim = getUnifRand(1_IK, 6_IK)
481 call disp%show("ndim ! matrix rank")
482 call disp%show( ndim )
483 call disp%show("mat = getCovRand(mold = 1._TKG, ndim = ndim)")
484 mat = getCovRand(mold = 1._TKG, ndim = ndim)
485 call disp%show("mat")
486 call disp%show( mat , format = rform )
487 call disp%show("chol = getMatChol(mat, subset = lowDia)")
488 chol = getMatChol(mat, subset = lowDia)
489 call disp%show("chol")
490 call disp%show( chol , format = rform )
491 call disp%show("inv = getMatInv(chol, auxil = choLow)")
492 inv = getMatInv(chol, auxil = choLow)
493 call disp%show("inv")
494 call disp%show( inv , format = rform )
495 call disp%show("mul = matmul(mat, inv)")
496 mul = matmul(mat, inv)
497 call disp%show("mul")
498 call disp%show( mul , format = rform )
499 call disp%skip
500 end do
501 end block
502
503 block
504 use pm_kind, only: TKG => RKS
505 real(TKG), allocatable :: mat(:,:), chol(:,:), inv(:,:), mul(:,:)
506 do i = 1, ntry
507 call disp%skip
508 call disp%show("ndim = getUnifRand(1_IK, 6_IK)")
509 ndim = getUnifRand(1_IK, 6_IK)
510 call disp%show("ndim ! matrix rank")
511 call disp%show( ndim )
512 call disp%show("mat = getCovRand(mold = 1._TKG, ndim = ndim)")
513 mat = getCovRand(mold = 1._TKG, ndim = ndim)
514 call disp%show("mat")
515 call disp%show( mat , format = rform )
516 call disp%show("chol = getMatChol(mat, subset = uppDia)")
517 chol = getMatChol(mat, subset = uppDia)
518 call disp%show("chol")
519 call disp%show( chol , format = rform )
520 call disp%show("inv = getMatInv(chol, auxil = choUpp)")
521 inv = getMatInv(chol, auxil = choUpp)
522 call disp%show("inv")
523 call disp%show( inv , format = rform )
524 call disp%show("mul = matmul(mat, inv)")
525 mul = matmul(mat, inv)
526 call disp%show("mul")
527 call disp%show( mul , format = rform )
528 call disp%skip
529 end do
530 end block
531
532 call disp%skip()
533 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
534 call disp%show("! Compute the inverse of a positive-definite complex matrix by passing its Cholesky factorization.")
535 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
536 call disp%skip()
537
538 block
539 use pm_kind, only: TKG => RKS
540 integer(IK), parameter :: ndim = 3_IK
541 complex(TKG), allocatable :: chol(:,:), inv(:,:), mul(:,:)
542 complex(TKG), parameter :: mat(*,*) = reshape( [ (9.0, 0.0), (3.0, 3.0), (3.0, -3.0) &
543 , (3.0, -3.0),(18.0, 0.0), (8.0, -6.0) &
544 , (3.0, 3.0), (8.0, 6.0),(43.0, 0.0) &
545 ], shape = [ndim, ndim], order = [2, 1])
546 call disp%skip
547 call disp%show("mat")
548 call disp%show( mat , format = cform )
549 call disp%show("chol = getMatChol(mat, subset = lowDia)")
550 chol = getMatChol(mat, subset = lowDia)
551 call disp%show("chol")
552 call disp%show( chol , format = cform )
553 call disp%show("inv = getMatInv(chol, auxil = choLow)")
554 inv = getMatInv(chol, auxil = choLow)
555 call disp%show("inv")
556 call disp%show( inv , format = cform )
557 call disp%show("mul = matmul(mat, inv)")
558 mul = matmul(mat, inv)
559 call disp%show("mul")
560 call disp%show( mul , format = cform )
561 call disp%skip
562 end block
563
564 block
565 use pm_kind, only: TKG => RKS
566 integer(IK), parameter :: ndim = 3_IK
567 complex(TKG), allocatable :: chol(:,:), inv(:,:), mul(:,:)
568 complex(TKG), parameter :: mat(*,*) = reshape( [ (9.0, 0.0), (3.0, 3.0), (3.0, -3.0) &
569 , (3.0, -3.0),(18.0, 0.0), (8.0, -6.0) &
570 , (3.0, 3.0), (8.0, 6.0),(43.0, 0.0) &
571 ], shape = [ndim, ndim], order = [2, 1])
572 call disp%skip
573 call disp%show("mat")
574 call disp%show( mat , format = cform )
575 call disp%show("chol = getMatChol(mat, subset = uppDia)")
576 chol = getMatChol(mat, subset = uppDia)
577 call disp%show("chol")
578 call disp%show( chol , format = cform )
579 call disp%show("inv = getMatInv(chol, auxil = choUpp)")
580 inv = getMatInv(chol, auxil = choUpp)
581 call disp%show("inv")
582 call disp%show( inv , format = cform )
583 call disp%show("mul = matmul(mat, inv)")
584 mul = matmul(mat, inv)
585 call disp%show("mul")
586 call disp%show( mul , format = cform )
587 call disp%skip
588 end block
589
590end 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...
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 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 a general real matrix.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
8mat
9 +1.00, +0.00, +2.00
10 -1.00, +5.00, +0.00
11 +0.00, +3.00, -9.00
12inv = getMatInv(mat)
13inv
14 +0.88, -0.12, +0.20
15 +0.18, +0.18, +0.04
16 +0.06, +0.06, -0.10
17inv = getMatInv(mat, info) ! gracefully catch inversion errors.
18if (info /= 0) error stop 'inversion failed.'
19inv
20 +0.88, -0.12, +0.20
21 +0.18, +0.18, +0.04
22 +0.06, +0.06, -0.10
23inv = getMatInv(mat, invDetSqrt) ! compute the sqrt of the determinant of the inverse of the general matrix along with the inverse.
24invDetSqrt
25-51.0000000
26inv
27 +0.88, -0.12, +0.20
28 +0.18, +0.18, +0.04
29 +0.06, +0.06, -0.10
30mul = matmul(mat, inv)
31mul
32 +1.00, +0.00, +0.00
33 +0.00, +1.00, +0.00
34 +0.00, +0.00, +1.00
35
36
37!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38! Compute inverse of a general complex matrix.
39!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40
41
42mat
43( +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)
44( +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)
45( +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)
46( +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)
47( +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)
48( +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)
49( +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)
50( +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)
51( +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)
52inv = getMatInv(mat)
53inv
54( -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)
55( +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)
56( +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)
57( +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)
58( +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)
59( +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)
60( +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)
61( -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)
62( -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)
63inv = getMatInv(mat, info) ! gracefully catch inversion errors.
64if (info /= 0) error stop 'inversion failed.'
65inv
66( -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)
67( +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)
68( +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)
69( +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)
70( +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)
71( +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)
72( +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)
73( -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)
74( -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)
75inv = getMatInv(mat, invDetSqrt) ! compute the sqrt of the determinant of the inverse of the general matrix along with the inverse.
76invDetSqrt
77(-1683.32458, +59.8470459)
78inv
79( -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)
80( +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)
81( +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)
82( +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)
83( +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)
84( +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)
85( +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)
86( -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)
87( -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)
88mul = matmul(mat, inv)
89mul
90( +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)
91( -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)
92( -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)
93( -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)
94( -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)
95( -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)
96( +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)
97( -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)
98( -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)
99
100
101!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102! Compute inverse of an upperDiag triangular real matrix.
103!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104
105
106ndim = getUnifRand(1_IK, 6_IK)
107ndim ! matrix rank
108+1
109mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
110call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
111mat
112 +5.00
113inv = getMatInv(mat, upperDiag)
114inv
115 +0.20
116mul = matmul(mat, inv)
117mul
118 +1.00
119
120
121ndim = getUnifRand(1_IK, 6_IK)
122ndim ! matrix rank
123+4
124mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
125call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
126mat
127 +3.00, +3.00, +9.00, +7.00
128 +0.00, +3.00, +5.00, +8.00
129 +0.00, +0.00, +9.00, +9.00
130 +0.00, +0.00, +0.00, +2.00
131inv = getMatInv(mat, upperDiag)
132inv
133 +0.33, -0.33, -0.15, +0.83
134 +0.00, +0.33, -0.19, -0.50
135 +0.00, +0.00, +0.11, -0.50
136 +0.00, +0.00, +0.00, +0.50
137mul = matmul(mat, inv)
138mul
139 +1.00, +0.00, +0.00, -0.00
140 +0.00, +1.00, +0.00, +0.00
141 +0.00, +0.00, +1.00, +0.00
142 +0.00, +0.00, +0.00, +1.00
143
144
145ndim = getUnifRand(1_IK, 6_IK)
146ndim ! matrix rank
147+5
148mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
149call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
150mat
151 +4.00, +1.00, +1.00, +2.00, +5.00
152 +0.00, +8.00, +1.00, +5.00, +9.00
153 +0.00, +0.00, +6.00, +8.00, +1.00
154 +0.00, +0.00, +0.00, +2.00, +6.00
155 +0.00, +0.00, +0.00, +0.00, +3.00
156inv = getMatInv(mat, upperDiag)
157inv
158 +0.25, -0.03, -0.04, -0.03, -0.26
159 +0.00, +0.12, -0.02, -0.23, +0.09
160 +0.00, +0.00, +0.17, -0.67, +1.28
161 +0.00, +0.00, +0.00, +0.50, -1.00
162 +0.00, +0.00, +0.00, +0.00, +0.33
163mul = matmul(mat, inv)
164mul
165 +1.00, +0.00, +0.00, +0.00, +0.00
166 +0.00, +1.00, +0.00, +0.00, +0.00
167 +0.00, +0.00, +1.00, +0.00, +0.00
168 +0.00, +0.00, +0.00, +1.00, +0.00
169 +0.00, +0.00, +0.00, +0.00, +1.00
170
171
172ndim = getUnifRand(1_IK, 6_IK)
173ndim ! matrix rank
174+5
175mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
176call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
177mat
178 +9.00, +4.00, +8.00, +5.00, +6.00
179 +0.00, +1.00, +1.00, +9.00, +3.00
180 +0.00, +0.00, +8.00, +6.00, +5.00
181 +0.00, +0.00, +0.00, +3.00, +4.00
182 +0.00, +0.00, +0.00, +0.00, +2.00
183inv = getMatInv(mat, upperDiag)
184inv
185 +0.11, -0.44, -0.06, +1.26, -2.05
186 +0.00, +1.00, -0.12, -2.75, +4.31
187 +0.00, +0.00, +0.12, -0.25, +0.19
188 +0.00, +0.00, +0.00, +0.33, -0.67
189 +0.00, +0.00, +0.00, +0.00, +0.50
190mul = matmul(mat, inv)
191mul
192 +1.00, +0.00, +0.00, -0.00, +0.00
193 +0.00, +1.00, +0.00, +0.00, +0.00
194 +0.00, +0.00, +1.00, +0.00, +0.00
195 +0.00, +0.00, +0.00, +1.00, +0.00
196 +0.00, +0.00, +0.00, +0.00, +1.00
197
198
199ndim = getUnifRand(1_IK, 6_IK)
200ndim ! matrix rank
201+2
202mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
203call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
204mat
205 +5.00, +1.00
206 +0.00, +2.00
207inv = getMatInv(mat, upperDiag)
208inv
209 +0.20, -0.10
210 +0.00, +0.50
211mul = matmul(mat, inv)
212mul
213 +1.00, +0.00
214 +0.00, +1.00
215
216
217ndim = getUnifRand(1_IK, 6_IK)
218ndim ! matrix rank
219+2
220mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
221call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
222mat
223 +3.00, +9.00
224 +0.00, +5.00
225inv = getMatInv(mat, upperDiag)
226inv
227 +0.33, -0.60
228 +0.00, +0.20
229mul = matmul(mat, inv)
230mul
231 +1.00, +0.00
232 +0.00, +1.00
233
234
235ndim = getUnifRand(1_IK, 6_IK)
236ndim ! matrix rank
237+5
238mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
239call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
240mat
241 +9.00, +1.00, +1.00, +6.00, +8.00
242 +0.00, +7.00, +7.00, +9.00, +8.00
243 +0.00, +0.00, +6.00, +2.00, +9.00
244 +0.00, +0.00, +0.00, +9.00, +3.00
245 +0.00, +0.00, +0.00, +0.00, +5.00
246inv = getMatInv(mat, upperDiag)
247inv
248 +0.11, -0.02, +0.00, -0.06, -0.12
249 +0.00, +0.14, -0.17, -0.11, +0.13
250 +0.00, +0.00, +0.17, -0.04, -0.28
251 +0.00, +0.00, +0.00, +0.11, -0.07
252 +0.00, +0.00, +0.00, +0.00, +0.20
253mul = matmul(mat, inv)
254mul
255 +1.00, +0.00, +0.00, +0.00, -0.00
256 +0.00, +1.00, +0.00, +0.00, +0.00
257 +0.00, +0.00, +1.00, +0.00, +0.00
258 +0.00, +0.00, +0.00, +1.00, +0.00
259 +0.00, +0.00, +0.00, +0.00, +1.00
260
261
262ndim = getUnifRand(1_IK, 6_IK)
263ndim ! matrix rank
264+4
265mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
266call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
267mat
268 +1.00, +9.00, +5.00, +9.00
269 +0.00, +8.00, +9.00, +8.00
270 +0.00, +0.00, +9.00, +2.00
271 +0.00, +0.00, +0.00, +8.00
272inv = getMatInv(mat, upperDiag)
273inv
274 +1.00, -1.12, +0.57, -0.14
275 +0.00, +0.12, -0.12, -0.09
276 +0.00, +0.00, +0.11, -0.03
277 +0.00, +0.00, +0.00, +0.12
278mul = matmul(mat, inv)
279mul
280 +1.00, +0.00, +0.00, +0.00
281 +0.00, +1.00, +0.00, +0.00
282 +0.00, +0.00, +1.00, +0.00
283 +0.00, +0.00, +0.00, +1.00
284
285
286ndim = getUnifRand(1_IK, 6_IK)
287ndim ! matrix rank
288+5
289mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
290call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
291mat
292 +2.00, +8.00, +3.00, +1.00, +1.00
293 +0.00, +4.00, +3.00, +5.00, +7.00
294 +0.00, +0.00, +4.00, +1.00, +9.00
295 +0.00, +0.00, +0.00, +9.00, +6.00
296 +0.00, +0.00, +0.00, +0.00, +4.00
297inv = getMatInv(mat, upperDiag)
298inv
299 +0.50, -1.00, +0.38, +0.46, +0.09
300 +0.00, +0.25, -0.19, -0.12, +0.16
301 +0.00, +0.00, +0.25, -0.03, -0.52
302 +0.00, +0.00, +0.00, +0.11, -0.17
303 +0.00, +0.00, +0.00, +0.00, +0.25
304mul = matmul(mat, inv)
305mul
306 +1.00, +0.00, +0.00, -0.00, +0.00
307 +0.00, +1.00, +0.00, +0.00, +0.00
308 +0.00, +0.00, +1.00, +0.00, +0.00
309 +0.00, +0.00, +0.00, +1.00, +0.00
310 +0.00, +0.00, +0.00, +0.00, +1.00
311
312
313ndim = getUnifRand(1_IK, 6_IK)
314ndim ! matrix rank
315+5
316mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
317call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, 0._TKG, 0._TKG)
318mat
319 +6.00, +2.00, +2.00, +2.00, +9.00
320 +0.00, +9.00, +2.00, +2.00, +9.00
321 +0.00, +0.00, +1.00, +4.00, +1.00
322 +0.00, +0.00, +0.00, +8.00, +3.00
323 +0.00, +0.00, +0.00, +0.00, +2.00
324inv = getMatInv(mat, upperDiag)
325inv
326 +0.17, -0.04, -0.26, +0.10, -0.60
327 +0.00, +0.11, -0.22, +0.08, -0.51
328 +0.00, +0.00, +1.00, -0.50, +0.25
329 +0.00, +0.00, +0.00, +0.12, -0.19
330 +0.00, +0.00, +0.00, +0.00, +0.50
331mul = matmul(mat, inv)
332mul
333 +1.00, +0.00, -0.00, +0.00, +0.00
334 +0.00, +1.00, +0.00, +0.00, +0.00
335 +0.00, +0.00, +1.00, +0.00, +0.00
336 +0.00, +0.00, +0.00, +1.00, +0.00
337 +0.00, +0.00, +0.00, +0.00, +1.00
338
339
340!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341! Compute inverse of a upperDiag triangular complex matrix.
342!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343
344
345ndim = getUnifRand(1_IK, 6_IK)
346ndim ! matrix rank
347+1
348mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
349call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
350mat
351( +1.37, +1.03)
352inv = getMatInv(mat, upperDiag)
353inv
354( +0.47, -0.35)
355mul = matmul(mat, inv)
356mul
357( +1.00, -0.00)
358
359
360ndim = getUnifRand(1_IK, 6_IK)
361ndim ! matrix rank
362+6
363mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
364call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
365mat
366( +1.05, +1.95), ( +1.39, +1.10), ( +1.56, +1.64), ( +1.48, +1.18), ( +1.90, +1.48), ( +1.99, +1.92)
367( +0.00, +0.00), ( +1.30, +1.84), ( +1.90, +1.85), ( +1.81, +1.36), ( +1.65, +1.37), ( +1.17, +1.09)
368( +0.00, +0.00), ( +0.00, +0.00), ( +1.63, +1.06), ( +1.12, +1.03), ( +1.66, +1.18), ( +1.19, +1.21)
369( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.43, +1.04), ( +1.09, +1.05), ( +1.47, +1.24)
370( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.53, +1.57), ( +1.94, +1.29)
371( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.35, +1.34)
372inv = getMatInv(mat, upperDiag)
373inv
374( +0.21, -0.40), ( -0.07, +0.35), ( -0.16, -0.05), ( -0.02, +0.03), ( +0.03, +0.12), ( -0.15, +0.17)
375( +0.00, +0.00), ( +0.26, -0.36), ( -0.44, +0.42), ( +0.08, +0.15), ( +0.06, -0.17), ( +0.06, +0.03)
376( +0.00, +0.00), ( +0.00, +0.00), ( +0.43, -0.28), ( -0.40, +0.20), ( -0.08, +0.18), ( +0.05, -0.22)
377( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.46, -0.33), ( -0.31, +0.24), ( -0.12, +0.01)
378( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.32, -0.33), ( -0.30, +0.47)
379( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.37, -0.37)
380mul = matmul(mat, inv)
381mul
382( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
383( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00)
384( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
385( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
386( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00)
387( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
388
389
390ndim = getUnifRand(1_IK, 6_IK)
391ndim ! matrix rank
392+5
393mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
394call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
395mat
396( +1.61, +1.96), ( +1.62, +1.70), ( +1.14, +1.12), ( +1.83, +1.14), ( +1.93, +1.95)
397( +0.00, +0.00), ( +1.18, +1.66), ( +1.09, +1.01), ( +1.13, +1.47), ( +1.15, +1.16)
398( +0.00, +0.00), ( +0.00, +0.00), ( +1.38, +1.70), ( +1.87, +1.51), ( +1.76, +1.06)
399( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.25, +1.05), ( +1.70, +1.96)
400( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.69, +1.20)
401inv = getMatInv(mat, upperDiag)
402inv
403( +0.25, -0.30), ( -0.24, +0.39), ( -0.03, -0.04), ( +0.14, +0.13), ( -0.25, -0.09)
404( +0.00, +0.00), ( +0.29, -0.40), ( -0.15, +0.30), ( -0.20, -0.07), ( +0.07, +0.11)
405( +0.00, +0.00), ( +0.00, +0.00), ( +0.29, -0.35), ( -0.41, +0.53), ( +0.40, -0.15)
406( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.47, -0.39), ( -0.69, +0.34)
407( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.39, -0.28)
408mul = matmul(mat, inv)
409mul
410( +1.00, -0.00), ( -0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
411( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
412( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
413( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
414( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
415
416
417ndim = getUnifRand(1_IK, 6_IK)
418ndim ! matrix rank
419+5
420mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
421call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
422mat
423( +1.30, +1.23), ( +1.13, +1.21), ( +1.08, +1.23), ( +1.57, +1.59), ( +1.37, +1.08)
424( +0.00, +0.00), ( +1.58, +1.17), ( +1.14, +1.64), ( +1.09, +1.78), ( +1.33, +1.97)
425( +0.00, +0.00), ( +0.00, +0.00), ( +1.48, +1.53), ( +1.58, +1.61), ( +1.82, +1.72)
426( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.70, +1.91), ( +1.44, +1.31)
427( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.61, +1.47)
428inv = getMatInv(mat, upperDiag)
429inv
430( +0.41, -0.38), ( -0.40, +0.26), ( +0.08, +0.10), ( -0.06, +0.12), ( +0.14, -0.06)
431( +0.00, +0.00), ( +0.41, -0.30), ( -0.43, +0.22), ( -0.01, -0.03), ( -0.01, -0.00)
432( +0.00, +0.00), ( +0.00, +0.00), ( +0.33, -0.34), ( -0.27, +0.31), ( -0.14, +0.10)
433( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.26, -0.29), ( -0.23, +0.26)
434( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.34, -0.31)
435mul = matmul(mat, inv)
436mul
437( +1.00, +0.00), ( +0.00, -0.00), ( -0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00)
438( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
439( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00), ( -0.00, +0.00)
440( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.00, +0.00)
441( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
442
443
444ndim = getUnifRand(1_IK, 6_IK)
445ndim ! matrix rank
446+3
447mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
448call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
449mat
450( +1.06, +1.08), ( +1.64, +1.15), ( +1.87, +1.30)
451( +0.00, +0.00), ( +1.15, +1.49), ( +1.50, +1.00)
452( +0.00, +0.00), ( +0.00, +0.00), ( +1.91, +1.43)
453inv = getMatInv(mat, upperDiag)
454inv
455( +0.46, -0.47), ( -0.32, +0.62), ( -0.21, -0.02)
456( +0.00, +0.00), ( +0.32, -0.42), ( -0.23, +0.33)
457( +0.00, +0.00), ( +0.00, +0.00), ( +0.34, -0.25)
458mul = matmul(mat, inv)
459mul
460( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
461( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
462( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00)
463
464
465ndim = getUnifRand(1_IK, 6_IK)
466ndim ! matrix rank
467+5
468mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
469call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
470mat
471( +2.00, +1.28), ( +1.33, +1.12), ( +1.91, +1.31), ( +1.77, +1.10), ( +1.58, +1.66)
472( +0.00, +0.00), ( +1.82, +1.48), ( +1.79, +1.32), ( +1.57, +1.88), ( +1.32, +1.70)
473( +0.00, +0.00), ( +0.00, +0.00), ( +1.67, +1.34), ( +1.34, +1.49), ( +1.20, +1.69)
474( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.61, +1.25), ( +1.60, +1.84)
475( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.39, +1.32)
476inv = getMatInv(mat, upperDiag)
477inv
478( +0.35, -0.23), ( -0.27, +0.16), ( -0.10, +0.09), ( +0.13, +0.07), ( -0.14, -0.07)
479( +0.00, +0.00), ( +0.33, -0.27), ( -0.33, +0.29), ( -0.09, +0.01), ( +0.11, +0.01)
480( +0.00, +0.00), ( +0.00, +0.00), ( +0.36, -0.29), ( -0.40, +0.22), ( +0.09, +0.01)
481( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.39, -0.30), ( -0.53, +0.33)
482( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.38, -0.36)
483mul = matmul(mat, inv)
484mul
485( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
486( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00)
487( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00)
488( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
489( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
490
491
492ndim = getUnifRand(1_IK, 6_IK)
493ndim ! matrix rank
494+1
495mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
496call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
497mat
498( +1.63, +1.94)
499inv = getMatInv(mat, upperDiag)
500inv
501( +0.25, -0.30)
502mul = matmul(mat, inv)
503mul
504( +1.00, +0.00)
505
506
507ndim = getUnifRand(1_IK, 6_IK)
508ndim ! matrix rank
509+3
510mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
511call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
512mat
513( +1.97, +1.93), ( +1.79, +1.94), ( +1.26, +1.66)
514( +0.00, +0.00), ( +1.71, +1.06), ( +1.91, +1.37)
515( +0.00, +0.00), ( +0.00, +0.00), ( +1.21, +1.30)
516inv = getMatInv(mat, upperDiag)
517inv
518( +0.26, -0.25), ( -0.42, +0.23), ( +0.15, -0.14)
519( +0.00, +0.00), ( +0.42, -0.26), ( -0.48, +0.45)
520( +0.00, +0.00), ( +0.00, +0.00), ( +0.38, -0.41)
521mul = matmul(mat, inv)
522mul
523( +1.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00)
524( +0.00, +0.00), ( +1.00, -0.00), ( -0.00, +0.00)
525( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
526
527
528ndim = getUnifRand(1_IK, 6_IK)
529ndim ! matrix rank
530+4
531mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
532call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
533mat
534( +1.34, +1.91), ( +1.09, +1.30), ( +1.12, +1.42), ( +1.06, +1.20)
535( +0.00, +0.00), ( +1.02, +1.40), ( +1.72, +1.71), ( +1.76, +1.72)
536( +0.00, +0.00), ( +0.00, +0.00), ( +1.76, +1.24), ( +1.92, +1.14)
537( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.87, +1.12)
538inv = getMatInv(mat, upperDiag)
539inv
540( +0.25, -0.35), ( -0.22, +0.36), ( +0.02, -0.13), ( +0.06, -0.01)
541( +0.00, +0.00), ( +0.34, -0.47), ( -0.46, +0.46), ( -0.02, -0.05)
542( +0.00, +0.00), ( +0.00, +0.00), ( +0.38, -0.27), ( -0.39, +0.28)
543( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.39, -0.24)
544mul = matmul(mat, inv)
545mul
546( +1.00, -0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00)
547( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00)
548( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
549( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
550
551
552ndim = getUnifRand(1_IK, 6_IK)
553ndim ! matrix rank
554+5
555mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
556call setMatInit(mat(2 : ndim, 1 : ndim - 1), lowDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
557mat
558( +1.74, +1.46), ( +1.22, +1.41), ( +1.99, +1.21), ( +1.99, +1.37), ( +1.97, +1.22)
559( +0.00, +0.00), ( +1.54, +1.35), ( +1.95, +1.64), ( +1.21, +1.17), ( +1.57, +1.60)
560( +0.00, +0.00), ( +0.00, +0.00), ( +1.89, +1.38), ( +1.68, +1.12), ( +1.09, +1.29)
561( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.42, +1.41), ( +1.84, +1.56)
562( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.57, +1.88)
563inv = getMatInv(mat, upperDiag)
564inv
565( +0.34, -0.28), ( -0.34, +0.21), ( +0.07, +0.10), ( -0.15, +0.14), ( +0.14, -0.09)
566( +0.00, +0.00), ( +0.37, -0.32), ( -0.42, +0.32), ( +0.05, -0.12), ( -0.05, +0.23)
567( +0.00, +0.00), ( +0.00, +0.00), ( +0.35, -0.25), ( -0.29, +0.32), ( -0.01, -0.18)
568( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.35, -0.35), ( -0.28, +0.40)
569( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.26, -0.31)
570mul = matmul(mat, inv)
571mul
572( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( -0.00, -0.00)
573( +0.00, +0.00), ( +1.00, -0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
574( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00)
575( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, -0.00)
576( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
577
578
579!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
580! Compute inverse of a lowerDiag triangular real matrix.
581!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
582
583
584ndim = getUnifRand(1_IK, 6_IK)
585ndim ! matrix rank
586+2
587mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
588call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
589mat
590 +7.00, +0.00
591 +9.00, +4.00
592inv = getMatInv(mat, lowerDiag)
593inv
594 +0.14, +0.00
595 -0.32, +0.25
596mul = matmul(mat, inv)
597mul
598 +1.00, +0.00
599 +0.00, +1.00
600
601
602ndim = getUnifRand(1_IK, 6_IK)
603ndim ! matrix rank
604+5
605mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
606call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
607mat
608 +7.00, +0.00, +0.00, +0.00, +0.00
609 +7.00, +3.00, +0.00, +0.00, +0.00
610 +8.00, +6.00, +5.00, +0.00, +0.00
611 +1.00, +2.00, +7.00, +4.00, +0.00
612 +4.00, +1.00, +5.00, +3.00, +2.00
613inv = getMatInv(mat, lowerDiag)
614inv
615 +0.14, +0.00, +0.00, +0.00, +0.00
616 -0.33, +0.33, +0.00, +0.00, +0.00
617 +0.17, -0.40, +0.20, +0.00, +0.00
618 -0.17, +0.53, -0.35, +0.25, +0.00
619 -0.29, +0.03, +0.02, -0.38, +0.50
620mul = matmul(mat, inv)
621mul
622 +1.00, +0.00, +0.00, +0.00, +0.00
623 +0.00, +1.00, +0.00, +0.00, +0.00
624 +0.00, +0.00, +1.00, +0.00, +0.00
625 +0.00, +0.00, +0.00, +1.00, +0.00
626 +0.00, +0.00, +0.00, +0.00, +1.00
627
628
629ndim = getUnifRand(1_IK, 6_IK)
630ndim ! matrix rank
631+5
632mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
633call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
634mat
635 +4.00, +0.00, +0.00, +0.00, +0.00
636 +5.00, +1.00, +0.00, +0.00, +0.00
637 +3.00, +2.00, +9.00, +0.00, +0.00
638 +7.00, +6.00, +6.00, +1.00, +0.00
639 +9.00, +8.00, +2.00, +3.00, +8.00
640inv = getMatInv(mat, lowerDiag)
641inv
642 +0.25, +0.00, +0.00, +0.00, +0.00
643 -1.25, +1.00, +0.00, +0.00, +0.00
644 +0.19, -0.22, +0.11, +0.00, +0.00
645 +4.58, -4.67, -0.67, +1.00, +0.00
646 -0.80, +0.81, +0.22, -0.38, +0.12
647mul = matmul(mat, inv)
648mul
649 +1.00, +0.00, +0.00, +0.00, +0.00
650 +0.00, +1.00, +0.00, +0.00, +0.00
651 +0.00, +0.00, +1.00, +0.00, +0.00
652 +0.00, +0.00, +0.00, +1.00, +0.00
653 +0.00, +0.00, +0.00, +0.00, +1.00
654
655
656ndim = getUnifRand(1_IK, 6_IK)
657ndim ! matrix rank
658+3
659mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
660call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
661mat
662 +5.00, +0.00, +0.00
663 +2.00, +5.00, +0.00
664 +7.00, +7.00, +1.00
665inv = getMatInv(mat, lowerDiag)
666inv
667 +0.20, +0.00, +0.00
668 -0.08, +0.20, +0.00
669 -0.84, -1.40, +1.00
670mul = matmul(mat, inv)
671mul
672 +1.00, +0.00, +0.00
673 -0.00, +1.00, +0.00
674 +0.00, +0.00, +1.00
675
676
677ndim = getUnifRand(1_IK, 6_IK)
678ndim ! matrix rank
679+6
680mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
681call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
682mat
683 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
684 +6.00, +5.00, +0.00, +0.00, +0.00, +0.00
685 +2.00, +6.00, +1.00, +0.00, +0.00, +0.00
686 +8.00, +1.00, +3.00, +9.00, +0.00, +0.00
687 +6.00, +5.00, +2.00, +8.00, +7.00, +0.00
688 +5.00, +5.00, +9.00, +3.00, +2.00, +1.00
689inv = getMatInv(mat, lowerDiag)
690inv
691 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
692 -1.20, +0.20, +0.00, +0.00, +0.00, +0.00
693 +5.20, -1.20, +1.00, +0.00, +0.00, +0.00
694 -2.49, +0.38, -0.33, +0.11, +0.00, +0.00
695 +1.36, -0.23, +0.10, -0.13, +0.14, +0.00
696 -41.05, +9.13, -8.19, -0.08, -0.29, +1.00
697mul = matmul(mat, inv)
698mul
699 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
700 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
701 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
702 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
703 +0.00, +0.00, +0.00, -0.00, +1.00, +0.00
704 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
705
706
707ndim = getUnifRand(1_IK, 6_IK)
708ndim ! matrix rank
709+2
710mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
711call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
712mat
713 +1.00, +0.00
714 +1.00, +6.00
715inv = getMatInv(mat, lowerDiag)
716inv
717 +1.00, +0.00
718 -0.17, +0.17
719mul = matmul(mat, inv)
720mul
721 +1.00, +0.00
722 +0.00, +1.00
723
724
725ndim = getUnifRand(1_IK, 6_IK)
726ndim ! matrix rank
727+2
728mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
729call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
730mat
731 +8.00, +0.00
732 +6.00, +2.00
733inv = getMatInv(mat, lowerDiag)
734inv
735 +0.12, +0.00
736 -0.38, +0.50
737mul = matmul(mat, inv)
738mul
739 +1.00, +0.00
740 +0.00, +1.00
741
742
743ndim = getUnifRand(1_IK, 6_IK)
744ndim ! matrix rank
745+6
746mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
747call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
748mat
749 +7.00, +0.00, +0.00, +0.00, +0.00, +0.00
750 +1.00, +8.00, +0.00, +0.00, +0.00, +0.00
751 +5.00, +2.00, +1.00, +0.00, +0.00, +0.00
752 +5.00, +7.00, +6.00, +2.00, +0.00, +0.00
753 +6.00, +6.00, +2.00, +1.00, +3.00, +0.00
754 +3.00, +3.00, +4.00, +3.00, +5.00, +6.00
755inv = getMatInv(mat, lowerDiag)
756inv
757 +0.14, +0.00, +0.00, +0.00, +0.00, +0.00
758 -0.02, +0.12, +0.00, +0.00, +0.00, +0.00
759 -0.68, -0.25, +1.00, +0.00, +0.00, +0.00
760 +1.74, +0.31, -3.00, +0.50, +0.00, +0.00
761 -0.38, -0.19, +0.33, -0.17, +0.33, +0.00
762 -0.17, +0.10, +0.56, -0.11, -0.28, +0.17
763mul = matmul(mat, inv)
764mul
765 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
766 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
767 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
768 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
769 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
770 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
771
772
773ndim = getUnifRand(1_IK, 6_IK)
774ndim ! matrix rank
775+3
776mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
777call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
778mat
779 +5.00, +0.00, +0.00
780 +8.00, +3.00, +0.00
781 +8.00, +3.00, +9.00
782inv = getMatInv(mat, lowerDiag)
783inv
784 +0.20, +0.00, +0.00
785 -0.53, +0.33, +0.00
786 +0.00, -0.11, +0.11
787mul = matmul(mat, inv)
788mul
789 +1.00, +0.00, +0.00
790 -0.00, +1.00, +0.00
791 +0.00, +0.00, +1.00
792
793
794ndim = getUnifRand(1_IK, 6_IK)
795ndim ! matrix rank
796+4
797mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
798call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, 0._TKG, 0._TKG)
799mat
800 +8.00, +0.00, +0.00, +0.00
801 +3.00, +6.00, +0.00, +0.00
802 +4.00, +5.00, +7.00, +0.00
803 +5.00, +9.00, +3.00, +9.00
804inv = getMatInv(mat, lowerDiag)
805inv
806 +0.12, +0.00, +0.00, +0.00
807 -0.06, +0.17, +0.00, +0.00
808 -0.03, -0.12, +0.14, +0.00
809 +0.00, -0.13, -0.05, +0.11
810mul = matmul(mat, inv)
811mul
812 +1.00, +0.00, +0.00, +0.00
813 +0.00, +1.00, +0.00, +0.00
814 -0.00, +0.00, +1.00, +0.00
815 +0.00, +0.00, +0.00, +1.00
816
817
818!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
819! Compute inverse of a lowerDiag triangular complex matrix.
820!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
821
822
823ndim = getUnifRand(1_IK, 6_IK)
824ndim ! matrix rank
825+1
826mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
827call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
828mat
829( +1.02, +1.19)
830inv = getMatInv(mat, lowerDiag)
831inv
832( +0.41, -0.49)
833mul = matmul(mat, inv)
834mul
835( +1.00, +0.00)
836
837
838ndim = getUnifRand(1_IK, 6_IK)
839ndim ! matrix rank
840+4
841mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
842call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
843mat
844( +2.00, +1.41), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
845( +1.94, +1.35), ( +1.30, +1.83), ( +0.00, +0.00), ( +0.00, +0.00)
846( +1.61, +1.72), ( +1.34, +1.19), ( +1.09, +1.08), ( +0.00, +0.00)
847( +1.32, +1.58), ( +1.53, +1.25), ( +1.39, +1.29), ( +1.18, +1.21)
848inv = getMatInv(mat, lowerDiag)
849inv
850( +0.33, -0.24), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
851( -0.25, +0.35), ( +0.26, -0.36), ( +0.00, +0.00), ( +0.00, +0.00)
852( -0.26, -0.08), ( -0.28, +0.44), ( +0.46, -0.46), ( +0.00, +0.00)
853( +0.11, -0.11), ( +0.03, -0.05), ( -0.49, +0.54), ( +0.41, -0.43)
854mul = matmul(mat, inv)
855mul
856( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
857( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00)
858( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00)
859( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, -0.00)
860
861
862ndim = getUnifRand(1_IK, 6_IK)
863ndim ! matrix rank
864+2
865mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
866call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
867mat
868( +1.05, +1.91), ( +0.00, +0.00)
869( +1.42, +1.41), ( +1.28, +1.61)
870inv = getMatInv(mat, lowerDiag)
871inv
872( +0.22, -0.40), ( +0.00, +0.00)
873( -0.17, +0.41), ( +0.30, -0.38)
874mul = matmul(mat, inv)
875mul
876( +1.00, +0.00), ( +0.00, +0.00)
877( +0.00, -0.00), ( +1.00, +0.00)
878
879
880ndim = getUnifRand(1_IK, 6_IK)
881ndim ! matrix rank
882+3
883mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
884call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
885mat
886( +1.77, +1.31), ( +0.00, +0.00), ( +0.00, +0.00)
887( +1.32, +1.45), ( +1.17, +1.20), ( +0.00, +0.00)
888( +1.36, +1.11), ( +1.63, +1.89), ( +1.24, +1.80)
889inv = getMatInv(mat, lowerDiag)
890inv
891( +0.36, -0.27), ( +0.00, +0.00), ( +0.00, +0.00)
892( -0.44, +0.30), ( +0.41, -0.43), ( +0.00, +0.00)
893( +0.24, -0.11), ( -0.42, +0.53), ( +0.26, -0.38)
894mul = matmul(mat, inv)
895mul
896( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
897( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, +0.00)
898( +0.00, -0.00), ( +0.00, +0.00), ( +1.00, -0.00)
899
900
901ndim = getUnifRand(1_IK, 6_IK)
902ndim ! matrix rank
903+6
904mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
905call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
906mat
907( +1.33, +1.56), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
908( +1.27, +1.96), ( +1.22, +1.94), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
909( +1.57, +1.57), ( +1.06, +1.86), ( +1.65, +1.36), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
910( +1.01, +1.35), ( +1.61, +1.51), ( +1.75, +1.39), ( +1.31, +1.76), ( +0.00, +0.00), ( +0.00, +0.00)
911( +1.10, +1.83), ( +1.02, +1.63), ( +1.05, +1.41), ( +1.30, +1.36), ( +1.60, +1.36), ( +0.00, +0.00)
912( +1.30, +1.18), ( +1.71, +1.39), ( +1.03, +1.45), ( +1.53, +1.23), ( +1.82, +1.45), ( +1.70, +1.92)
913inv = getMatInv(mat, lowerDiag)
914inv
915( +0.32, -0.37), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
916( -0.32, +0.38), ( +0.23, -0.37), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
917( +0.07, +0.11), ( -0.35, +0.26), ( +0.36, -0.30), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
918( -0.09, -0.24), ( +0.11, +0.06), ( -0.28, +0.39), ( +0.27, -0.37), ( +0.00, +0.00), ( +0.00, +0.00)
919( -0.02, +0.13), ( -0.06, +0.05), ( -0.07, -0.15), ( -0.28, +0.30), ( +0.36, -0.31), ( +0.00, +0.00)
920( +0.09, -0.12), ( +0.07, +0.11), ( -0.03, -0.03), ( +0.04, -0.00), ( -0.28, +0.33), ( +0.26, -0.29)
921mul = matmul(mat, inv)
922mul
923( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
924( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
925( -0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
926( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
927( +0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
928( +0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
929
930
931ndim = getUnifRand(1_IK, 6_IK)
932ndim ! matrix rank
933+4
934mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
935call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
936mat
937( +1.00, +1.01), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
938( +1.09, +1.87), ( +1.15, +1.99), ( +0.00, +0.00), ( +0.00, +0.00)
939( +1.20, +1.73), ( +1.43, +1.11), ( +1.92, +1.04), ( +0.00, +0.00)
940( +1.92, +1.25), ( +1.98, +1.71), ( +1.10, +1.14), ( +1.38, +1.54)
941inv = getMatInv(mat, lowerDiag)
942inv
943( +0.49, -0.50), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
944( -0.46, +0.47), ( +0.22, -0.38), ( +0.00, +0.00), ( +0.00, +0.00)
945( -0.20, -0.11), ( -0.23, +0.28), ( +0.40, -0.22), ( +0.00, +0.00)
946( +0.28, +0.09), ( -0.05, +0.29), ( -0.30, +0.18), ( +0.32, -0.36)
947mul = matmul(mat, inv)
948mul
949( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
950( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
951( -0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00)
952( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00)
953
954
955ndim = getUnifRand(1_IK, 6_IK)
956ndim ! matrix rank
957+3
958mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
959call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
960mat
961( +1.85, +1.88), ( +0.00, +0.00), ( +0.00, +0.00)
962( +1.05, +1.49), ( +1.38, +1.70), ( +0.00, +0.00)
963( +1.15, +1.51), ( +1.23, +1.06), ( +1.33, +1.44)
964inv = getMatInv(mat, lowerDiag)
965inv
966( +0.27, -0.27), ( +0.00, +0.00), ( +0.00, +0.00)
967( -0.24, +0.21), ( +0.29, -0.35), ( +0.00, +0.00)
968( -0.11, +0.04), ( -0.20, +0.32), ( +0.35, -0.37)
969mul = matmul(mat, inv)
970mul
971( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
972( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
973( +0.00, +0.00), ( -0.00, +0.00), ( +1.00, -0.00)
974
975
976ndim = getUnifRand(1_IK, 6_IK)
977ndim ! matrix rank
978+6
979mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
980call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
981mat
982( +1.06, +1.99), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
983( +1.63, +1.48), ( +1.52, +1.76), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
984( +1.46, +1.71), ( +1.41, +1.84), ( +1.93, +1.28), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
985( +1.39, +1.21), ( +1.20, +1.55), ( +1.01, +1.78), ( +1.20, +1.07), ( +0.00, +0.00), ( +0.00, +0.00)
986( +1.25, +1.42), ( +1.25, +1.85), ( +1.36, +1.01), ( +1.99, +1.76), ( +1.92, +1.74), ( +0.00, +0.00)
987( +1.69, +1.62), ( +1.38, +1.45), ( +1.41, +1.25), ( +1.36, +1.39), ( +1.95, +1.80), ( +1.46, +1.16)
988inv = getMatInv(mat, lowerDiag)
989inv
990( +0.21, -0.39), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
991( -0.15, +0.39), ( +0.28, -0.33), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
992( -0.03, -0.01), ( -0.37, +0.22), ( +0.36, -0.24), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
993( +0.06, +0.04), ( +0.13, +0.22), ( -0.53, +0.14), ( +0.46, -0.41), ( +0.00, +0.00), ( +0.00, +0.00)
994( -0.02, -0.07), ( -0.21, -0.17), ( +0.32, +0.03), ( -0.47, +0.43), ( +0.29, -0.26), ( +0.00, +0.00)
995( -0.09, +0.13), ( +0.21, +0.13), ( -0.27, +0.07), ( +0.18, -0.19), ( -0.43, +0.34), ( +0.42, -0.33)
996mul = matmul(mat, inv)
997mul
998( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
999( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1000( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1001( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1002( +0.00, -0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1003( +0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +1.00, +0.00)
1004
1005
1006ndim = getUnifRand(1_IK, 6_IK)
1007ndim ! matrix rank
1008+1
1009mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
1010call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
1011mat
1012( +1.49, +1.04)
1013inv = getMatInv(mat, lowerDiag)
1014inv
1015( +0.45, -0.31)
1016mul = matmul(mat, inv)
1017mul
1018( +1.00, +0.00)
1019
1020
1021ndim = getUnifRand(1_IK, 6_IK)
1022ndim ! matrix rank
1023+3
1024mat = getUnifRand((1., 1.), (2., 2.), ndim, ndim)
1025call setMatInit(mat(1 : ndim - 1, 2 : ndim), uppDia, (0._TKG, 0._TKG), (0._TKG, 0._TKG))
1026mat
1027( +1.42, +1.07), ( +0.00, +0.00), ( +0.00, +0.00)
1028( +1.53, +1.81), ( +1.38, +1.04), ( +0.00, +0.00)
1029( +1.57, +1.35), ( +1.03, +1.70), ( +1.69, +1.24)
1030inv = getMatInv(mat, lowerDiag)
1031inv
1032( +0.45, -0.34), ( +0.00, +0.00), ( +0.00, +0.00)
1033( -0.70, +0.32), ( +0.46, -0.35), ( +0.00, +0.00)
1034( +0.27, +0.28), ( -0.53, +0.14), ( +0.39, -0.28)
1035mul = matmul(mat, inv)
1036mul
1037( +1.00, -0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1038( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1039( -0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1040
1041
1042!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1043! Compute inverse of a upperUnit triangular real matrix.
1044!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1045
1046
1047ndim = getUnifRand(1_IK, 6_IK)
1048ndim ! matrix rank
1049+3
1050mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1051call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1052mat
1053 +1.00, +3.00, +9.00
1054 +0.00, +1.00, +7.00
1055 +0.00, +0.00, +1.00
1056inv = getMatInv(mat, upperUnit)
1057inv
1058 +1.00, -3.00, +12.00
1059 +0.00, +1.00, -7.00
1060 +0.00, +0.00, +1.00
1061mul = matmul(mat, inv)
1062mul
1063 +1.00, +0.00, +0.00
1064 +0.00, +1.00, +0.00
1065 +0.00, +0.00, +1.00
1066
1067
1068ndim = getUnifRand(1_IK, 6_IK)
1069ndim ! matrix rank
1070+6
1071mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1072call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1073mat
1074 +1.00, +8.00, +7.00, +7.00, +1.00, +3.00
1075 +0.00, +1.00, +5.00, +1.00, +5.00, +6.00
1076 +0.00, +0.00, +1.00, +2.00, +6.00, +8.00
1077 +0.00, +0.00, +0.00, +1.00, +6.00, +4.00
1078 +0.00, +0.00, +0.00, +0.00, +1.00, +5.00
1079 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1080inv = getMatInv(mat, upperUnit)
1081inv
1082 +1.00, -8.00, +33.00, -65.00, +231.00, -1114.00
1083 +0.00, +1.00, -5.00, +9.00, -29.00, +143.00
1084 +0.00, +0.00, +1.00, -2.00, +6.00, -30.00
1085 +0.00, +0.00, +0.00, +1.00, -6.00, +26.00
1086 +0.00, +0.00, +0.00, +0.00, +1.00, -5.00
1087 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1088mul = matmul(mat, inv)
1089mul
1090 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1091 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
1092 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
1093 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
1094 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
1095 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1096
1097
1098ndim = getUnifRand(1_IK, 6_IK)
1099ndim ! matrix rank
1100+1
1101mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1102call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1103mat
1104 +1.00
1105inv = getMatInv(mat, upperUnit)
1106inv
1107 +1.00
1108mul = matmul(mat, inv)
1109mul
1110 +1.00
1111
1112
1113ndim = getUnifRand(1_IK, 6_IK)
1114ndim ! matrix rank
1115+2
1116mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1117call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1118mat
1119 +1.00, +9.00
1120 +0.00, +1.00
1121inv = getMatInv(mat, upperUnit)
1122inv
1123 +1.00, -9.00
1124 +0.00, +1.00
1125mul = matmul(mat, inv)
1126mul
1127 +1.00, +0.00
1128 +0.00, +1.00
1129
1130
1131ndim = getUnifRand(1_IK, 6_IK)
1132ndim ! matrix rank
1133+1
1134mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1135call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1136mat
1137 +1.00
1138inv = getMatInv(mat, upperUnit)
1139inv
1140 +1.00
1141mul = matmul(mat, inv)
1142mul
1143 +1.00
1144
1145
1146ndim = getUnifRand(1_IK, 6_IK)
1147ndim ! matrix rank
1148+2
1149mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1150call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1151mat
1152 +1.00, +2.00
1153 +0.00, +1.00
1154inv = getMatInv(mat, upperUnit)
1155inv
1156 +1.00, -2.00
1157 +0.00, +1.00
1158mul = matmul(mat, inv)
1159mul
1160 +1.00, +0.00
1161 +0.00, +1.00
1162
1163
1164ndim = getUnifRand(1_IK, 6_IK)
1165ndim ! matrix rank
1166+1
1167mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1168call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1169mat
1170 +1.00
1171inv = getMatInv(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+4
1182mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1183call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1184mat
1185 +1.00, +4.00, +2.00, +8.00
1186 +0.00, +1.00, +1.00, +8.00
1187 +0.00, +0.00, +1.00, +9.00
1188 +0.00, +0.00, +0.00, +1.00
1189inv = getMatInv(mat, upperUnit)
1190inv
1191 +1.00, -4.00, +2.00, +6.00
1192 +0.00, +1.00, -1.00, +1.00
1193 +0.00, +0.00, +1.00, -9.00
1194 +0.00, +0.00, +0.00, +1.00
1195mul = matmul(mat, inv)
1196mul
1197 +1.00, +0.00, +0.00, +0.00
1198 +0.00, +1.00, +0.00, +0.00
1199 +0.00, +0.00, +1.00, +0.00
1200 +0.00, +0.00, +0.00, +1.00
1201
1202
1203ndim = getUnifRand(1_IK, 6_IK)
1204ndim ! matrix rank
1205+4
1206mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1207call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1208mat
1209 +1.00, +4.00, +5.00, +3.00
1210 +0.00, +1.00, +2.00, +4.00
1211 +0.00, +0.00, +1.00, +1.00
1212 +0.00, +0.00, +0.00, +1.00
1213inv = getMatInv(mat, upperUnit)
1214inv
1215 +1.00, -4.00, +3.00, +10.00
1216 +0.00, +1.00, -2.00, -2.00
1217 +0.00, +0.00, +1.00, -1.00
1218 +0.00, +0.00, +0.00, +1.00
1219mul = matmul(mat, inv)
1220mul
1221 +1.00, +0.00, +0.00, +0.00
1222 +0.00, +1.00, +0.00, +0.00
1223 +0.00, +0.00, +1.00, +0.00
1224 +0.00, +0.00, +0.00, +1.00
1225
1226
1227ndim = getUnifRand(1_IK, 6_IK)
1228ndim ! matrix rank
1229+6
1230mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1231call setMatInit(mat, lowDia, 0._TKG, 1._TKG)
1232mat
1233 +1.00, +4.00, +7.00, +7.00, +5.00, +9.00
1234 +0.00, +1.00, +9.00, +2.00, +7.00, +4.00
1235 +0.00, +0.00, +1.00, +1.00, +9.00, +2.00
1236 +0.00, +0.00, +0.00, +1.00, +2.00, +4.00
1237 +0.00, +0.00, +0.00, +0.00, +1.00, +5.00
1238 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1239inv = getMatInv(mat, upperUnit)
1240inv
1241 +1.00, -4.00, +29.00, -28.00, -182.00, +971.00
1242 +0.00, +1.00, -9.00, +7.00, +60.00, -314.00
1243 +0.00, +0.00, +1.00, -1.00, -7.00, +37.00
1244 +0.00, +0.00, +0.00, +1.00, -2.00, +6.00
1245 +0.00, +0.00, +0.00, +0.00, +1.00, -5.00
1246 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1247mul = matmul(mat, inv)
1248mul
1249 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1250 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
1251 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
1252 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
1253 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
1254 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1255
1256
1257!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1258! Compute inverse of a upperUnit triangular complex matrix.
1259!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1260
1261
1262ndim = getUnifRand(1_IK, 6_IK)
1263ndim ! matrix rank
1264+6
1265mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1266call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1267mat
1268( +1.00, +0.00), ( -0.35, -0.38), ( +0.45, +0.09), ( -0.89, +0.11), ( +0.65, -0.41), ( -0.01, +0.83)
1269( +0.00, +0.00), ( +1.00, +0.00), ( +0.84, -0.07), ( -0.36, +0.11), ( -0.19, +0.63), ( -0.90, +0.95)
1270( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.75, -0.06), ( +0.12, -0.02), ( -0.87, -0.91)
1271( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.14, -0.03), ( -0.26, +0.47)
1272( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.94, -0.35)
1273( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1274inv = getMatInv(mat, upperUnit)
1275inv
1276( +1.00, +0.00), ( +0.35, +0.38), ( -0.77, -0.38), ( +0.50, -0.35), ( -0.29, +0.36), ( -0.09, -1.95)
1277( +0.00, +0.00), ( +1.00, +0.00), ( -0.84, +0.07), ( -0.28, -0.11), ( +0.33, -0.65), ( +0.52, -2.04)
1278( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.75, +0.06), ( -0.23, +0.04), ( +0.87, +0.52)
1279( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.14, +0.03), ( +0.12, -0.49)
1280( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.94, +0.35)
1281( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1282mul = matmul(mat, inv)
1283mul
1284( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00), ( +0.00, -0.00), ( +0.00, +0.00)
1285( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, -0.00)
1286( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1287( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1288( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
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)
1290
1291
1292ndim = getUnifRand(1_IK, 6_IK)
1293ndim ! matrix rank
1294+3
1295mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1296call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1297mat
1298( +1.00, +0.00), ( +0.42, +0.99), ( -0.31, +0.53)
1299( +0.00, +0.00), ( +1.00, +0.00), ( -0.73, -0.34)
1300( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1301inv = getMatInv(mat, upperUnit)
1302inv
1303( +1.00, +0.00), ( -0.42, -0.99), ( +0.34, -1.41)
1304( +0.00, +0.00), ( +1.00, +0.00), ( +0.73, +0.34)
1305( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1306mul = matmul(mat, inv)
1307mul
1308( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1309( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1310( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1311
1312
1313ndim = getUnifRand(1_IK, 6_IK)
1314ndim ! matrix rank
1315+5
1316mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1317call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1318mat
1319( +1.00, +0.00), ( +0.91, -0.85), ( -0.61, +0.93), ( -0.18, -0.54), ( +0.76, -0.80)
1320( +0.00, +0.00), ( +1.00, +0.00), ( -0.71, -0.58), ( -0.19, -0.95), ( +0.84, +0.87)
1321( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.61, +0.02), ( -0.46, -0.57)
1322( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.46, -0.61)
1323( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1324inv = getMatInv(mat, upperUnit)
1325inv
1326( +1.00, +0.00), ( -0.91, +0.85), ( -0.52, -0.86), ( -1.14, -0.68), ( +1.92, -0.21)
1327( +0.00, +0.00), ( +1.00, +0.00), ( +0.71, +0.58), ( +0.64, +1.30), ( -1.93, -0.40)
1328( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.61, -0.02), ( +0.19, +0.96)
1329( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.46, +0.61)
1330( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1331mul = matmul(mat, inv)
1332mul
1333( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1334( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( +0.00, -0.00)
1335( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1336( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1337( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1338
1339
1340ndim = getUnifRand(1_IK, 6_IK)
1341ndim ! matrix rank
1342+5
1343mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1344call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1345mat
1346( +1.00, +0.00), ( -0.26, +0.76), ( +0.44, +0.15), ( +0.46, -0.83), ( +0.45, -0.62)
1347( +0.00, +0.00), ( +1.00, +0.00), ( +0.11, +0.57), ( +0.79, -0.58), ( -0.68, +0.52)
1348( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.50, +0.85), ( -0.90, +0.50)
1349( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.52, +0.31)
1350( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1351inv = getMatInv(mat, upperUnit)
1352inv
1353( +1.00, +0.00), ( +0.26, -0.76), ( -0.91, -0.22), ( -0.87, +2.24), ( -1.36, +1.66)
1354( +0.00, +0.00), ( +1.00, +0.00), ( -0.11, -0.57), ( -1.33, +0.38), ( -0.28, -0.37)
1355( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.50, -0.85), ( +0.89, -1.09)
1356( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.52, -0.31)
1357( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1358mul = matmul(mat, inv)
1359mul
1360( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00)
1361( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1362( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1363( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1364( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1365
1366
1367ndim = getUnifRand(1_IK, 6_IK)
1368ndim ! matrix rank
1369+3
1370mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1371call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1372mat
1373( +1.00, +0.00), ( +0.24, +0.37), ( -0.22, +0.73)
1374( +0.00, +0.00), ( +1.00, +0.00), ( -0.40, +0.18)
1375( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1376inv = getMatInv(mat, upperUnit)
1377inv
1378( +1.00, +0.00), ( -0.24, -0.37), ( +0.06, -0.84)
1379( +0.00, +0.00), ( +1.00, +0.00), ( +0.40, -0.18)
1380( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1381mul = matmul(mat, inv)
1382mul
1383( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1384( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1385( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1386
1387
1388ndim = getUnifRand(1_IK, 6_IK)
1389ndim ! matrix rank
1390+2
1391mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1392call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1393mat
1394( +1.00, +0.00), ( -0.18, +0.64)
1395( +0.00, +0.00), ( +1.00, +0.00)
1396inv = getMatInv(mat, upperUnit)
1397inv
1398( +1.00, +0.00), ( +0.18, -0.64)
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+3
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.10, -0.27), ( +0.76, +0.98)
1413( +0.00, +0.00), ( +1.00, +0.00), ( +0.22, +0.00)
1414( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1415inv = getMatInv(mat, upperUnit)
1416inv
1417( +1.00, +0.00), ( -0.10, +0.27), ( -0.74, -1.04)
1418( +0.00, +0.00), ( +1.00, +0.00), ( -0.22, -0.00)
1419( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1420mul = matmul(mat, inv)
1421mul
1422( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1423( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1424( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1425
1426
1427ndim = getUnifRand(1_IK, 6_IK)
1428ndim ! matrix rank
1429+4
1430mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1431call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1432mat
1433( +1.00, +0.00), ( +0.41, +0.67), ( -1.00, +0.25), ( +0.34, -0.73)
1434( +0.00, +0.00), ( +1.00, +0.00), ( +0.97, +0.21), ( -0.10, +0.49)
1435( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( -0.26, +0.61)
1436( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1437inv = getMatInv(mat, upperUnit)
1438inv
1439( +1.00, +0.00), ( -0.41, -0.67), ( +1.25, +0.50), ( -0.08, +0.23)
1440( +0.00, +0.00), ( +1.00, +0.00), ( -0.97, -0.21), ( -0.28, +0.04)
1441( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.26, -0.61)
1442( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1443mul = matmul(mat, inv)
1444mul
1445( +1.00, +0.00), ( +0.00, +0.00), ( -0.00, +0.00), ( -0.00, -0.00)
1446( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1447( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1448( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1449
1450
1451ndim = getUnifRand(1_IK, 6_IK)
1452ndim ! matrix rank
1453+1
1454mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1455call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1456mat
1457( +1.00, +0.00)
1458inv = getMatInv(mat, upperUnit)
1459inv
1460( +1.00, +0.00)
1461mul = matmul(mat, inv)
1462mul
1463( +1.00, +0.00)
1464
1465
1466ndim = getUnifRand(1_IK, 6_IK)
1467ndim ! matrix rank
1468+1
1469mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1470call setMatInit(mat, lowDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1471mat
1472( +1.00, +0.00)
1473inv = getMatInv(mat, upperUnit)
1474inv
1475( +1.00, +0.00)
1476mul = matmul(mat, inv)
1477mul
1478( +1.00, +0.00)
1479
1480
1481!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1482! Compute inverse of a lowerUnit triangular real matrix.
1483!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1484
1485
1486ndim = getUnifRand(1_IK, 6_IK)
1487ndim ! matrix rank
1488+5
1489mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1490call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1491mat
1492 +1.00, +0.00, +0.00, +0.00, +0.00
1493 +7.00, +1.00, +0.00, +0.00, +0.00
1494 +1.00, +3.00, +1.00, +0.00, +0.00
1495 +4.00, +5.00, +2.00, +1.00, +0.00
1496 +8.00, +9.00, +2.00, +4.00, +1.00
1497inv = getMatInv(mat, lowerUnit)
1498inv
1499 +1.00, +0.00, +0.00, +0.00, +0.00
1500 -7.00, +1.00, +0.00, +0.00, +0.00
1501 +20.00, -3.00, +1.00, +0.00, +0.00
1502 -9.00, +1.00, -2.00, +1.00, +0.00
1503 +51.00, -7.00, +6.00, -4.00, +1.00
1504mul = matmul(mat, inv)
1505mul
1506 +1.00, +0.00, +0.00, +0.00, +0.00
1507 +0.00, +1.00, +0.00, +0.00, +0.00
1508 +0.00, +0.00, +1.00, +0.00, +0.00
1509 +0.00, +0.00, +0.00, +1.00, +0.00
1510 +0.00, +0.00, +0.00, +0.00, +1.00
1511
1512
1513ndim = getUnifRand(1_IK, 6_IK)
1514ndim ! matrix rank
1515+1
1516mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1517call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1518mat
1519 +1.00
1520inv = getMatInv(mat, lowerUnit)
1521inv
1522 +1.00
1523mul = matmul(mat, inv)
1524mul
1525 +1.00
1526
1527
1528ndim = getUnifRand(1_IK, 6_IK)
1529ndim ! matrix rank
1530+3
1531mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1532call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1533mat
1534 +1.00, +0.00, +0.00
1535 +4.00, +1.00, +0.00
1536 +3.00, +4.00, +1.00
1537inv = getMatInv(mat, lowerUnit)
1538inv
1539 +1.00, +0.00, +0.00
1540 -4.00, +1.00, +0.00
1541 +13.00, -4.00, +1.00
1542mul = matmul(mat, inv)
1543mul
1544 +1.00, +0.00, +0.00
1545 +0.00, +1.00, +0.00
1546 +0.00, +0.00, +1.00
1547
1548
1549ndim = getUnifRand(1_IK, 6_IK)
1550ndim ! matrix rank
1551+5
1552mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1553call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1554mat
1555 +1.00, +0.00, +0.00, +0.00, +0.00
1556 +4.00, +1.00, +0.00, +0.00, +0.00
1557 +5.00, +6.00, +1.00, +0.00, +0.00
1558 +8.00, +3.00, +8.00, +1.00, +0.00
1559 +3.00, +5.00, +8.00, +8.00, +1.00
1560inv = getMatInv(mat, lowerUnit)
1561inv
1562 +1.00, +0.00, +0.00, +0.00, +0.00
1563 -4.00, +1.00, +0.00, +0.00, +0.00
1564 +19.00, -6.00, +1.00, +0.00, +0.00
1565 -148.00, +45.00, -8.00, +1.00, +0.00
1566 +1049.00, -317.00, +56.00, -8.00, +1.00
1567mul = matmul(mat, inv)
1568mul
1569 +1.00, +0.00, +0.00, +0.00, +0.00
1570 +0.00, +1.00, +0.00, +0.00, +0.00
1571 +0.00, +0.00, +1.00, +0.00, +0.00
1572 +0.00, +0.00, +0.00, +1.00, +0.00
1573 +0.00, +0.00, +0.00, +0.00, +1.00
1574
1575
1576ndim = getUnifRand(1_IK, 6_IK)
1577ndim ! matrix rank
1578+6
1579mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1580call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1581mat
1582 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1583 +3.00, +1.00, +0.00, +0.00, +0.00, +0.00
1584 +4.00, +9.00, +1.00, +0.00, +0.00, +0.00
1585 +6.00, +7.00, +8.00, +1.00, +0.00, +0.00
1586 +4.00, +8.00, +9.00, +1.00, +1.00, +0.00
1587 +8.00, +3.00, +6.00, +9.00, +4.00, +1.00
1588inv = getMatInv(mat, lowerUnit)
1589inv
1590 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1591 -3.00, +1.00, +0.00, +0.00, +0.00, +0.00
1592 +23.00, -9.00, +1.00, +0.00, +0.00, +0.00
1593 -169.00, +65.00, -8.00, +1.00, +0.00, +0.00
1594 -18.00, +8.00, -1.00, -1.00, +1.00, +0.00
1595 +1456.00, -566.00, +70.00, -5.00, -4.00, +1.00
1596mul = matmul(mat, inv)
1597mul
1598 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1599 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
1600 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
1601 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
1602 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
1603 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1604
1605
1606ndim = getUnifRand(1_IK, 6_IK)
1607ndim ! matrix rank
1608+1
1609mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1610call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1611mat
1612 +1.00
1613inv = getMatInv(mat, lowerUnit)
1614inv
1615 +1.00
1616mul = matmul(mat, inv)
1617mul
1618 +1.00
1619
1620
1621ndim = getUnifRand(1_IK, 6_IK)
1622ndim ! matrix rank
1623+4
1624mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1625call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1626mat
1627 +1.00, +0.00, +0.00, +0.00
1628 +9.00, +1.00, +0.00, +0.00
1629 +6.00, +8.00, +1.00, +0.00
1630 +5.00, +4.00, +8.00, +1.00
1631inv = getMatInv(mat, lowerUnit)
1632inv
1633 +1.00, +0.00, +0.00, +0.00
1634 -9.00, +1.00, +0.00, +0.00
1635 +66.00, -8.00, +1.00, +0.00
1636 -497.00, +60.00, -8.00, +1.00
1637mul = matmul(mat, inv)
1638mul
1639 +1.00, +0.00, +0.00, +0.00
1640 +0.00, +1.00, +0.00, +0.00
1641 +0.00, +0.00, +1.00, +0.00
1642 +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 +1.00, +1.00, +0.00, +0.00, +0.00, +0.00
1653 +8.00, +8.00, +1.00, +0.00, +0.00, +0.00
1654 +5.00, +3.00, +3.00, +1.00, +0.00, +0.00
1655 +8.00, +2.00, +5.00, +7.00, +1.00, +0.00
1656 +4.00, +6.00, +3.00, +6.00, +7.00, +1.00
1657inv = getMatInv(mat, lowerUnit)
1658inv
1659 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1660 -1.00, +1.00, +0.00, +0.00, +0.00, +0.00
1661 -0.00, -8.00, +1.00, +0.00, +0.00, +0.00
1662 -2.00, +21.00, -3.00, +1.00, +0.00, +0.00
1663 +8.00, -109.00, +16.00, -7.00, +1.00, +0.00
1664 -42.00, +655.00, -97.00, +43.00, -7.00, +1.00
1665mul = matmul(mat, inv)
1666mul
1667 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
1668 +0.00, +1.00, +0.00, +0.00, +0.00, +0.00
1669 +0.00, +0.00, +1.00, +0.00, +0.00, +0.00
1670 +0.00, +0.00, +0.00, +1.00, +0.00, +0.00
1671 +0.00, +0.00, +0.00, +0.00, +1.00, +0.00
1672 +0.00, +0.00, +0.00, +0.00, +0.00, +1.00
1673
1674
1675ndim = getUnifRand(1_IK, 6_IK)
1676ndim ! matrix rank
1677+1
1678mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1679call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1680mat
1681 +1.00
1682inv = getMatInv(mat, lowerUnit)
1683inv
1684 +1.00
1685mul = matmul(mat, inv)
1686mul
1687 +1.00
1688
1689
1690ndim = getUnifRand(1_IK, 6_IK)
1691ndim ! matrix rank
1692+4
1693mat = getUnifRand(1_IK, 9_IK, ndim, ndim)
1694call setMatInit(mat, uppDia, 0._TKG, 1._TKG)
1695mat
1696 +1.00, +0.00, +0.00, +0.00
1697 +5.00, +1.00, +0.00, +0.00
1698 +9.00, +6.00, +1.00, +0.00
1699 +2.00, +1.00, +9.00, +1.00
1700inv = getMatInv(mat, lowerUnit)
1701inv
1702 +1.00, +0.00, +0.00, +0.00
1703 -5.00, +1.00, +0.00, +0.00
1704 +21.00, -6.00, +1.00, +0.00
1705 -186.00, +53.00, -9.00, +1.00
1706mul = matmul(mat, inv)
1707mul
1708 +1.00, +0.00, +0.00, +0.00
1709 +0.00, +1.00, +0.00, +0.00
1710 +0.00, +0.00, +1.00, +0.00
1711 +0.00, +0.00, +0.00, +1.00
1712
1713
1714!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1715! Compute inverse of a lowerUnit triangular complex matrix.
1716!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1717
1718
1719ndim = getUnifRand(1_IK, 6_IK)
1720ndim ! matrix rank
1721+3
1722mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1723call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1724mat
1725( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1726( -0.09, +0.99), ( +1.00, +0.00), ( +0.00, +0.00)
1727( +0.02, +0.05), ( +0.13, +0.42), ( +1.00, +0.00)
1728inv = getMatInv(mat, lowerUnit)
1729inv
1730( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1731( +0.09, -0.99), ( +1.00, +0.00), ( +0.00, +0.00)
1732( -0.45, +0.04), ( -0.13, -0.42), ( +1.00, +0.00)
1733mul = matmul(mat, inv)
1734mul
1735( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1736( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1737( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1738
1739
1740ndim = getUnifRand(1_IK, 6_IK)
1741ndim ! matrix rank
1742+3
1743mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1744call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1745mat
1746( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1747( +0.52, -0.26), ( +1.00, +0.00), ( +0.00, +0.00)
1748( +0.79, +0.56), ( -1.00, -0.66), ( +1.00, +0.00)
1749inv = getMatInv(mat, lowerUnit)
1750inv
1751( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1752( -0.52, +0.26), ( +1.00, +0.00), ( +0.00, +0.00)
1753( -1.48, -0.65), ( +1.00, +0.66), ( +1.00, +0.00)
1754mul = matmul(mat, inv)
1755mul
1756( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1757( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1758( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1759
1760
1761ndim = getUnifRand(1_IK, 6_IK)
1762ndim ! matrix rank
1763+1
1764mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1765call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1766mat
1767( +1.00, +0.00)
1768inv = getMatInv(mat, lowerUnit)
1769inv
1770( +1.00, +0.00)
1771mul = matmul(mat, inv)
1772mul
1773( +1.00, +0.00)
1774
1775
1776ndim = getUnifRand(1_IK, 6_IK)
1777ndim ! matrix rank
1778+6
1779mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1780call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1781mat
1782( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1783( +0.30, -0.56), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1784( -0.69, +0.30), ( -0.91, -0.49), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1785( +0.36, -0.69), ( -0.93, +0.87), ( +0.19, +0.58), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1786( +0.27, -0.59), ( -0.63, +0.08), ( -0.74, -0.66), ( -0.28, -0.54), ( +1.00, +0.00), ( +0.00, +0.00)
1787( -0.07, -0.05), ( -0.51, -0.90), ( -0.05, -0.73), ( +0.17, +0.28), ( +0.65, -0.60), ( +1.00, +0.00)
1788inv = getMatInv(mat, lowerUnit)
1789inv
1790( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1791( -0.30, +0.56), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1792( +0.14, +0.07), ( +0.91, +0.49), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1793( -0.13, +1.38), ( +1.04, -1.49), ( -0.19, -0.58), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1794( -1.12, +1.43), ( +2.07, +1.02), ( +1.00, +0.40), ( +0.28, +0.54), ( +1.00, +0.00), ( +0.00, +0.00)
1795( -0.35, -1.64), ( -2.36, +2.13), ( -0.97, +1.22), ( -0.68, -0.46), ( -0.65, +0.60), ( +1.00, +0.00)
1796mul = matmul(mat, inv)
1797mul
1798( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1799( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1800( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1801( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1802( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1803( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1804
1805
1806ndim = getUnifRand(1_IK, 6_IK)
1807ndim ! matrix rank
1808+2
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)
1813( +0.11, -0.60), ( +1.00, +0.00)
1814inv = getMatInv(mat, lowerUnit)
1815inv
1816( +1.00, +0.00), ( +0.00, +0.00)
1817( -0.11, +0.60), ( +1.00, +0.00)
1818mul = matmul(mat, inv)
1819mul
1820( +1.00, +0.00), ( +0.00, +0.00)
1821( +0.00, +0.00), ( +1.00, +0.00)
1822
1823
1824ndim = getUnifRand(1_IK, 6_IK)
1825ndim ! matrix rank
1826+1
1827mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1828call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1829mat
1830( +1.00, +0.00)
1831inv = getMatInv(mat, lowerUnit)
1832inv
1833( +1.00, +0.00)
1834mul = matmul(mat, inv)
1835mul
1836( +1.00, +0.00)
1837
1838
1839ndim = getUnifRand(1_IK, 6_IK)
1840ndim ! matrix rank
1841+3
1842mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1843call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1844mat
1845( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1846( +0.86, +0.74), ( +1.00, +0.00), ( +0.00, +0.00)
1847( -0.35, +0.63), ( -0.36, +0.37), ( +1.00, +0.00)
1848inv = getMatInv(mat, lowerUnit)
1849inv
1850( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1851( -0.86, -0.74), ( +1.00, +0.00), ( +0.00, +0.00)
1852( -0.23, -0.57), ( +0.36, -0.37), ( +1.00, +0.00)
1853mul = matmul(mat, inv)
1854mul
1855( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1856( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1857( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1858
1859
1860ndim = getUnifRand(1_IK, 6_IK)
1861ndim ! matrix rank
1862+4
1863mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1864call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1865mat
1866( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1867( +0.22, +0.99), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1868( -0.14, +0.96), ( -0.14, +0.03), ( +1.00, +0.00), ( +0.00, +0.00)
1869( -0.89, +0.44), ( +0.17, +0.80), ( +0.55, -0.84), ( +1.00, +0.00)
1870inv = getMatInv(mat, lowerUnit)
1871inv
1872( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1873( -0.22, -0.99), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1874( +0.08, -1.09), ( +0.14, -0.03), ( +1.00, +0.00), ( +0.00, +0.00)
1875( +1.02, +0.57), ( -0.22, -0.66), ( -0.55, +0.84), ( +1.00, +0.00)
1876mul = matmul(mat, inv)
1877mul
1878( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1879( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1880( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1881( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1882
1883
1884ndim = getUnifRand(1_IK, 6_IK)
1885ndim ! matrix rank
1886+6
1887mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1888call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1889mat
1890( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1891( +0.53, +0.54), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1892( +0.34, -0.24), ( +0.97, -0.76), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1893( +0.60, -0.15), ( +0.40, +0.95), ( +0.75, +0.96), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1894( +0.16, +0.79), ( +0.56, +0.82), ( +0.34, +0.79), ( -0.77, +0.27), ( +1.00, +0.00), ( +0.00, +0.00)
1895( +0.35, +0.88), ( -0.28, +0.93), ( -0.17, -0.80), ( -0.44, +0.99), ( -0.34, +0.22), ( +1.00, +0.00)
1896inv = getMatInv(mat, lowerUnit)
1897inv
1898( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1899( -0.53, -0.54), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1900( +0.59, +0.37), ( -0.97, +0.76), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1901( -0.98, +0.03), ( +1.05, -0.58), ( -0.75, -0.96), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1902( -0.97, -0.36), ( +1.02, -1.04), ( -1.17, -1.33), ( +0.77, -0.27), ( +1.00, +0.00), ( +0.00, +0.00)
1903( -2.01, +1.07), ( -0.50, -3.45), ( -1.80, +0.94), ( +0.64, -1.25), ( +0.34, -0.22), ( +1.00, +0.00)
1904mul = matmul(mat, inv)
1905mul
1906( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1907( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1908( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1909( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
1910( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00), ( +0.00, +0.00)
1911( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00), ( +1.00, +0.00)
1912
1913
1914ndim = getUnifRand(1_IK, 6_IK)
1915ndim ! matrix rank
1916+1
1917mat = getUnifRand((-1., -1.), (+1., +1.), ndim, ndim)
1918call setMatInit(mat, uppDia, (0._TKG, 0._TKG), (1._TKG, 0._TKG))
1919mat
1920( +1.00, +0.00)
1921inv = getMatInv(mat, lowerUnit)
1922inv
1923( +1.00, +0.00)
1924mul = matmul(mat, inv)
1925mul
1926( +1.00, +0.00)
1927
1928
1929!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1930! Compute inverse of a general real matrix by passing its LUP factorization.
1931!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1932
1933
1934mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1935mat
1936 +1.00, +0.00, +2.00
1937 -1.00, +5.00, +0.00
1938 +0.00, +3.00, -9.00
1939call setResized(rperm, size(mat, 1, IK))
1940lup = mat
1941lup
1942 +1.00, +0.00, +2.00
1943 -1.00, +5.00, +0.00
1944 +0.00, +3.00, -9.00
1945call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1946if (info /= 0) error stop 'LUP factorization failed.'
1947lup
1948 +1.00, +0.00, +2.00
1949 -1.00, +5.00, +2.00
1950 +0.00, +0.60, -10.20
1951inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1952inv
1953 +0.88, -0.12, +0.20
1954 +0.18, +0.18, +0.04
1955 +0.06, +0.06, -0.10
1956mul = matmul(mat, inv)
1957mul
1958 +1.00, +0.00, +0.00
1959 +0.00, +1.00, +0.00
1960 +0.00, +0.00, +1.00
1961
1962
1963mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1964mat
1965 +1.00, +0.00, +2.00
1966 -1.00, +5.00, +0.00
1967 +0.00, +3.00, -9.00
1968call setResized(rperm, size(mat, 1, IK))
1969lup = mat
1970lup
1971 +1.00, +0.00, +2.00
1972 -1.00, +5.00, +0.00
1973 +0.00, +3.00, -9.00
1974call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
1975if (info /= 0) error stop 'LUP factorization failed.'
1976lup
1977 +1.00, +0.00, +2.00
1978 -1.00, +5.00, +2.00
1979 +0.00, +0.60, -10.20
1980inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
1981inv
1982 +0.88, -0.12, +0.20
1983 +0.18, +0.18, +0.04
1984 +0.06, +0.06, -0.10
1985mul = matmul(mat, inv)
1986mul
1987 +1.00, +0.00, +0.00
1988 +0.00, +1.00, +0.00
1989 +0.00, +0.00, +1.00
1990
1991
1992mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
1993mat
1994 +1.00, +0.00, +2.00
1995 -1.00, +5.00, +0.00
1996 +0.00, +3.00, -9.00
1997call setResized(rperm, size(mat, 1, IK))
1998lup = mat
1999lup
2000 +1.00, +0.00, +2.00
2001 -1.00, +5.00, +0.00
2002 +0.00, +3.00, -9.00
2003call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2004if (info /= 0) error stop 'LUP factorization failed.'
2005lup
2006 +1.00, +0.00, +2.00
2007 -1.00, +5.00, +2.00
2008 +0.00, +0.60, -10.20
2009inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2010inv
2011 +0.88, -0.12, +0.20
2012 +0.18, +0.18, +0.04
2013 +0.06, +0.06, -0.10
2014mul = matmul(mat, inv)
2015mul
2016 +1.00, +0.00, +0.00
2017 +0.00, +1.00, +0.00
2018 +0.00, +0.00, +1.00
2019
2020
2021mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2022mat
2023 +1.00, +0.00, +2.00
2024 -1.00, +5.00, +0.00
2025 +0.00, +3.00, -9.00
2026call setResized(rperm, size(mat, 1, IK))
2027lup = mat
2028lup
2029 +1.00, +0.00, +2.00
2030 -1.00, +5.00, +0.00
2031 +0.00, +3.00, -9.00
2032call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2033if (info /= 0) error stop 'LUP factorization failed.'
2034lup
2035 +1.00, +0.00, +2.00
2036 -1.00, +5.00, +2.00
2037 +0.00, +0.60, -10.20
2038inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2039inv
2040 +0.88, -0.12, +0.20
2041 +0.18, +0.18, +0.04
2042 +0.06, +0.06, -0.10
2043mul = matmul(mat, inv)
2044mul
2045 +1.00, +0.00, +0.00
2046 +0.00, +1.00, +0.00
2047 +0.00, +0.00, +1.00
2048
2049
2050mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2051mat
2052 +1.00, +0.00, +2.00
2053 -1.00, +5.00, +0.00
2054 +0.00, +3.00, -9.00
2055call setResized(rperm, size(mat, 1, IK))
2056lup = mat
2057lup
2058 +1.00, +0.00, +2.00
2059 -1.00, +5.00, +0.00
2060 +0.00, +3.00, -9.00
2061call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2062if (info /= 0) error stop 'LUP factorization failed.'
2063lup
2064 +1.00, +0.00, +2.00
2065 -1.00, +5.00, +2.00
2066 +0.00, +0.60, -10.20
2067inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2068inv
2069 +0.88, -0.12, +0.20
2070 +0.18, +0.18, +0.04
2071 +0.06, +0.06, -0.10
2072mul = matmul(mat, inv)
2073mul
2074 +1.00, +0.00, +0.00
2075 +0.00, +1.00, +0.00
2076 +0.00, +0.00, +1.00
2077
2078
2079mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2080mat
2081 +1.00, +0.00, +2.00
2082 -1.00, +5.00, +0.00
2083 +0.00, +3.00, -9.00
2084call setResized(rperm, size(mat, 1, IK))
2085lup = mat
2086lup
2087 +1.00, +0.00, +2.00
2088 -1.00, +5.00, +0.00
2089 +0.00, +3.00, -9.00
2090call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2091if (info /= 0) error stop 'LUP factorization failed.'
2092lup
2093 +1.00, +0.00, +2.00
2094 -1.00, +5.00, +2.00
2095 +0.00, +0.60, -10.20
2096inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2097inv
2098 +0.88, -0.12, +0.20
2099 +0.18, +0.18, +0.04
2100 +0.06, +0.06, -0.10
2101mul = matmul(mat, inv)
2102mul
2103 +1.00, +0.00, +0.00
2104 +0.00, +1.00, +0.00
2105 +0.00, +0.00, +1.00
2106
2107
2108mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2109mat
2110 +1.00, +0.00, +2.00
2111 -1.00, +5.00, +0.00
2112 +0.00, +3.00, -9.00
2113call setResized(rperm, size(mat, 1, IK))
2114lup = mat
2115lup
2116 +1.00, +0.00, +2.00
2117 -1.00, +5.00, +0.00
2118 +0.00, +3.00, -9.00
2119call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2120if (info /= 0) error stop 'LUP factorization failed.'
2121lup
2122 +1.00, +0.00, +2.00
2123 -1.00, +5.00, +2.00
2124 +0.00, +0.60, -10.20
2125inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2126inv
2127 +0.88, -0.12, +0.20
2128 +0.18, +0.18, +0.04
2129 +0.06, +0.06, -0.10
2130mul = matmul(mat, inv)
2131mul
2132 +1.00, +0.00, +0.00
2133 +0.00, +1.00, +0.00
2134 +0.00, +0.00, +1.00
2135
2136
2137mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2138mat
2139 +1.00, +0.00, +2.00
2140 -1.00, +5.00, +0.00
2141 +0.00, +3.00, -9.00
2142call setResized(rperm, size(mat, 1, IK))
2143lup = mat
2144lup
2145 +1.00, +0.00, +2.00
2146 -1.00, +5.00, +0.00
2147 +0.00, +3.00, -9.00
2148call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2149if (info /= 0) error stop 'LUP factorization failed.'
2150lup
2151 +1.00, +0.00, +2.00
2152 -1.00, +5.00, +2.00
2153 +0.00, +0.60, -10.20
2154inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2155inv
2156 +0.88, -0.12, +0.20
2157 +0.18, +0.18, +0.04
2158 +0.06, +0.06, -0.10
2159mul = matmul(mat, inv)
2160mul
2161 +1.00, +0.00, +0.00
2162 +0.00, +1.00, +0.00
2163 +0.00, +0.00, +1.00
2164
2165
2166mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2167mat
2168 +1.00, +0.00, +2.00
2169 -1.00, +5.00, +0.00
2170 +0.00, +3.00, -9.00
2171call setResized(rperm, size(mat, 1, IK))
2172lup = mat
2173lup
2174 +1.00, +0.00, +2.00
2175 -1.00, +5.00, +0.00
2176 +0.00, +3.00, -9.00
2177call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2178if (info /= 0) error stop 'LUP factorization failed.'
2179lup
2180 +1.00, +0.00, +2.00
2181 -1.00, +5.00, +2.00
2182 +0.00, +0.60, -10.20
2183inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2184inv
2185 +0.88, -0.12, +0.20
2186 +0.18, +0.18, +0.04
2187 +0.06, +0.06, -0.10
2188mul = matmul(mat, inv)
2189mul
2190 +1.00, +0.00, +0.00
2191 +0.00, +1.00, +0.00
2192 +0.00, +0.00, +1.00
2193
2194
2195mat = reshape([1, 0, 2, -1, 5, 0, 0, 3, -9], shape = [3,3], order = [2, 1])
2196mat
2197 +1.00, +0.00, +2.00
2198 -1.00, +5.00, +0.00
2199 +0.00, +3.00, -9.00
2200call setResized(rperm, size(mat, 1, IK))
2201lup = mat
2202lup
2203 +1.00, +0.00, +2.00
2204 -1.00, +5.00, +0.00
2205 +0.00, +3.00, -9.00
2206call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2207if (info /= 0) error stop 'LUP factorization failed.'
2208lup
2209 +1.00, +0.00, +2.00
2210 -1.00, +5.00, +2.00
2211 +0.00, +0.60, -10.20
2212inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2213inv
2214 +0.88, -0.12, +0.20
2215 +0.18, +0.18, +0.04
2216 +0.06, +0.06, -0.10
2217mul = matmul(mat, inv)
2218mul
2219 +1.00, +0.00, +0.00
2220 +0.00, +1.00, +0.00
2221 +0.00, +0.00, +1.00
2222
2223
2224!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2225! Compute inverse of a general complex matrix by passing its LUP factorization.
2226!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2227
2228
2229call setResized(rperm, size(mat, 1, IK))
2230lup = mat
2231lup
2232( +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)
2233( +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)
2234( +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)
2235( +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)
2236( +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)
2237( +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)
2238( +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)
2239( +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)
2240( +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)
2241call setMatLUP(lup, rperm, info) ! compute the LUP factorization of the matrix.
2242if (info /= 0) error stop 'LUP factorization failed.'
2243lup
2244( +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)
2245( +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)
2246( +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)
2247( +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)
2248( +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)
2249( +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)
2250( +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)
2251( +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)
2252( +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)
2253inv = getMatInv(lup, rperm) ! compute the inverse of the matrix by passing its LUP factorization.
2254inv
2255( -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)
2256( +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)
2257( +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)
2258( +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)
2259( +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)
2260( +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)
2261( +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)
2262( -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)
2263( -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)
2264mul = matmul(mat, inv)
2265mul
2266( +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)
2267( -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)
2268( -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)
2269( -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)
2270( -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)
2271( -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)
2272( +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)
2273( -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)
2274( -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)
2275
2276
2277!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2278! Compute the inverse of a positive-definite real matrix by passing its Cholesky factorization.
2279!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2280
2281
2282ndim = getUnifRand(1_IK, 6_IK)
2283ndim ! matrix rank
2284+1
2285mat = getCovRand(mold = 1._TKG, ndim = ndim)
2286mat
2287 +1.00
2288chol = getMatChol(mat, subset = lowDia)
2289chol
2290 +1.00
2291inv = getMatInv(chol, auxil = choLow)
2292inv
2293 +1.00
2294mul = matmul(mat, inv)
2295mul
2296 +1.00
2297
2298
2299ndim = getUnifRand(1_IK, 6_IK)
2300ndim ! matrix rank
2301+5
2302mat = getCovRand(mold = 1._TKG, ndim = ndim)
2303mat
2304 +1.00, -0.57, +0.68, +0.16, +0.42
2305 -0.57, +1.00, +0.16, -0.83, -0.67
2306 +0.68, +0.16, +1.00, -0.51, -0.16
2307 +0.16, -0.83, -0.51, +1.00, +0.28
2308 +0.42, -0.67, -0.16, +0.28, +1.00
2309chol = getMatChol(mat, subset = lowDia)
2310chol
2311 +1.00, +0.00, +0.00, +0.00, +0.00
2312 -0.57, +0.82, +0.00, +0.00, +0.00
2313 +0.68, +0.68, +0.28, +0.00, +0.00
2314 +0.16, -0.90, -0.01, +0.40, +0.00
2315 +0.42, -0.52, -0.34, -0.64, +0.16
2316inv = getMatInv(chol, auxil = choLow)
2317inv
2318 +38.70, -22.83, -48.04, -41.65, -27.43
2319 -22.83, +93.02, +56.70, +94.30, +54.01
2320 -48.04, +56.70, +71.09, +77.24, +47.56
2321 -41.65, +94.30, +77.24, +107.37, +62.38
2322 -27.43, +54.01, +47.56, +62.38, +38.52
2323mul = matmul(mat, inv)
2324mul
2325 +1.00, +0.00, +0.00, +0.00, +0.00
2326 +0.00, +1.00, -0.00, -0.00, -0.00
2327 -0.00, +0.00, +1.00, -0.00, -0.00
2328 -0.00, +0.00, +0.00, +1.00, +0.00
2329 -0.00, +0.00, +0.00, +0.00, +1.00
2330
2331
2332ndim = getUnifRand(1_IK, 6_IK)
2333ndim ! matrix rank
2334+5
2335mat = getCovRand(mold = 1._TKG, ndim = ndim)
2336mat
2337 +1.00, +0.15, -0.89, +0.00, +0.10
2338 +0.15, +1.00, -0.52, -0.69, +0.34
2339 -0.89, -0.52, +1.00, +0.30, -0.27
2340 +0.00, -0.69, +0.30, +1.00, -0.71
2341 +0.10, +0.34, -0.27, -0.71, +1.00
2342chol = getMatChol(mat, subset = lowDia)
2343chol
2344 +1.00, +0.00, +0.00, +0.00, +0.00
2345 +0.15, +0.99, +0.00, +0.00, +0.00
2346 -0.89, -0.39, +0.22, +0.00, +0.00
2347 +0.00, -0.70, +0.12, +0.70, +0.00
2348 +0.10, +0.33, -0.23, -0.65, +0.64
2349inv = getMatInv(chol, auxil = choLow)
2350inv
2351 +16.98, +6.76, +19.06, -0.51, +0.76
2352 +6.76, +5.56, +8.63, +2.20, +1.32
2353 +19.06, +8.63, +22.88, +0.06, +1.34
2354 -0.51, +2.20, +0.06, +4.12, +2.25
2355 +0.76, +1.32, +1.34, +2.25, +2.44
2356mul = matmul(mat, inv)
2357mul
2358 +1.00, -0.00, -0.00, -0.00, -0.00
2359 +0.00, +1.00, +0.00, +0.00, +0.00
2360 -0.00, +0.00, +1.00, -0.00, -0.00
2361 -0.00, +0.00, -0.00, +1.00, -0.00
2362 +0.00, +0.00, -0.00, +0.00, +1.00
2363
2364
2365ndim = getUnifRand(1_IK, 6_IK)
2366ndim ! matrix rank
2367+2
2368mat = getCovRand(mold = 1._TKG, ndim = ndim)
2369mat
2370 +1.00, +1.00
2371 +1.00, +1.00
2372chol = getMatChol(mat, subset = lowDia)
2373chol
2374 +1.00, +0.00
2375 +1.00, +0.06
2376inv = getMatInv(chol, auxil = choLow)
2377inv
2378 +258.15, -257.65
2379 -257.65, +258.15
2380mul = matmul(mat, inv)
2381mul
2382 +1.00, +0.00
2383 +0.00, +1.00
2384
2385
2386ndim = getUnifRand(1_IK, 6_IK)
2387ndim ! matrix rank
2388+1
2389mat = getCovRand(mold = 1._TKG, ndim = ndim)
2390mat
2391 +1.00
2392chol = getMatChol(mat, subset = lowDia)
2393chol
2394 +1.00
2395inv = getMatInv(chol, auxil = choLow)
2396inv
2397 +1.00
2398mul = matmul(mat, inv)
2399mul
2400 +1.00
2401
2402
2403ndim = getUnifRand(1_IK, 6_IK)
2404ndim ! matrix rank
2405+5
2406mat = getCovRand(mold = 1._TKG, ndim = ndim)
2407mat
2408 +1.00, +0.55, -0.69, +0.66, +0.14
2409 +0.55, +1.00, -0.34, -0.07, +0.34
2410 -0.69, -0.34, +1.00, -0.85, +0.38
2411 +0.66, -0.07, -0.85, +1.00, -0.30
2412 +0.14, +0.34, +0.38, -0.30, +1.00
2413chol = getMatChol(mat, subset = lowDia)
2414chol
2415 +1.00, +0.00, +0.00, +0.00, +0.00
2416 +0.55, +0.84, +0.00, +0.00, +0.00
2417 -0.69, +0.04, +0.72, +0.00, +0.00
2418 +0.66, -0.52, -0.51, +0.18, +0.00
2419 +0.14, +0.32, +0.65, +0.58, +0.35
2420inv = getMatInv(chol, auxil = choLow)
2421inv
2422 +18.77, -28.92, -37.22, -43.53, +8.49
2423 -28.92, +53.60, +72.97, +79.36, -18.48
2424 -37.22, +72.97, +104.65, +110.67, -26.70
2425 -43.53, +79.36, +110.67, +121.28, -27.13
2426 +8.49, -18.48, -26.70, -27.13, +8.24
2427mul = matmul(mat, inv)
2428mul
2429 +1.00, -0.00, +0.00, +0.00, +0.00
2430 -0.00, +1.00, +0.00, +0.00, -0.00
2431 +0.00, +0.00, +1.00, +0.00, -0.00
2432 -0.00, +0.00, +0.00, +1.00, -0.00
2433 +0.00, +0.00, -0.00, +0.00, +1.00
2434
2435
2436ndim = getUnifRand(1_IK, 6_IK)
2437ndim ! matrix rank
2438+1
2439mat = getCovRand(mold = 1._TKG, ndim = ndim)
2440mat
2441 +1.00
2442chol = getMatChol(mat, subset = lowDia)
2443chol
2444 +1.00
2445inv = getMatInv(chol, auxil = choLow)
2446inv
2447 +1.00
2448mul = matmul(mat, inv)
2449mul
2450 +1.00
2451
2452
2453ndim = getUnifRand(1_IK, 6_IK)
2454ndim ! matrix rank
2455+3
2456mat = getCovRand(mold = 1._TKG, ndim = ndim)
2457mat
2458 +1.00, -0.68, -0.86
2459 -0.68, +1.00, +0.91
2460 -0.86, +0.91, +1.00
2461chol = getMatChol(mat, subset = lowDia)
2462chol
2463 +1.00, +0.00, +0.00
2464 -0.68, +0.73, +0.00
2465 -0.86, +0.44, +0.26
2466inv = getMatInv(chol, auxil = choLow)
2467inv
2468 +4.80, -2.63, +6.51
2469 -2.63, +7.00, -8.59
2470 +6.51, -8.59, +14.37
2471mul = matmul(mat, inv)
2472mul
2473 +1.00, +0.00, +0.00
2474 +0.00, +1.00, -0.00
2475 +0.00, -0.00, +1.00
2476
2477
2478ndim = getUnifRand(1_IK, 6_IK)
2479ndim ! matrix rank
2480+6
2481mat = getCovRand(mold = 1._TKG, ndim = ndim)
2482mat
2483 +1.00, -0.77, +0.13, +0.38, -0.82, +0.20
2484 -0.77, +1.00, -0.41, -0.15, +0.78, -0.54
2485 +0.13, -0.41, +1.00, -0.82, -0.46, +0.31
2486 +0.38, -0.15, -0.82, +1.00, +0.05, -0.14
2487 -0.82, +0.78, -0.46, +0.05, +1.00, -0.57
2488 +0.20, -0.54, +0.31, -0.14, -0.57, +1.00
2489chol = getMatChol(mat, subset = lowDia)
2490chol
2491 +1.00, +0.00, +0.00, +0.00, +0.00, +0.00
2492 -0.77, +0.64, +0.00, +0.00, +0.00, +0.00
2493 +0.13, -0.48, +0.87, +0.00, +0.00, +0.00
2494 +0.38, +0.22, -0.88, +0.15, +0.00, +0.00
2495 -0.82, +0.23, -0.28, +0.44, +0.08, +0.00
2496 +0.20, -0.61, -0.01, -0.54, -0.48, +0.27
2497inv = getMatInv(chol, auxil = choLow)
2498inv
2499 +1103.79, -901.19, -1968.35, -2210.79, +869.29, +105.77
2500 -901.19, +765.13, +1650.35, +1846.24, -710.30, -78.72
2501 -1968.35, +1650.35, +3581.06, +4009.01, -1547.78, -176.92
2502 -2210.79, +1846.24, +4009.01, +4491.64, -1739.25, -200.61
2503 +869.29, -710.30, -1547.78, -1739.25, +687.58, +84.20
2504 +105.77, -78.72, -176.92, -200.61, +84.20, +13.65
2505mul = matmul(mat, inv)
2506mul
2507 +1.00, -0.00, -0.00, -0.00, -0.00, +0.00
2508 +0.00, +1.00, +0.00, +0.00, +0.00, -0.00
2509 +0.00, +0.00, +1.00, -0.00, -0.00, +0.00
2510 +0.00, -0.00, +0.00, +1.00, -0.00, -0.00
2511 -0.00, +0.00, +0.00, -0.00, +1.00, -0.00
2512 +0.00, -0.00, -0.00, -0.00, +0.00, +1.00
2513
2514
2515ndim = getUnifRand(1_IK, 6_IK)
2516ndim ! matrix rank
2517+3
2518mat = getCovRand(mold = 1._TKG, ndim = ndim)
2519mat
2520 +1.00, +0.47, -0.98
2521 +0.47, +1.00, -0.52
2522 -0.98, -0.52, +1.00
2523chol = getMatChol(mat, subset = lowDia)
2524chol
2525 +1.00, +0.00, +0.00
2526 +0.47, +0.88, +0.00
2527 -0.98, -0.06, +0.16
2528inv = getMatInv(chol, auxil = choLow)
2529inv
2530 +34.79, +1.82, +35.20
2531 +1.82, +1.46, +2.55
2532 +35.20, +2.55, +36.98
2533mul = matmul(mat, inv)
2534mul
2535 +1.00, -0.00, +0.00
2536 +0.00, +1.00, +0.00
2537 -0.00, +0.00, +1.00
2538
2539
2540ndim = getUnifRand(1_IK, 6_IK)
2541ndim ! matrix rank
2542+5
2543mat = getCovRand(mold = 1._TKG, ndim = ndim)
2544mat
2545 +1.00, -0.94, -0.85, +0.11, -0.22
2546 -0.94, +1.00, +0.80, -0.11, +0.37
2547 -0.85, +0.80, +1.00, -0.43, -0.11
2548 +0.11, -0.11, -0.43, +1.00, +0.76
2549 -0.22, +0.37, -0.11, +0.76, +1.00
2550chol = getMatChol(mat, subset = uppDia)
2551chol
2552 +1.00, -0.94, -0.85, +0.11, -0.22
2553 +0.00, +0.35, +0.02, -0.01, +0.48
2554 +0.00, +0.00, +0.53, -0.64, -0.57
2555 +0.00, +0.00, +0.00, +0.76, +0.56
2556 +0.00, +0.00, +0.00, +0.00, +0.29
2557inv = getMatInv(chol, auxil = choUpp)
2558inv
2559 +21.14, +22.66, +2.64, +9.34, -10.64
2560 +22.66, +32.79, -3.45, +12.70, -17.30
2561 +2.64, -3.45, +6.41, +0.39, +2.25
2562 +9.34, +12.70, +0.39, +8.41, -9.06
2563 -10.64, -17.30, +2.25, -9.06, +12.26
2564mul = matmul(mat, inv)
2565mul
2566 +1.00, -0.00, -0.00, -0.00, +0.00
2567 +0.00, +1.00, -0.00, +0.00, -0.00
2568 +0.00, +0.00, +1.00, +0.00, +0.00
2569 +0.00, +0.00, -0.00, +1.00, +0.00
2570 -0.00, +0.00, +0.00, -0.00, +1.00
2571
2572
2573ndim = getUnifRand(1_IK, 6_IK)
2574ndim ! matrix rank
2575+4
2576mat = getCovRand(mold = 1._TKG, ndim = ndim)
2577mat
2578 +1.00, +0.85, -0.20, +0.33
2579 +0.85, +1.00, +0.32, +0.74
2580 -0.20, +0.32, +1.00, +0.76
2581 +0.33, +0.74, +0.76, +1.00
2582chol = getMatChol(mat, subset = uppDia)
2583chol
2584 +1.00, +0.85, -0.20, +0.33
2585 +0.00, +0.52, +0.93, +0.87
2586 +0.00, +0.00, +0.31, +0.05
2587 +0.00, +0.00, +0.00, +0.35
2588inv = getMatInv(chol, auxil = choUpp)
2589inv
2590 +39.37, -43.76, +16.72, +6.64
2591 -43.76, +51.86, -16.70, -11.20
2592 +16.72, -16.70, +10.59, -1.24
2593 +6.64, -11.20, -1.24, +8.04
2594mul = matmul(mat, inv)
2595mul
2596 +1.00, -0.00, -0.00, +0.00
2597 -0.00, +1.00, +0.00, +0.00
2598 +0.00, +0.00, +1.00, -0.00
2599 +0.00, -0.00, +0.00, +1.00
2600
2601
2602ndim = getUnifRand(1_IK, 6_IK)
2603ndim ! matrix rank
2604+3
2605mat = getCovRand(mold = 1._TKG, ndim = ndim)
2606mat
2607 +1.00, +0.99, +0.57
2608 +0.99, +1.00, +0.47
2609 +0.57, +0.47, +1.00
2610chol = getMatChol(mat, subset = uppDia)
2611chol
2612 +1.00, +0.99, +0.57
2613 +0.00, +0.13, -0.71
2614 +0.00, +0.00, +0.42
2615inv = getMatInv(chol, auxil = choUpp)
2616inv
2617 +252.54, -234.86, -33.16
2618 -234.86, +219.70, +30.24
2619 -33.16, +30.24, +5.63
2620mul = matmul(mat, inv)
2621mul
2622 +1.00, -0.00, -0.00
2623 +0.00, +1.00, -0.00
2624 +0.00, -0.00, +1.00
2625
2626
2627ndim = getUnifRand(1_IK, 6_IK)
2628ndim ! matrix rank
2629+1
2630mat = getCovRand(mold = 1._TKG, ndim = ndim)
2631mat
2632 +1.00
2633chol = getMatChol(mat, subset = uppDia)
2634chol
2635 +1.00
2636inv = getMatInv(chol, auxil = choUpp)
2637inv
2638 +1.00
2639mul = matmul(mat, inv)
2640mul
2641 +1.00
2642
2643
2644ndim = getUnifRand(1_IK, 6_IK)
2645ndim ! matrix rank
2646+4
2647mat = getCovRand(mold = 1._TKG, ndim = ndim)
2648mat
2649 +1.00, -0.98, +0.36, -0.22
2650 -0.98, +1.00, -0.26, +0.39
2651 +0.36, -0.26, +1.00, +0.64
2652 -0.22, +0.39, +0.64, +1.00
2653chol = getMatChol(mat, subset = uppDia)
2654chol
2655 +1.00, -0.98, +0.36, -0.22
2656 +0.00, +0.20, +0.46, +0.89
2657 +0.00, +0.00, +0.81, +0.39
2658 +0.00, +0.00, +0.00, +0.07
2659inv = getMatInv(chol, auxil = choUpp)
2660inv
2661 +1760.36, +2033.17, +280.71, -597.15
2662 +2033.17, +2350.82, +326.48, -692.16
2663 +280.71, +326.48, +48.47, -98.51
2664 -597.15, -692.16, -98.51, +206.65
2665mul = matmul(mat, inv)
2666mul
2667 +1.00, +0.00, +0.00, -0.00
2668 +0.00, +1.00, -0.00, -0.00
2669 -0.00, +0.00, +1.00, -0.00
2670 +0.00, +0.00, -0.00, +1.00
2671
2672
2673ndim = getUnifRand(1_IK, 6_IK)
2674ndim ! matrix rank
2675+3
2676mat = getCovRand(mold = 1._TKG, ndim = ndim)
2677mat
2678 +1.00, -0.16, -0.42
2679 -0.16, +1.00, -0.72
2680 -0.42, -0.72, +1.00
2681chol = getMatChol(mat, subset = uppDia)
2682chol
2683 +1.00, -0.16, -0.42
2684 +0.00, +0.99, -0.80
2685 +0.00, +0.00, +0.43
2686inv = getMatInv(chol, auxil = choUpp)
2687inv
2688 +2.64, +2.56, +2.94
2689 +2.56, +4.57, +4.36
2690 +2.94, +4.36, +5.38
2691mul = matmul(mat, inv)
2692mul
2693 +1.00, +0.00, +0.00
2694 +0.00, +1.00, +0.00
2695 -0.00, +0.00, +1.00
2696
2697
2698ndim = getUnifRand(1_IK, 6_IK)
2699ndim ! matrix rank
2700+1
2701mat = getCovRand(mold = 1._TKG, ndim = ndim)
2702mat
2703 +1.00
2704chol = getMatChol(mat, subset = uppDia)
2705chol
2706 +1.00
2707inv = getMatInv(chol, auxil = choUpp)
2708inv
2709 +1.00
2710mul = matmul(mat, inv)
2711mul
2712 +1.00
2713
2714
2715ndim = getUnifRand(1_IK, 6_IK)
2716ndim ! matrix rank
2717+2
2718mat = getCovRand(mold = 1._TKG, ndim = ndim)
2719mat
2720 +1.00, -0.76
2721 -0.76, +1.00
2722chol = getMatChol(mat, subset = uppDia)
2723chol
2724 +1.00, -0.76
2725 +0.00, +0.65
2726inv = getMatInv(chol, auxil = choUpp)
2727inv
2728 +2.39, +1.83
2729 +1.83, +2.39
2730mul = matmul(mat, inv)
2731mul
2732 +1.00, +0.00
2733 +0.00, +1.00
2734
2735
2736ndim = getUnifRand(1_IK, 6_IK)
2737ndim ! matrix rank
2738+3
2739mat = getCovRand(mold = 1._TKG, ndim = ndim)
2740mat
2741 +1.00, +0.18, +0.81
2742 +0.18, +1.00, +0.42
2743 +0.81, +0.42, +1.00
2744chol = getMatChol(mat, subset = uppDia)
2745chol
2746 +1.00, +0.18, +0.81
2747 +0.00, +0.98, +0.28
2748 +0.00, +0.00, +0.52
2749inv = getMatInv(chol, auxil = choUpp)
2750inv
2751 +3.11, +0.59, -2.75
2752 +0.59, +1.32, -1.02
2753 -2.75, -1.02, +3.64
2754mul = matmul(mat, inv)
2755mul
2756 +1.00, +0.00, +0.00
2757 +0.00, +1.00, +0.00
2758 +0.00, +0.00, +1.00
2759
2760
2761ndim = getUnifRand(1_IK, 6_IK)
2762ndim ! matrix rank
2763+2
2764mat = getCovRand(mold = 1._TKG, ndim = ndim)
2765mat
2766 +1.00, +0.52
2767 +0.52, +1.00
2768chol = getMatChol(mat, subset = uppDia)
2769chol
2770 +1.00, +0.52
2771 +0.00, +0.85
2772inv = getMatInv(chol, auxil = choUpp)
2773inv
2774 +1.37, -0.71
2775 -0.71, +1.37
2776mul = matmul(mat, inv)
2777mul
2778 +1.00, +0.00
2779 +0.00, +1.00
2780
2781
2782!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2783! Compute the inverse of a positive-definite complex matrix by passing its Cholesky factorization.
2784!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2785
2786
2787mat
2788( +9.00, +0.00), ( +3.00, +3.00), ( +3.00, -3.00)
2789( +3.00, -3.00), ( +18.00, +0.00), ( +8.00, -6.00)
2790( +3.00, +3.00), ( +8.00, +6.00), ( +43.00, +0.00)
2791chol = getMatChol(mat, subset = lowDia)
2792chol
2793( +3.00, +0.00), ( +0.00, +0.00), ( +0.00, +0.00)
2794( +1.00, -1.00), ( +4.00, +0.00), ( +0.00, +0.00)
2795( +1.00, +1.00), ( +2.00, +1.00), ( +6.00, +0.00)
2796inv = getMatInv(chol, auxil = choLow)
2797inv
2798( +0.13, -0.00), ( -0.02, -0.03), ( -0.00, +0.01)
2799( -0.02, +0.03), ( +0.07, -0.00), ( -0.01, +0.01)
2800( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, -0.00)
2801mul = matmul(mat, inv)
2802mul
2803( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
2804( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
2805( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
2806
2807
2808mat
2809( +9.00, +0.00), ( +3.00, +3.00), ( +3.00, -3.00)
2810( +3.00, -3.00), ( +18.00, +0.00), ( +8.00, -6.00)
2811( +3.00, +3.00), ( +8.00, +6.00), ( +43.00, +0.00)
2812chol = getMatChol(mat, subset = uppDia)
2813chol
2814( +3.00, +0.00), ( +1.00, +1.00), ( +1.00, -1.00)
2815( +0.00, +0.00), ( +4.00, +0.00), ( +2.00, -1.00)
2816( +0.00, +0.00), ( +0.00, +0.00), ( +6.00, +0.00)
2817inv = getMatInv(chol, auxil = choUpp)
2818inv
2819( +0.13, -0.00), ( -0.02, -0.03), ( -0.00, +0.01)
2820( -0.02, +0.03), ( +0.07, -0.00), ( -0.01, +0.01)
2821( -0.00, -0.01), ( -0.01, -0.01), ( +0.03, -0.00)
2822mul = matmul(mat, inv)
2823mul
2824( +1.00, +0.00), ( -0.00, -0.00), ( +0.00, -0.00)
2825( +0.00, -0.00), ( +1.00, +0.00), ( -0.00, +0.00)
2826( +0.00, +0.00), ( -0.00, -0.00), ( +1.00, -0.00)
2827
2828
Test:
test_pm_matrixInv


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 362 of file pm_matrixInv.F90.


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