-0.095564468900000 0.338540141400000 -0.795937993200000
1.255304630000000 -1.312819645600000
Columns 11 through 13
0.873192546400000 -0.334354244200000 0.056103628050000 >> n=14;
>> b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0]'; >> cholesky_qiu_jie(n,b) 1.0e+15 * Columns 1 through 5 -0.000000018973466
0.000003062445902
-0.000120619605275
0.002041840742992 -0.018571410648157
Columns 6 through 10 0.101712531234567
-0.357252637738148
0.831474891793232
-1.294880899877584 1.331275372322000
Columns 11 through 14 -0.862636505012200 -0.002171662407011
>> n=15;
>> b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0 1]'; >> cholesky_qiu_jie(n,b) 1.0e+16 * Columns 1 through 5 0.000000009159679
-0.000000881206821
0.000013799271738
0.314323195943382
-0.045197162809621
0.000103167625626 -0.003987948970647
Columns 6 through 10 0.038905667203020
-0.198056922710865
0.601726021228474
-1.119920061974954 1.191735365493764
Columns 11 through 15 -0.450794442163960
-0.496191645217859
0.756621451313167
-0.399838355711562 0.079684802839153
>> n=16;
>> b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0]'; >> cholesky_qiu_jie(n,b) 1.0e+16 * Columns 1 through 5 0.000000106506398
-0.000014879116455
0.000507146024044
-0.007257871409944 0.052560866946652
Columns 6 through 10 -0.198284962679135
0.290609837891524
0.581225032778005
-3.497134240175643 6.758520114521732
Columns 11 through 15 -5.326111865614911
-2.146668037387352
8.700448141028517
-8.161919041143481 3.588648336729691
Column 16
-0.635128701903556 >> n=17;
>> b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1]'; >> cholesky_qiu_jie(n,b) 1.0e+17 * Columns 1 through 5 0.000000014777084
-0.000002118394303
0.000074232548837
-0.001097606950101 0.008314003699029
Columns 6 through 10 -0.034029369522343
0.065917257262332
0.015959536689882
-0.377621602904773 0.819475115416494
Columns 11 through 15 -0.660163184213223
-0.295786673257216
1.100782605917994
-0.952907140993597 0.339855611203294
Columns 16 through 17
-0.014551513983896 -0.014219174116106 >> n=18;
>> b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 2]'; >> cholesky_qiu_jie(n,b) 1.0e+16 * Columns 1 through 5 0.000000155967115
-0.000021645380087
0.000727005315139
-0.010130391409408 0.069910333639844
Columns 6 through 10 -0.237692894985775
0.207119320267744
1.320710222270083
-5.362833277085945 8.761578864695567
Columns 11 through 15 -5.416385894431453
-3.678202876264916
9.162910938126201
-7.610028175492047 4.801505077240169
Columns 16 through 18
-3.460280780403269 1.887745959501761 -0.436632060441746 >> n=19;
>> b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 2 0]'; >> cholesky_qiu_jie(n,b) 1.0e+17 *
Columns 1 through 5 0.000000000186975
0.000000487130031
-0.000037337486618
0.000907963809187 -0.010389239660544
Columns 6 through 10 0.065117610127561
-0.236770662992548
0.490423724491871
-0.485761304739977 -0.006945225699907
Columns 11 through 15 0.375039361697087
-0.191724740660743
0.584539934693850
-1.664633268513667 0.883570199543987
Columns 16 through 19 1.944997967101147 -0.384572610629205
n=20;
b=[1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 2 0 0]'; >> cholesky_qiu_jie(n,b) 1.0e+17 * Columns 1 through 5 -0.000000005297720
0.000002201926696
-0.000135104609897
-3.195222688027543
1.831459798885819
0.003035236689788 -0.033417756031216
Columns 6 through 10 0.204643883440640
-0.727554702009794
1.433949931025033
-1.101616652841183 -1.111630914232476
Columns 11 through 15 2.722140887157841
-0.945117835365089
-0.676679844961023
-1.643697361216293 2.211735585037371
Columns 16 through 20 3.295476378249488
-7.583406568516137
5.452181213933089
-1.659242365243840 0.159333719326849
A?1利用cholesky分解求出的解的精确度高于直接,因为当n逐渐增大的过程中,
越来越接近奇异矩阵,使得计算结果的误差增大,而使用cholesky分解可以避免这种现象的产生,是计算结果更加精确。
6:(1)编制程序House(x),其作用是对输入的向量x,输出单位向量u使得
(I?2uuT)x?x2e1。
编制Householder变换阵H?I?2uuT?Rn?n乘以A?Rn?m的程序HA,注意,你的程序并不显式的计算出H。
考虑矩阵
?1???1A???2???10?0?232224??23?e??
??37?75/2??3用你编制的程序计算H使得HA的第一列为?e1,并将HA的结果显示出来。 编制House(x),其作用是对输入的向量x,输出单位向量U使得
(I?2uuT)x?x2e1:
House(x)通用程序: function House(x) [n,~]=size(x); e1=zeros(n,1); e1(1)=1; w=x-norm(x)*e1; U=w/sqrt((w'*w)); disp('U='); disp(U);
编制Householder变换阵H?I?2uuT?Rn?n乘以A?Rn?n的程序HA,注意,你的