<?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: matrix inverse - dgetri in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910302#M12090</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;BR /&gt;I 've slightly changed your code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;int SIZE = 3; &lt;BR /&gt;double *a = new double [SIZE*SIZE]; &lt;BR /&gt;&lt;BR /&gt;for(int i = 0; i &amp;lt; SIZE; i++ ) {&lt;BR /&gt;for(int j = 0; j &amp;lt; SIZE; j++ ) {&lt;BR /&gt;a[j*SIZE+i] = (double) (i+j+1)*(2*i-j); &lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int info = 0; &lt;BR /&gt;int lworkspace = SIZE;//-1; !!!!!!&lt;BR /&gt;int *ipiv = new int [SIZE]; &lt;BR /&gt;dgetrf(&amp;amp;SIZE, &amp;amp;SIZE, a, &amp;amp;SIZE, ipiv, &amp;amp;info); &lt;BR /&gt;&lt;BR /&gt;//double workspace; !!!!! this is array&lt;BR /&gt;double* workspace = new double [lworkspace * sizeof(double)]; &lt;BR /&gt;dgetri(&amp;amp;SIZE, a, &amp;amp;SIZE, ipiv, workspace, &amp;amp;lworkspace, &amp;amp;info);&lt;/P&gt;
&lt;P&gt;for(int i = 0; i &amp;lt; SIZE; i++ ) {&lt;BR /&gt; for(int j = 0; j &amp;lt; SIZE; j++ ) { &lt;BR /&gt; printf(" %lf", a[j*SIZE+i] );&lt;BR /&gt;}&lt;BR /&gt; printf("n");&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;=== &lt;BR /&gt;3.750000 -6.500000 2.250000&lt;BR /&gt;-5.000000 9.000000 -3.000000&lt;BR /&gt;1.500000 -3.000000 1.000000&lt;BR /&gt;Press any key to continue . . .&lt;BR /&gt;&lt;BR /&gt;- Gennady&lt;/P&gt;</description>
    <pubDate>Sun, 03 May 2009 05:26:56 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2009-05-03T05:26:56Z</dc:date>
    <item>
      <title>matrix inverse - dgetri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910301#M12089</link>
      <description>Hi everybody,&lt;BR /&gt;&lt;BR /&gt;I can not find mistake with dgetri. Please see my code:&lt;BR /&gt;
&lt;PRE&gt;[cpp]int SIZE = 3;&lt;BR /&gt;double *a = new double [SIZE*SIZE];&lt;BR /&gt;&lt;BR /&gt;for(int i = 0; i &amp;lt; SIZE; i++ )&lt;BR /&gt;for(int j = 0; j &amp;lt; SIZE; j++ )&lt;BR /&gt;a[j*SIZE+i] = (double) (i+j+1)*(2*i-j);&lt;BR /&gt;&lt;BR /&gt;int info = 0, lworkspace = -1;&lt;BR /&gt;int *ipiv = new int [SIZE];&lt;BR /&gt;dgetrf(&amp;amp;SIZE, &amp;amp;SIZE, a, &amp;amp;SIZE, ipiv, &amp;amp;info);&lt;BR /&gt;&lt;BR /&gt;double workspace;&lt;BR /&gt;dgetri(&amp;amp;SIZE, a, &amp;amp;SIZE, ipiv, &amp;amp;workspace, &amp;amp;lworkspace, &amp;amp;info);[/cpp]&lt;/PRE&gt;
true answer a=&lt;BR /&gt; | 3.75 -6.5 2.25 |&lt;BR /&gt;| -5 9   -3 |&lt;BR /&gt; | 1.5   -3   1 |&lt;BR /&gt;&lt;BR /&gt;but I have a=&lt;BR /&gt; | 12 12  10 |&lt;BR /&gt;| 0  -2  -6 |&lt;BR /&gt; | 0.(3) 0.5 -0.(3) |&lt;BR /&gt;&lt;BR /&gt;both after dgetrf and dgetri. What's wrong?</description>
      <pubDate>Sat, 02 May 2009 17:08:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910301#M12089</guid>
      <dc:creator>smtp12357</dc:creator>
      <dc:date>2009-05-02T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: matrix inverse - dgetri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910302#M12090</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;BR /&gt;I 've slightly changed your code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;int SIZE = 3; &lt;BR /&gt;double *a = new double [SIZE*SIZE]; &lt;BR /&gt;&lt;BR /&gt;for(int i = 0; i &amp;lt; SIZE; i++ ) {&lt;BR /&gt;for(int j = 0; j &amp;lt; SIZE; j++ ) {&lt;BR /&gt;a[j*SIZE+i] = (double) (i+j+1)*(2*i-j); &lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int info = 0; &lt;BR /&gt;int lworkspace = SIZE;//-1; !!!!!!&lt;BR /&gt;int *ipiv = new int [SIZE]; &lt;BR /&gt;dgetrf(&amp;amp;SIZE, &amp;amp;SIZE, a, &amp;amp;SIZE, ipiv, &amp;amp;info); &lt;BR /&gt;&lt;BR /&gt;//double workspace; !!!!! this is array&lt;BR /&gt;double* workspace = new double [lworkspace * sizeof(double)]; &lt;BR /&gt;dgetri(&amp;amp;SIZE, a, &amp;amp;SIZE, ipiv, workspace, &amp;amp;lworkspace, &amp;amp;info);&lt;/P&gt;
&lt;P&gt;for(int i = 0; i &amp;lt; SIZE; i++ ) {&lt;BR /&gt; for(int j = 0; j &amp;lt; SIZE; j++ ) { &lt;BR /&gt; printf(" %lf", a[j*SIZE+i] );&lt;BR /&gt;}&lt;BR /&gt; printf("n");&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;=== &lt;BR /&gt;3.750000 -6.500000 2.250000&lt;BR /&gt;-5.000000 9.000000 -3.000000&lt;BR /&gt;1.500000 -3.000000 1.000000&lt;BR /&gt;Press any key to continue . . .&lt;BR /&gt;&lt;BR /&gt;- Gennady&lt;/P&gt;</description>
      <pubDate>Sun, 03 May 2009 05:26:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910302#M12090</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2009-05-03T05:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: matrix inverse - dgetri</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910303#M12091</link>
      <description>Gennady,&lt;BR /&gt;&lt;BR /&gt;Thank you for the help!&lt;BR /&gt;</description>
      <pubDate>Sun, 03 May 2009 07:57:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/matrix-inverse-dgetri/m-p/910303#M12091</guid>
      <dc:creator>smtp12357</dc:creator>
      <dc:date>2009-05-03T07:57:17Z</dc:date>
    </item>
  </channel>
</rss>

