Re: [eigen] Eigen Types as Parameters for Functions |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Eigen Types as Parameters for Functions*From*: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>*Date*: Thu, 26 Jan 2012 15:12:47 +0100

On 26.01.2012 14:50, Benoit Jacob wrote:

2012/1/26 Christoph Hertzberg<chtz@xxxxxxxxxxxxxxxxxxxxxxxx>:On 26.01.2012 14:33, Benoit Jacob wrote:2012/1/26 Christian Seiler<christian@xxxxxxxx>:- subclass of MatrixBase, i.e. can be used inside the function like a Matrix object - has private members containing the above-mentioned bits of information (pointer to first element, dimension, ...) - can be implicitly converetd to from any compatible MatrixBase (i..e. foo(mat) and foo(mat.block(...)) can be used directly)Just note that this is only possible for those matrix expressions whose coefficients are stored in memory with a simple enough layout that can be described in terms of strides. That is what we call a "Direct Access" matrix expression; the test is ExpressionType::Flags& DirectAccessBit.Yes, and I would say this would be the main application, if you have complicated-enough functions (i.e. where you don't really bother about evaluating expressions to a temporary if required). And more importantly, when having parameters that are actually output parameters, you are more or less stuck to direct access types anyway -- and this is a very important point, where currently const-correctness is ignored (almost) entirely.With that said, yes, we have been considering doing this, that's bug 58: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=58 If someone wants to do this and needs mentoring, I should find time to do at least that mentoring.I'd be interested at least to join the "specification committee" ;)Really, I haven't thought about this in a long time so your thoughts on this subject are probably a lot fresher than mine. From the top of my head, the starting point is to look at MapBase (which is inherited both by Map and by Block<direct access type>) and ask: how much of the templated stuff there can we replace by runtime variables (data members), and try to make all direct-access types inherit the resulting base class (in particular, Matrix should inherit it).

Christoph -- ---------------------------------------------- Dipl.-Inf. Christoph Hertzberg Cartesium 0.051 Universität Bremen Enrique-Schmidt-Straße 5 28359 Bremen Tel: (+49) 421-218-64252 ----------------------------------------------

**References**:**[eigen] Eigen Types as Parameters for Functions***From:*Christian Seiler

**Re: [eigen] Eigen Types as Parameters for Functions***From:*Benoit Jacob

**Re: [eigen] Eigen Types as Parameters for Functions***From:*Christoph Hertzberg

**Re: [eigen] Eigen Types as Parameters for Functions***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Eigen Types as Parameters for Functions** - Previous by thread:
**Re: [eigen] Eigen Types as Parameters for Functions** - Next by thread:
**Re: [eigen] Eigen Types as Parameters for Functions**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |