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

use of the any() syntax

Tags: None
(comma "," separated)
johnm1019
Registered Member
Posts
46
Karma
0

use of the any() syntax

Fri Mar 11, 2011 2:59 pm
I'm trying to do

if( (a > b).any() )

specifically

if( (Eigen::Matrix<float, Eigen::Dynamic, 1> > float).any() )


and the compiler is complaining that no operator was found which takes those arguments.

Am I doing this wrong?

MSVC 9 SP1 Eigen devel rev 3937

JM
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: use of the any() syntax

Tue Mar 15, 2011 10:12 am
comparison operator are not directly available for matrices, you have to view your matrix as an array:

(a.array() > 2).any()


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora