<?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 access to sub-matrices in CSR format in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764471#M135</link>
    <description>The Intel MKL supports twovariations of thecompressed sparse row (CSR) format. The first variation proposed in the NISTSparse BLAS is specified by four arrays: the &lt;VAR&gt;values&lt;/VAR&gt;, &lt;VAR&gt;columns&lt;/VAR&gt;, &lt;VAR&gt;pointerB&lt;/VAR&gt;, and &lt;VAR&gt;pointerE&lt;/VAR&gt;. And the second variation is specified by three arrays:values, columns and rowIndex as you described above.Some MKLSparse BLAS routines can only works with the three arraysvarition of the CSR, all other routines can work with the both variations. &lt;BR /&gt;&lt;BR /&gt;Compared to the classical three arrays variation of CSR mentioned by you, the NIST variation with four arraysallows working with submatrices. You just need to define &lt;VAR&gt;pointerB&lt;/VAR&gt; and &lt;VAR&gt;pointerE arraysproperly&lt;/VAR&gt;. You don't need to form additional the values and columns arrays since all sparse representations of submatrices can use only one copy of these arrays. &lt;BR /&gt;&lt;BR /&gt;Hope it helps&lt;BR /&gt;All the best&lt;BR /&gt;Sergey&lt;BR /&gt;</description>
    <pubDate>Wed, 13 Apr 2011 10:51:09 GMT</pubDate>
    <dc:creator>Sergey_K_Intel1</dc:creator>
    <dc:date>2011-04-13T10:51:09Z</dc:date>
    <item>
      <title>access to sub-matrices in CSR format</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764469#M133</link>
      <description>&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;Hello all,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;SupposeY&lt;SPAN style="font-family: arial, sans-serif;"&gt;is saved in sparse CSR format&lt;/SPAN&gt;by defining its values, columns and rowIndex vectors. Is that possible have access to its sub-matrices?&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;/SPAN&gt;For example:&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;     |  1   -1   0  -3  0  |    &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;     | -1   5   0   0  0  |&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt; Y = |  0   0   4   6  4  |&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;     | -3   0   6   7  0  |&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;     |  0   0   4   0  -5  |&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;values[13]	 = {1.0, -1.0, -3.0, -1.0, 5.0, 4.0, 6.0, 4.0, -3.0, 6.0, 7.0, 4.0, -5.0};&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;columns[13] = {0, 1, 3, 0, 1, 2, 3, 4, 0, 2, 3, 2, 4};&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;rowIndex[6]  = {0, 3, 5, 8, 11, 13};&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;Can I have access to sub-matrices of Y , e.g. [-3  0 // 0 0 // 6 4] or [0 0 4 // -3 0 6// 0 0 4] ?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;&lt;SPAN style="font-family: arial, sans-serif;"&gt;Thanks for your help,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Apr 2011 12:56:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764469#M133</guid>
      <dc:creator>Vahid_Jalili</dc:creator>
      <dc:date>2011-04-12T12:56:16Z</dc:date>
    </item>
    <item>
      <title>access to sub-matrices in CSR format</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764470#M134</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;You could write code to unpack and access it I suppose, but if you're asking whether there is an easyway to access it or have MKL functions act upon it (as there is in LAPACK by specifying the first element and an appropriate leading dimension parameter as the stride) then I believe the answer is no. &lt;BR /&gt;&lt;BR /&gt;Todd</description>
      <pubDate>Wed, 13 Apr 2011 05:06:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764470#M134</guid>
      <dc:creator>Todd_R_Intel</dc:creator>
      <dc:date>2011-04-13T05:06:07Z</dc:date>
    </item>
    <item>
      <title>access to sub-matrices in CSR format</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764471#M135</link>
      <description>The Intel MKL supports twovariations of thecompressed sparse row (CSR) format. The first variation proposed in the NISTSparse BLAS is specified by four arrays: the &lt;VAR&gt;values&lt;/VAR&gt;, &lt;VAR&gt;columns&lt;/VAR&gt;, &lt;VAR&gt;pointerB&lt;/VAR&gt;, and &lt;VAR&gt;pointerE&lt;/VAR&gt;. And the second variation is specified by three arrays:values, columns and rowIndex as you described above.Some MKLSparse BLAS routines can only works with the three arraysvarition of the CSR, all other routines can work with the both variations. &lt;BR /&gt;&lt;BR /&gt;Compared to the classical three arrays variation of CSR mentioned by you, the NIST variation with four arraysallows working with submatrices. You just need to define &lt;VAR&gt;pointerB&lt;/VAR&gt; and &lt;VAR&gt;pointerE arraysproperly&lt;/VAR&gt;. You don't need to form additional the values and columns arrays since all sparse representations of submatrices can use only one copy of these arrays. &lt;BR /&gt;&lt;BR /&gt;Hope it helps&lt;BR /&gt;All the best&lt;BR /&gt;Sergey&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Apr 2011 10:51:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764471#M135</guid>
      <dc:creator>Sergey_K_Intel1</dc:creator>
      <dc:date>2011-04-13T10:51:09Z</dc:date>
    </item>
    <item>
      <title>access to sub-matrices in CSR format</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764472#M136</link>
      <description>&lt;DIV&gt;Hello Sergey,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your reply,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I am aware of pointerB and poiterE vectors used for CSR format:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;For matrix Y they are as following:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;pointerB&lt;I&gt; = {0, 3, 5, 8, 11};&lt;/I&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;pointerE&lt;I&gt; = {3, 5, 8, 11, 13};&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;But, still I cannot set these pointers correctly to extract submatrices&lt;SPAN style="border-collapse: collapse; font-size: 12px; font-weight: 200; line-height: 16px; font-family: arial, sans-serif;"&gt;, e.g. [0 0 4 // -3 0 6// 0 0 4] ?&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse; font-size: 12px; font-weight: 200; line-height: 16px; font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse; font-size: 12px; font-weight: 200; line-height: 16px; font-family: arial, sans-serif;"&gt;I want to use these submatix in&lt;/SPAN&gt;&lt;SPAN style="border-collapse: collapse; font-size: 12px; line-height: 16px;"&gt;&lt;B&gt;mkl_scsrmv&lt;/B&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse; font-size: 12px; font-weight: 200; line-height: 16px; font-family: arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse; font-size: 12px; font-weight: 200; line-height: 16px; font-family: arial, sans-serif;"&gt;&lt;DIV&gt;mkl_ccsrmv(&amp;amp;transa, &amp;amp;m, &amp;amp;k, α, matdescra, values, columns, pointerB, pointerE, sol_vec, β, rhs_vec);&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;If m and k should be dimensions of the original matrix (i.e. 5x5) or they should be dimensions of the submatrix (e.g 3x3)?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 11px; border-collapse: separate; font-weight: normal; line-height: normal;"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 11px; border-collapse: separate; font-weight: normal; line-height: normal;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 11px; border-collapse: separate; font-weight: normal; line-height: normal;"&gt;--Vahid&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Apr 2011 13:50:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764472#M136</guid>
      <dc:creator>Vahid_Jalili</dc:creator>
      <dc:date>2011-04-13T13:50:41Z</dc:date>
    </item>
    <item>
      <title>access to sub-matrices in CSR format</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764473#M137</link>
      <description>&lt;P&gt;Hello Vahid,&lt;BR /&gt;&lt;BR /&gt;Your submatrix can be defined as follows:&lt;BR /&gt; int pointerB[3]={2, 3, 5} , pointerE[3]={3,3,8};&lt;BR /&gt;Here is a code example where submatrix is multiplied by vector {3,4, 5) with the help of mkl_dcsrmv&lt;BR /&gt;int main() {&lt;BR /&gt;//*******************************************************************************&lt;BR /&gt;// Declaration and initialization of parameters for sparse representation of &lt;BR /&gt;// the matrix A in the compressed sparse row format:&lt;BR /&gt;//******************************************************************************* &lt;BR /&gt;#define M 5 &lt;BR /&gt;#define NNZ 13 &lt;BR /&gt;#define MN &lt;BR /&gt; double values[NNZ] = {1.0, -1.0, -3.0, -1.0, 5.0, 4.0, 6.0, 4.0, -3.0, 6.0, 7.0, 4.0, -5.0};&lt;BR /&gt; int columns[NNZ] = {0, 1, 3, 0, 1, 2, 3, 4, 0, 2, 3, 2, 4};&lt;BR /&gt; int rowIndex[M+1] = {0, 3, 5, 8, 11, 13}; &lt;BR /&gt; double sol_vec&lt;M&gt; = {1.0, 2.0, 3.0, 4.0, 5.0};&lt;BR /&gt; double rhs_vec&lt;M&gt; = {0.0, 0.0, 0.0, 0.0, 0.0};&lt;BR /&gt; double alpha=1.0, beta=0.0; &lt;BR /&gt; int pointerB[3]={2, 3, 5} , pointerE[3]={3,3,8};&lt;BR /&gt; char transa;&lt;BR /&gt; char matdescra[6];&lt;BR /&gt; int i, ishift, mn=3;&lt;BR /&gt; &lt;BR /&gt; transa = 'n';&lt;BR /&gt; matdescra[0] = 'g';&lt;BR /&gt; matdescra[3] = 'c';&lt;BR /&gt; ishift=pointerB[0];&lt;BR /&gt; mkl_dcsrmv(&amp;amp;transa, &amp;amp;mn, &amp;amp;mn, α, matdescra,&amp;amp;values[ishift], &amp;amp;columns[ishift], pointerB, pointerE, sol_vec, β, rhs_vec);&lt;BR /&gt; for (i = 0; i &amp;lt; mn; i++) {&lt;BR /&gt; printf("%7.1f\n", rhs_vec&lt;I&gt;);&lt;BR /&gt; };&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;As concerns as m and k, I'd recommend to use dimensions of the submatrix. &lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;Sergey&lt;/I&gt;&lt;/M&gt;&lt;/M&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2011 07:33:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/access-to-sub-matrices-in-CSR-format/m-p/764473#M137</guid>
      <dc:creator>Sergey_K_Intel1</dc:creator>
      <dc:date>2011-04-14T07:33:37Z</dc:date>
    </item>
  </channel>
</rss>

