- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Visual Studio 2008, C++, Windows 7, 64 bit.
Want to use LAPACKE_zgesv to solve systems of equations
Have calculated relevant matrices in C++ using (standard) complex
Need to convert these to MKL_Complex16 in order to use zgesv, then convert back afterwards.
Have tried a fewguesses that seemed reasonable, but no luck. The official example for zgesv just loads complex constants and does not do variable type conversions, so it doesn't help.
Help! I'm stuck once again. New user blues.
Paul Margosian
Want to use LAPACKE_zgesv to solve systems of equations
Have calculated relevant matrices in C++ using (standard) complex
Need to convert these to MKL_Complex16 in order to use zgesv, then convert back afterwards.
Have tried a fewguesses that seemed reasonable, but no luck. The official example for zgesv just loads complex constants and does not do variable type conversions, so it doesn't help.
Help! I'm stuck once again. New user blues.
Paul Margosian
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul,
Please add the following define-line in your C++ source file before including mkl.h header file
#define MKL_Complex16 complex
After that no conversion will be needed because MKL_Comlex16 typeis redefined to your complex type.
Note, that such redefinitions are to be consistent in order to get correct results after MKL routines.
Please add the following define-line in your C++ source file before including mkl.h header file
#define MKL_Complex16 complex
After that no conversion will be needed because MKL_Comlex16 typeis redefined to your complex
Note, that such redefinitions are to be consistent in order to get correct results after MKL routines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Victor,
Thanks. A very nice trick.
Unfortunately: MKL_Complex16 and complex are not enough alike for this to work (tried and had troubles).
One of many error messages revealed some details about how MKL_Complex16 is defined (a structuredefining "xxx.real" and "xxx.imag")
Just for the record, this is an example of what seems to work:
complexmyZ = (2.,3.);
MKL_Complex16 mkl_Z;
mkl_Z.real = real(myZ);
mkl_Z.imag = imag(myZ);
Did this with my input arrays (suitable loops and array formatting) for zgesv and compilation went OK.
Have not yet run this and checked outputs, so there is still a chance for additional puzzling problems.
Paul Margosian
Thanks. A very nice trick.
Unfortunately: MKL_Complex16 and complex
One of many error messages revealed some details about how MKL_Complex16 is defined (a structuredefining "xxx.real" and "xxx.imag")
Just for the record, this is an example of what seems to work:
complex
MKL_Complex16 mkl_Z;
mkl_Z.real = real(myZ);
mkl_Z.imag = imag(myZ);
Did this with my input arrays (suitable loops and array formatting) for zgesv and compilation went OK.
Have not yet run this and checked outputs, so there is still a chance for additional puzzling problems.
Paul Margosian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul,
Sorry, but I don't understand why you had problems if MKL_Complex16 was redefined.
Could you please send me small testcase to demonstrate this problem?
It will be helpful to make MKL-types more flexible and be freindlyin applications.
Sorry, but I don't understand why you had problems if MKL_Complex16 was redefined.
Could you please send me small testcase to demonstrate this problem?
It will be helpful to make MKL-types more flexible and be freindlyin applications.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page