This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen 3.2.0 doesn´t work in my computer

Tags: None
(comma "," separated)
yuhao
Registered Member
Posts
11
Karma
0
I am not able to compile it. It shows " cannot convert form ¨std::complex to real¨ in core module? What is the problem ?
jitseniesen
Registered Member
Posts
204
Karma
2
You need to show us the program you are trying to compile, as the error may well be in there. As far as I know, there is no type 'real' in the Eigen library.
yuhao
Registered Member
Posts
11
Karma
0
So I have included <Eigen/Core> module, then there is a GenericPacketMath.h file, in it, there is

template<> inline std::complex<float> pmul(const std::complex<float>& a, const std::complex<float>& b)
{ return std::complex<float>(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); }

template<> inline std::complex<double> pmul(const std::complex<double>& a, const std::complex<double>& b)
{ return std::complex<double>(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); }


So the compiler can't pass it, it shows " cannot covert from std::complex<double> to real" ,
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hm, you probably have a "real" type in your code (or some other header included before Eigen). What about replacing these lines by

Code: Select all
template<> inline std::complex<float> pmul(const std::complex<float>& a, const std::complex<float>& b)
{ return std::complex<float>(numext::real(a)*numext::real(b) - numext::imag(a)*numext::imag(b), numext::imag(a)*numext::real(b) + numext::real(a)*numext::imag(b)); }

template<> inline std::complex<double> pmul(const std::complex<double>& a, const std::complex<double>& b)
{ return std::complex<double>(numext::real(a)*numext::real(b) - numext::imag(a)*numext::imag(b), numext::imag(a)*numext::real(b) + numext::real(a)*numext::imag(b)); }
shubhaditya
Registered Member
Posts
1
Karma
0
Hi everyone,

I am facing a similar kind of problem like this. Has anybody solved this??. I need help with this


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]