Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

LU factorization of band matrix

baskin
Beginner
522 Views

I try to use https://software.intel.com/sites/products/documentation/doclib/iss/2013/mkl/mklman/GUID-03E2AA41-0886-485D-B0D7-1C2186119220.htm routine for band matrix factorization. I've wrote simple application that factorizes 4*4 matrix. However, I can't undertand relation between elements of matrix L and multipliers used during factorization mi,j. Those mutipliers represent correct columns of matrix L, but order of elements mi,j in the column is not correct. I assume, some permutation of rows should be performed based on ipiv vector. 
Initial matrix:

-0.230 -6.980  0.000  0.000
 2.540  2.460  2.560  0.000
-3.660 -2.730  2.460 -4.780
 0.000 -2.130  4.070 -3.820

Result of dgbtrf:
 0.000  0.000  0.000 -4.780
 0.000  0.000  2.460  0.300
 0.000 -2.730 -0.155 -3.292
-3.660 -6.808  4.254 -0.727
-0.694 -0.083  0.968  0.000
 0.063  0.313  0.000  0.000

Permutation vector: 3 3 3 4

In this case 
m21 = -0.694 m32 = -0.083 m43= 0.968
m31 =  0.063 m42 = 0.313
Those values form matrix L_result:

 1.000  0.000  0.000  0.000
-0.694  1.000  0.000  0.000
 0.063 -0.083  1.000  0.000
 0.000  0.313  0.968  1.000

However, the correct answer is L_correct:
 1.000  0.000  0.000  0.000
 0.063  1.000  0.000  0.000
-0.694 -0.083  1.000  0.000
 0.000  0.313  0.968  1.000

Could you explain how L_result should be transformed into L_correct in general case?

 

0 Kudos
3 Replies
Ying_H_Intel
Employee
522 Views

Hi Baskin, 

Could you please attach your code and tell which platform you are working? 

Best Regards,

Ying 

0 Kudos
baskin
Beginner
522 Views

Hi Ying,

Thank you for reply. I have solved my problem. I didn't understand output of gbtrf - the meaning of coefficients mi,j. The explanation is pretty simple. LU factorization with partial pivoting requires swap of rows. For dense matrices, full rows are swapped( i.e columns from 1 to n). In gbtrf routine swap is performed using only "right" part of the row. For example, if you already found 10 columns, at step 11 you are going to swap rows 11 and 16(row 16 contains maximum element), then you should swap elements in row 11 starting from column 11, in row 16 starting from column 11 too. For dense matrix, you would swap elements starting from column 1.

 

0 Kudos
Ying_H_Intel
Employee
522 Views

Hi Baskin, 

Thanks for the updating and sharing the result. 

Thanks

Ying

 

0 Kudos
Reply