<?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 Matrix - Vector Matrix operation A_ij = alpha B_ik c_k D_kj + beta A_ij? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matrix-Vector-Matrix-operation-A-ij-alpha-B-ik-c-k-D-kj-beta-A/m-p/883436#M9801</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm looking for an efficient way of computing the matrix expression&lt;BR /&gt;&lt;BR /&gt;A_ij = alpha B_ik c_k D_kj + beta A_ij&lt;BR /&gt;&lt;BR /&gt;...or its simpler version:&lt;BR /&gt;A_ij = B_ik c_k D_kj + A_ij&lt;BR /&gt;&lt;BR /&gt;were alpha, beta are constants, A,B,D are matrices, and c is a vector. Summation over repeated indices is implied.&lt;BR /&gt;&lt;BR /&gt;It does look like it should be very easy to modify a dgemm kernel to do this operation, however by applying only blas calls one is stuck by either first scaling D_kj with c_k, or B_ik with c_k, or hand-writing a loop to do this computation.&lt;BR /&gt;&lt;BR /&gt;As this is already the second time I see this operation appear. So I was wondering: am I missing something obvious, or does such a function really not exist?&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Emanuel</description>
    <pubDate>Wed, 10 Jun 2009 16:53:28 GMT</pubDate>
    <dc:creator>gullcphys_ethz_ch</dc:creator>
    <dc:date>2009-06-10T16:53:28Z</dc:date>
    <item>
      <title>Matrix - Vector Matrix operation A_ij = alpha B_ik c_k D_kj + beta A_ij?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matrix-Vector-Matrix-operation-A-ij-alpha-B-ik-c-k-D-kj-beta-A/m-p/883436#M9801</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm looking for an efficient way of computing the matrix expression&lt;BR /&gt;&lt;BR /&gt;A_ij = alpha B_ik c_k D_kj + beta A_ij&lt;BR /&gt;&lt;BR /&gt;...or its simpler version:&lt;BR /&gt;A_ij = B_ik c_k D_kj + A_ij&lt;BR /&gt;&lt;BR /&gt;were alpha, beta are constants, A,B,D are matrices, and c is a vector. Summation over repeated indices is implied.&lt;BR /&gt;&lt;BR /&gt;It does look like it should be very easy to modify a dgemm kernel to do this operation, however by applying only blas calls one is stuck by either first scaling D_kj with c_k, or B_ik with c_k, or hand-writing a loop to do this computation.&lt;BR /&gt;&lt;BR /&gt;As this is already the second time I see this operation appear. So I was wondering: am I missing something obvious, or does such a function really not exist?&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Emanuel</description>
      <pubDate>Wed, 10 Jun 2009 16:53:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matrix-Vector-Matrix-operation-A-ij-alpha-B-ik-c-k-D-kj-beta-A/m-p/883436#M9801</guid>
      <dc:creator>gullcphys_ethz_ch</dc:creator>
      <dc:date>2009-06-10T16:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix - Vector Matrix operation A_ij = alpha B_ik c_k D_kj</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matrix-Vector-Matrix-operation-A-ij-alpha-B-ik-c-k-D-kj-beta-A/m-p/883437#M9802</link>
      <description>&lt;DIV style="margin:0px;"&gt;Hi Emanuel,&lt;BR /&gt;&lt;BR /&gt;I see an efficient way is that you mentioned yet - first scaling D_kj with c_k, or B_ik with c_k and than to call DGEMM with A, B and D&lt;BR /&gt;You could also use blas call for this scaling &lt;BR /&gt;B scaling will be more efficient in case of column-major order of your matrix&lt;BR /&gt;&lt;BR /&gt;do ii=1, num_columns_of_B&lt;BR /&gt; call dscal(num_rows_of_B,B(1,ii),c(ii),1)&lt;BR /&gt;enddo&lt;BR /&gt;In row-major case it seems more effective to do D scaling.&lt;BR /&gt;&lt;BR /&gt;Since scaling operation is ~n^2 ops but our full operation is ~n^3 ops the overhead isnt supposed to be significant.&lt;BR /&gt;&lt;BR /&gt;As to It does look like it should be very easy to modify a dgemm kernel to do this operation ,&lt;BR /&gt;I dont think so because &lt;BR /&gt;the loop by k &lt;BR /&gt; temp += B_ik c_k D_kj&lt;BR /&gt;involves k additional multiplies against&lt;BR /&gt; temp += B_ik D_kj&lt;BR /&gt;&lt;BR /&gt;So if we did implementation of this operation we would do roughly the same  scaling and than matrix-matrix multiplication.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;BR /&gt;&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jun 2009 08:59:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Matrix-Vector-Matrix-operation-A-ij-alpha-B-ik-c-k-D-kj-beta-A/m-p/883437#M9802</guid>
      <dc:creator>Sergey_K_Intel2</dc:creator>
      <dc:date>2009-06-11T08:59:26Z</dc:date>
    </item>
  </channel>
</rss>

