![]() Registered Member ![]()
|
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?
|
![]() Moderator ![]()
|
What you need is a visitor, see http://eigen.tuxfamily.org/dox/classEig ... 19c347f7b3
|
![]() Registered Member ![]()
|
Great, thanks ggael! Is it possible for the visitor to exit once it has found its value? (Other than by throwing an exception...). |
![]() Moderator ![]()
|
ah good point, no I don't see any clean way to exit the loop.
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]