This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 519 - AlignedBox::dim() is inconsistent with ctor-from-dim
Summary: AlignedBox::dim() is inconsistent with ctor-from-dim
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: 3.1
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-08 20:35 UTC by Jim Bosch
Modified: 2019-12-04 11:55 UTC (History)
3 users (show)



Attachments
patch to Geometry/AlignedBox.h (539 bytes, patch)
2012-10-08 20:35 UTC, Jim Bosch
no flags Details | Diff

Description Jim Bosch 2012-10-08 20:35:39 UTC
Created attachment 300 [details]
patch to Geometry/AlignedBox.h

AlignedBox::dim() subtracts one from the internal value that contains its true dimension before returning it, making the constructor and accessor disagree:

AlignBoxXd box(4);
assert(box.dim() == 4); // fails

I suspect this is just a remnant from copy/pasting the implementation class whose internal value actually was one larger than the true dimension, like an affine transform.

A patch to fix the bug is attached.
Comment 1 Gael Guennebaud 2012-10-24 10:00:06 UTC
Thank you for the fix!

https://bitbucket.org/eigen/eigen/changeset/bd1fb10be694/
changeset:   bd1fb10be694
date:        2012-10-24 09:58:35
summary:     Fix bug 519: AlignedBox::dim() was wrong for dynamic dimensions


https://bitbucket.org/eigen/eigen/changeset/7ac37305f159/
changeset:   7ac37305f159
branch:      3.1
date:        2012-10-24 09:58:35
summary:     Fix bug 519: AlignedBox::dim() was wrong for dynamic dimensions
(transplanted from bd1fb10be694f1bec3ca950a8a533234677cdaef)
Comment 2 Nobody 2019-12-04 11:55:17 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/519.

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