Bug 679 - Performing cwiseMax()/cwiseMin() on Map
Performing cwiseMax()/cwiseMin() on Map
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Core - expression templates
3.2
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-14 09:58 UTC by newstzpz
Modified: 2013-10-16 11:19 UTC (History)
3 users (show)



Attachments

Description newstzpz 2013-10-14 09:58:13 UTC
The following code snippet will not compile since cc is a mapping.

std::vector<double> value(5, 0);
Eigen::Map<Eigen::VectorXd> cc(value.data(), value.size());
auto dd = cc.cwiseMax(3);
auto ee = cc.array().cwiseMax(3);

Other functions, like cwiseInverse(), cwiseAbs() work well.
Comment 1 Christoph Hertzberg 2013-10-15 19:14:31 UTC
I fixed this in the dev-branch:
https://bitbucket.org/eigen/eigen/commits/ab2547dbf681f4248792491315f08808b2739b22
A unit case for this would actually be nice (therefore I don't close it yet).
Comment 2 Gael Guennebaud 2013-10-16 00:17:14 UTC
unit test:
https://bitbucket.org/eigen/eigen/commits/ab730abc5eae/
Changeset:   ab730abc5eae
User:        ggael
Date:        2013-10-15 23:51:01
Summary:     bug 679: add respective unit test

Both changesets have been backported to 3.2
Comment 3 Christoph Hertzberg 2013-10-16 10:00:15 UTC
The unit test still does not cover Maps or Blocks (or .transpose(), ...)
Comment 4 Gael Guennebaud 2013-10-16 11:19:04 UTC
we cannot test all operations with all possible expressions. The problem was that cwiseMin/Max worked only on Matrix or Array object. The new tests check for a more general expression that seems enough to me.

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