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

|| operator on Array doesn't exist??

Tags: None
(comma "," separated)
MMU
Registered Member
Posts
10
Karma
0
Hi,

I was going through the documentation and saw that || and && were overloaded for bool arrays http://eigen.tuxfamily.org/dox-devel/classEigen_1_1ArrayBase.html#acd1d613f08624631d4f561ee55acf7a5
However when I actually tried to use this (I have the latest version advertised 3.0.3) I get a compile error saying it actually isn't overloaded.

Code: Select all
error C2676: binary '||' : 'const Eigen::CwiseUnaryOp<UnaryOp,XprType>' does not define this operator or a conversion to a type acceptable to the predefined operator


Suffice to say this has made me quite confused...

Code that produced the above error:
Code: Select all
ArrayXXd newData(2, 14);
newData.row(0) << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14;
newData.row(1) << 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28;

cout << ((newData<0)||(newData>0)) << endl;

(I know this code makes little sense but I was using it to test the || operator).

Thank you.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you were looking at the documentation of the devel branch.
MMU
Registered Member
Posts
10
Karma
0
Weird. I never went to the dev documentation. There must be a link broken somewhere that leads you to it from the release docs....

Good to know this is coming though. I had written my own OR and AND functions to replicate this for bool arrays.


Bookmarks



Who is online

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