New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1019 - viewAsReal() method
Summary: viewAsReal() method
Status: DECISIONNEEDED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.4 (development)
Hardware: All All
: Normal Feature Request
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1018 1712
  Show dependency treegraph
 
Reported: 2015-05-20 12:59 UTC by Christoph Hertzberg
Modified: 2019-05-10 16:54 UTC (History)
3 users (show)



Attachments

Description Christoph Hertzberg 2015-05-20 12:59:38 UTC
I propose adding a viewAsReal() method, which returns for complex-valued matrices/vectors a matrix/vector of twice the size but with pure real values. I guess doubling the size in the direction of storage order would make most sense.
For real-valued matrices this would simply return itself.

Perhaps, the inverse of that would also make sense (this has to assert that the dimension is even, of course).

Bug 1018 could efficiently be solved by that.
Comment 1 Gael Guennebaud 2015-06-05 13:03:10 UTC
I'm ok with that.

For expressions with direct access and no custom inner-stride, this can be efficiently implemented on top of MapBase.

For general expression, I'm afraid we need a new one (similar to Block).
Comment 2 Christoph Hertzberg 2016-03-22 18:15:11 UTC
A point which just came up in an IRC discussion:
For both viewAsReal() and viewAsComplex() it is often ambiguous in which direction to expand/contract -- especially when the expression uses mixed Majorness sub-expressions (e.g. A+A.transpose()).

Perhaps using viewAsReal<RowMajor>() could expand to the side and viewAsReal<ColMajor>() to the bottom.

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