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

[eigen] casting real array to a segement of complex array

Tags: None
(comma "," separated)
denisfitzpatrick
Registered Member
Posts
3
Karma
0
The following:

snr1dft.segment(iminf,imaxf-iminf+1)=snr1;

where snr1dft is ArrayXcd and snr1 is ArrayXd gives

YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY

How can I make this work?

Thanks!

Denis Fitzpatrick
jitseniesen
Registered Member
Posts
204
Karma
2
As Trevor said on the mailing list,

Code: Select all
snr1dft.segment(iminf,imaxf-iminf+1)=snr1.cast<std::complex<double> >( );

should work, provided the two array lengths are the same.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]