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

removing all nan/inf values from vector

Tags: None
(comma "," separated)
robstr
Registered Member
Posts
4
Karma
0
Hey,

im completely new to eigen but love it, but got some problem containing nan/inf values.
Is there a way to remove these values from a Vector ? Or a simple way do ignore these values ?

If i would do a correlation, I only want to look at samples where both! are not nan/inf, the rest should be ignored.

Hopefully this wasn't answer in the board :)

Best regards
Robstr
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You rather see how to avoid generating them in the first place. Anyway, in the devel branch, you can replace them (e.g., to 0) as follows:

VectorXd A;
A = (A.array().isfinite()).select(A,0);


Bookmarks



Who is online

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