Blitz logo

Blitz Support :

From: Marc Vinyes (mvinyes_at_[hidden])
Date: 2005-05-04 10:08:17


Apologies for cross-posting. I already sent a message to the list without
subscribing but now I have read more things and I have some other
questions.

http://www.oonumerics.org/MailArchives/blitz-support/2004/01/0993.php

I got the same problem:

        Array<float,2> B(2,3),C(3,1);
        B=1,2,3,4,5,6;
        cout<<B;
        C=1,2,3;
        cout<<C;
        Array<float,2> A(B*C);
        cout<<A;

        //Has as a result:
        // 2 x 3
        // [ 1 2 3
        // 4 5 6 ]
        // 3 x 1
        // [ 1
        // 2
        // 3 ]
        // 1 x 1
        // [ 1 ]

And,also, for example:

        Array<int,2> B(2,3),C(3,1);
        B=1,2,3,4,5,6;
        cout<<B;
        C=1,2,3;
        cout<<C;
        Array<int,2> A(2,1);
        A=B*C;
        cout<<A;
        //obtaining:
        //2 x 3
        //[ 1 2 3
        // 4 5 6 ]
        //3 x 1
        //[ 1
        // 2
        // 3 ]
        //2 x 1
        //[ 1
        // 4 ]

when "the result sould be intuitively":
2x1
[ 14
       32]

I understood from the first mail that the practical solution consists in
switching to the "Matrix definition" but then I lose all the power of the
blitz operators like firstIndex, pow2(A),etc... (which give me compilation
errors)

So what do you recommend me? I really need the matrix multiplication and
some operator overloading to manage easily matrix operations and translate
from my "matlab drafts" efficiently.

Maybe for my purposes, I should use other much simpler and
semi-inefficient libraries like: gMatVec
http://gama.fsv.cvut.cz/~cepek/matvec/doc/html/
or http://www.robertnz.net/nm_intro.htm... or maybe I could try to add
some tricks to the blitz code...

I'm just working in my degree's final project in
http://www.iua.upf.es/mtg/eng/, doing some audio processing and filter
training...

Thank you in advance. Congratulations for your work, blitz++ looks
promising but I didn't expect to find this kind of issues...

Marc Vinyes