topic Lapacke: solve a banded matrix system of equations [C] in IntelĀ® oneAPI Math Kernel Library & IntelĀ® Math Kernel Library
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Lapacke-solve-a-banded-matrix-system-of-equations-C/m-p/807360#M3513
<P>I need to solve a 2D Poisson equation, that is, a system of equations in the for AX=B where A is an n-by-n matrix and B is a n-by-1 vector. Being A a discretization matrix for the 2D Poisson problem, I know that only 5 diagonals will be not null. MKL has functions for solving banded matrix system of equations, namely LAPACKE_dgbtrf (for LU factorization) and LAPACKE_dgbtrs. Now, the 5 diagonals are: the main diagonal, the first diagonals above and below the main and two diagonals above and below by m diagonals wrt the main diagonal. After reading the documentation about band storage, I learned that I have to create a (3*m+1)-by-n matrix to store A in band storage format, so let's call this matrix AB.I'm filling AB in a row major fashion, since it's easier for me and LAPACKE_dgbtrf allows me to choose between row and column major. Now, I stuck on the leading dimenstion (parameter 7). I've read that this parameters tells how many memory elements there are between two elements of the same row and adjacent column.Now, I need to use the leading dimension of A (plain old full matrix) or AB (A turned into band storage format)?Is this call correct?LAPACKE_dgbtrf(LAPACK_ROW_MAJOR, n, n, m, m, AB, n, pivots); //pivots is int *LAPACKE_dgbtrs(LAPACK_ROW_MAJOR, 'N', n, m, m, 1, AB, n, pivots, B, n);Thank you</P>Wed, 06 Jun 2012 14:31:40 GMTPatrik_Osgnach2012-06-06T14:31:40ZLapacke: solve a banded matrix system of equations [C]
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Lapacke-solve-a-banded-matrix-system-of-equations-C/m-p/807360#M3513
<P>I need to solve a 2D Poisson equation, that is, a system of equations in the for AX=B where A is an n-by-n matrix and B is a n-by-1 vector. Being A a discretization matrix for the 2D Poisson problem, I know that only 5 diagonals will be not null. MKL has functions for solving banded matrix system of equations, namely LAPACKE_dgbtrf (for LU factorization) and LAPACKE_dgbtrs. Now, the 5 diagonals are: the main diagonal, the first diagonals above and below the main and two diagonals above and below by m diagonals wrt the main diagonal. After reading the documentation about band storage, I learned that I have to create a (3*m+1)-by-n matrix to store A in band storage format, so let's call this matrix AB.I'm filling AB in a row major fashion, since it's easier for me and LAPACKE_dgbtrf allows me to choose between row and column major. Now, I stuck on the leading dimenstion (parameter 7). I've read that this parameters tells how many memory elements there are between two elements of the same row and adjacent column.Now, I need to use the leading dimension of A (plain old full matrix) or AB (A turned into band storage format)?Is this call correct?LAPACKE_dgbtrf(LAPACK_ROW_MAJOR, n, n, m, m, AB, n, pivots); //pivots is int *LAPACKE_dgbtrs(LAPACK_ROW_MAJOR, 'N', n, m, m, 1, AB, n, pivots, B, n);Thank you</P>Wed, 06 Jun 2012 14:31:40 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Lapacke-solve-a-banded-matrix-system-of-equations-C/m-p/807360#M3513Patrik_Osgnach2012-06-06T14:31:40ZLapacke: solve a banded matrix system of equations [C]
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Lapacke-solve-a-banded-matrix-system-of-equations-C/m-p/807361#M3514
<TABLE border="0" cellspacing="0" cellpadding="0" width="90%">
<TBODY><TR>
<TD width="30%" valign="top">
<P><I>ldab</I></P>
</TD>
<TD valign="top">
<P>INTEGER. The leading dimension of the array<I>ab</I>. (<I>ldab</I>2*<I>kl</I>+<I>ku</I>+
1)</P>
</TD>
</TR>
</TBODY></TABLE>this is the quote from manualSat, 09 Jun 2012 05:40:29 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Lapacke-solve-a-banded-matrix-system-of-equations-C/m-p/807361#M3514Gennady_F_Intel2012-06-09T05:40:29Z