<?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: mkl_dcsrmv() gives wierd result in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909945#M12060</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
Thanks, Sergey!&lt;BR /&gt;Now it works.&lt;BR /&gt;</description>
    <pubDate>Tue, 28 Jul 2009 13:09:28 GMT</pubDate>
    <dc:creator>agnonchik</dc:creator>
    <dc:date>2009-07-28T13:09:28Z</dc:date>
    <item>
      <title>mkl_dcsrmv() gives wierd result</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909943#M12058</link>
      <description>Hi, &lt;BR /&gt;Could you check the following example?&lt;BR /&gt;&lt;BR /&gt;void test_mkl_dcsrmv()&lt;BR /&gt;{&lt;BR /&gt;// |1 1||0|=|1|&lt;BR /&gt;// |0 1||1| |1|&lt;BR /&gt;&lt;BR /&gt; int size = 2;&lt;BR /&gt; double one = 1.0;&lt;BR /&gt; double entries[] = {1.0, 1.0, 1.0};&lt;BR /&gt; int adjncy[] = {0, 1, 1};&lt;BR /&gt; int pntrb[] = {0, 2};&lt;BR /&gt; int pntre[] = {1, 2};&lt;BR /&gt; double x[] = {0.0, 1.0};&lt;BR /&gt; double y[] = {0.0, 0.0};&lt;BR /&gt; // y = alpha*A*x + beta*y&lt;BR /&gt; mkl_dcsrmv("N", &amp;amp;size, &amp;amp;size, &amp;amp;one, "G**C", entries, adjncy, pntrb, pntre,&lt;BR /&gt; x, &amp;amp;one, y);&lt;BR /&gt; std::cout &amp;lt;&amp;lt; "y=[" &amp;lt;&amp;lt; y[0] &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; y[1] &amp;lt;&amp;lt; "]\n";&lt;BR /&gt; // Should print "y=[1,1]". Right?&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;As a matter of fact, it prints "y=[0,0]". Why????&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Fri, 24 Jul 2009 12:50:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909943#M12058</guid>
      <dc:creator>agnonchik</dc:creator>
      <dc:date>2009-07-24T12:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: mkl_dcsrmv() gives wierd result</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909944#M12059</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/436876"&gt;agnonchik&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;Hi, &lt;BR /&gt;Could you check the following example?&lt;BR /&gt;&lt;BR /&gt;void test_mkl_dcsrmv()&lt;BR /&gt;{&lt;BR /&gt;// |1 1||0|=|1|&lt;BR /&gt;// |0 1||1| |1|&lt;BR /&gt;&lt;BR /&gt;int size = 2;&lt;BR /&gt;double one = 1.0;&lt;BR /&gt;double entries[] = {1.0, 1.0, 1.0};&lt;BR /&gt;int adjncy[] = {0, 1, 1};&lt;BR /&gt;int pntrb[] = {0, 2};&lt;BR /&gt;int pntre[] = {1, 2};&lt;BR /&gt;double x[] = {0.0, 1.0};&lt;BR /&gt;double y[] = {0.0, 0.0};&lt;BR /&gt;// y = alpha*A*x + beta*y&lt;BR /&gt;mkl_dcsrmv("N", &amp;amp;size, &amp;amp;size, &amp;amp;one, "G**C", entries, adjncy, pntrb, pntre,&lt;BR /&gt;x, &amp;amp;one, y);&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "y=[" &amp;lt;&amp;lt; y[0] &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; y[1] &amp;lt;&amp;lt; "]n";&lt;BR /&gt;// Should print "y=[1,1]". Right?&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;As a matter of fact, it prints "y=[0,0]". Why????&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Hello,&lt;BR /&gt;&lt;BR /&gt;The representation ofyour matrix in CSR fromat is not correct in your program. In your case, the values of thearray pntre must be&lt;BR /&gt;&lt;BR /&gt;int pntre[] = {2, 3};&lt;BR /&gt;&lt;BR /&gt;intead of your setting&lt;BR /&gt;&lt;BR /&gt;int pntre[] = {1, 2};&lt;BR /&gt;&lt;BR /&gt;If we replace the values of pntre by {2, 3 }, we get y=[1,1] as it should be. &lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;Sergey</description>
      <pubDate>Fri, 24 Jul 2009 13:52:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909944#M12059</guid>
      <dc:creator>Sergey_K_Intel1</dc:creator>
      <dc:date>2009-07-24T13:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: mkl_dcsrmv() gives wierd result</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909945#M12060</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
Thanks, Sergey!&lt;BR /&gt;Now it works.&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Jul 2009 13:09:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-dcsrmv-gives-wierd-result/m-p/909945#M12060</guid>
      <dc:creator>agnonchik</dc:creator>
      <dc:date>2009-07-28T13:09:28Z</dc:date>
    </item>
  </channel>
</rss>

