Skip to content

Instantly share code, notes, and snippets.

@mkitti

mkitti/21x21.jl Secret

Created Jan 24, 2020
Embed
What would you like to do?
using LinearAlgebra
using Printf
const LA = LinearAlgebra.LAPACK
gdb_matSolveRed = zeros(ComplexF64, 21, 21)
gdb_matSolveRed[:, 1] = [0.25742928375170709 + -0.52799728665772461im, 0.17556411231024846 + 0.076020416636867066im, -0.069867820911511697 + 0.49830366166688028im, 0.14844822711849467 + 0.35261864761864664im, 0.26194845330606931 + -0.581972233827311im, 0.040569840346062841 + 0.29260314309379193im, 0.21392984933673168 + 0.76042425362066335im, -0.38704583037882201 + 0.62620989909405755im, -0.46295720576798155 + -0.38212478385978793im, -0.84567116100031436 + -0.53370430713306038im, 0.53239832439146606 + 0.11401236550716029im, 0.61938576019632019 + -0.62970826931117707im, -0.4130550821421653 + 0.28815892248213504im, 0.26874540814074527 + 0.53891578303733756im, -0.011260035051614763 + -0.36770481202141242im, -0.34699000282084946 + 0.015445123869004007im, 0.19087175002034551 + 0.10879490349545594im, 0.075373326540106131 + -0.16213208428753068im, -0.10056465876848675 + 0.053503115867321385im, 0.048737087276222696 + 0.06885057970198849im, 0.0051437523994665984 + -0.05323228770865264im]
gdb_matSolveRed[:, 2] = [-0.17800470331325882 + -0.031477671399324947im, -0.15775674992730282 + 0.11377503142833711im, -0.34241159510593555 + -0.28095319855040018im, -0.13405817240819404 + 0.1012617337153523im, -0.2735970661110268 + -0.47598359274100188im, -0.40528455050780793 + -0.057041374124044815im, 0.10491773389498439 + -0.79250842485172168im, 0.13516768920964717 + -0.33447356258158367im, 0.95569172836841842 + -0.2943693603760168im, -0.015721406085871862 + 0.22803605426511397im, 0.3826774505301857 + 0.8727227924591181im, -0.16585969557839683 + -0.29965848695430164im, -0.67750413556123534 + 0.22530071761621892im, 0.34753574469464099 + -0.011695015511553917im, -0.034353666700591617 + -0.44439929963565428im, -0.095493261751866967 + 0.23310496329116132im, 0.23535732858735939 + 0.067546322543983781im, -0.097835408793836218 + -0.11067463110997915im, -0.080210707024029215 + 0.09295046349908509im, 0.073816571194945363 + -0.016317945007523565im, -0.021083285959445468 + -0.053012744396868129im]
gdb_matSolveRed[:, 3] = [0.20077239651551759 + 0.44010724054165024im, 0.45547389816108103 + 0.10101424579613007im, -0.05973067691568143 + -0.82313153885668677im, 0.55777019485625534 + 0.21528410812835769im, 0.59939291584089371 + 0.42355262872208582im, 0.48159386091492468 + 0.87639451911171606im, -0.25842277341527065 + -0.30435297380865883im, -0.57376673192332561 + 0.65245823411658099im, 0.58267655505256455 + 0.19271163999386515im, -0.38862480735076638 + -0.03451616759857868im, -0.34096916687519102 + 0.21788175425997361im, -0.32956920645602689 + -0.18409578164343315im, 0.14691969385852585 + -0.14922534288658584im, 0.16492051710235855 + -0.38939110084925588im, -0.080897534009064076 + 0.21496767415043425im, 0.25800229886843074 + 0.19145311710619817im, -0.10685295551839033 + -0.16372875573253834im, -0.16681487982006771 + 0.10190428828182388im, 0.12491381776236325 + -0.0033247334343486801im, -0.0085177347995294157 + -0.10365016694793829im, -0.034268620923236175 + 0.057558787367485639im]
gdb_matSolveRed[:, 4] = [-0.38250097963226637 + 0.082926742421479058im, 0.059126768767196393 + 0.17458912044369218im, -0.61629662110233241 + 0.22700456691890725im, -0.23265326373010148 + 0.4886085205936152im, -0.96402696610271565 + -0.26580445561877569im, -0.051410247241630312 + -0.26138286616899359im, -0.15717815715584313 + -0.80098998039493574im, 0.042501699447634662 + 0.63591143712308384im, 0.18067094586960353 + -0.0021021555963019662im, -0.67111341688472514 + -0.35427951264084961im, -0.34329772316704937 + -0.3613902852175665im, 0.51845420160047129 + -0.16426023884157029im, 0.62683158527076832 + -0.41449525116016356im, -0.2790699761196514 + 0.33799594701704028im, 0.22330954794959412 + 0.61456493998187445im, -0.054327230455132332 + -0.37490067826897477im, -0.43257998203559478 + 0.00734309540816279im, 0.2429477493575013 + 0.1096442081575847im, 0.094655872103295596 + -0.22347091335323138im, -0.12702112874508775 + 0.08813250681601828im, 0.077894420126692371 + 0.094244205200276321im]
gdb_matSolveRed[:, 5] = [-0.69412858411625533 + 0.048109375795897219im, 0.28616018474025212 + -0.57455220978527743im, 0.50102622683762477 + -0.49833367309308985im, 0.78969963906548446 + -0.61349366749775291im, -0.51219092448654258 + 0.20600103541963591im, 0.55316832831308738 + 0.28380592202605137im, 0.086996110682673614 + -0.46318414610074465im, -0.071865145058542704 + -0.10506027104572607im, -0.073512281570783516 + -0.068821167199666772im, 0.39149580785455401 + -0.31784946682305243im, 0.30703934274188249 + -0.13200579173402688im, 0.6271460893490971 + 0.32314038278847634im, -0.17135906711681884 + 0.24422627550609299im, -0.2600136304301629 + 0.69997955773737608im, 0.017462955924947725 + -0.34143366377711476im, -0.53065624568694936 + -0.27254235975997848im, 0.2565236605295636 + 0.20278319253741106im, 0.26246969400703019 + -0.27933047031520691im, -0.21574131139385685 + 0.088611270483476751im, 0.087214883243628513 + 0.19355872194868659im, 0.017172819130354733 + -0.13399132252889673im]
gdb_matSolveRed[:, 6] = [0.2405696452491127 + 0.26842552525397156im, 0.36809562649786737 + 0.08452602120036419im, 0.13711173821049921 + 0.99055558715545877im, -0.2630883207750932 + 0.044268677226934686im, -0.40214796880997977 + 0.34077342055025817im, 0.62681840979343706 + -0.33723051988136399im, 0.25715682785526334 + -0.10260578756463132im, -0.13978921119623627 + 0.47257227046355504im, 0.28329972567539513 + 0.5324430782567845im, 0.15988983968686585 + -0.40061271753994682im, -0.17494217087479053 + 0.40708613163556928im, 0.11652526978093937 + 0.4394604073103478im, -0.40841132079626208 + 0.2937001900228346im, -0.21383501960696738 + -0.23955314070826481im, -0.45475255416244442 + -0.40560375746662347im, 0.30026859749051898 + 0.11836558764205334im, 0.38274093262126585 + -0.32804813172004665im, -0.2554470915456431 + 0.14661520095883485im, 0.12801902961478701 + 0.2971701210866195im, 0.0042394636768783465 + -0.20379172256855818im, -0.17737319463412757 + -0.00087518099183776234im]
gdb_matSolveRed[:, 7] = [-0.75193225897292881 + -0.085541538528131011im, -0.99095500097692901 + -0.13419458274764476im, 0.53652215738588815 + 0.12569263966967206im, -0.37498318558718718 + -0.57691610246590552im, -0.28885396019596132 + 0.23101608859943065im, 0.033673349509628921 + 0.3395223933555071im, 0.066235041049337695 + 0.23236279605276661im, -0.51869589956637507 + 0.36245142916929624im, -0.077003725163264772 + -0.16777573784645347im, -0.49439308880653293 + -0.064445764003904449im, 0.20974334896235575 + 0.41523117686255273im, -0.33070856540544763 + -0.086561521185812007im, -0.4744120964747281 + -0.12950259900972758im, -0.34850991517535318 + -0.49834344085077864im, 0.3778744977967059 + -0.10490712539911883im, 0.53254634554234248 + -0.43821982392893288im, -0.23459820774879075 + 0.30702948621817922im, 0.26558455486016241 + 0.4655415167143887im, -0.094126642816957234 + -0.30955176117455896im, -0.32294594143552968 + 0.065551244396379549im, 0.20575189311583686 + 0.0503188660774362im]
gdb_matSolveRed[:, 8] = [0.39334430529144621 + -0.91939124288563334im, 0.38009134508095344 + -0.092319459642011173im, 0.64885853251219106 + -0.41230939440789866im, -0.75212051181480977 + 0.19816693651527725im, -0.26241502639743763 + -0.07668637754348015im, 0.3472313831460509 + -0.40712223384339041im, -0.46419992188349135 + -0.48884992829810275im, -0.38309553815042768 + 0.41755233752844356im, -0.19455091794846316 + -0.38224701675295075im, 0.10714676788586265 + -0.21538934479488578im, -0.15627528552685477 + -0.4162236816089816im, -0.35217864990070213 + 0.22946311932337413im, -0.015048107427932831 + -0.46781640566831084im, 0.14739264990563727 + -0.44332206485626141im, 0.53738320554113184 + -0.44521038016608377im, 0.079425685772855359 + 0.4190169309278779im, 0.49841427645578934 + 0.52394394991982918im, -0.33873604043034783 + -0.25114243267234199im, -0.44568196546851807 + 0.2943238650582829im, 0.31439372619742145 + -0.11166436816950571im, -0.079872542518454742 + -0.30615717638883017im]
gdb_matSolveRed[:, 9] = [-0.54126058514570741 + 0.38974745599580263im, 0.6613546086316775 + 0.75007338417093594im, 0.33514903389379225 + -0.24628119631857093im, 0.05408834165650208 + -0.18407621838255722im, -0.091604882337283089 + -0.18859474350532349im, 0.34608152286086769 + -0.45226521318826202im, 0.097120948211777386 + 0.22807568784103247im, 0.18106808800663851 + -0.32118012771584337im, -0.30988809465916395 + -0.34689921514520144im, 0.09399078709607038 + -0.37719014793195016im, 0.20607000849950363 + 0.17017971689538139im, 0.28523270979950033 + -0.31977417990596824im, -0.29826636233651638 + -0.25681711778607597im, 0.36669630224347516 + -0.20772204119820176im, 0.4007027958053338 + 0.058395144039400979im, 0.54486488753487405 + 0.27387582569169971im, -0.36173526963190078 + 0.15903981188460362im, -0.24869282684614527 + 0.53871312802226756im, 0.11788288577938812 + -0.34866541863185763im, -0.33553648856696205 + -0.2447083190381158im, 0.16846008807049784 + 0.21159063926247737im]
gdb_matSolveRed[:, 10] = [-0.86388109843945049 + 0.50369578890342948im, -0.17005626086297765 + -0.58947590871470101im, -0.041457079501055961 + 0.49940542861522608im, 0.20527872303781927 + 0.72946954853759005im, 0.72714080088461575 + 0.087267798437519861im, -0.0044039280933942911 + -0.50339559701213443im, 0.49261035698738787 + 0.015789736304167305im, -0.069572632120345618 + 0.29172322964820874im, 0.43345160907357566 + -0.29488680155200436im, 0.14116497074151396 + -0.4603648776624627im, 0.46995457631239773 + -0.27582284010241481im, -0.12009938104374787 + 0.32330447239337551im, 0.51119386889097573 + -0.063557664467233571im, 0.11373407465518004 + -0.47232794462585365im, 0.57041488622770364 + 0.11511835450630203im, 0.14326473036874957 + 0.5081327252366028im, 0.20189640651214166 + 0.76310115067633566im, -0.43876650654728633 + -0.31309184378105465im, -0.6835240576364795 + 0.17632503389850696im, 0.44422898709110553 + -0.13270072911667574im, -0.01481821959403192 + -0.46271640288968802im]
gdb_matSolveRed[:, 11] = [0.82205920582224334 + 0.094737357050945728im, -0.77640220196373522 + -0.59230000383924242im, -0.2639788681731578 + -0.44555595463382536im, -0.10353639251347035 + 0.9946256659795667im, -0.4312348307605649 + 0.51556139476822072im, 0.59147109114054786 + 0.49906417543509135im, 0.55853892165611496 + -0.30045928459826865im, 0.62074251662080748 + 0.084246161364183197im, -0.44116680650049372 + 0.22216681385382009im, 0.68061322845842886 + -0.1293573249631374im, 0.52718154232700531 + -0.27020522045758022im, 0.6664980495297409 + -0.13413657741284826im, -0.42774685414110669 + 0.20472527861310943im, 0.62750729303046027 + 0.10673116631638631im, 0.50564710740490204 + -0.29648508114346028im, 0.65977276390008577 + 0.44460687533926918im, -0.35588571530678448 + 0.61366638867156975im, -0.23706803357152673 + 0.94861676491400815im, -0.19805306139747836 + -0.68204968770481689im, -0.76415381963557016 + -0.22718050617920291im, 0.5266721008466243 + 0.17434413909930807im]
gdb_matSolveRed[:, 12] = [0.28383695926679864 + -0.47800531026062743im, 0.32826371986502434 + 0.45054833195966065im, -0.529484943776794 + -0.25320453813804061im, -0.044637266445123058 + -0.82814849123847012im, -0.39612055663701956 + 0.91819851045924583im, -0.60191699982560731 + 0.5031225102551109im, 0.71999895194234376 + 0.48483134928177191im, 0.60756579770565988 + 0.0029793899508669648im, 0.66191465714179898 + 0.029136346859885792im, -0.49969579933660835 + 0.016488517720757719im, 0.68235606252184777 + -0.20022525388689172im, 0.61382059099044639 + 0.039814562921551014im, 0.68513481526261344 + -0.20326220234436529im, -0.49960496415544314 + 0.022072390154994011im, 0.65729761884254445 + 0.019558698814927989im, 0.61964817587198562 + -0.007393293950670619im, 0.72503216683046001 + 0.49955827112846574im, -0.6402331037301433 + 0.50021498142192389im, -0.3352927103809365 + 0.90192269888437526im, -0.014769861607724949 + -0.74599231164712942im, -0.63950928552305497 + -0.30175314913909485im]
gdb_matSolveRed[:, 13] = [-0.23551396083781331 + 0.26470043873529808im, 0.23224123006271766 + -0.24561391850273881im, 0.41660910901720194 + 0.10700550132338713im, -0.6422482560824444 + -0.077510888624554936im, -0.13722641144741171 + -0.76587817966074445im, -0.022396525335192926 + 0.93483760634570046im, -0.70284065518293604 + 0.68832498411261356im, 0.9842540989450167 + 0.17675935253879274im, 0.77434850008157274 + 0.065363485457466231im, 0.61089689702165373 + -0.41837113597390169im, -0.48552662403081565 + 0.003945140115073591im, 0.49587038364043123 + -0.5931195888812929im, 0.73205490581381183 + 0.096262285130774158im, 0.49505714790060051 + -0.59346650063185247im, -0.48630051640664046 + 0.0031613285383772604im, 0.6108166457488271 + -0.42260840352709278im, 0.77692834644684738 + 0.068331966819083892im, 0.98274816322881375 + 0.16763790327401831im, -0.69532825253141828 + 0.68421051895465246im, -0.012059153255938964 + 0.94781042398564685im, -0.17112989941841325 + -0.7650253898801318im]
gdb_matSolveRed[:, 14] = [0.11482379499896371 + 0.0065006314480873569im, -0.071667253077257714 + 0.15671284442566907im, -0.063503809143048734 + -0.17444173770947588im, 0.34980351835081397 + -0.15483019992391941im, -0.34659878022188589 + 0.27268055633468163im, -0.55742317639491601 + -0.38614061864577293im, 0.59247302108691768 + 0.50003402912846306im, -0.10142505367082831 + 0.9935559525916281im, 0.66745989690919016 + -0.6839830972745824im, 0.87122059013980468 + -0.39964426318439755im, -0.16825579172977928 + -0.75830410130396353im, -0.40226931130907484 + 0.06496349290205844im, -0.3565850242104176 + -0.64390536248390684im, 0.72963817716389501 + -0.33506747700129641im, -0.35744945607917528 + -0.64361168577612615im, -0.40243931070244449 + 0.064336778560453514im, -0.17089703467092338 + -0.75813759396262526im, 0.87142697905061273 + -0.4012219682234387im, 0.66472994923411377 + -0.68791763228012492im, -0.096970487031654978 + 0.99528725735078283im, 0.59267848494441122 + 0.49551863438401034im]
gdb_matSolveRed[:, 15] = [-0.034058902348351877 + 0.027552594664358089im, 0.021073837009848016 + -0.028662196405738201im, 0.077087010653639862 + 0.027869987737899379im, -0.093218064470382153 + 0.015309020470013809im, -0.043975894857572161 + -0.20253284427662049im, 0.13218898179725311 + 0.18762233881011478im, -0.31454565428026643 + 0.32215537657950805im, 0.31183331535743958 + -0.36460055210226211im, 0.77551899519060508 + 0.21610389207184527im, -0.55520668595435085 + -0.46275858087187877im, -0.15928829300124955 + -0.98663743183706021im, -0.61412958514726024 + 0.33361509851447435im, -0.3744052230857785 + 0.36613472116355694im, -0.3685097307854292 + 0.47865053231346577im, -0.11115002816332767 + -0.62982301037802013im, -0.36816436552818688 + 0.47900353831395859im, -0.37483800857638022 + 0.36653118294959319im, -0.61364286708988658 + 0.33509779731860734im, -0.16071587947974639 + -0.98700071230118769im, -0.55641554842255714 + -0.46083434930680578im, 0.77569439405764617 + 0.21427369093946785im]
gdb_matSolveRed[:, 16] = [0.0013979432375272154 + -0.0048482149079603484im, 0.0092690422582443355 + 0.0066995007128733261im, -0.010993594778070404 + 0.0023796007304773049im, -0.0067329895746729958 + -0.035534673862018973im, 0.024223757110442543 + 0.022810474314099417im, -0.066300449175578091 + 0.073785369079237592im, 0.017420628797813694 + -0.09513259308012946im, 0.25425765892245533 + 0.025205392583791529im, -0.24967334128569432 + 0.043510907593390075im, -0.25089561722277726 + -0.5277302326589326im, 0.13486382161949539 + 0.47685825891723271im, -0.65947832256307759 + 0.75172358089219837im, 0.6240015811633659 + -0.048688378468111936im, 0.85249049433022872 + 0.33694099090082275im, 0.39911146641103923 + -0.37962932215480821im, -0.20816236406444685 + 0.16687691443980923im, 0.39894370789967049 + -0.3798714943591619im, 0.85301763433037781 + 0.33674317978659418im, 0.62396359170440474 + -0.049535879297378869im, -0.65867816577661142 + 0.75237036997270135im, 0.13573295273910799 + 0.47623298306491635im]
gdb_matSolveRed[:, 17] = [0.00041300381636318322 + -0.00022661414952054854im, -0.00010057921165784174 + 0.00032760404627895208im, -0.0013400814300331895 + -0.00060812302121449134im, 0.0012910256857936275 + -0.00048464118030573856im, 0.0013500358153951126 + 0.0058104140674450711im, -0.0036864118248398094 + -0.0026299888462208115im, 0.013524804403120797 + -0.016041923841728915im, 0.0015554015531016568 + 0.015075741952268233im, -0.066393112482527911 + 0.00040810356061731352im, 0.044376733861577491 + -0.035047855598077014im, 0.13597273342317717 + 0.16070202092870017im, -0.13262653718009232 + -0.1071449971678976im, 0.2176668315815091 + -0.53495791208778565im, -0.21328724065602281 + 0.25476162898884169im, -0.99731241860023667 + -0.072557020769586672im, 0.13650289294024681 + 0.37274347586764023im, 0.047016888926827524 + 0.56009814941688707im, 0.13660879656512498 + 0.37271520479713649im, -0.99738637725346702 + -0.072252435731983908im, -0.21305181189108127 + 0.25487095433500812im, 0.21726002215202059 + -0.53487386365315304im]
gdb_matSolveRed[:, 18] = [-4.5955517763689564e-10 + -1.0057186647683002e-05im, 1.8421186586168273e-08 + -4.7141845645433251e-05im, -1.1399122335486226e-08 + 3.1354702014684799e-05im, 1.4201443982171211e-07 + 0.00021921816974769442im, 2.401305533373996e-07 + -0.00011989300791830167im, -1.118039170845428e-06 + -0.00090005237546149646im, 3.2750384923667877e-07 + 0.00043566978739022785im, 5.744905862712099e-06 + 0.0034727236973010325im, -4.1561791263032471e-06 + -0.001554883950386975im, 6.3623185691952751e-05 + -0.012733319673040857im, 2.7338491432142926e-05 + 0.0050318936361142307im, -3.338141917651982e-05 + 0.043934464149565047im, 9.9233371349055893e-05 + -0.013249117913955638im, 0.00051577018527480399 + -0.12823667326332211im, -0.0010649940298771716 + 0.036634932044199452im, 0.01076678834486631 + 0.35804445992698103im, -0.0048440690369740275 + -0.068759527805409615im, 0.029571575411139379 + -0.99956266533304627im, -0.0048436041772737535 + -0.068762755093823624im, 0.010764281298689156 + 0.35803867868260697im, -0.0010647296764282777 + 0.036631177760388232im]
gdb_matSolveRed[:, 19] = [0 + 0.00047727719427245589im, 0 + -0.0002397446482019748im, 0 + -0.0012379853508716556im, 0 + 0.00088645592685717919im, 0 + 0.003900009911993661im, 0 + -0.0026958361685381505im, 0 + -0.011953774099112812im, 0 + 0.0075071784002586212im, 0 + 0.034201118509045628im, 0 + -0.018996713435107237im, 0 + -0.089963591049220346im, 0 + 0.042227045117453982im, 0 + 0.21271986142377675im, 0 + -0.078979255983655919im, 0 + -0.43934480167879536im, 0 + 0.11481876910426586im, 0 + 0.76576252618760021im, 0 + -0.08077879784642493im, 0 + -0.99999999999999989im, 0 + -0.080785999457811702im, 0 + 0.76579470857523901im]
gdb_matSolveRed[:, 20] = [-0 + -0.00055263893265814954im, -0 + -0.0010478891048936701im, -0 + 0.0012165016834712922im, -0 + 0.0036795840169793208im, -0 + -0.0031924617177390021im, -0 + -0.010568470162150349im, -0 + 0.0081558798176374313im, -0 + 0.028101677642206151im, -0 + -0.019226657975310035im, -0 + -0.069266074907165687im, -0 + 0.040814503245434432im, -0 + 0.1563495618213038im, -0 + -0.075568348994376117im, -0 + -0.31719873485820971im, -0 + 0.11608764130394346im, -0 + 0.56417351292885354im, -0 + -0.13232524403294652im, -0 + -0.84765550650841515im, -0 + 0.069610382241483706im, -0 + 1im, -0 + 0.069615923246698977im]
gdb_matSolveRed[:, 21] = [0 + -0.0013447137601695059im, 0 + 0.00082315534792236442im, 0 + 0.002890437717322981im, 0 + -0.0026400555549303101im, 0 + -0.0074642350308739766im, 0 + 0.0067026461522228555im, 0 + 0.019089842762232925im, 0 + -0.015499817582465547im, 0 + -0.04601295907833635im, 0 + 0.032721544256004632im, 0 + 0.10297262524919261im, 0 + -0.061930967893525112im, 0 + -0.21115951508211814im, 0 + 0.10192271529036687im, 0 + 0.39016453914098542im, 0 + -0.13845791176162922im, 0 + -0.63536121822939162im, 0 + 0.13818581314862252im, 0 + 0.88348881026467729im, 0 + -0.063608617653415328im, 0 + -1im]
gdb_bSolveRed = zeros(ComplexF64, 21, 1)
gdb_bSolveRed[:,1] = [0 + 6.5507607349187661e-05im, -0 + -9.4317068087468713e-06im, -0 + -6.1823576434961959e-05im, -0 + -4.3748717078498843e-05im, 0 + 7.220417518244322e-05im, -0 + -3.6302708917805127e-05im, -0 + -9.4344373889317432e-05im, -0 + -7.7692657187119558e-05im, 0 + 4.7409486624326541e-05im, 0 + 6.6215666397745636e-05im, -0 + -1.4145294798525544e-05im, 0 + 7.8126693248167954e-05im, -0 + -3.5751323018372626e-05im, -0 + -6.6862244184931076e-05im, 0 + 4.5620428466179224e-05im, -0 + -1.9162467979237248e-06im, -0 + -1.3497974326510336e-05im, 0 + 2.0115415712539384e-05im, -0 + -6.6380286315118976e-06im, -0 + -8.5421589368991969e-06im, 0 + 6.6044275030108905e-06]
gdb_xSolveRed = zeros(ComplexF64, 21, 1)
gdb_xSolveRed[:,1] = [-7.1478984847102005e-05 + -5.9675313770135291e-07im, 4.4421087644167133e-07 + 2.8117808307531805e-06im, 7.9193122503419666e-06 + 4.7989408234232991e-06im, -4.0637885570931701e-06 + -1.0756183542773194e-06im, 6.782282782666774e-06 + -1.4472065311400478e-05im, -2.0744599313131957e-06 + -4.9253602118804968e-06im, -6.2897038593701829e-06 + -2.534333733641845e-06im, -2.5247022367529735e-06 + 5.1638136877380111e-06im, 4.2974966491647928e-06 + -1.426080364999685e-05im, -1.4841198588506724e-06 + -7.8348555496757076e-06im, -1.2097730470616521e-06 + 5.3023964283570968e-06im, 5.094567688031402e-06 + -1.510061040587366e-06im, -2.7543522596451774e-05 + -1.8589090396772447e-07im, -1.5490707240404779e-05 + -4.4047097254597025e-06im, -9.3060449559440005e-06 + 2.277377631270853e-06im, -1.066854084902561e-05 + -4.83457305669925e-05im, -2.6659737846010537e-05 + -2.8187788323976172e-05im, -0.00013797938455251363 + -1.7663992939024476e-05im, 9.3372003628972868e-05 + -3.47695864586826e-05im, 7.8680371007396597e-05 + 6.6848351649778423e-05im, 7.6527502029689502e-05 + -6.3369184484732367e-06im]
# I ran the whole file in Juno with each individual method as the LAPACK functions change the inputs.
matSolveF = zeros(ComplexF64, 21, 21)
ipivSolve = zeros(Int, 21)
cScalSolve = zeros(Float64, 21)
rScalSolve = zeros(Float64, 21)
gesvx_xSolveRed = LA.gesvx!('N', 'N', deepcopy(gdb_matSolveRed), matSolveF, ipivSolve, 'N', rScalSolve, cScalSolve, deepcopy(gdb_bSolveRed))[1]
gelsy_xSolveRed = LA.gelsy!(deepcopy(gdb_matSolveRed), deepcopy(gdb_bSolveRed))[1]
gelsd_xSolveRed = LA.gelsd!(deepcopy(gdb_matSolveRed), deepcopy(gdb_bSolveRed))[1]
gels_xSolveRed = LA.gels!('N', deepcopy(gdb_matSolveRed), deepcopy(gdb_bSolveRed))[2]
julia_xSolveRed = gdb_matSolveRed \ gdb_bSolveRed
x0 = gdb_matSolveRed * gdb_xSolveRed - gdb_bSolveRed
x1 = gdb_matSolveRed * gelsy_xSolveRed - gdb_bSolveRed
x2 = gdb_matSolveRed * gelsd_xSolveRed - gdb_bSolveRed
x3 = gdb_matSolveRed * gels_xSolveRed - gdb_bSolveRed
x4 = gdb_matSolveRed * gesvx_xSolveRed - gdb_bSolveRed
x5 = gdb_matSolveRed * julia_xSolveRed - gdb_bSolveRed
@printf("Σ|x_0| = %g\n",sum(abs.(x0)))
@printf("Σ|x_1| = %g\n",sum(abs.(x1)))
@printf("Σ|x_2| = %g\n",sum(abs.(x2)))
@printf("Σ|x_3| = %g\n",sum(abs.(x3)))
@printf("Σ|x_4| = %g\n",sum(abs.(x4)))
@printf("Σ|x_5| = %g\n",sum(abs.(x5)))
using LinearAlgebra
using Printf
const LA = LinearAlgebra.LAPACK
gdb_matSolveRed = zeros(ComplexF64, 21, 21)
gdb_matSolveRed[:, 1] = [0.25742928375170709 + -0.52799728665772461im, 0.17556411231024846 + 0.076020416636867066im, -0.069867820911511697 + 0.49830366166688028im, 0.14844822711849467 + 0.35261864761864664im, 0.26194845330606931 + -0.581972233827311im, 0.040569840346062841 + 0.29260314309379193im, 0.21392984933673168 + 0.76042425362066335im, -0.38704583037882201 + 0.62620989909405755im, -0.46295720576798155 + -0.38212478385978793im, -0.84567116100031436 + -0.53370430713306038im, 0.53239832439146606 + 0.11401236550716029im, 0.61938576019632019 + -0.62970826931117707im, -0.4130550821421653 + 0.28815892248213504im, 0.26874540814074527 + 0.53891578303733756im, -0.011260035051614763 + -0.36770481202141242im, -0.34699000282084946 + 0.015445123869004007im, 0.19087175002034551 + 0.10879490349545594im, 0.075373326540106131 + -0.16213208428753068im, -0.10056465876848675 + 0.053503115867321385im, 0.048737087276222696 + 0.06885057970198849im, 0.0051437523994665984 + -0.05323228770865264im]
gdb_matSolveRed[:, 2] = [-0.17800470331325882 + -0.031477671399324947im, -0.15775674992730282 + 0.11377503142833711im, -0.34241159510593555 + -0.28095319855040018im, -0.13405817240819404 + 0.1012617337153523im, -0.2735970661110268 + -0.47598359274100188im, -0.40528455050780793 + -0.057041374124044815im, 0.10491773389498439 + -0.79250842485172168im, 0.13516768920964717 + -0.33447356258158367im, 0.95569172836841842 + -0.2943693603760168im, -0.015721406085871862 + 0.22803605426511397im, 0.3826774505301857 + 0.8727227924591181im, -0.16585969557839683 + -0.29965848695430164im, -0.67750413556123534 + 0.22530071761621892im, 0.34753574469464099 + -0.011695015511553917im, -0.034353666700591617 + -0.44439929963565428im, -0.095493261751866967 + 0.23310496329116132im, 0.23535732858735939 + 0.067546322543983781im, -0.097835408793836218 + -0.11067463110997915im, -0.080210707024029215 + 0.09295046349908509im, 0.073816571194945363 + -0.016317945007523565im, -0.021083285959445468 + -0.053012744396868129im]
gdb_matSolveRed[:, 3] = [0.20077239651551759 + 0.44010724054165024im, 0.45547389816108103 + 0.10101424579613007im, -0.05973067691568143 + -0.82313153885668677im, 0.55777019485625534 + 0.21528410812835769im, 0.59939291584089371 + 0.42355262872208582im, 0.48159386091492468 + 0.87639451911171606im, -0.25842277341527065 + -0.30435297380865883im, -0.57376673192332561 + 0.65245823411658099im, 0.58267655505256455 + 0.19271163999386515im, -0.38862480735076638 + -0.03451616759857868im, -0.34096916687519102 + 0.21788175425997361im, -0.32956920645602689 + -0.18409578164343315im, 0.14691969385852585 + -0.14922534288658584im, 0.16492051710235855 + -0.38939110084925588im, -0.080897534009064076 + 0.21496767415043425im, 0.25800229886843074 + 0.19145311710619817im, -0.10685295551839033 + -0.16372875573253834im, -0.16681487982006771 + 0.10190428828182388im, 0.12491381776236325 + -0.0033247334343486801im, -0.0085177347995294157 + -0.10365016694793829im, -0.034268620923236175 + 0.057558787367485639im]
gdb_matSolveRed[:, 4] = [-0.38250097963226637 + 0.082926742421479058im, 0.059126768767196393 + 0.17458912044369218im, -0.61629662110233241 + 0.22700456691890725im, -0.23265326373010148 + 0.4886085205936152im, -0.96402696610271565 + -0.26580445561877569im, -0.051410247241630312 + -0.26138286616899359im, -0.15717815715584313 + -0.80098998039493574im, 0.042501699447634662 + 0.63591143712308384im, 0.18067094586960353 + -0.0021021555963019662im, -0.67111341688472514 + -0.35427951264084961im, -0.34329772316704937 + -0.3613902852175665im, 0.51845420160047129 + -0.16426023884157029im, 0.62683158527076832 + -0.41449525116016356im, -0.2790699761196514 + 0.33799594701704028im, 0.22330954794959412 + 0.61456493998187445im, -0.054327230455132332 + -0.37490067826897477im, -0.43257998203559478 + 0.00734309540816279im, 0.2429477493575013 + 0.1096442081575847im, 0.094655872103295596 + -0.22347091335323138im, -0.12702112874508775 + 0.08813250681601828im, 0.077894420126692371 + 0.094244205200276321im]
gdb_matSolveRed[:, 5] = [-0.69412858411625533 + 0.048109375795897219im, 0.28616018474025212 + -0.57455220978527743im, 0.50102622683762477 + -0.49833367309308985im, 0.78969963906548446 + -0.61349366749775291im, -0.51219092448654258 + 0.20600103541963591im, 0.55316832831308738 + 0.28380592202605137im, 0.086996110682673614 + -0.46318414610074465im, -0.071865145058542704 + -0.10506027104572607im, -0.073512281570783516 + -0.068821167199666772im, 0.39149580785455401 + -0.31784946682305243im, 0.30703934274188249 + -0.13200579173402688im, 0.6271460893490971 + 0.32314038278847634im, -0.17135906711681884 + 0.24422627550609299im, -0.2600136304301629 + 0.69997955773737608im, 0.017462955924947725 + -0.34143366377711476im, -0.53065624568694936 + -0.27254235975997848im, 0.2565236605295636 + 0.20278319253741106im, 0.26246969400703019 + -0.27933047031520691im, -0.21574131139385685 + 0.088611270483476751im, 0.087214883243628513 + 0.19355872194868659im, 0.017172819130354733 + -0.13399132252889673im]
gdb_matSolveRed[:, 6] = [0.2405696452491127 + 0.26842552525397156im, 0.36809562649786737 + 0.08452602120036419im, 0.13711173821049921 + 0.99055558715545877im, -0.2630883207750932 + 0.044268677226934686im, -0.40214796880997977 + 0.34077342055025817im, 0.62681840979343706 + -0.33723051988136399im, 0.25715682785526334 + -0.10260578756463132im, -0.13978921119623627 + 0.47257227046355504im, 0.28329972567539513 + 0.5324430782567845im, 0.15988983968686585 + -0.40061271753994682im, -0.17494217087479053 + 0.40708613163556928im, 0.11652526978093937 + 0.4394604073103478im, -0.40841132079626208 + 0.2937001900228346im, -0.21383501960696738 + -0.23955314070826481im, -0.45475255416244442 + -0.40560375746662347im, 0.30026859749051898 + 0.11836558764205334im, 0.38274093262126585 + -0.32804813172004665im, -0.2554470915456431 + 0.14661520095883485im, 0.12801902961478701 + 0.2971701210866195im, 0.0042394636768783465 + -0.20379172256855818im, -0.17737319463412757 + -0.00087518099183776234im]
gdb_matSolveRed[:, 7] = [-0.75193225897292881 + -0.085541538528131011im, -0.99095500097692901 + -0.13419458274764476im, 0.53652215738588815 + 0.12569263966967206im, -0.37498318558718718 + -0.57691610246590552im, -0.28885396019596132 + 0.23101608859943065im, 0.033673349509628921 + 0.3395223933555071im, 0.066235041049337695 + 0.23236279605276661im, -0.51869589956637507 + 0.36245142916929624im, -0.077003725163264772 + -0.16777573784645347im, -0.49439308880653293 + -0.064445764003904449im, 0.20974334896235575 + 0.41523117686255273im, -0.33070856540544763 + -0.086561521185812007im, -0.4744120964747281 + -0.12950259900972758im, -0.34850991517535318 + -0.49834344085077864im, 0.3778744977967059 + -0.10490712539911883im, 0.53254634554234248 + -0.43821982392893288im, -0.23459820774879075 + 0.30702948621817922im, 0.26558455486016241 + 0.4655415167143887im, -0.094126642816957234 + -0.30955176117455896im, -0.32294594143552968 + 0.065551244396379549im, 0.20575189311583686 + 0.0503188660774362im]
gdb_matSolveRed[:, 8] = [0.39334430529144621 + -0.91939124288563334im, 0.38009134508095344 + -0.092319459642011173im, 0.64885853251219106 + -0.41230939440789866im, -0.75212051181480977 + 0.19816693651527725im, -0.26241502639743763 + -0.07668637754348015im, 0.3472313831460509 + -0.40712223384339041im, -0.46419992188349135 + -0.48884992829810275im, -0.38309553815042768 + 0.41755233752844356im, -0.19455091794846316 + -0.38224701675295075im, 0.10714676788586265 + -0.21538934479488578im, -0.15627528552685477 + -0.4162236816089816im, -0.35217864990070213 + 0.22946311932337413im, -0.015048107427932831 + -0.46781640566831084im, 0.14739264990563727 + -0.44332206485626141im, 0.53738320554113184 + -0.44521038016608377im, 0.079425685772855359 + 0.4190169309278779im, 0.49841427645578934 + 0.52394394991982918im, -0.33873604043034783 + -0.25114243267234199im, -0.44568196546851807 + 0.2943238650582829im, 0.31439372619742145 + -0.11166436816950571im, -0.079872542518454742 + -0.30615717638883017im]
gdb_matSolveRed[:, 9] = [-0.54126058514570741 + 0.38974745599580263im, 0.6613546086316775 + 0.75007338417093594im, 0.33514903389379225 + -0.24628119631857093im, 0.05408834165650208 + -0.18407621838255722im, -0.091604882337283089 + -0.18859474350532349im, 0.34608152286086769 + -0.45226521318826202im, 0.097120948211777386 + 0.22807568784103247im, 0.18106808800663851 + -0.32118012771584337im, -0.30988809465916395 + -0.34689921514520144im, 0.09399078709607038 + -0.37719014793195016im, 0.20607000849950363 + 0.17017971689538139im, 0.28523270979950033 + -0.31977417990596824im, -0.29826636233651638 + -0.25681711778607597im, 0.36669630224347516 + -0.20772204119820176im, 0.4007027958053338 + 0.058395144039400979im, 0.54486488753487405 + 0.27387582569169971im, -0.36173526963190078 + 0.15903981188460362im, -0.24869282684614527 + 0.53871312802226756im, 0.11788288577938812 + -0.34866541863185763im, -0.33553648856696205 + -0.2447083190381158im, 0.16846008807049784 + 0.21159063926247737im]
gdb_matSolveRed[:, 10] = [-0.86388109843945049 + 0.50369578890342948im, -0.17005626086297765 + -0.58947590871470101im, -0.041457079501055961 + 0.49940542861522608im, 0.20527872303781927 + 0.72946954853759005im, 0.72714080088461575 + 0.087267798437519861im, -0.0044039280933942911 + -0.50339559701213443im, 0.49261035698738787 + 0.015789736304167305im, -0.069572632120345618 + 0.29172322964820874im, 0.43345160907357566 + -0.29488680155200436im, 0.14116497074151396 + -0.4603648776624627im, 0.46995457631239773 + -0.27582284010241481im, -0.12009938104374787 + 0.32330447239337551im, 0.51119386889097573 + -0.063557664467233571im, 0.11373407465518004 + -0.47232794462585365im, 0.57041488622770364 + 0.11511835450630203im, 0.14326473036874957 + 0.5081327252366028im, 0.20189640651214166 + 0.76310115067633566im, -0.43876650654728633 + -0.31309184378105465im, -0.6835240576364795 + 0.17632503389850696im, 0.44422898709110553 + -0.13270072911667574im, -0.01481821959403192 + -0.46271640288968802im]
gdb_matSolveRed[:, 11] = [0.82205920582224334 + 0.094737357050945728im, -0.77640220196373522 + -0.59230000383924242im, -0.2639788681731578 + -0.44555595463382536im, -0.10353639251347035 + 0.9946256659795667im, -0.4312348307605649 + 0.51556139476822072im, 0.59147109114054786 + 0.49906417543509135im, 0.55853892165611496 + -0.30045928459826865im, 0.62074251662080748 + 0.084246161364183197im, -0.44116680650049372 + 0.22216681385382009im, 0.68061322845842886 + -0.1293573249631374im, 0.52718154232700531 + -0.27020522045758022im, 0.6664980495297409 + -0.13413657741284826im, -0.42774685414110669 + 0.20472527861310943im, 0.62750729303046027 + 0.10673116631638631im, 0.50564710740490204 + -0.29648508114346028im, 0.65977276390008577 + 0.44460687533926918im, -0.35588571530678448 + 0.61366638867156975im, -0.23706803357152673 + 0.94861676491400815im, -0.19805306139747836 + -0.68204968770481689im, -0.76415381963557016 + -0.22718050617920291im, 0.5266721008466243 + 0.17434413909930807im]
gdb_matSolveRed[:, 12] = [0.28383695926679864 + -0.47800531026062743im, 0.32826371986502434 + 0.45054833195966065im, -0.529484943776794 + -0.25320453813804061im, -0.044637266445123058 + -0.82814849123847012im, -0.39612055663701956 + 0.91819851045924583im, -0.60191699982560731 + 0.5031225102551109im, 0.71999895194234376 + 0.48483134928177191im, 0.60756579770565988 + 0.0029793899508669648im, 0.66191465714179898 + 0.029136346859885792im, -0.49969579933660835 + 0.016488517720757719im, 0.68235606252184777 + -0.20022525388689172im, 0.61382059099044639 + 0.039814562921551014im, 0.68513481526261344 + -0.20326220234436529im, -0.49960496415544314 + 0.022072390154994011im, 0.65729761884254445 + 0.019558698814927989im, 0.61964817587198562 + -0.007393293950670619im, 0.72503216683046001 + 0.49955827112846574im, -0.6402331037301433 + 0.50021498142192389im, -0.3352927103809365 + 0.90192269888437526im, -0.014769861607724949 + -0.74599231164712942im, -0.63950928552305497 + -0.30175314913909485im]
gdb_matSolveRed[:, 13] = [-0.23551396083781331 + 0.26470043873529808im, 0.23224123006271766 + -0.24561391850273881im, 0.41660910901720194 + 0.10700550132338713im, -0.6422482560824444 + -0.077510888624554936im, -0.13722641144741171 + -0.76587817966074445im, -0.022396525335192926 + 0.93483760634570046im, -0.70284065518293604 + 0.68832498411261356im, 0.9842540989450167 + 0.17675935253879274im, 0.77434850008157274 + 0.065363485457466231im, 0.61089689702165373 + -0.41837113597390169im, -0.48552662403081565 + 0.003945140115073591im, 0.49587038364043123 + -0.5931195888812929im, 0.73205490581381183 + 0.096262285130774158im, 0.49505714790060051 + -0.59346650063185247im, -0.48630051640664046 + 0.0031613285383772604im, 0.6108166457488271 + -0.42260840352709278im, 0.77692834644684738 + 0.068331966819083892im, 0.98274816322881375 + 0.16763790327401831im, -0.69532825253141828 + 0.68421051895465246im, -0.012059153255938964 + 0.94781042398564685im, -0.17112989941841325 + -0.7650253898801318im]
gdb_matSolveRed[:, 14] = [0.11482379499896371 + 0.0065006314480873569im, -0.071667253077257714 + 0.15671284442566907im, -0.063503809143048734 + -0.17444173770947588im, 0.34980351835081397 + -0.15483019992391941im, -0.34659878022188589 + 0.27268055633468163im, -0.55742317639491601 + -0.38614061864577293im, 0.59247302108691768 + 0.50003402912846306im, -0.10142505367082831 + 0.9935559525916281im, 0.66745989690919016 + -0.6839830972745824im, 0.87122059013980468 + -0.39964426318439755im, -0.16825579172977928 + -0.75830410130396353im, -0.40226931130907484 + 0.06496349290205844im, -0.3565850242104176 + -0.64390536248390684im, 0.72963817716389501 + -0.33506747700129641im, -0.35744945607917528 + -0.64361168577612615im, -0.40243931070244449 + 0.064336778560453514im, -0.17089703467092338 + -0.75813759396262526im, 0.87142697905061273 + -0.4012219682234387im, 0.66472994923411377 + -0.68791763228012492im, -0.096970487031654978 + 0.99528725735078283im, 0.59267848494441122 + 0.49551863438401034im]
gdb_matSolveRed[:, 15] = [-0.034058902348351877 + 0.027552594664358089im, 0.021073837009848016 + -0.028662196405738201im, 0.077087010653639862 + 0.027869987737899379im, -0.093218064470382153 + 0.015309020470013809im, -0.043975894857572161 + -0.20253284427662049im, 0.13218898179725311 + 0.18762233881011478im, -0.31454565428026643 + 0.32215537657950805im, 0.31183331535743958 + -0.36460055210226211im, 0.77551899519060508 + 0.21610389207184527im, -0.55520668595435085 + -0.46275858087187877im, -0.15928829300124955 + -0.98663743183706021im, -0.61412958514726024 + 0.33361509851447435im, -0.3744052230857785 + 0.36613472116355694im, -0.3685097307854292 + 0.47865053231346577im, -0.11115002816332767 + -0.62982301037802013im, -0.36816436552818688 + 0.47900353831395859im, -0.37483800857638022 + 0.36653118294959319im, -0.61364286708988658 + 0.33509779731860734im, -0.16071587947974639 + -0.98700071230118769im, -0.55641554842255714 + -0.46083434930680578im, 0.77569439405764617 + 0.21427369093946785im]
gdb_matSolveRed[:, 16] = [0.0013979432375272154 + -0.0048482149079603484im, 0.0092690422582443355 + 0.0066995007128733261im, -0.010993594778070404 + 0.0023796007304773049im, -0.0067329895746729958 + -0.035534673862018973im, 0.024223757110442543 + 0.022810474314099417im, -0.066300449175578091 + 0.073785369079237592im, 0.017420628797813694 + -0.09513259308012946im, 0.25425765892245533 + 0.025205392583791529im, -0.24967334128569432 + 0.043510907593390075im, -0.25089561722277726 + -0.5277302326589326im, 0.13486382161949539 + 0.47685825891723271im, -0.65947832256307759 + 0.75172358089219837im, 0.6240015811633659 + -0.048688378468111936im, 0.85249049433022872 + 0.33694099090082275im, 0.39911146641103923 + -0.37962932215480821im, -0.20816236406444685 + 0.16687691443980923im, 0.39894370789967049 + -0.3798714943591619im, 0.85301763433037781 + 0.33674317978659418im, 0.62396359170440474 + -0.049535879297378869im, -0.65867816577661142 + 0.75237036997270135im, 0.13573295273910799 + 0.47623298306491635im]
gdb_matSolveRed[:, 17] = [0.00041300381636318322 + -0.00022661414952054854im, -0.00010057921165784174 + 0.00032760404627895208im, -0.0013400814300331895 + -0.00060812302121449134im, 0.0012910256857936275 + -0.00048464118030573856im, 0.0013500358153951126 + 0.0058104140674450711im, -0.0036864118248398094 + -0.0026299888462208115im, 0.013524804403120797 + -0.016041923841728915im, 0.0015554015531016568 + 0.015075741952268233im, -0.066393112482527911 + 0.00040810356061731352im, 0.044376733861577491 + -0.035047855598077014im, 0.13597273342317717 + 0.16070202092870017im, -0.13262653718009232 + -0.1071449971678976im, 0.2176668315815091 + -0.53495791208778565im, -0.21328724065602281 + 0.25476162898884169im, -0.99731241860023667 + -0.072557020769586672im, 0.13650289294024681 + 0.37274347586764023im, 0.047016888926827524 + 0.56009814941688707im, 0.13660879656512498 + 0.37271520479713649im, -0.99738637725346702 + -0.072252435731983908im, -0.21305181189108127 + 0.25487095433500812im, 0.21726002215202059 + -0.53487386365315304im]
gdb_matSolveRed[:, 18] = [-4.5955517763689564e-10 + -1.0057186647683002e-05im, 1.8421186586168273e-08 + -4.7141845645433251e-05im, -1.1399122335486226e-08 + 3.1354702014684799e-05im, 1.4201443982171211e-07 + 0.00021921816974769442im, 2.401305533373996e-07 + -0.00011989300791830167im, -1.118039170845428e-06 + -0.00090005237546149646im, 3.2750384923667877e-07 + 0.00043566978739022785im, 5.744905862712099e-06 + 0.0034727236973010325im, -4.1561791263032471e-06 + -0.001554883950386975im, 6.3623185691952751e-05 + -0.012733319673040857im, 2.7338491432142926e-05 + 0.0050318936361142307im, -3.338141917651982e-05 + 0.043934464149565047im, 9.9233371349055893e-05 + -0.013249117913955638im, 0.00051577018527480399 + -0.12823667326332211im, -0.0010649940298771716 + 0.036634932044199452im, 0.01076678834486631 + 0.35804445992698103im, -0.0048440690369740275 + -0.068759527805409615im, 0.029571575411139379 + -0.99956266533304627im, -0.0048436041772737535 + -0.068762755093823624im, 0.010764281298689156 + 0.35803867868260697im, -0.0010647296764282777 + 0.036631177760388232im]
gdb_matSolveRed[:, 19] = [0 + 0.00047727719427245589im, 0 + -0.0002397446482019748im, 0 + -0.0012379853508716556im, 0 + 0.00088645592685717919im, 0 + 0.003900009911993661im, 0 + -0.0026958361685381505im, 0 + -0.011953774099112812im, 0 + 0.0075071784002586212im, 0 + 0.034201118509045628im, 0 + -0.018996713435107237im, 0 + -0.089963591049220346im, 0 + 0.042227045117453982im, 0 + 0.21271986142377675im, 0 + -0.078979255983655919im, 0 + -0.43934480167879536im, 0 + 0.11481876910426586im, 0 + 0.76576252618760021im, 0 + -0.08077879784642493im, 0 + -0.99999999999999989im, 0 + -0.080785999457811702im, 0 + 0.76579470857523901im]
gdb_matSolveRed[:, 20] = [-0 + -0.00055263893265814954im, -0 + -0.0010478891048936701im, -0 + 0.0012165016834712922im, -0 + 0.0036795840169793208im, -0 + -0.0031924617177390021im, -0 + -0.010568470162150349im, -0 + 0.0081558798176374313im, -0 + 0.028101677642206151im, -0 + -0.019226657975310035im, -0 + -0.069266074907165687im, -0 + 0.040814503245434432im, -0 + 0.1563495618213038im, -0 + -0.075568348994376117im, -0 + -0.31719873485820971im, -0 + 0.11608764130394346im, -0 + 0.56417351292885354im, -0 + -0.13232524403294652im, -0 + -0.84765550650841515im, -0 + 0.069610382241483706im, -0 + 1im, -0 + 0.069615923246698977im]
gdb_matSolveRed[:, 21] = [0 + -0.0013447137601695059im, 0 + 0.00082315534792236442im, 0 + 0.002890437717322981im, 0 + -0.0026400555549303101im, 0 + -0.0074642350308739766im, 0 + 0.0067026461522228555im, 0 + 0.019089842762232925im, 0 + -0.015499817582465547im, 0 + -0.04601295907833635im, 0 + 0.032721544256004632im, 0 + 0.10297262524919261im, 0 + -0.061930967893525112im, 0 + -0.21115951508211814im, 0 + 0.10192271529036687im, 0 + 0.39016453914098542im, 0 + -0.13845791176162922im, 0 + -0.63536121822939162im, 0 + 0.13818581314862252im, 0 + 0.88348881026467729im, 0 + -0.063608617653415328im, 0 + -1im]
gdb_bSolveRed = zeros(ComplexF64, 21, 1)
gdb_bSolveRed[:,1] = [0 + 6.5507607349187661e-05im, -0 + -9.4317068087468713e-06im, -0 + -6.1823576434961959e-05im, -0 + -4.3748717078498843e-05im, 0 + 7.220417518244322e-05im, -0 + -3.6302708917805127e-05im, -0 + -9.4344373889317432e-05im, -0 + -7.7692657187119558e-05im, 0 + 4.7409486624326541e-05im, 0 + 6.6215666397745636e-05im, -0 + -1.4145294798525544e-05im, 0 + 7.8126693248167954e-05im, -0 + -3.5751323018372626e-05im, -0 + -6.6862244184931076e-05im, 0 + 4.5620428466179224e-05im, -0 + -1.9162467979237248e-06im, -0 + -1.3497974326510336e-05im, 0 + 2.0115415712539384e-05im, -0 + -6.6380286315118976e-06im, -0 + -8.5421589368991969e-06im, 0 + 6.6044275030108905e-06]
gdb_xSolveRed = zeros(ComplexF64, 21, 1)
gdb_xSolveRed[:,1] = [-7.1478984847102005e-05 + -5.9675313770135291e-07im, 4.4421087644167133e-07 + 2.8117808307531805e-06im, 7.9193122503419666e-06 + 4.7989408234232991e-06im, -4.0637885570931701e-06 + -1.0756183542773194e-06im, 6.782282782666774e-06 + -1.4472065311400478e-05im, -2.0744599313131957e-06 + -4.9253602118804968e-06im, -6.2897038593701829e-06 + -2.534333733641845e-06im, -2.5247022367529735e-06 + 5.1638136877380111e-06im, 4.2974966491647928e-06 + -1.426080364999685e-05im, -1.4841198588506724e-06 + -7.8348555496757076e-06im, -1.2097730470616521e-06 + 5.3023964283570968e-06im, 5.094567688031402e-06 + -1.510061040587366e-06im, -2.7543522596451774e-05 + -1.8589090396772447e-07im, -1.5490707240404779e-05 + -4.4047097254597025e-06im, -9.3060449559440005e-06 + 2.277377631270853e-06im, -1.066854084902561e-05 + -4.83457305669925e-05im, -2.6659737846010537e-05 + -2.8187788323976172e-05im, -0.00013797938455251363 + -1.7663992939024476e-05im, 9.3372003628972868e-05 + -3.47695864586826e-05im, 7.8680371007396597e-05 + 6.6848351649778423e-05im, 7.6527502029689502e-05 + -6.3369184484732367e-06im]
# I ran the whole file in Juno with each individual method as the LAPACK functions change the inputs.
matSolveF = zeros(ComplexF64, 21, 21)
ipivSolve = zeros(Int, 21)
cScalSolve = zeros(Float64, 21)
rScalSolve = zeros(Float64, 21)
gesvx_xSolveRed = LA.gesvx!('N', 'N', deepcopy(gdb_matSolveRed), matSolveF, ipivSolve, 'N', rScalSolve, cScalSolve, deepcopy(gdb_bSolveRed))[1]
gelsy_xSolveRed = LA.gelsy!(deepcopy(gdb_matSolveRed), deepcopy(gdb_bSolveRed))[1]
gelsd_xSolveRed = LA.gelsd!(deepcopy(gdb_matSolveRed), deepcopy(gdb_bSolveRed))[1]
gels_xSolveRed = LA.gels!('N', deepcopy(gdb_matSolveRed), deepcopy(gdb_bSolveRed))[2]
julia_xSolveRed = gdb_matSolveRed \ gdb_bSolveRed
x0 = gdb_matSolveRed * gdb_xSolveRed - gdb_bSolveRed
x1 = gdb_matSolveRed * gelsy_xSolveRed - gdb_bSolveRed
x2 = gdb_matSolveRed * gelsd_xSolveRed - gdb_bSolveRed
x3 = gdb_matSolveRed * gels_xSolveRed - gdb_bSolveRed
x4 = gdb_matSolveRed * gesvx_xSolveRed - gdb_bSolveRed
x5 = gdb_matSolveRed * julia_xSolveRed - gdb_bSolveRed
@printf("Σ|x_0| = %g\n",sum(abs.(x0)))
@printf("Σ|x_1| = %g\n",sum(abs.(x1)))
@printf("Σ|x_2| = %g\n",sum(abs.(x2)))
@printf("Σ|x_3| = %g\n",sum(abs.(x3)))
@printf("Σ|x_4| = %g\n",sum(abs.(x4)))
@printf("Σ|x_5| = %g\n",sum(abs.(x5)))
for i=1:21
println(abs(x0[i]-x5[i]));
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment