Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-09-15 08:08:51


"Manfred Doudar" <manfred.doudar_at_[hidden]> wrote in message
news:20060915185102.4ab9a2af_at_mathmcn.rsise.anu.edu.au...
> On Fri, 15 Sep 2006 09:26:43 +0100
> "Andy Little" <andy_at_[hidden]> wrote:
>
>>
>> "Manfred Doudar" <manfred.doudar_at_[hidden]> wrote in message
>> news:20060915124632.096ed245_at_mathmcn.rsise.anu.edu.au...
>> > On Fri, 15 Sep 2006 03:28:39 +0100
>>
>> > ..Back to C++, kinda, yeah .. though for the inner_product (and
>> > this is where variadic template parameters would be a nice fit):
>> >
>> > fusion::inner_product<SequenceA, SequenceB, ...> { /*...*/ }
>> >
>> > (, or whatever the syntax was - forgot the exact semantics Doug
>> > Gregor implemented)
>>
>> fusion::inner_product<
>> SequenceA, SequenceB,
>> FunctionSequenceA,FunctionSequenceB
>> > { /*...*/ }
>>
>> ?
>
> No (, at least I don't see how) ... you'd expect the valid functions to
> be the operations sensible on sequences A&B both. With this in
> mind (sequences not variadics), it would be more reasonable to propose
> the following methinks:
>
> fusion::inner_product<SequenceA, SequenceB, FunctionSequence>
> { /*,,,*/ }

It occurs that I took the accumulate algorithm and particularised it for dot
product. Now you are taking dot product and generalising it back into accumulate
:-) , but I could be wrong ...

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk