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

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

Definition at line 362 of file pm_matrixInv.F90.


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