Hi,
I tried to solve the linear equation Ax=b by LU decomposition. A is an 8*8 array (see the data below). b is an 8*1 array filled with zero elements. I first solved the equation by sgesv, and there was no problem. Then I solved it by sgetrf and sgetrs, but it didn't work. Anybody knows why? The method 2 is what I need. Thanks.
method 1 :
call sgesv(9,1,a,9,ipiv,b,9,info)
method 2 :
call sgetrf(9,9,a,9,ipiv,info)
call sgetrs('N',9,1,a,9,indx,b,9,info)
DATA A/
& 0.2500000,7.2429009E-04, 1.0723306E-02, 4.7634955E-02, 0.1250000,
& 0.2389767, 0.3642767, 0.4626641, 0.2500000, 0.5000000,
&-1.4485803E-03,-2.1446612E-02 ,-9.5269904E-02 ,-0.2500000,
& -0.4779534,
&-0.7285534, -0.9253282, 0.5000000, 0.5000000, 1.4485803E-03,
& 2.1446612E-02, 9.5269904E-02, 0.2499999, 0.4779531, 0.7285531,
& 0.9253327, 0.5000000, 0.5000000,-1.4460249E-03,-1.9291120E-02,
&-5.6222156E-03, 0.7499998, 4.575798, 13.76929, 25.43128,
& 0.5000000, 0.5000000, 1.4293027E-03, 7.9906452E-03,-0.2898659,
& -1.750000, 1.974375 , 33.24201 , 94.31410, 0.5000000,
& 0.5000000, -1.3704496E-03, 2.0553773E-02 , 0.5418495, -1.249999,
& -10.97703, 35.72947 , 220.4367 , 0.5000000, 0.5000000,
& 1.2212018E-03, -6.4339831E-02, -0.1665607 ,4.249999, -15.38186,
& -2.185663, 397.0475 ,0.5000000, 0.5000000,-9.1620837E-04,
& 0.1016594, -0.8309855,1.749996, 6.661992, -74.85165,
& 591.6705, 0.5000000 ,0.2500000,1.9274710E-04 ,4.8151217E-02,
& 0.6329165,-3.874999 ,16.88956, -67.57687,373.7280,
& 0.2500000
& /

