Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-09-17 10:16:45

"Larry Evans" <cppljevans_at_[hidden]> wrote in message
> On 09/05/2006 08:36 AM, David Abrahams wrote:
>> "Andy Little" <andy_at_[hidden]> writes:
>>>Is it possible to use fusion to do a compile time matrix?
>> Not directly, but there are at least two good ways to build one on top
>> of fusion:
>> 1. use a fusion vector of fusion vectors.
>> 2. use a fusion vector augmented with a row length (assuming it's row-major).
> Andy,
> It suddenly dawned on me that 1 above seems a pretty simple solution.
> Is there some reason for not using 1?

Well, Lets assume that you could use one infinitely long sequence. That is
slightly simpler (IMO) because it would work exactly the same for any size
matrix, iow each could have the same representation, which might be something

matrix<rows, columns, sequence>

which actually is what I am currently going for.

 I havent tried the alternative., but I suspect that the metaprogramming of it
would be more complicated.

Ultimately I suppose the interface should be separated from the implementation
and it should work for both, however I'm certainly not planning something
suitable for a boost review, just something where I can say 'look ma, it works!"
if you get my drift :-), but in fact to get a row or a column you will probably
need a fusion::View either way at some stage.

If I can get to be able to produce a cofactor matrix and the inverse then I
reckon I will have succeeded.; -)

BTW, if you look at my example in the Generic Programming
section of the vault you will see why it is advantageous to be able to have
arbitrary elements, even if they are just meant to stand in for doubles.

Also BTW my other aim is following the book I bought called "Quaternions and
Rotation sequences A primer with Applications to Orbits Aerospace and Virtual
Reality", by Jack B. Kuipers. That might give a clue that my understanding of
the subject isnt that advanced ;-)

 The ultimate aim being to make some sort of virtual reality using my Quan
library. That's the dream anyway :-)

Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at