Summary: | One-index coeff accessors should static_assert on LinearAccessBit | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Eigen | Reporter: | Benoit Jacob <jacob.benoit.1> | ||||||
Component: | Core - expression templates | Assignee: | Nobody <eigen.nobody> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Unknown | CC: | chtz, gael.guennebaud, jacob.benoit.1 | ||||||
Priority: | Normal | ||||||||
Version: | unspecified | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 558 | ||||||||
Attachments: |
|
Created attachment 571 [details]
Add static assertions on linear access. Breaks lots of tests at the moment.
This flags is now handled by the evaluator, so the test should be internal::evaluator<Derived>::Flags&LinearAccessBit, but that does not seem to be sufficient. If I relax it to: bool(internal::evaluator<Derived>::Flags & LinearAccessBit) || Derived::IsVectorAtCompileTime then everything compile again meaning that some vector expressions does not have the LinearAccessBit flag... https://bitbucket.org/eigen/eigen/commits/40765154d719/ Summary: Bug 1009, part 1/2: make sure vector expressions expose LinearAccessBit flag. https://bitbucket.org/eigen/eigen/commits/1bcd78a74740/ Summary: Bug 1009, part 2/2: add static assertion on LinearAccessBit in coeff(index)-like methods. -- 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/1009. |
Created attachment 570 [details] minimal testcase coeff(Index) and coeffRef(Index), and corresponding operator()(Index) and operator[], should probably require LinearAccessBit, right? The attached testcase is how I came across this: I was mistakenly using operator()(Index) on a Block<MatrixXf>, so I was addressing coefficients outside of the block. Also attaching a patch that does this static-assertion; but I can't push it at the moment, because it seems to be breaking lots of tests, and I don't currently have time to look into them...