<?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>topic Re: getrf and getri in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887735#M10132</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Are you considering that subscripts of a 2D array with identical memory storage are reversed from Fortran (and MKL) to C? Do you want mklP[i+j*nCells]=P(i,j) ?&lt;BR /&gt;</description>
    <pubDate>Mon, 24 Aug 2009 22:07:52 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2009-08-24T22:07:52Z</dc:date>
    <item>
      <title>getrf and getri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887734#M10131</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am doing a evaluation to be prepared to use MKL in our product. During this evaluation I have done a test to compare simple inversion of a matrix with another library. I have stored matrix data in a matrix called "P" with the dimensions of "nCells x nCells" and then called "getrf" and "getri" as below:&lt;BR /&gt;&lt;BR /&gt;double *mklP;&lt;BR /&gt;mklP=new double[nCells*nCells];&lt;BR /&gt;&lt;BR /&gt;for (int i=0; i&lt;NCELLS&gt;&lt;/NCELLS&gt; for (int j=0; j&lt;NCELLS&gt;&lt;/NCELLS&gt; mklP[i*nCells+j]=P(i, j);&lt;BR /&gt;&lt;BR /&gt;int info;&lt;BR /&gt;int ipiv[nCells];&lt;BR /&gt;int lwork=-1;&lt;BR /&gt;double work[nCells];&lt;BR /&gt;&lt;BR /&gt;dgetrf(&amp;amp;nCells, &amp;amp;nCells, mklP, &amp;amp;nCells, ipiv, &amp;amp;info);&lt;BR /&gt;dgetri(&amp;amp;nCells, mklP, &amp;amp;nCells, ipiv, work, &amp;amp;lwork, &amp;amp;info);&lt;BR /&gt;&lt;BR /&gt;I have following questions:&lt;BR /&gt;&lt;BR /&gt;1. Do I feed the "mklP" in correct way? I mean since the "mklP" is passed to MKL and it is just an array, do I feed it in a right way (mklP[i*nCells+j]=P(i, j)) ?&lt;BR /&gt;&lt;BR /&gt;2. The result of matrix inversion will be stored in "mklP" but it is not correct at all! I do not know where I am doing wrong, but maybe some params are passed incorrectly ot "getrf" or "getri" functions. Can anybody help?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Aug 2009 21:46:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887734#M10131</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2009-08-24T21:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: getrf and getri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887735#M10132</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Are you considering that subscripts of a 2D array with identical memory storage are reversed from Fortran (and MKL) to C? Do you want mklP[i+j*nCells]=P(i,j) ?&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Aug 2009 22:07:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887735#M10132</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-08-24T22:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: getrf and getri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887736#M10133</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/367365"&gt;tim18&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; Are you considering that subscripts of a 2D array with identical memory storage are reversed from Fortran (and MKL) to C? Do you want mklP[i+j*nCells]=P(i,j) ?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip. I changed the code as you said but the result is not still correct. When I multiply inverted matrix with original matrix the result is far far away from identity matrix. I am wodering if I am calling LAPACK functions correctly?&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Aug 2009 09:17:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887736#M10133</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2009-08-25T09:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: getrf and getri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887737#M10134</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/410217"&gt;danltu.se&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/367365"&gt;tim18&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; Are you considering that subscripts of a 2D array with identical memory storage are reversed from Fortran (and MKL) to C? Do you want mklP[i+j*nCells]=P(i,j) ?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip. I changed the code as you said but the result is not still correct. When I multiply inverted matrix with original matrix the result is far far away from identity matrix. I am wodering if I am calling LAPACK functions correctly?&lt;BR /&gt;&lt;BR /&gt;D.&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
You have set LWORK to -1 which is just a workspace query. The function is returning without any actual inversion taking place. You might look at your info variable to see if this gives any good information if the call is still failing.&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Aug 2009 23:46:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887737#M10134</guid>
      <dc:creator>Melvin_Robinson</dc:creator>
      <dc:date>2009-08-28T23:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: getrf and getri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887738#M10135</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/305376"&gt;Melvin&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
You have set LWORK to -1 which is just a workspace query. The function is returning without any actual inversion taking place. You might look at your info variable to see if this gives any good information if the call is still failing.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Exactly! Now I used returned values (after querying) to set lwork and it works fine now. Thanks for the tip.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 11:46:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/getrf-and-getri/m-p/887738#M10135</guid>
      <dc:creator>Dan4</dc:creator>
      <dc:date>2009-09-10T11:46:36Z</dc:date>
    </item>
  </channel>
</rss>

