Boost logo

Proto :

Subject: Re: [proto] Defining the result domain of a proto operator
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2011-08-26 13:01:05


Le 26/08/2011 17:44, Eric Niebler a écrit :
> On 8/26/2011 11:23 AM, Joel Falcou wrote:
>> On 26/08/2011 17:18, Eric Niebler wrote:
>>> Why can't you use a grammar to recognize patterns like these and
>>> take appropriate action?
>>
>> we do. Another point is that container based operation in our system
>> need to know the number of dimension of the container. Domains carry
>> this dimensions informations as we dont want to mix different sized
>> container in a same expression. The containers we have are :
>>
>> table which can have 1 to MAX_DIM dimesnions matrix which behave as
>> table<2> when mixed with table covector and vector that act as a
>> matrix when mixed with matrix adn table<2> with table.
>>
>> The domain are then flagged with this dimension informations.
>
> OK, then I'll just assume you guys know what you're doing ('cause you
> clearly do).

Except ... read after that

> The answer is no, but you don't need that, I don't think. Proto will
> compute the domain of m*v to be matrix. It will use matrix_domain's
> generator to post-process the new expression. That generator can do
> anything -- including placing the new expression in the vector domain.
> In short, there is no requirement that a domain's generator must produce
> expressions in that domain. Just hack matrix_domain's generator.

OK, if we can do that, in fact, we can remove the meta_informations from
the domain all together and just have table_domain and
matrix/vector/covector_domain then use a hacked geenrator to do all the
checking/recreation we need. I guess we can handle the checking on size,
gemm/gemv proper sytsem in the generator and allow m * v in matrix
grammar etc ... And this hacked generator can static_assert proper
message when uncomaptible stuff get mixed.

Again seems proto lack of some obscure feature I thought necessary makes
my problem clearer. Put this on hold then, I'll try to come up with a
better implementation of my domain handling.


Proto list run by eric at boostpro.com