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

Octave-like find() in Eigen

Tags: None
(comma "," separated)
TC1
Registered Member
Posts
4
Karma
0
OS

Octave-like find() in Eigen

Thu Oct 20, 2011 8:25 am
Hey,

So I've been using Eigen for a while now and found my way around, but there's something I can't find, so I wanted to ask:

Is there anything like Octave's / Matlab's find() in Eigen? E.g., like this

>> A = [1 2 3 4 5]
A =
1 2 3 4 5

>> find(A >= 3)
ans =
3 4 5

>> find(A < 2)
ans = 1

It returns a vector of indexes, for which the given boolean holds true.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Octave-like find() in Eigen

Mon Oct 24, 2011 1:58 pm
We don't have that yet. We first have to support integer array as indices to make that feature useful. However, we have a (A > 3).select(E,F) mechanism which might be enough in your case?
TC1
Registered Member
Posts
4
Karma
0
OS

Re: Octave-like find() in Eigen

Fri Oct 28, 2011 11:27 am
Not exactly what I need, but I wrote some util function for my own purposes, not that important anyway.

As for the select() -- thanks, hadn't noticed that, I'm sure it'll come in handy. :)


Bookmarks



Who is online

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