<?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: Problems with Complex16 and complex matrices in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-Complex16-and-complex-matrices/m-p/948483#M15079</link>
    <description>&lt;DIV&gt;Leandro,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I just tried out these examples and they worked fine except for a couple of small matters. First of all, for some reason the examples have the line "#include ", with no file indicated. If this is replaced with "inlcude &lt;MKL.H&gt;", the line in the C++ example that declares zdotc() to be "extern "C"", can be removed, since mkl.h has all the necessary declarations in it for both C and C++.&lt;/MKL.H&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Bruce&lt;/DIV&gt;</description>
    <pubDate>Tue, 27 Jul 2004 01:47:15 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2004-07-27T01:47:15Z</dc:date>
    <item>
      <title>Problems with Complex16 and complex matrices</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-Complex16-and-complex-matrices/m-p/948482#M15078</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I'm just learning to use C++, so this question migth be very basic.&lt;/DIV&gt;
&lt;DIV&gt;I need to usesome LAPACKfunction so solve a LLS problem. As it is the simplest I tried with zgels. The main problem is that I don't know how to define matrices with complex16. The only examples I could find are the ones in:&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="http://developer.intel.com/support/performancetools/libraries/mkl/30484.htm#4" target="_blank"&gt;http://developer.intel.com/support/performancetools/libraries/mkl/30484.htm#4&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;But they doesn't work! I used to work with complex, using the standard complex library. Is there any way I could still use this? I think I just need a simple example to understand how MKL works. As I said the examples I found doesn't work for me. I put the example I'm trying (in this case just to work with complex, with doubleI made itwork):&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#008000" size="2"&gt;
&lt;P&gt;//Example 2: Calling a Complex BLAS Level 1 Function from C++&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;#include&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;#include&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;typedef&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;struct&lt;/FONT&gt;&lt;FONT size="2"&gt;{ &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt; re; &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt; im; } complex16;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;extern&lt;FONT size="2"&gt; "C" &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;void&lt;/FONT&gt;&lt;FONT size="2"&gt; zdotc (complex16*, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *, complex16 *, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *, complex16 *, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *);&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;#define&lt;FONT size="2"&gt; N 5&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;void&lt;FONT size="2"&gt; main()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;int&lt;FONT size="2"&gt; n, inca = 1, incb = 1, i;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;complex16 a&lt;N&gt;, b&lt;N&gt;, c;&lt;/N&gt;&lt;/N&gt;&lt;/P&gt;
&lt;P&gt;n = N;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;for&lt;FONT size="2"&gt;( i = 0; i &amp;lt; n; i++ ){&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;a&lt;I&gt;.re = (&lt;FONT color="#0000ff" size="2"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt;)i; a&lt;I&gt;.im = (&lt;/I&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt;)i * 2.0;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;b&lt;I&gt;.re = (&lt;FONT color="#0000ff" size="2"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt;)(n - i); b&lt;I&gt;.im = (&lt;/I&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt;)i * 2.0;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;zdotc(&amp;amp;c, &amp;amp;n, a, &amp;amp;inca, b, &amp;amp;incb );&lt;/P&gt;
&lt;P&gt;printf( "The complex dot product is: ( %6.2f, %6.2f)
", c.re, c.im );&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;ERROR MESSAGE: &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;c:Documents and SettingsAdministratorMy DocumentsVisual Studio ProjectsIntel MKL testsExample2.cpp(7): error C2733: second C linkage of overloaded function 'zdotc' not allowed&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;If I comment the line of the linkage (It made the example to work with double) I get the following erro message:&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;c:Documents and SettingsAdministratorMy DocumentsVisual Studio ProjectsIntel MKL testsExample2.cpp(22): error C2664: 'zdotc' : cannot convert parameter 1 from 'complex16 *' to 'MKL_Complex16 *'&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;Could you please give me an example that work so I can analyze it and learn how 
to use MKL with complex numbers? And just in case how to define a complex matix?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Sorry to post such a basic question, but I'm trying to learn by my own and, as most of you migth know, sometimes we need some help like this.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thank you again,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Leandro.&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Jul 2004 18:03:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-Complex16-and-complex-matrices/m-p/948482#M15078</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2004-07-15T18:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Complex16 and complex matrices</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-Complex16-and-complex-matrices/m-p/948483#M15079</link>
      <description>&lt;DIV&gt;Leandro,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I just tried out these examples and they worked fine except for a couple of small matters. First of all, for some reason the examples have the line "#include ", with no file indicated. If this is replaced with "inlcude &lt;MKL.H&gt;", the line in the C++ example that declares zdotc() to be "extern "C"", can be removed, since mkl.h has all the necessary declarations in it for both C and C++.&lt;/MKL.H&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Bruce&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Jul 2004 01:47:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-Complex16-and-complex-matrices/m-p/948483#M15079</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2004-07-27T01:47:15Z</dc:date>
    </item>
  </channel>
</rss>

