Subject: Re: [boost] [qvm] few q's for emil
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-07-19 13:44:07
On Mon, Jul 18, 2011 at 11:54 PM, Jeffrey Lee Hellrung, Jr.
>> > I just ran through a quick count of the number of multiplies, and for 4x4
>> > matrices, dynamic programming will reduce the number of multiplications
>> > 40 to 28 over straightforward recursion, while for 5x5 matrices, the
>> > reduction from 205 to 75 (or so).
>> I welcome any optimization like this. Is it possible to write a
>> generic code generator for this algorithm, similarly to the other code
>> generators in libs/qvm/gen/gen.cpp?
> I think it is, but it's certainly more challenging than the straightforward
> algorithm. Lemme look at this gen.cpp to see what you do.
> I'm curious, what are you reasons for not using the preprocessor for code
> generation? Is it not possible in this case? Too much of a maintenance
> problem? Compile-time speed? Haven't tried?
Compile-time speed and readability of the generated code. I often step
through this kind of code trying to figure out what's wrong with my
matrices; the last thing I want is to have to look at preprocessor or
template meta programs. What's the downside anyway?
> Well, when you get that far, it seems you'll need to revisit your
> (documented) scalar requirements. It's possible that could be a
> precondition for review.
Reverge Studios, Inc.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk