<?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 Re: Calling mkl LAPACK routines from c++ in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-mkl-LAPACK-routines-from-c/m-p/854257#M6804</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;As I understand, the LAPACK routines are written in Fortran, but can be called from a c++ program. I found some general guidelines explaining the differences in how matrices are stored in Fortran vs c++. I found the following guidelines:&lt;BR /&gt;- Pass variables by address as opposed to pass by value.&lt;BR /&gt;- Store your data in Fortran style, that is, column-major rather than row-major order. &lt;BR /&gt;For example, if a two-dimensional matrix A of size m x n is stored densely in a one-dimensional array B, you can access a matrix element like this:&lt;BR /&gt;&lt;BR /&gt;A&lt;I&gt;&lt;J&gt; = B[i*n+j] in C (i=0, ... , m-1, j=0, ... , n-1)&lt;BR /&gt;&lt;BR /&gt;A(i,j) = B(j*m+i) in Fortran (i=1, ... , m, j=1, ... , n).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My questions are&lt;BR /&gt;1. If I store a symmetrical matrix in a packed format by columns, the rersulting vector should be the same in both C++ and Fortran styles. Right?&lt;BR /&gt;2. Do I have to shift the elements of the packed matrix so that the first lement has an index 1 before I call a LAPACK routine (for example, dpptrf - Cholesky factorization)?&lt;BR /&gt;Thanks.&lt;/J&gt;&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;1. If I store a symmetrical matrix in a packed format by columns, the rersulting vector should be the same in both C++ and Fortran styles. Right?&lt;BR /&gt;&lt;BR /&gt;-- Yes, you're right.&lt;BR /&gt;&lt;BR /&gt;2. Do I have to shift the elements of the packed matrix so that the first lement has an index 1 before I call a LAPACK routine (for example, dpptrf - Cholesky factorization)?&lt;BR /&gt;&lt;BR /&gt;-- No, you don't need to.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 16 Jul 2009 23:32:37 GMT</pubDate>
    <dc:creator>jaewonj</dc:creator>
    <dc:date>2009-07-16T23:32:37Z</dc:date>
    <item>
      <title>Calling mkl LAPACK routines from c++</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-mkl-LAPACK-routines-from-c/m-p/854256#M6803</link>
      <description>As I understand, the LAPACK routines are written in Fortran, but can be called from a c++ program. I found some general guidelines explaining the differences in how matrices are stored in Fortran vs c++. I found the following guidelines:&lt;BR /&gt;- Pass variables by address as opposed to pass by value.&lt;BR /&gt;- Store your data in Fortran style, that is, column-major rather than row-major order. &lt;BR /&gt;For example, if a two-dimensional matrix A of size m x n is stored densely in a one-dimensional array B, you can access a matrix element like this:&lt;BR /&gt;&lt;BR /&gt;A&lt;I&gt;&lt;J&gt; = B[i*n+j] in C (i=0, ... , m-1, j=0, ... , n-1)&lt;BR /&gt;&lt;BR /&gt;A(i,j) = B(j*m+i) in Fortran (i=1, ... , m, j=1, ... , n).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My questions are&lt;BR /&gt;1. If I store a symmetrical matrix in a packed format by columns, the rersulting vector should be the same in both C++ and Fortran styles. Right?&lt;BR /&gt;2. Do I have to shift the elements of the packed matrix so that the first lement has an index 1 before I call a LAPACK routine (for example, dpptrf - Cholesky factorization)?&lt;BR /&gt;Thanks.&lt;/J&gt;&lt;/I&gt;</description>
      <pubDate>Thu, 16 Jul 2009 18:01:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-mkl-LAPACK-routines-from-c/m-p/854256#M6803</guid>
      <dc:creator>gpwr9k5</dc:creator>
      <dc:date>2009-07-16T18:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calling mkl LAPACK routines from c++</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-mkl-LAPACK-routines-from-c/m-p/854257#M6804</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/435402"&gt;gpwr9k5&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;As I understand, the LAPACK routines are written in Fortran, but can be called from a c++ program. I found some general guidelines explaining the differences in how matrices are stored in Fortran vs c++. I found the following guidelines:&lt;BR /&gt;- Pass variables by address as opposed to pass by value.&lt;BR /&gt;- Store your data in Fortran style, that is, column-major rather than row-major order. &lt;BR /&gt;For example, if a two-dimensional matrix A of size m x n is stored densely in a one-dimensional array B, you can access a matrix element like this:&lt;BR /&gt;&lt;BR /&gt;A&lt;I&gt;&lt;J&gt; = B[i*n+j] in C (i=0, ... , m-1, j=0, ... , n-1)&lt;BR /&gt;&lt;BR /&gt;A(i,j) = B(j*m+i) in Fortran (i=1, ... , m, j=1, ... , n).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My questions are&lt;BR /&gt;1. If I store a symmetrical matrix in a packed format by columns, the rersulting vector should be the same in both C++ and Fortran styles. Right?&lt;BR /&gt;2. Do I have to shift the elements of the packed matrix so that the first lement has an index 1 before I call a LAPACK routine (for example, dpptrf - Cholesky factorization)?&lt;BR /&gt;Thanks.&lt;/J&gt;&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;1. If I store a symmetrical matrix in a packed format by columns, the rersulting vector should be the same in both C++ and Fortran styles. Right?&lt;BR /&gt;&lt;BR /&gt;-- Yes, you're right.&lt;BR /&gt;&lt;BR /&gt;2. Do I have to shift the elements of the packed matrix so that the first lement has an index 1 before I call a LAPACK routine (for example, dpptrf - Cholesky factorization)?&lt;BR /&gt;&lt;BR /&gt;-- No, you don't need to.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Jul 2009 23:32:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-mkl-LAPACK-routines-from-c/m-p/854257#M6804</guid>
      <dc:creator>jaewonj</dc:creator>
      <dc:date>2009-07-16T23:32:37Z</dc:date>
    </item>
  </channel>
</rss>

