<?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 const correctness in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/const-correctness/m-p/884605#M9939</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I wrote a modular PDE-solver in C++ which makes heavy use of PARDISO and CRS-matrix-vector-multiplication. Everything works fine so far and PARDISO is really a great solver for a huge class of PDEs. The declaration for the multiplication-subroutine in the MKL is as follow
&lt;PRE&gt;[cpp]void mkl_dcsrgemv(char *transa, int *m, double *a, int *ia, int *ja, double *x, double *y);&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
Although nothing is affected by calling mkl_dsrgemv except *y, there are no const modifiers. A better declaration should be like
&lt;PRE&gt;[cpp]void mkl_dcsrgemv(char *transa, int *m, const double *a, const int *ia, const int *ja, const double *x, double *y);&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
This would allow better and more correct coding, since there is no need to const-cast-away modifiers or declare friend classes. Debugging or proving correctness of code could be more easier. Same for the PARDISO-Interface, of course.&lt;BR /&gt;&lt;BR /&gt;Anyway, thanks for the nice tools!&lt;BR /&gt;Fabian</description>
    <pubDate>Mon, 09 Mar 2009 15:29:05 GMT</pubDate>
    <dc:creator>Fabian_K</dc:creator>
    <dc:date>2009-03-09T15:29:05Z</dc:date>
    <item>
      <title>const correctness</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/const-correctness/m-p/884605#M9939</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I wrote a modular PDE-solver in C++ which makes heavy use of PARDISO and CRS-matrix-vector-multiplication. Everything works fine so far and PARDISO is really a great solver for a huge class of PDEs. The declaration for the multiplication-subroutine in the MKL is as follow
&lt;PRE&gt;[cpp]void mkl_dcsrgemv(char *transa, int *m, double *a, int *ia, int *ja, double *x, double *y);&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
Although nothing is affected by calling mkl_dsrgemv except *y, there are no const modifiers. A better declaration should be like
&lt;PRE&gt;[cpp]void mkl_dcsrgemv(char *transa, int *m, const double *a, const int *ia, const int *ja, const double *x, double *y);&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
This would allow better and more correct coding, since there is no need to const-cast-away modifiers or declare friend classes. Debugging or proving correctness of code could be more easier. Same for the PARDISO-Interface, of course.&lt;BR /&gt;&lt;BR /&gt;Anyway, thanks for the nice tools!&lt;BR /&gt;Fabian</description>
      <pubDate>Mon, 09 Mar 2009 15:29:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/const-correctness/m-p/884605#M9939</guid>
      <dc:creator>Fabian_K</dc:creator>
      <dc:date>2009-03-09T15:29:05Z</dc:date>
    </item>
  </channel>
</rss>

