This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 336 - POB::Map() should get a default parameter for stride
Summary: POB::Map() should get a default parameter for stride
Status: RESOLVED WONTFIX
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Low Feature Request
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-27 00:38 UTC by Dennis Schridde
Modified: 2019-12-04 11:04 UTC (History)
3 users (show)



Attachments

Description Dennis Schridde 2011-08-27 00:38:33 UTC
PlainObjectBase::Map(data,stride) and similar should get a default parameter for stride, so they can be called without specifying "stride" when the outer/inner template parameters are provided. That makes it more consistent with Map::Map().
Comment 1 Christoph Hertzberg 2017-08-02 13:02:45 UTC
This had been fixed a while ago. The following (and similar) work at least with Eigen 3.2 and later:

    double* data;
    Map<Vector3d, Unaligned, InnerStride<2> > map1(data);
    Map<VectorXd, Unaligned, InnerStride<2> > map2(data,3);
    Map<MatrixXd, Unaligned, OuterStride<10> > map3(data, 2, 2);
Comment 2 Christoph Hertzberg 2017-08-02 13:08:52 UTC
Ok, misunderstanding. I guess you meant to write things like:

   MatrixXd::Map<2,1>(data, 2,2 /* implicit Stride<2,1>() here */);

Not sure if that is really a good idea. But I'll reopen that for now.
Comment 3 Gael Guennebaud 2017-08-22 14:58:52 UTC
hm, you're supposed to call them like this:

   MatrixXd::Map(data, 2,2 Stride<2,1>() );

This is more readable, and this allows you to use shortcuts, like:

MatrixXd::Map(data, 2,2 OuterStride<2>() );
Comment 4 Gael Guennebaud 2017-08-22 15:19:59 UTC
I improved the doc with an example, this should be good enough:

https://bitbucket.org/eigen/eigen/commits/18be685e28cb/
Summary:     Bug 336: improve doc for PlainObjectBase::Map
Comment 5 Nobody 2019-12-04 11:04:39 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/336.

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