<?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 clapack - leading dimension when data is in row-major order? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812359#M4042</link>
    <description>Hi. I hope this isn't too basic of a question, but I am interested in trying out the clapack interface, and there is something that is not quite clear to me in the documentation.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Suppose I want to use the dtrtrs function to solve AX=B when A is triangular. Both A and B are stored in row-major order. In the parameter arguments, the routine asks for the leading dimensions of A and B (lda and ldb). This makes sense when matrices are in column-major order, but if they are in row-major, the number of rows in the array doesn't really tell the routing anything. Shouldn't I be reporting the trailing dimension (number of columns in the array) instead?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks so much for your help.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Michael&lt;/DIV&gt;</description>
    <pubDate>Fri, 03 Jun 2011 00:30:14 GMT</pubDate>
    <dc:creator>Michael_B_19</dc:creator>
    <dc:date>2011-06-03T00:30:14Z</dc:date>
    <item>
      <title>MKL clapack - leading dimension when data is in row-major order?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812359#M4042</link>
      <description>Hi. I hope this isn't too basic of a question, but I am interested in trying out the clapack interface, and there is something that is not quite clear to me in the documentation.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Suppose I want to use the dtrtrs function to solve AX=B when A is triangular. Both A and B are stored in row-major order. In the parameter arguments, the routine asks for the leading dimensions of A and B (lda and ldb). This makes sense when matrices are in column-major order, but if they are in row-major, the number of rows in the array doesn't really tell the routing anything. Shouldn't I be reporting the trailing dimension (number of columns in the array) instead?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks so much for your help.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Michael&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Jun 2011 00:30:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812359#M4042</guid>
      <dc:creator>Michael_B_19</dc:creator>
      <dc:date>2011-06-03T00:30:14Z</dc:date>
    </item>
    <item>
      <title>MKL clapack - leading dimension when data is in row-major order</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812360#M4043</link>
      <description>&lt;P&gt;Hi Michael,&lt;BR /&gt;&lt;BR /&gt;You are right ifyou have &lt;EM&gt;N&lt;/EM&gt; columns in your matrix &lt;EM&gt;A, &lt;/EM&gt;then&lt;EM&gt;LDA=N&lt;/EM&gt; for row-major case.&lt;BR /&gt;&lt;BR /&gt;In general leading dimension is equal to the number of elements in major dimension.Also it isequal to the distance in elements between two neighbor elements in a line of minor dimension.&lt;BR /&gt;&lt;BR /&gt;Thusif you have no extra elements in your matrix with &lt;EM&gt;M&lt;/EM&gt; rows and &lt;EM&gt;N&lt;/EM&gt; columns, then:&lt;BR /&gt;- In row-major case: row &lt;EM&gt;i&lt;/EM&gt;lays in memory right after row &lt;EM&gt;i-1&lt;/EM&gt;and thus &lt;EM&gt;LDA=N&lt;/EM&gt; - number of elements in row.&lt;BR /&gt;- In column-major case: column &lt;EM&gt;i&lt;/EM&gt;lays in memory right after column &lt;EM&gt;i-1&lt;/EM&gt;and thus &lt;EM&gt;LDA=M&lt;/EM&gt; - number of elements in column.&lt;BR /&gt;&lt;BR /&gt;If you refer to a submatrix ( &lt;EM&gt;m &lt;/EM&gt;x &lt;EM&gt;n&lt;/EM&gt; )then you use as leading dimension the number of elements in major dimension of the whole matrix (as above)while&lt;EM&gt;m&lt;/EM&gt; and&lt;EM&gt;n&lt;/EM&gt; in subroutine's inputparametersdescribes the size of the submatrix.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.intel.com/skins/images/7B13F55A7CE623EF42E69096FA81A3A1/2021_redesign/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;You are welcome.&lt;BR /&gt;Alexander.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2011 10:23:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812360#M4043</guid>
      <dc:creator>Alexander_K_Intel3</dc:creator>
      <dc:date>2011-06-03T10:23:31Z</dc:date>
    </item>
    <item>
      <title>MKL clapack - leading dimension when data is in row-major order</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812361#M4044</link>
      <description>Thank you, your answer is crystal clear. But is this a standard interpretation? I ask because I often use the GSL library, for which all arrays are in row-major order, and what you are calling the leading dimension, GSL calls the trailing dimension. I'm wondering why the discrepancy, or whether some clarification in the documentation might be appropriate.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;In any event, I now know what to do when using MKL. Thanks again.&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Jun 2011 16:52:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-clapack-leading-dimension-when-data-is-in-row-major-order/m-p/812361#M4044</guid>
      <dc:creator>Michael_B_19</dc:creator>
      <dc:date>2011-06-03T16:52:03Z</dc:date>
    </item>
  </channel>
</rss>

