<?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 mkl_ddnscsr problem in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829425#M5419</link>
    <description>Thank you Gennady. Will do, P-</description>
    <pubDate>Fri, 20 Jan 2012 18:24:36 GMT</pubDate>
    <dc:creator>Petros_Mamales</dc:creator>
    <dc:date>2012-01-20T18:24:36Z</dc:date>
    <item>
      <title>mkl_ddnscsr problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829423#M5417</link>
      <description>&lt;PRE&gt;[cpp]#include &lt;MKL_SPBLAS.H&gt;
#include &lt;IOSTREAM&gt;
using namespace std;

void 	mkl_ddnscsr_test() {
	const size_t nNon0s =  6 ;
	MKL_INT job[8] ;
	job[0] = 0;			// ge-&amp;gt;csr
	job[1] = 0;			// ge is 0-based
	job[2] = 1;			// csr is 1-based
	job[3] = 2;			// general matrix
	job[4] = nNon0s;	// general matrix
	job[5] = 1;			// all csr arrays are generated 

	MKL_INT info;
	MKL_INT nRows = 5 ;
	MKL_INT nCols = 5 ;
	MKL_INT lda	  = 5;

	double values[ nNon0s  ] ;
	MKL_INT columns[ nNon0s ] ;
	MKL_INT rowIndex[ 5 + 1 ] ;

	double pdata[25];
	for ( size_t i = 0; i != 25 ; ++i )
		pdata&lt;I&gt; = 0L;
	for ( size_t i = 0; i != nRows ; ++i )
		pdata[i + 5*i] = double(i+1);
	pdata[ 2 + 5*3 ] = 3.14L;
	mkl_ddnscsr( 
		job, 
		&amp;amp;nRows, &amp;amp;nCols, 
		pdata, &amp;amp;lda, 
		values, 
		columns, 
		rowIndex, 
		&amp;amp;info );
	if ( info != 0 )
		throw;
	cout &amp;lt;&amp;lt; "values :" &amp;lt;&amp;lt; endl;
	for ( size_t i = 0; i !=nNon0s; ++i )
		cout &amp;lt;&amp;lt; values&lt;I&gt; &amp;lt;&amp;lt; endl;
	cout &amp;lt;&amp;lt; "rowIdx :" &amp;lt;&amp;lt; endl;
	for ( size_t i = 0; i != ( nRows + 1 ); ++i )
		cout &amp;lt;&amp;lt; rowIndex&lt;I&gt; &amp;lt;&amp;lt; endl;
	cout &amp;lt;&amp;lt; "columns :" &amp;lt;&amp;lt; endl;
	for ( size_t i = 0; i !=nNon0s; ++i )
		cout &amp;lt;&amp;lt; columns&lt;I&gt; &amp;lt;&amp;lt; endl;
	
}

int main(){
	cout &amp;lt;&amp;lt; "mkl_ddnscsr_test()" &amp;lt;&amp;lt; endl;
	mkl_ddnscsr_test();
	return 1;
}[/cpp]&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/IOSTREAM&gt;&lt;/MKL_SPBLAS.H&gt;&lt;/PRE&gt; Hi,&lt;BR /&gt;The follwing code shows a problem with the above function to convert between a (column-major) general matrix and a csr (3 variation).&lt;BR /&gt;It is a 5x5 matrix, with all diagonal elements being the corresponding incremental (1-based) row and the element &lt;BR /&gt;(2,3) being 3.14.&lt;BR /&gt;The result I get is for the rowIndex vector seems wrong since:&lt;BR /&gt;it should be:&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;and is, instead :&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;&lt;BR /&gt;i.e. 4 shoulld be 5, snce the 5th element in values corresponds to the beginning of the 4th row.&lt;BR /&gt;Can you please help?&lt;BR /&gt;TIA&lt;BR /&gt;Petros&lt;BR /&gt;ps: using msvc10, win7, mkl10.2.4.032 &lt;BR /&gt;&lt;BR /&gt;UPDATE: by setting job[1]=1 I get the right order. Apparently mkl assumes that the dense matrix is 1-based ??&lt;BR /&gt;This is rather confusing !&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Jan 2012 02:43:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829423#M5417</guid>
      <dc:creator>Petros_Mamales</dc:creator>
      <dc:date>2012-01-17T02:43:43Z</dc:date>
    </item>
    <item>
      <title>mkl_ddnscsr problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829424#M5418</link>
      <description>&lt;DIV&gt;Petros, please check this problem with the latest 10.3 update8 (Evaluation Version valid for 30 days). Since version 10.2 we have fixed several similar issues.&lt;/DIV&gt;&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Jan 2012 16:07:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829424#M5418</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2012-01-17T16:07:15Z</dc:date>
    </item>
    <item>
      <title>mkl_ddnscsr problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829425#M5419</link>
      <description>Thank you Gennady. Will do, P-</description>
      <pubDate>Fri, 20 Jan 2012 18:24:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-ddnscsr-problem/m-p/829425#M5419</guid>
      <dc:creator>Petros_Mamales</dc:creator>
      <dc:date>2012-01-20T18:24:36Z</dc:date>
    </item>
  </channel>
</rss>

