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

How do I get the first value in an expression that is finite

Tags: None
(comma "," separated)
quantdev
Registered Member
Posts
17
Karma
0
I'm trying to write a function that returns the first value in a matrix/expression that is finite, to do this I thought I would write my own functor for the redux method, but when I look at the documentation I don't really see any information on how to use this function. Is it even possible to pass a functor with state? If not, how else would I evaluate the first finite value in an expression?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
quantdev
Registered Member
Posts
17
Karma
0
ggael wrote:What you need is a visitor, see http://eigen.tuxfamily.org/dox/classEig ... 19c347f7b3


Great, thanks ggael! Is it possible for the visitor to exit once it has found its value? (Other than by throwing an exception...).
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
ah good point, no I don't see any clean way to exit the loop.


Bookmarks



Who is online

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