Blitz logo

Blitz Support :

From: melon (sweetmelon_at_[hidden])
Date: 2004-12-28 02:04:47


Dear Blitz,
    I'm a beginner of blitz. I have read some of the source code and
really love your program model. Actually, this library gives me
extremely convenience to create/operate Arrays. But I feel a little
confused about common matrix operations in 2D/3D-space. It makes these
much complicate. Such as the outer-product:

    Array<float,1> x(3), y(3);
    Array<float,2> A(3,3);

    x = 1, 2, 3;
    y = 1, 0, 0;

    firstIndex i;
    secondIndex j;

    A = x(i) * y(j);

We should alway use "firstIndex,secondIndex...". Can I calculate
inner-product like below?

A= 1,2, 3,4; //matrix
B=1,2; //vector
C=A*B //C will be 5,11.

{1 2} {1} {5}
{3 4} {2} ={11}.

or

A=1,2; //vector
B=3,4; //vector
A*B //will get 11(scalar)

Thank you. Best Regards,

Melon.