Documentation


array_test.cpp

#include <animal/array.h>
//#include <boost/config.h>
static const int SIZE = 3;
typedef animal::Array<SIZE,double> Vec;

double tab[SIZE];


main()
{
    using std::cout;
    using std::cin;
    using std::endl;
    Vec u;
    cout << "entrez un tableau u de dimension " << animal::size(u) << ": ";
    cin  >> u;
    cout << u << endl;
    cout << "u*2 = " << u*2 << endl;
    cout << "2*u = " << 2.*u << endl;
    cout << "-u = " << -u << endl;
    cout << "u*=2 = " << (u*=2) << endl;

    for( int i=0; i<Vec::size(); ++i )
        tab[i] = i;
    Vec v(tab);
    cout << "v= " << v << endl;
    cout << "u+=v = " << (u+=v) << endl;
    cout << "u-=v = " << (u-=v) << endl;
    cout << "u+v = " << u+v << endl;
    cout << "u-v = " << u-v << endl;
    
    // ces deux dernieres ne compilent pas sous SGI pour une raison inconnue (piment, 12/12/2001)
//  cout << "u×v = " << cross(u,v) << endl;
//  cout << "u.v = " << dot(u,v) << endl;
    //cout << "u*v = " << u*v << endl;
}

Generated on Thu Dec 23 13:52:23 2004 by doxygen 1.3.6