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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 26 Jan 2012 08:50:57 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=4+B51/Zi6iC1XRWYXtxQ/enk8GcyJM58j1wulPL+Ids=; b=beWq60EMZZnrN6ZtcKDkGyzsXnFnMvwgb+L4p0n+D+u6yG9Ho+vvn+JGz6V3rpcBj/ cga3qI2+JvXu1aww4bS+ojxHZ90qUNKbFebRu+wiQc26WREXIXLuT/UsLTgt8qxXgEj0 lGDAIIqHRYz5RyVleKUdzvQpixbkc2Xj/qw1I=
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).
Benoit
>
>
> Christoph
>
>
> --
> ----------------------------------------------
> Dipl.-Inf. Christoph Hertzberg
> Cartesium 0.051
> Universität Bremen
> Enrique-Schmidt-Straße 5
> 28359 Bremen
>
> Tel: (+49) 421-218-64252
> ----------------------------------------------
>
>