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

Generate and return the determinant of the input general square matrix.
More...

Detailed Description

Generate and return the determinant of the input general square matrix.

This generic interface uses the pivoted LU (LUP) factorization to compute the determinant.
If the matrix is already known to be positive-definite, use the other more appropriate faster generic interfaces of this module (e.g., getMatDetSqrt).

Parameters
[in]mat: The input contiguous square matrix of shape (ndim,ndim) of type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128).
Returns
det : The output scalar of the same type and kind as the input mat containing the determinant of the input square matrix.


Possible calling interfaces

det = getMatDet(mat)
Generate and return the determinant of the input general square matrix.
This module contains procedures and generic interfaces relevant to the computation of the determinant...
Warning
The condition size(mat, 1) == size(mat, 2) must hold for the corresponding input arguments.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
The procedures under this generic interface call error stop if the Pivoted LU factorization of mat fails.
See setMatDet for the fault-tolerant potentially faster subroutine version of this interface.
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.
Remarks
The procedures under this generic interface are computationally demanding since the LU factorization requires creating a copy of the input mat to avoid the direct manipulation of the input intent(in) :: mat.
See setMatDet for the performant subroutine versions of these procedures where mat has intent(inout).
See also
getMatDet
setMatDet
getMatDetSqrtLog
setMatDetSqrtLog
getMatDetSqrt
setMatDetSqrt


Example usage

1program example
2
3 use pm_kind, only: SK, IK, LK
4 use pm_matrixDet, only: getMatDet
5 use pm_matrixInv, only: getMatInv
6 use pm_distUnif, only: getUnifRand
7 use pm_io, only: display_type
8
9 implicit none
10
11 integer(IK) :: ndim, itry, ntry = 10
12 type(display_type) :: disp
13
14 disp = display_type(file = "main.out.F90")
15
16 call disp%skip()
17 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
18 call disp%show("! Compute the determinant of the square matrix.")
19 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
20 call disp%skip()
21
22 block
23 use pm_kind, only: TKG => RKH
24 real(TKG), allocatable :: mat(:,:)
25 real(TKG) :: det
26 do itry = 1, ntry
27 call disp%skip()
28 call disp%show("ndim = getUnifRand(1, 9)")
29 ndim = getUnifRand(1, 9)
30 call disp%show("ndim")
31 call disp%show( ndim )
32 call disp%show("mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)")
33 mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
34 call disp%show("mat")
35 call disp%show( mat )
36 call disp%show("det = getMatDet(mat)")
37 det = getMatDet(mat)
38 call disp%show("det")
39 call disp%show( det )
40 call disp%show("det * getMatDet(getMatInv(mat)) ! must be one.")
41 call disp%show( det * getMatDet(getMatInv(mat)) )
42 call disp%skip()
43 end do
44 end block
45
46 block
47 use pm_kind, only: TKG => CKH
48 complex(TKG), allocatable :: mat(:,:)
49 real(TKG) :: det
50 do itry = 1, ntry
51 call disp%skip()
52 call disp%show("ndim = getUnifRand(1, 9)")
53 ndim = getUnifRand(1, 9)
54 call disp%show("mat = getUnifRand((1._TKG, 1._TKG), (2._TKG, 2._TKG), ndim, ndim)")
55 mat = getUnifRand((1._TKG, 1._TKG), (2._TKG, 2._TKG), ndim, ndim)
56 call disp%show("mat")
57 call disp%show( mat )
58 call disp%show("det = getMatDet(mat)")
59 det = getMatDet(mat)
60 call disp%show("det")
61 call disp%show( det )
62 call disp%show("det * getMatDet(getMatInv(mat)) ! must be one.")
63 call disp%show( det * getMatDet(getMatInv(mat)) )
64 call disp%skip()
65 end do
66 end block
67
68end program example
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Generate and return the full inverse of an input matrix of general or triangular form directly or thr...
This module contains classes and procedures for computing various statistical quantities related to t...
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 CKH
The scalar integer constant of intrinsic default kind, representing the highest-precision complex kin...
Definition: pm_kind.F90:843
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 RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
Definition: pm_kind.F90:858
This module contains abstract and concrete derived types and procedures related to the inversion of s...
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 the determinant of the square matrix.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7ndim = getUnifRand(1, 9)
8ndim
9+9
10mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
11mat
12+1.49402272699495955229968775346136775, +1.85237859119052848993428623004310583, +1.59489728699916983445865862359433522, +1.93658818799610192464743346780798548, +1.81851967447870033398198584424662113, +1.02510588460616795213269813095252423, +1.92107084625127376423261551257252226, +1.16935554870566144873085922744295611, +1.50653656165577174144493849606245770
13+1.94910385368816601100604329999531410, +1.10900538620702539375600446403730221, +1.75115739896550289923339469421091949, +1.66700273789256997737671367842785779, +1.28653975576022225524092921502559754, +1.91084292610287752425950255891319612, +1.09959050459096343005292445000894733, +1.07520707555084741847715945280574046, +1.35041877050326302274694067755651219
14+1.73628509429831731194580962783870552, +1.72617137000275159495580901305968628, +1.31690247620684536201050162069941299, +1.31481071647990743940026843009048375, +1.21936741289044879340958013234744695, +1.63422218934515603877616470227566096, +1.50354141048215485501346040396057462, +1.41367681453036919564715351807178214, +1.86538914658007091786611610185211739
15+1.20571703667906907595842337738863478, +1.32910856021534916504782623435891903, +1.13586542293268578165677633487674690, +1.09581420885105751688064640196691259, +1.55287724754859887435067450424926084, +1.99100462856035206026910550068809563, +1.42205015441976430803559907612724183, +1.23367864551498290524680351737066279, +1.01540296172634488168466320750798092
16+1.37022057017961127143429219144238202, +1.24524331858503539985706542164274871, +1.72943312112610664246432932345478839, +1.55303166578794574789135712430431617, +1.75799713746101806862021047509304061, +1.72425049876420401906599487292017892, +1.93290629246226979854346233652419816, +1.37922722786235467664691080500019316, +1.75177954425251237005618181208882097
17+1.94881843562449333965809146829395033, +1.16499575000018091065927234432881184, +1.10425283609488807097917500181457648, +1.82307157758049403366740893839272469, +1.28140125496685711142004437385900865, +1.87548308679940348205837224570248194, +1.38267277265784025537611475507036557, +1.29377868031281650203536566405624491, +1.69091257285227413487797073773976701
18+1.62229802713976577359938748725710689, +1.29314249011570573121150381817749367, +1.31094645797093657886901034114757573, +1.97745165473330343709479750649538730, +1.01792341546566074045980039323035594, +1.18512771296780952612828100719259259, +1.95143763098583021413635778796290127, +1.58968919573004566475631043116911505, +1.87101395015098579114454791538859052
19+1.32280911625412560936755934971457940, +1.27448769231685373711596585840053627, +1.93294986242146200704766964186452230, +1.61882478864143899376609321109564946, +1.07297791474644594876651255837406627, +1.20256116248010243912574904235601016, +1.16122521248699632836529341081077427, +1.63617033224710813799161311091865429, +1.18861491080196340992406956050104999
20+1.76476994117808388757893381536740285, +1.70553202520638216677482644902068293, +1.17617918845810318720035153949871538, +1.72008499777548860090542344406581309, +1.26334385706709138524514788227367137, +1.16269025733283316062830031045647551, +1.20238658016550898022547189742924917, +1.16040329209635799725384869745558736, +1.04670786752624214872450610064660428
21det = getMatDet(mat)
22det
23+0.700562546885857398778122954709650247E-1
24det * getMatDet(getMatInv(mat)) ! must be one.
25+1.00000000000000000000000000000000096
26
27
28ndim = getUnifRand(1, 9)
29ndim
30+5
31mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
32mat
33+1.23628321006451491424024824364077714, +1.84564118143214438874265858541717766, +1.37224075357606449198863660046821652, +1.70901418995622989563344925962301498, +1.53803492122739706157749617579171243
34+1.04068772105846838870366678069776326, +1.41361414960964293722946740851887823, +1.48040296032698150151233551752666894, +1.47900539669768120797759630589630084, +1.83860374735656624556907913738304227
35+1.09597194752290804434366224650854273, +1.01895939544080508364105825577573706, +1.07395862568612990418172644417418630, +1.87428831780212705101319816316388340, +1.76372183426906124558799982120800557
36+1.97340939837643406580666587462972107, +1.19898128769320963299795623747479212, +1.31744836887910296841994937915735759, +1.09317287664291150353135251631174046, +1.80677908897636311646299862040134433
37+1.71530789234513759257461551664970883, +1.13600577517119037479142984717083108, +1.94004099746720844927539973436868659, +1.01875097310141377571417499785111112, +1.10757250517436206898587017783743247
38det = getMatDet(mat)
39det
40+1.08881967688509821976451643585285958
41det * getMatDet(getMatInv(mat)) ! must be one.
42+1.00000000000000000000000000000000039
43
44
45ndim = getUnifRand(1, 9)
46ndim
47+7
48mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
49mat
50+1.47527565792525574667017148352325835, +1.21419205551870990028448565880994422, +1.72435042098148928149422949795493562, +1.79696534083779717684110587867641691, +1.07858384785475723151343860935150938, +1.98155654372547836517837417844227146, +1.56042489063917376975867551593182734
51+1.75057181475874590286368197545039594, +1.82031583134333053373045131320528679, +1.25170085550157780901983011681940305, +1.80659455292972744199141350955166976, +1.41086109424444556966598101436130105, +1.94584308234005666673493040578709408, +1.77256202480427362666847666761647609
52+1.35429786743591557746981173054130295, +1.22006772252613200021623407883123473, +1.76603172218536132344374290043900830, +1.69782697212912788560991950639670472, +1.48413600722401515290840052980668251, +1.88933018993906925781390102521567303, +1.60913149444224036167395287237948344
53+1.87688679056718594963787862287071023, +1.91597431470881347689070874879192412, +1.12232358344368709750114733506195237, +1.43875957270364912033002978973779409, +1.44844380754626351918478984459957015, +1.81194226359468811376518013049763476, +1.94212557706730664369089630208773686
54+1.45689785992368720245008322242812153, +1.76037626673364314242695395947767973, +1.87109316762600837604357631149627941, +1.28410517646925737238442764216233170, +1.37803913486648113693908150615793871, +1.01308318563294080200589575679728806, +1.84107909536913841382778015968089453
55+1.80528953622066551657997338273072821, +1.46945158760877306483415751042032869, +1.10361958251621305798427518120635463, +1.59753617241573416011644864377008627, +1.74201191075276731418565910577111203, +1.24222360748065840745226539674912607, +1.61874521243065617709387909666007392
56+1.14366788816464848300234706426329719, +1.23290487011265288516232261102352114, +1.76429681254086053455592117261892161, +1.23359440132908005930680588090422791, +1.08257015463123199938914708250987616, +1.40126496940344288214404806063185123, +1.00174284295301334099727318261505196
57det = getMatDet(mat)
58det
59+0.110424511713007174716850546635810066
60det * getMatDet(getMatInv(mat)) ! must be one.
61+1.00000000000000000000000000000000212
62
63
64ndim = getUnifRand(1, 9)
65ndim
66+2
67mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
68mat
69+1.88468741031064195061527280926085988, +1.90933812281065576987472268757493805
70+1.88494738962611675285928622008173685, +1.65807775142198677197725058462545178
71det = getMatDet(mat)
72det
73-0.474043647084378947062219844005107912
74det * getMatDet(getMatInv(mat)) ! must be one.
75+0.999999999999999999999999999999999615
76
77
78ndim = getUnifRand(1, 9)
79ndim
80+6
81mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
82mat
83+1.81293055620438891001481559242059200, +1.49007730173726118588558701019122316, +1.70966001702866118901945676640664402, +1.21027724568738326461884867217913328, +1.52356527427679350120032689074562121, +1.15746047138956993309345324405246725
84+1.00151251833628660226030226178904099, +1.59392166260873014506599392942146161, +1.23082826553472245368912761044096415, +1.50392605142046166537861260824736470, +1.79868133072827766696406467063738492, +1.98021207277300276586929365507408374
85+1.87211074392861866807561487284325977, +1.40842562147537729625073403085469667, +1.46179160086059216258268712125986253, +1.70438052035864933019318468044427395, +1.00757235219674104234482347334728885, +1.83186686596344942791447568319973019
86+1.86430802455765189249892848182982996, +1.15599678494655389688335165497534711, +1.65275883737122493676452571994840251, +1.35793041029692814676025802046909605, +1.07290980816270909987151865436386958, +1.07411373293010131707397585822052459
87+1.52843074300684833121669083573336032, +1.75986021640685617244804314365561630, +1.50041296266782693787677156420085328, +1.61990588029672362314222661890584722, +1.89615135962545904329345461170779851, +1.46672908803170194833703567066288523
88+1.15430894964600821989779197310838242, +1.88879109869998822376796313716395725, +1.82141932442100425871397448894263294, +1.88952415566039455049546287108493899, +1.89422906556484697994609086400578578, +1.98488145844739048046429993570108872
89det = getMatDet(mat)
90det
91+0.905189558588608556314311073158766797E-1
92det * getMatDet(getMatInv(mat)) ! must be one.
93+1.00000000000000000000000000000000077
94
95
96ndim = getUnifRand(1, 9)
97ndim
98+4
99mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
100mat
101+1.86559456936248834255673093831364183, +1.75476368714460352177828079228086916, +1.07003209423701922329460032284313780, +1.42546658708880837154822497991362323
102+1.35801607670792111265320019509967099, +1.91908215319550306930897304042086610, +1.94270227299446275650293933257168133, +1.91759872833595806187451461753861460
103+1.75104336381645529428245054446538434, +1.01907734992091147410982121675371167, +1.71528826569417497851499891448324421, +1.10841050570674471367813097605239152
104+1.48678359068235510494531164532874052, +1.84290097213465622126555392431494796, +1.04850639953056002130060433110318841, +1.60496011024375950637472028112372489
105det = getMatDet(mat)
106det
107+0.150266533305688629329157149336841886
108det * getMatDet(getMatInv(mat)) ! must be one.
109+0.999999999999999999999999999999996533
110
111
112ndim = getUnifRand(1, 9)
113ndim
114+2
115mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
116mat
117+1.99757713786968863752969967051320807, +1.33958468740009192952524589497147777
118+1.78460885591087350517180469990237456, +1.08798329800989520490351191226111259
119det = getMatDet(mat)
120det
121-0.217304133888172211748907133914927470
122det * getMatDet(getMatInv(mat)) ! must be one.
123+0.999999999999999999999999999999999904
124
125
126ndim = getUnifRand(1, 9)
127ndim
128+8
129mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
130mat
131+1.60269983323099500570846048802758953, +1.62605304523476135966038240944529508, +1.05022987743180314151714321272729531, +1.08900708002345482222660109762003156, +1.53634482076540808743621690019305291, +1.84167662070769746107044904019642088, +1.65593889186301863286351660006002563, +1.08055412010872429658888459550900420
132+1.22115412354344771817675231785067815, +1.08317810205078653726832785675409255, +1.52887383436064778156697273546619648, +1.51516390508645130531832137844585966, +1.99576206921663285391311896185007710, +1.79531574618682160518763462742437298, +1.14133966996429009584131465573974551, +1.88539486745994435270371864925095638
133+1.69764014873453629913820309426782221, +1.20453217645677274024584343787090621, +1.66765883971482309347417880185827803, +1.80369755338428181324056702181468934, +1.54847880343360366243954668151449927, +1.45696822285245721813699504129759351, +1.10869501096545274203437834086263193, +1.31954535027185258552332496491655088
134+1.34263623858029472886974338822018266, +1.02145069480617944913692359675946319, +1.46643090928428249785317197103700874, +1.58877543730618735820908642187942634, +1.18191612490851928633204076957102206, +1.57480352274292405466219172061764241, +1.49343113771888871634959705705554982, +1.21850248883643327212565577766298202
135+1.47086278442947895411993392701443361, +1.35777923908711141721314001305186820, +1.01655159283145072867309526953331423, +1.53870330103500862828815896387620252, +1.50454917446560033255200119420487211, +1.05942676672727537320701802584856586, +1.27653221508844736030828598944158321, +1.11603982363155022646822273858837539
136+1.74031255621943012603660145137724168, +1.71649682447799306596663050698330714, +1.53089619729045209024148667930494682, +1.42975217947975862317221088010884003, +1.28081948487323861939168888336240113, +1.56295593572043292012079592117577020, +1.60652591583781463515272823447387364, +1.12085872961580197086398452826508153
137+1.64332364058743872005356661007275084, +1.78592790670253758147817310927057316, +1.01970646830484670542223416410462339, +1.85781019558278594188371282778868332, +1.91221640907958754701687422910988019, +1.45150143064013894480752612824737849, +1.84667524529797815045135889921254245, +1.06029720583604871504972961538912628
138+1.02852054627682343446246457006503420, +1.09227250595424578896353189518680036, +1.20115741991838601618438097246241245, +1.57455041662602953181116306478246176, +1.90512324109672623399983438587608513, +1.28488815793589217006470523514919480, +1.78428484839273336135210642262005188, +1.85954485027202267428411774825665883
139det = getMatDet(mat)
140det
141-0.268467422128554905869938763845753700E-1
142det * getMatDet(getMatInv(mat)) ! must be one.
143+0.999999999999999999999999999999999519
144
145
146ndim = getUnifRand(1, 9)
147ndim
148+3
149mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
150mat
151+1.14790522786343246643465110126513324, +1.57126836941055412725025774889943759, +1.95731625754478066726984501998275719
152+1.21310362335246663877465282291482305, +1.16503835442665402298715813168970849, +1.41299128532707752200348933868498512
153+1.15383206876649788711257255351213541, +1.39455327035131978923930336099648064, +1.14523197485734820391873822969113459
154det = getMatDet(mat)
155det
156+0.328553848201798241432649896895990211
157det * getMatDet(getMatInv(mat)) ! must be one.
158+1.00000000000000000000000000000000077
159
160
161ndim = getUnifRand(1, 9)
162ndim
163+5
164mat = getUnifRand(1._TKG, 2._TKG, ndim, ndim)
165mat
166+1.75571710613527834119994960928349205, +1.50783385627270486931830478935720769, +1.90212632398114560450235556520201743, +1.23915050245782621028885933597950763, +1.89353926923229995331242446173799277
167+1.87876068567007193633886960549990256, +1.84869256021181684545075341247889814, +1.42406538656046392709920729147999937, +1.35782137028737440668590302452781664, +1.92495649828840898346925834219764296
168+1.67938791926268679870245694647940605, +1.27494273963575576326522659146057983, +1.21116091803017584602791895811822360, +1.29172724437231936392634699684168920, +1.80158291102987095790071646209911745
169+1.08654435590444428833755876398765491, +1.43025761680209612672344565838438054, +1.04496635968775443228631418288105220, +1.60921006110457382424790864144744309, +1.76272904937242836794142074926537224
170+1.77190293722902740327867258664836626, +1.29630735154871431808492253980180035, +1.31093905452671343854248611214451437, +1.24303975958450343692437005559245200, +1.50969525888793072828267122964822106
171det = getMatDet(mat)
172det
173+0.121786965454092241529072773292377479
174det * getMatDet(getMatInv(mat)) ! must be one.
175+0.999999999999999999999999999999999133
176
177
178ndim = getUnifRand(1, 9)
179mat = getUnifRand((1._TKG, 1._TKG), (2._TKG, 2._TKG), ndim, ndim)
180mat
181(+1.20707850960389843998120110654120468, +1.02050693443003742580992094967893223), (+1.22297492272994639207581835712234290, +1.17576541498844453569941118055873125), (+1.41607902894809750924945669330589076, +1.92429902182844620910981913527982019), (+1.74458810286163165210426881464950725, +1.52873371921086710526745376489958838)
182(+1.76961398813810651825733087405318131, +1.83953242475030836236312374177812312), (+1.58542589586188076296094162911026772, +1.94682279964190602809837520132273744), (+1.76996342810911639196102945026401702, +1.01103954558947755303940519460243369), (+1.40721457769363294901632365879260670, +1.75826989093689732327289432846527901)
183(+1.57840577123474554740497750351386693, +1.92278427685307777846364217342382703), (+1.20338908011089784085557492562415930, +1.57778887160788508076424330259417516), (+1.27938062500195494048593896722946110, +1.33644998883371742144492730299177240), (+1.25954654041150771430037490750405139, +1.97106041130941220242839194015011083)
184(+1.98748552944362033449326879555796323, +1.83770812546567443572273777198096130), (+1.04546598934871812321753864825681759, +1.83978357563200149281393249043626326), (+1.38060404782833860572602967062069486, +1.42854866600487292246928339606505030), (+1.71627556390745559674276294064309990, +1.78828808709852570980740522332924227)
185det = getMatDet(mat)
186det
187+0.507220704467218365775744149531454406
188det * getMatDet(getMatInv(mat)) ! must be one.
189(+0.705804614838700766631101242390287292, +0.455680217379572039964673677461129913)
190
191
192ndim = getUnifRand(1, 9)
193mat = getUnifRand((1._TKG, 1._TKG), (2._TKG, 2._TKG), ndim, ndim)
194mat
195(+1.97748598421393153280157914183232854, +1.71767092627039753764424209127714231), (+1.87474308310767480516423945794550155, +1.89410210904297308475404858591917165), (+1.62090498520067496300153991746945154, +1.49016925145638431099369136570781806), (+1.63007243041324414092218321033975108, +1.94529292188401842992591404867297216)
196(+1.29290680985654570915349233843108584, +1.92611632931753627462645668067859941), (+1.68729390007332759874435133047014683, +1.44015285650387973106079437635476534), (+1.26710504794451909415396229036790958, +1.88849459836338446072022401333363815), (+1.17437732155022577585422091452754573, +1.23610266212384388094351409469590369)
197(+1.33299561904211138237551696562031810, +1.34807333956249440446310431726041578), (+1.66052753592048811653276375785969946, +1.01443222227950335427439353109952394), (+1.05734643227877642834572816012245780, +1.62934155933155601363244880977382091), (+1.75619292442578145000850630341914158, +1.20202405453105740640182253214596899)
198(+1.34294792835065059740908092628642087, +1.84429948268273750108356017826586733), (+1.93756801850549091863538717928101346, +1.89043648985658425134755241178699139), (+1.15318415176520422591420021740077005, +1.53582013514531108069938361357911228), (+1.83111510978812272362176186676647877, +1.72640978849183631983744109027570136)
199det = getMatDet(mat)
200det
201-0.398875188878261928666590201784560301
202det * getMatDet(getMatInv(mat)) ! must be one.
203(+0.469545180283952262105374588860601237, +0.499071642107686809792529418165774628)
204
205
206ndim = getUnifRand(1, 9)
207mat = getUnifRand((1._TKG, 1._TKG), (2._TKG, 2._TKG), ndim, ndim)
208mat
209(+1.30207803872331615372243050108015355, +1.84722132841251073650217840030155274), (+1.51844647458436711522327537816129510, +1.27743118706545433132664534919122027), (+1.21179807927738505934047126132264737, +1.99721162848284068390349833001438938), (+1.77409294730113762131531733331281227, +1.95874049415849800199520942789552477), (+1.52838927609664797351703157480524520, +1.84787337305397383423155397127184877), (+1.70527958750887746116730074722052216, +1.83205386067314882443054540082489585), (+1.74601672567646814851177310982080947, +1.65352891979249530139089902856142072), (+1.08489980990638755072423008235269198, +1.87118876369478039526454266256953862), (+1.38196978769012870003076930672119083, +1.00657642485850128781223911525458241)
210(+1.66406369963884232782584612955629088, +1.08089097408354867928673840415885992), (+1.10105384083480200911680768331595941, +1.73674030764226863581862889219855294), (+1.63421412991366636174843321459194917, +1.56112652232331625318617264833103834), (+1.69832581967562096611395941294505798, +1.79900377084754869389412036922081202), (+1.41298666489759178598414269785669620, +1.89239554126757321124999429410815350), (+1.11712824955107448345706371500331598, +1.22971608817368503193796949772291038), (+1.00911879849401049564863893875443125, +1.97101806291571936215292255477731819), (+1.78572005658089816685383222626927894, +1.71037542498432640884272134432725154), (+1.48596666469699226983777919861780060, +1.65740586084632489198030869428504634)
211(+1.36026764498284347249175580379893137, +1.70401947235145237658322028200210778), (+1.40461028365915680935530958175333840, +1.63507584839228621745804821172546214), (+1.61124034494867976464317979116882304, +1.78550044566404134913840336797866161), (+1.93690968532578361068496582130637855, +1.87472521923937082413042160990528973), (+1.69438148922664249911715510069473311, +1.70486228769972106771916756315311450), (+1.71196692677333696387787557282509366, +1.03489029599566732352527723945427164), (+1.16596286598214812753671776439042007, +1.57390388330659840645909433839083183), (+1.76137963640653862002862131548347405, +1.79353578978374428524577635264198697), (+1.21783780898631728219311389014020729, +1.50714343060348773887480847568491972)
212(+1.53964082860682838260967660983847561, +1.35981489433667542049117893237790569), (+1.46296224760651941344671775695064678, +1.85798981183886944500581415554836269), (+1.21980408608144304782355318062589921, +1.11894275726421486598930419433070128), (+1.60495171564514121996546762950743483, +1.51421454689565681881121323372631638), (+1.01541924513000051321518768838862148, +1.17954483944108911908950403217874870), (+1.69848392343589262809225597920342923, +1.39647005854797790451876312866564006), (+1.70167581902383716752621406740945247, +1.67104455141727648048047537816498221), (+1.07644923614379805789080126377990943, +1.18508634754614549273858604836433135), (+1.74859744873104850925924176969046180, +1.63178813938915152471132336667023388)
213(+1.37307938480156771525035364207533540, +1.77402070128317939871306297065835929), (+1.59214403441636854587188706250090059, +1.97793792733644431745451110399621457), (+1.65591837447100096477532321967623369, +1.38648608538987052683857994287697217), (+1.17890338251861831393823224035265362, +1.60569854732749711477805100768627248), (+1.98034661900404106396291036915127833, +1.38868551355655356297601277183863915), (+1.79361441685347859274552799998396794, +1.16583047949112620718920922769239860), (+1.40994636569754454237018867751658355, +1.83202557180262915167931327630787679), (+1.43331803081566708999256896779460216, +1.29216109514668335337745414038899193), (+1.25011961467554133898315063037067941, +1.02931826746318697909512757239200126)
214(+1.73366873467149039459503683066205153, +1.95381854253945354901878129074838683), (+1.99798128555593097999486279891761772, +1.50640795207089697756913373725474420), (+1.76728391290101965837086833342167979, +1.63679555276936757773044638746240678), (+1.39307528139361310732896247029044107, +1.20963691185552658417783496274629460), (+1.67443642419532898242150099242627305, +1.38255973963375844927141980911404135), (+1.96881229302076751089806943002749327, +1.14551202353690982294315377488479728), (+1.13031410102217213646878399097030420, +1.56505661300639680840803996164569385), (+1.91359621738914716063545002325222636, +1.97157789631157267431501619489440429), (+1.88099667649566421931369344530067800, +1.77818892496428480705331464900948316)
215(+1.35481600585037608522112079156519145, +1.51536967562618570443329206525877227), (+1.41499308782045465593961663925465037, +1.09304576855813618466503008432371840), (+1.12638681502884000577551789341460233, +1.45292880371961817202041574683061202), (+1.54903235677872169705052024883992249, +1.87469090072727297688447556488906733), (+1.04433802283209702127383414600005242, +1.75780875697652070775484406834188052), (+1.53976750462980717328644854104697915, +1.37709148745376314484157278948464486), (+1.03361265910734897518406985053034462, +1.46297074421621765559339869643888843), (+1.12263485046985256410253406393675991, +1.40060886071634019564874543507780201), (+1.07167112245719915715197035915651634, +1.42819812520772059597213757782826050)
216(+1.55449028716365428781148444599858238, +1.56865414782221571534601976790975859), (+1.90650477468281391768445455938525365, +1.61963436176064954731279394393157519), (+1.78900857377034936544419636630828854, +1.59739729451208801710642626664865284), (+1.78901344599632086165463396095931738, +1.67365528794873830073933837173596875), (+1.05958157414770646515464416948655515, +1.54859508035354083288767175912870063), (+1.88304131581130248563721248849900506, +1.81568790680715331515776926268721445), (+1.39175993970052167734128797970729752, +1.69150717890762628171212793062343565), (+1.17730098864905455610238700764657013, +1.93624486859930733945938463981183255), (+1.85285503176602848927062477803743763, +1.06741835959765334879040547675106065)
217(+1.47853166244849858246401176005747891, +1.62040024830904031405267253157396728), (+1.89276434544984154978070355382037745, +1.26989776267908478127866394376500579), (+1.88382111674231839731728571331536735, +1.11947224404721267983282654133467886), (+1.57099860680684644220814923212264716, +1.96779558357084381315020297129376505), (+1.29800446132867683247717624515807785, +1.06012286887517704325135386939556421), (+1.43264057243239047545871314736315044, +1.40520765216348999112862300190751277), (+1.59386698624812153560912215762737308, +1.94783572093682563039491246410994265), (+1.82199071289727141529134936650862931, +1.00114300817680588964722268228925347), (+1.63360773461433494332882099929709832, +1.92798654697872380425178983679558635)
218det = getMatDet(mat)
219det
220+1.23619850600300303900879252007315528
221det * getMatDet(getMatInv(mat)) ! must be one.
222(+0.438549949253286386558873967385021776, +0.496209523551519838903785924797996017)
223
224
225ndim = getUnifRand(1, 9)
226mat = getUnifRand((1._TKG, 1._TKG), (2._TKG, 2._TKG), ndim, ndim)
227mat
228(+1.54955842774115145448683046738