<?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 Quote:mecej4 wrote: in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007647#M19020</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I agree that 'ldc' is incorrectly described as an output argument to mkl_?csr_multd(). Rather, the matrix C is the output argument, and ldC is its leading dimension.&lt;/P&gt;

&lt;P&gt;The description is complicated by the presence of an option to transpose A before multiplying into B, which requires that A or A&lt;SUP&gt;T&lt;/SUP&gt; should conform with B for multiplication, depending on the value provided for &lt;EM&gt;trans&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Among the MKL examples you will find (you may have to unzip the examples zip file if you have not done so already) mkl_?csrmult.f, where ? stands for s, d, c, z. Look at the example and see if that helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thank you for your help. I have seen the example. Since in the example the matrix is a square matrix, the m,n,k are the same number, &amp;nbsp;there will be no mismatch.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I think the ia is always an array of length m+1. And ib is k+1, no matter when the trans is 'N' or 'T'. Is it right?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2015 01:23:03 GMT</pubDate>
    <dc:creator>forrest_R_</dc:creator>
    <dc:date>2015-05-20T01:23:03Z</dc:date>
    <item>
      <title>Sparse Matrix mkl_?csrmultd problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007645#M19018</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I want to use the&amp;nbsp;mkl_?csrmultd to do 2 matrix product and the output is a dense matrix.&lt;/P&gt;

&lt;P&gt;But i am confused when i read the manual, The ldc (leading dimension of dense matrix C) is a output &amp;nbsp;parameters( not a input parameter as usual ?), and the length of ib is m+1. The definition of ia is also very different with other sparse matrix routines, because the length is not m+1.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Is there any problem about this part?&lt;/P&gt;

&lt;P&gt;Any help and comment will be appreciated.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Jiajun&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 11:12:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007645#M19018</guid>
      <dc:creator>forrest_R_</dc:creator>
      <dc:date>2015-05-19T11:12:30Z</dc:date>
    </item>
    <item>
      <title>I agree that 'ldc' is</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007646#M19019</link>
      <description>&lt;P&gt;I agree that 'ldc' is incorrectly described as an output argument to mkl_?csr_multd(). Rather, the matrix C is the output argument, and ldC is its leading dimension.&lt;/P&gt;

&lt;P&gt;The description is complicated by the presence of an option to transpose A before multiplying into B, which requires that A or A&lt;SUP&gt;T&lt;/SUP&gt; should conform with B for multiplication, depending on the value provided for &lt;EM&gt;trans&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Among the MKL examples you will find (you may have to unzip the examples zip file if you have not done so already) mkl_?csrmult.f, where ? stands for s, d, c, z. Look at the example and see if that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 14:34:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007646#M19019</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-05-19T14:34:27Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007647#M19020</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I agree that 'ldc' is incorrectly described as an output argument to mkl_?csr_multd(). Rather, the matrix C is the output argument, and ldC is its leading dimension.&lt;/P&gt;

&lt;P&gt;The description is complicated by the presence of an option to transpose A before multiplying into B, which requires that A or A&lt;SUP&gt;T&lt;/SUP&gt; should conform with B for multiplication, depending on the value provided for &lt;EM&gt;trans&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Among the MKL examples you will find (you may have to unzip the examples zip file if you have not done so already) mkl_?csrmult.f, where ? stands for s, d, c, z. Look at the example and see if that helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thank you for your help. I have seen the example. Since in the example the matrix is a square matrix, the m,n,k are the same number, &amp;nbsp;there will be no mismatch.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I think the ia is always an array of length m+1. And ib is k+1, no matter when the trans is 'N' or 'T'. Is it right?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 01:23:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007647#M19020</guid>
      <dc:creator>forrest_R_</dc:creator>
      <dc:date>2015-05-20T01:23:03Z</dc:date>
    </item>
    <item>
      <title>Here is an example with</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007648#M19021</link>
      <description>&lt;P&gt;Here is an example with rectangular matrices. There are two cases, one with &lt;STRONG&gt;trans&lt;/STRONG&gt; = 'N' and the other with 'T'. You and I know that At = A&lt;SUP&gt;T&lt;/SUP&gt;, but it is not easy to detect that in the CSR representation. Therefore, seeing the same output for C with the different values for &lt;STRONG&gt;trans&lt;/STRONG&gt; is a good test that the calls are being made properly.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program xscsrmultd
use mkl_mod
!
! illustrate usage of mkl_scsrmultd with trans = 'N' and 'Y'
! A is 4 X 3, B is 3 X 2, so C is 4 X 2.
! At is the transpose of A, stored in CSR format
!
implicit none
integer :: i,j
integer :: mA=4, nA=3, mB=3, nB=2, mC=4, nC=2
integer :: iA(5)  = [1, 3, 4, 6, 8],         jA(7) = [1,2, 2, 1,3, 1,2]
integer :: iB(4)  = [1, 2, 4, 5],            jB(4) = [2, 1,2, 2]
real    :: A(7)   = [4, -2, 4, 2, 3, -1, -1], B(4) = [2, 2, -1, 3], C(4,2)
integer :: iAt(4) = [1,4,7,8], jAt(7) = [1,3,4, 1,2,4, 3]
real    :: At(7)  = [4,2,-1,-2,4,-1,3]
! C = A.B
call mkl_scsrmultd('N',mA,nA,nB, A,   ja, ia,  B, jB, iB, C, mC)
write(*,10)((C(i,j),j=1,nC),i=1,mC)
10 format(/(2F10.4))
! C = (At)^T.B
call mkl_scsrmultd('T',nA,mA,nB, At, jAt, iAt, B, jB, iB, C, mC)
write(*,10)((C(i,j),j=1,nC),i=1,mC)
end program&lt;/PRE&gt;

&lt;P&gt;Here is the source code of mkl_mod, which I use to avoid recompiling mkl.fi everytime it is used:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;      module mkl_mod
      include 'mkl.fi'
      end module&lt;/PRE&gt;

&lt;P&gt;(I do have six leading blanks on each of these three lines, but the forum software removes them from the display).&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 02:55:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-Matrix-mkl-csrmultd-problem/m-p/1007648#M19021</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-05-20T02:55:00Z</dc:date>
    </item>
  </channel>
</rss>

