This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 679

Summary: Performing cwiseMax()/cwiseMin() on Map
Product: Eigen Reporter: newstzpz
Component: Core - expression templatesAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Unknown CC: chtz, gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: All   
Whiteboard:

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.
Comment 5 Nobody 2019-12-04 12:42:18 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/679.