Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > 6ba95eb068aab5480bfe9a9a0d0fa03c > files > 192

blitz-devel-0.9-13.fc13.x86_64.rpm

/*****************************************************************************
 * outer.cpp        Blitz++ outer product (tensor notation) example
 * $Id: outer.cpp,v 1.5 2004/10/07 01:23:26 julianc Exp $
 *****************************************************************************/

#include <blitz/array.h>

BZ_USING_NAMESPACE(blitz)

int main()
{
    Array<float,1> x(4), y(4);
    Array<float,2> A(4,4);

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

    firstIndex i;
    secondIndex j;

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

    cout << A << endl;

    return 0;
}