This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 272 - Boolean operators & | !
Summary: Boolean operators & | !
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - vectorization (show other bugs)
Version: 3.0
Hardware: All All
: Normal enhancement
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 585
  Show dependency treegraph
 
Reported: 2011-05-18 12:42 UTC by Marton Danoczy
Modified: 2019-12-04 10:45 UTC (History)
5 users (show)



Attachments

Description Marton Danoczy 2011-05-18 12:42:11 UTC
Hi,

unfortunately, it is not possible to use boolean operators on boolean expressions. It would be great to allow something such as:

x = (x>0 & y>0).select(x, 0);  // or &&?

This issue can be worked around by:

x = (y>0).select((x>0).select(x, 0), 0);

but adding boolean operators would make code a lot more readable. Or maybe even faster?

(possibly blocks or is blocked by bug 97)
Comment 1 Gael Guennebaud 2013-06-10 21:17:24 UTC
This is possible since this 2 years old commit:

https://bitbucket.org/eigen/eigen/commits/46509beb6fca375b94273a2fe48474b3d0c4cef2
Comment 2 Marton Danoczy 2013-06-24 09:21:12 UTC
Sorry for the late answer, the notification was filtered out as spam.

I see, thanks. Isn't using the short-circuit operators confusing here? That's why I didn't find this functionality, since I didn't expect && to be used for something that doesn't short-circuit.
Comment 3 Nobody 2019-12-04 10:45:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/272.

Note You need to log in before you can comment on or make changes to this bug.