2.減少QR法運算-Rayleigh Quotient Shift
之前Power迭代法有介紹利用\( A-\alpha I \)來加快收斂速度。
https://math.pro/db/viewthread.php?tid=2561&page=1#pid16043
在\(QR\)迭代法則取\( \alpha=A[n,n] \)也就是矩陣的右下角元當作位移值。
---------------------------
虛擬碼
\(n\)為\(A\)矩陣的列數或行數
1.對\( k=0,1,2,\ldots \),直到\( \lambda(k) \)收斂為止,計算
2.\( A_k-A[n,n]\cdot I=Q_kR_k \),計算\( A_k-A[n,n]\cdot I \)的\(QR\)分解
3.\( A_{k+1}=R_k Q_k+A[n,n]\cdot I \),將\( Q_k \)和\(R_k\)對調後相乘再加\( A[n,n]\cdot I \)得到下一個矩陣\(A_{k+1}\)
4.特徵值\( \lambda(1),\lambda(2),\ldots,\lambda(n) \)在矩陣\( A_{k+1} \)的對角線上。
---------------------------
計算\( A=\left[ \matrix{0&0&0&0&0&363.6 \cr 1&0&0&0&0&-349.02 \cr 0&1&0&0&0&-236.39 \cr 0&0&1&0&0&322.63 \cr 0&0&0&1&0&-117.81 \cr 0&0&0&0&1&17.99} \right] \)全部的特徵值。
[計算過程]
第一輪:
計算\( A-A[n,n]\cdot I\)的\(QR\)分解
\( \left[ \matrix{0&0&0&0&0&363.6 \cr 1&0&0&0&0&-349.02 \cr 0&1&0&0&0&-236.39 \cr 0&0&1&0&0&322.63 \cr 0&0&0&1&0&-117.81 \cr 0&0&0&0&1&\bbox[border:1px solid blue]{17.99}} \right]-17.99I=\left[ \matrix{-17.99&0&0&0&0&363.6\cr 1&-17.99&0&0&0&-349.02\cr 0&1&-17.99&0&0&-236.39\cr 0&0&1&-17.99&0&322.63\cr 0&0&0&1&-17.99&-117.81\cr 0&0&0&0&1&0} \right]=QR \)
將\(Q\)和\(R\)對調後相乘再加\( A[n,n]\cdot I \)得到下一個矩陣\(A\)
\( RQ+17.99 I= \left[ \matrix{-0.0554152&-0.00307557&-1.70959\cdot 10^{-4}&-9.50302\cdot 10^{-6}&-21.2568&-381.819\cr 0.998463&-1.70696\cdot 10^{-4}&-9.48832\cdot 10^{-6}&-5.27422\cdot 10^{-7}&17.4905&314.168\cr 0&0.999995&-5.2742\cdot 10^{-7}&-2.93174\cdot 10^{-8}&15.1092&271.394\cr 0&0&1.0&-1.62964\cdot 10^{-9}&-17.458&-313.584\cr 0&0&0&1.0&5.6338&101.195\cr 0&0&0&0&-0.310553&12.4118} \right] \)
特徵值\( \left[ -0.0554152,-1.70696\cdot 10^{-4},-5.2742\cdot 10^{-7},-1.62964\cdot 10^{-9},5.6338,12.4118 \right] \)
第二輪:
計算\(A-A[n,n]\cdot I\)的\(QR\)分解
\( \left[ \matrix{-0.0554152&-0.00307557&-1.70959\cdot 10^{-4}&-9.50302\cdot 10^{-6}&-21.2568&-381.819\cr 0.998463&-1.70696\cdot 10^{-4}&-9.48832\cdot 10^{-6}&-5.27422\cdot 10^{-7}&17.4905&314.168\cr 0&0.999995&-5.2742\cdot 10^{-7}&-2.93174\cdot 10^{-8}&15.1092&271.394\cr 0&0&1&-1.62964\cdot 10^{-9}&-17.458&-313.584\cr 0&0&0&1&5.6338&101.195\cr 0&0&0&0&-0.310553&\bbox[border:1px solid blue]{12.4118}} \right]- 12.4118 \cdot I \)
\(= \left[ \matrix{-12.4672&-0.00307557&-1.70959\cdot 10^{-4}&-9.50302\cdot 10^{-6}&-21.2568&-381.819\cr 0.998463&-12.412&-9.48832\cdot 10^{-6}&-5.27422\cdot 10^{-7}&17.4905&314.168\cr 0&0.999995&-12.4118&-2.93174\cdot 10^{-8}&15.1092&271.394\cr 0&0&1&-12.4118&-17.458&-313.584\cr 0&0&0&1&-6.77799&101.195\cr 0&0&0&0&-0.310553&0} \right]=QR \)
將\(Q\)和\(R\)對調後相乘再加\( A[n,n]\cdot I \)得到下一個矩陣\(A\)
\( RQ+ 12.4118 I= \left[ \matrix{-0.134273&-0.0137569&-0.00127716&1.81955&-38.1301&404.512\cr 0.990944&-0.00186405&-1.73055\cdot 10^{-4}&-1.16579&24.4282&-259.152\cr 0&0.999904&-1.7894\cdot 10^{-5}&-1.42457&29.851&-316.681\cr 0&0&0.999999&1.32836&-27.8351&295.295\cr 0&0&0&0.649217&7.37399&-77.7816\cr 0&0&0&0&0.115242&9.4238} \right] \)
特徵值
\( \left[ -0.134273,-0.00186405,-1.7894\cdot 10^{-5},1.32836,7.37399,9.4238 \right] \)
第三輪:
計算\(A-A[n,n]\cdot I\)的\(QR\)分解
\( \left[ \matrix{-0.134273&-0.0137569&-0.00127716&1.81955&-38.1301&404.512\cr 0.990944&-0.00186405&-1.73055\cdot 10^{-4}&-1.16579&24.4282&-259.152\cr 0&0.999904&-1.7894\cdot 10^{-5}&-1.42457&29.851&-316.681\cr 0&0&0.999999&1.32836&-27.8351&295.295\cr 0&0&0&0.649217&7.37399&-77.7816\cr 0&0&0&0&0.115242&\bbox[border:1px solid blue]{9.4238}} \right]- 9.4238 \cdot I\)
\(= \left[ \matrix{-9.55808&-0.0137569&-0.00127716&1.81955&-38.1301&404.512\cr 0.990944&-9.42567&-1.73055\cdot 10^{-4}&-1.16579&24.4282&-259.152\cr 0&0.999904&-9.42382&-1.42457&29.851&-316.681\cr 0&0&0.999999&-8.09544&-27.8351&295.295\cr 0&0&0&0.649217&-2.04981&-77.7816\cr 0&0&0&0&0.115242&0.0} \right]=QR \)
將\(Q\)和\(R\)對調後相乘再加\( A[n,n]\cdot I \)得到下一個矩陣\(A\)
\( RQ+ 9.4238 I= \left[ \matrix{-0.233098&-0.0373848&-0.210022&5.10063&-52.6375&-427.73\cr 0.972453&-0.0089612&0.0852744&-2.15513&22.236&180.689\cr 0&0.999261&0.175089&-4.36603&45.0504&366.077\cr 0&0&0.874009&3.15576&-32.2784&-262.283\cr 0&0&0&0.312162&7.14176&57.2873\cr 0&0&0&0&-0.0484512&7.75945} \right] \)
特徵值\( \left[ -0.233098,-0.0089612,0.175089,3.15576,7.14176,7.75945 \right] \)
反覆計算直到全部特徵值\( \left[ -1.01,1,3,4,5,6 \right] \)
要先載入lapack才能使用dgeqrf指令
(%i1) load(lapack);
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
0 errors, 0 warnings
(%o1) C:\maxima-5.39.0\share\maxima\5.39.0_2_g5a49f11_dirty\share\lapack\lapack.mac
有Rayleigh位移的QR分解副程式
(%i2)
QRwithRayleighShift(A,epsilon):=block
([count:0,Q,R,I,n:length(A),eig1,eig2],
eig2:makelist(0,n),
I:ident(n),
do
(count:count+1,
[Q,R]:dgeqrf(A-A[n,n]*I),
A:R.Q+A[n,n]*I,
eig1:create_list(A[i,i],i,1,n),
print("特徵值",eig1),
if lmax(abs(eig1-eig2))<epsilon then
(print("執行次數",count),
return(eig1)
),
eig2:eig1
)
)$
Hessenberg矩陣
(%i3)
A:matrix([0,0,0,0,0,363.6],
[1,0,0,0,0,-349.02],
[0,1,0,0,0,-236.39],
[0,0,1,0,0,322.63],
[0,0,0,1,0,-117.81],
[0,0,0,0,1,17.99]);
(%o3) \( \left[ \matrix{0&0&0&0&0&363.6 \cr 1&0&0&0&0&-349.02 \cr 0&1&0&0&0&-236.39 \cr 0&0&1&0&0&322.63 \cr 0&0&0&1&0&-117.81 \cr 0&0&0&0&1&17.99} \right] \)
計算矩陣A全部的特徵值,誤差10^-5
(%i4) QRwithRayleighShift(A,10^-5);
特徵值\( [-0.0554152121071958,-1.706957479434834 \cdot 10^{-4},-5.274195551407956 \cdot 10^{-7},-1.629643975320505 \cdot 10^{-9},5.633796457744232,12.41178997916011] \)
特徵值\( [-0.1342728973892626,-0.001864054657636061,-1.789401310148264 \cdot 10^{-5},1.328361385039951,7.373990728556812,9.423802732463246] \)
特徵值\( [-0.2330984496644373,-0.00896120187027627,0.1750887851007601,3.155759970239055,7.141761495529245,7.75944940066566] \)
特徵值\( [-0.3419389276255256,-0.03277311167899644,0.7656578204246607,4.323032959391513,6.463362526448887,6.812658733039465] \)
特徵值\( [-0.4516838784880166,-0.04859673999350367,1.632578188284038,4.666773060400056,5.895419068145634,6.295510301651798] \)
特徵值\( [-0.5633422880002747,0.02944794977870835,2.355825335361045,4.60082766258795,5.50449211080626,6.062749229466317] \)
特徵值\( [-0.6788276506780742,0.2239951458769376,2.749431534145878,4.436268986900575,5.255300885689792,6.003831098064898] \)
特徵值\( [-0.7863651279227009,0.4527888848794159,2.906886108392509,4.294225869684157,5.12244896958134,6.000015295385284] \)
特徵值\( [-0.8711542188771304,0.6444491049212555,2.960203806951765,4.196380448349329,5.060120858415357,6.00000000023943] \)
特徵值\( [-0.9289699805732585,0.7799453397954821,2.977380864737738,4.131653967421146,5.02998980861915,5.99999999999975] \)
特徵值\( [-0.9645416477980442,0.8674499800082502,2.98345617185446,4.088593345440747,5.015042150494844,5.99999999999975] \)
特徵值\( [-0.9850455588070135,0.9212586824227689,2.986528792091727,4.059703590286082,5.007554494006693,5.99999999999975] \)
特徵值\( [-0.996420748038723,0.9535030515319471,2.988896306535816,4.040228509856105,5.00379288011511,5.99999999999975] \)
特徵值\( [-1.002605207530562,0.9725812027521856,2.991042001366524,4.027079206073314,5.001902797338794,5.99999999999975] \)
特徵值\( [-1.005940275258888,0.9838100028962309,2.992972662236778,4.01820380067515,5.000953809450982,5.99999999999975] \)
特徵值\( [-1.007739426659477,0.9904122174984673,2.994628810107148,4.012220616788556,5.000477782265562,5.99999999999975] \)
特徵值\( [-1.008716781517061,0.994299741198426,2.995984283944792,4.008193554048924,5.000239202325174,5.99999999999975] \)
特徵值\( [-1.009254404197364,0.9965954520976856,2.997051813148713,4.005487429353162,5.000119709598057,5.99999999999975] \)
特徵值\( [-1.009555347544265,0.9979563073390505,2.997867521069139,4.003671627009723,5.000059892126607,5.99999999999975] \)
特徵值\( [-1.009727505038192,0.9987665417094682,2.998476221504767,4.002454783021602,5.00002995880261,5.99999999999975] \)
特徵值\( [-1.00982848582706,0.999251263181379,2.998922039936204,4.001640198987505,5.000014983722228,5.99999999999975] \)
特徵值\( [-1.009889339001543,0.9995427357842255,2.999243733525915,4.001095376371471,5.000007493320185,5.99999999999975] \)
特徵值\( [-1.009927029226854,0.9997189546363359,2.999473089254277,4.000731238185238,5.000003747151255,5.99999999999975] \)
特徵值\( [-1.009950993097018,0.9998261013041958,2.999635017979005,4.000488000073412,5.00000187374066,5.99999999999975] \)
特徵值\( [-1.009966595539297,0.9998916408332965,2.99974842403746,4.000325593743018,5.000000936925779,5.99999999999975] \)
特徵值\( [-1.009976964039406,0.9999319830257809,2.9998273170086,4.000217195523692,5.000000468481591,5.99999999999975] \)
特徵值\( [-1.009983971927121,0.9999569799022288,2.999881892978214,4.000144864799742,5.000000234247194,5.99999999999975] \)
特徵值\( [-1.009988772855428,0.9999725762149927,2.999919468523729,4.000096610991085,5.00000011712588,5.99999999999975] \)
特徵值\( [-1.009992096532979,0.9999823779538515,2.999945235207018,4.000064424808519,5.000000058563849,5.99999999999975] \)
特徵值\( [-1.009994415923166,0.9999885845273688,2.999962843388455,4.000042958725227,5.000000029282374,5.99999999999975] \)
特徵值\( [-1.009996044151435,0.9999925452102545,2.999974840673362,4.000028643626595,5.000000014641483,5.99999999999975] \)
特徵值\( [-1.009997192214406,0.999995092806369,2.999982994075778,4.000019098011532,5.000000007320986,5.99999999999975] \)
執行次數 32
(%o4) \( [-1.009997192214406,0.999995092806369,2.999982994075778,4.000019098011532,5.000000007320986,5.99999999999975] \)
實對稱矩陣
(%i5)
A:matrix([3599/900,-1501/900,-1201/900,-901/900,151/450,-301/900],
[-1501/900,3299/900,-901/900,-601/900,301/450,-1/900],
[-1201/900,-901/900,2999/900,-301/900,451/450,299/900],
[-901/900,-601/900,-301/900,2699/900,601/450,599/900],
[151/450,301/450,451/450,601/450,374/225,901/450],
[-301/900,-1/900,299/900,599/900,901/450,2099/900]);
(%o5) \( \left[ \matrix{ \displaystyle
\frac{3599}{900}&-\frac{1501}{900}&-\frac{1201}{900}&-\frac{901}{900}&\frac{151}{450}&-\frac{301}{900}\cr
-\frac{1501}{900}&\frac{3299}{900}&-\frac{901}{900}&-\frac{601}{900}&\frac{301}{450}&-\frac{1}{900}\cr
-\frac{1201}{900}&-\frac{901}{900}&\frac{2999}{900}&-\frac{301}{900}&\frac{451}{450}&\frac{299}{900}\cr
-\frac{901}{900}&-\frac{601}{900}&-\frac{301}{900}&\frac{2699}{900}&\frac{601}{450}&\frac{599}{900}\cr
\frac{151}{450}&\frac{301}{450}&\frac{451}{450}&\frac{601}{450}&\frac{374}{450}&\frac{901}{450}\cr
-\frac{301}{900}&-\frac{1}{900}&\frac{299}{900}&\frac{599}{900}&\frac{901}{450}&\frac{2099}{900}} \right] \)
計算矩陣A全部的特徵值,誤差10^-5
(%i6) QRwithRayleighShift(A,10^-5);
特徵值\( [4.687463048832852,2.303233931699447,2.895757871614659,4.180419375119289,1.698867537928739,2.224258234805014] \)
特徵值\( [5.0472697019595,1.567035460671847,3.220795257274317,4.165306321709514,1.524463222953819,2.465130035431002] \)
特徵值\( [5.093280274517875,0.9153126236507791,3.918620820796786,4.066872770913875,1.093783248203376,2.902130261917306] \)
特徵值\( [4.670843575256507,0.6452057194127008,4.657952826984372,4.017888431300075,0.9983637095017406,2.9997457375446] \)
特徵值\( [3.93434857995697,1.130324432377812,4.921565821472631,4.004239302946366,0.9995218632488947,2.99999999999732] \)
特徵值\( [3.001259108881703,2.002038670362651,4.985791453569853,4.001029727196395,0.9998810399893925,3.0] \)
特徵值\( [1.989400649137261,3.001349949453158,4.999025079966701,4.000253914617052,0.9999704068258226,3.0] \)
特徵值\( [1.057592981093276,3.931439082990065,5.000912219500666,4.000063077937745,0.999992638478242,3.0] \)
特徵值\( [0.3196378154597554,4.669606730711599,5.000741560680952,4.000015724365658,0.9999981687820307,3.0] \)
特徵值\( [-0.1980838105378795,5.187667036440498,5.000413303579961,4.000003926041754,0.9999995444756622,3.0] \)
特徵值\( [-0.5311792385543539,5.520973849385642,5.00020452153543,4.000000980947106,0.9999998866861723,3.0] \)
特徵值\( [-0.7337023068465403,5.723606010076015,5.000096079783825,4.000000245174043,0.9999999718126538,3.0] \)
特徵值\( [-0.8526274607253512,5.842583415671053,5.0000439907795,4.000000061286531,0.9999999929882648,3.0] \)
特徵值\( [-0.9210400359561284,5.911020150414187,5.000019871965285,4.000000015320857,0.999999998255797,3.0] \)
特徵值\( [-0.9599296300952491,5.94992071499559,5.000008911703409,4.000000003830127,0.99999999956612,3.0] \)
特徵值\( [-0.9818873306755895,5.971883349239707,5.000003980586289,4.000000000957522,0.999999999892069,3.0] \)
特徵值\( [-0.9942375695225221,5.984235795227988,5.000001774082003,4.00000000023938,0.9999999999731504,3.0] \)
特徵值\( [-1.001169057827592,5.991168268066513,5.000000789707915,4.000000000059845,0.99999999999332,3.0] \)
特徵值\( [-1.005054596592398,5.995054245292558,5.000000351286541,4.00000000001496,0.9999999999983373,3.0] \)
特徵值\( [-1.007231207609367,5.997231051402752,5.000000156203289,4.00000000000374,0.9999999999995857,3.0] \)
特徵值\( [-1.008450042880667,5.998449973437261,5.000000069442574,4.000000000000934,0.9999999999998965,3.0] \)
特徵值\( [-1.009132407625798,5.999132376757524,5.000000030868065,4.000000000000233,0.9999999999999738,3.0] \)
特徵值\( [-1.009514383811725,5.999514370091365,5.00000001372031,4.000000000000057,0.9999999999999929,3.0] \)
特徵值\( [-1.009728193294757,5.999728187196538,5.000000006098205,4.000000000000013,0.9999999999999978,3.0] \)
特徵值\( [-1.009847867730331,5.999847865019944,5.000000002710385,4.000000000000003,0.9999999999999991,3.0] \)
特徵值\( [-1.009914851057516,5.999914849852884,5.000000001204633,4.0,0.9999999999999996,3.0] \)
特徵值\( [-1.009952342051302,5.999952341515906,5.000000000535396,3.999999999999999,0.9999999999999996,3.0] \)
特徵值\( [-1.00997332586102,5.999973325623067,5.000000000237954,3.999999999999999,0.9999999999999996,3.0] \)
特徵值\( [-1.009985070512432,5.999985070406677,5.000000000105756,3.999999999999999,0.9999999999999996,3.0] \)
特徵值\( [-1.009991643987654,5.999991643940653,5.000000000047002,3.999999999999999,0.9999999999999996,3.0] \)
執行次數 30
(%o6) \( [-1.009991643987654,5.999991643940653,5.000000000047002,3.999999999999999,0.9999999999999996,3.0] \)
三對角矩陣
(%i7)
A:matrix([3.99889,2.40601,0,0,0,0],
[2.40601,1.68454,-1.93868,0,0,0],
[0,-1.93868,2.37077,-1.67177,0,0],
[0,0,-1.67177,2.35489,1.31944,0],
[0,0,0,1.31944,3.60161,-0.72545],
[0,0,0,0,-0.72545,3.97930]);
(%o7) \( \left[ \matrix{3.99889&2.40601&0&0&0&0 \cr
2.40601&1.68454&-1.93868&0&0&0 \cr
0&-1.93868&2.37077&-1.67177&0&0 \cr
0&0&-1.67177&2.35489&1.31944&0 \cr
0&0&0&1.31944&3.60161&-0.725455 \cr
0&0&0&0&-0.725455& 3.9793} \right] \)
計算矩陣A全部的特徵值,誤差10^-5
(%i8) QRwithRayleighShift(A,10^-5);
特徵值\( [1.72387082004926,3.324540397328139,1.33606542554601,3.693330312406069,3.912210035607812,3.999983009062711] \)
特徵值\( [-0.1957077674919923,4.850881309601665,1.378752309771135,4.000089214192345,3.955987137170426,3.99999779675642] \)
特徵值\( [-0.8127503789372117,4.932944318289477,1.873316361922162,4.037006805484861,3.959485096484287,3.999997796756424] \)
特徵值\( [-0.9592847557581403,4.283345647667558,2.665987856408768,4.040426288835855,3.959527166089535,3.999997796756424] \)
特徵值\( [-0.9952758240675927,3.322858800886055,3.662340297890198,4.040634960426104,3.959443968108812,3.999997796756424] \)
特徵值\( [-1.005287026228012,2.395061618114314,4.600198787928333,4.040618030497149,3.959410792931794,3.999997796756424] \)
特徵值\( [-1.008400216221442,1.734394949564231,5.264000184602603,4.040608164880656,3.959399120417531,3.999997796756424] \)
特徵值\( [-1.009439482743673,1.355559926441152,5.643880858248862,4.040607079913188,3.959393821384052,3.999997796756424] \)
特徵值\( [-1.009799761617996,1.164579046933425,5.835223723597451,4.040608967826792,3.959390226503906,3.999997796756424] \)
特徵值\( [-1.00992696494193,1.07452788620796,5.925402526712892,4.04061168529806,3.959387069966598,3.999997796756424] \)
特徵值\( [-1.00997225893254,1.033407889174767,5.966567928871993,4.040614619747304,3.959384024382054,3.999997796756424] \)
特徵值\( [-1.009988449151831,1.014907085280123,5.985084950921726,4.040617609505592,3.959381006687969,3.999997796756424] \)
特徵值\( [-1.009994246304271,1.006638754385619,5.993359085969478,4.040620613208874,3.95937799598388,3.999997796756424] \)
特徵值\( [-1.009996323664509,1.002954616134844,5.99704530333256,4.04062362041098,3.959374987029705,3.999997796756424] \)
特徵值\( [-1.009997068325025,1.001315290801098,5.998685373765045,4.040626628488697,3.959371978513766,3.999997796756424] \)
特徵值\( [-1.009997335300511,1.000586289686123,5.999414641965082,4.040629636784925,3.95936897010796,3.999997796756424] \)
特徵值\( [-1.009997431023016,1.000262196765743,5.999738830635367,4.040632645135246,3.959365961730242,3.999997796756424] \)
特徵值\( [-1.009997465344805,1.000118133210399,5.999882928519348,4.04063565349854,3.959362953360099,3.999997796756424] \)
特徵值\( [-1.009997477651221,1.000054099107653,5.999946974930223,4.040638661864524,3.959359944992403,3.999997796756424] \)
特徵值\( [-1.009997482063836,1.000025637814941,5.999975440635978,4.040641670230628,3.959356936625871,3.999997796756424] \)
特徵值\( [-1.009997483646035,1.000012987820502,5.999988092212724,4.04064467859621,3.959353928260182,3.999997796756424] \)
特徵值\( [-1.009997484213353,1.000007365422972,5.9999937151776,4.04064768696111,3.959350919895256,3.999997796756424] \)
執行次數 22
(%o8) \( [-1.009997484213353,1.000007365422972,5.9999937151776,4.04064768696111,3.959350919895256,3.999997796756424] \)
| (1)相伴矩陣
A:matrix([0,0,0,0,0,363.6],
[1,0,0,0,0,-349.02],
[0,1,0,0,0,-236.39],
[0,0,1,0,0,322.63],
[0,0,0,1,0,-117.81],
[0,0,0,0,1,17.99]);
| (2)實對稱矩陣
A:matrix([3599/900,-1501/900,-1201/900,-901/900,151/450,-301/900],
[-1501/900,3299/900,-901/900,-601/900,301/450,-1/900],
[-1201/900,-901/900,2999/900,-301/900,451/450,299/900],
[-901/900,-601/900,-301/900,2699/900,601/450,599/900],
[151/450,301/450,451/450,601/450,374/225,901/450],
[-301/900,-1/900,299/900,599/900,901/450,2099/900]); |
原始的QR法 | 1142次 | 348次 |
Rayleigh Quotient Shift | 32次 | 30次 |
| (3)Hessenberg矩陣
A:matrix([0,0,0,0,0,363.6],
[1,0,0,0,0,-349.02],
[0,1,0,0,0,-236.39],
[0,0,1,0,0,322.63],
[0,0,0,1,0,-117.81],
[0,0,0,0,1,17.99]);
| (4)三對角矩陣
A:matrix([3.99889,2.40601,0,0,0,0],
[2.40601,1.68454,-1.93868,0,0,0],
[0,-1.93868,2.37077,-1.67177,0,0],
[0,0,-1.67177,2.35489,1.31944,0],
[0,0,0,1.31944,3.60161,-0.72545],
[0,0,0,0,-0.72545,3.97930]); |
原始的QR法 | 1142次 | 444次 |
Rayleigh Quotient Shift | 32次 | 22次 |
看得出來\(Rayleigh\) \(Quotient\) \(Shift\)大幅減少\(QR\)迭代次數。
[
本帖最後由 bugmens 於 2017-7-13 19:20 編輯 ]