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