<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Intel® oneAPI Math Kernel LibraryのトピックPlease see the MKL reference</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055539#M21404</link>
    <description>&lt;P&gt;Please see the MKL reference manual,&amp;nbsp;https://software.intel.com/en-us/node/520877, where it says about DGETRF:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;The routine computes the LU factorization of a general m-by-n matrix A as&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;A = P*L*U,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m &amp;gt; n) and U is upper triangular (upper trapezoidal if m &amp;lt; n). The routine uses partial pivoting, with row interchanges.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Thu, 07 May 2015 12:03:53 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2015-05-07T12:03:53Z</dc:date>
    <item>
      <title>problem with the C interface to Lapack LU factorization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055535#M21400</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've written the following C code that should perform the LU factorization&lt;/P&gt;

&lt;P&gt;of a general n x n matrix&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;mkl.h&amp;gt;

#include "mkl_lapack.h"

#define N 3

double* A;
lapack_int n=N;
lapack_int* ipiv;

int main(){
    int i=0,j=0,ierr=0;
    A=malloc(n*n*sizeof(double));
    ipiv=malloc(n*sizeof(lapack_int));
    A[0]=1e0;A[1]=0e0;A[2]=0e0;
    A[3]=2e0;A[4]=3e0;A[5]=0e0;
    A[6]=4e0;A[7]=5e0;A[8]=6e0;
    ierr=LAPACKE_dgetrf(LAPACK_ROW_MAJOR,n,n,A,n,ipiv);
    for(i=0;i&amp;lt;n;i++){
        for(j=0;j&amp;lt;n;j++)
          printf("%f ",A[i*n+j]);
        printf("\n");
    }
    printf("ierr=%d\n",ierr);
    free(A);
    free(ipiv);
    return 0;
}
&lt;/PRE&gt;

&lt;P&gt;the result (computed with mathematica) should give for U the 3x3 diagonal matrix {1,3,6}&lt;/P&gt;

&lt;P&gt;and for L={{1., 0., 0.}, {2., 1., 0.}, {4., 1.66667, 1.}}. However, the code seems to fail.&lt;/P&gt;

&lt;P&gt;Am I doing some mistake?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;F&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 18:34:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055535#M21400</guid>
      <dc:creator>Fabio_G_</dc:creator>
      <dc:date>2015-05-06T18:34:31Z</dc:date>
    </item>
    <item>
      <title>I guess I am misunderstanding</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055536#M21401</link>
      <description>&lt;P&gt;I guess I am misunderstanding the storage of the result. I have tried&lt;/P&gt;

&lt;P&gt;to solve a linear system with b={1,1,1} and it seems that it is working.&lt;/P&gt;

&lt;P&gt;How to interpret the result from LU stored in A?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 18:53:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055536#M21401</guid>
      <dc:creator>Fabio_G_</dc:creator>
      <dc:date>2015-05-06T18:53:21Z</dc:date>
    </item>
    <item>
      <title>I think that the issue is how</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055537#M21402</link>
      <description>&lt;P&gt;I think that the issue is how to interpret the results, since your program works correctly. Its output agrees with that Matlab prints when given the command &lt;STRONG&gt;lu(A)&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Different packages &amp;nbsp;(e.g., MKL, Matlab, Mathematica) may use different conventions since, as with finding the factors of composite integers, the P,L,U factors of a matrix A, A = P.L.U, &amp;nbsp;are not unique. The convention used in MKL is that L has a unit diagonal.&lt;/P&gt;

&lt;P&gt;Your program prints the factors of a permutation of A, not those of A itself, and you need to take this into account, as well, when comparing results.&lt;/P&gt;

&lt;P&gt;Commonly, finding the L and U factors is the first of a two step solution of the problem of solving linear equations, and the second step, in which you call DGETRS, handles the permutation vector properly but transparently. Furthermore, the solution is independent of the convention used for the L-U factors.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 21:33:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055537#M21402</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-05-06T21:33:11Z</dc:date>
    </item>
    <item>
      <title>I agree, indeed by using </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055538#M21403</link>
      <description>&lt;P&gt;I agree, indeed by using&amp;nbsp; dgetres gave me the right solution for a system. However, there is no reference in the MKL guide how to interpret this result and I think should be.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;F&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 05:38:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055538#M21403</guid>
      <dc:creator>Fabio_G_</dc:creator>
      <dc:date>2015-05-07T05:38:42Z</dc:date>
    </item>
    <item>
      <title>Please see the MKL reference</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055539#M21404</link>
      <description>&lt;P&gt;Please see the MKL reference manual,&amp;nbsp;https://software.intel.com/en-us/node/520877, where it says about DGETRF:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;The routine computes the LU factorization of a general m-by-n matrix A as&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;A = P*L*U,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m &amp;gt; n) and U is upper triangular (upper trapezoidal if m &amp;lt; n). The routine uses partial pivoting, with row interchanges.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 07 May 2015 12:03:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-the-C-interface-to-Lapack-LU-factorization/m-p/1055539#M21404</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-05-07T12:03:53Z</dc:date>
    </item>
  </channel>
</rss>

