#include "machdefs.h" #include #include #include "nbrandom.h" #include "tarrinit.h" #include "tarray.h" #include "timing.h" int main(int narg, char* arg[]) { SophyaInit(); InitTim(); // Initializing the CPU timer int n = 5; int i,j,k; if (narg > 1) n = atoi(arg[1]); try { cout << "\n -----> Testing TArray <---- " << endl; TArray ia(7,5); ia = Sequence(10., 2.); cout << " ----- matrix IA = \n " << ia << endl; // Extraction de sous tableau TArray ic = ia(Range(2,3),Range(1,2)); cout << " ----- matrix IC IA(Range(2,3),Range(1,2)) = \n " << ic << endl; ic = 0; cout << " ----- matrix IC Apres (=0) = \n " << ic << endl; cout << " ----- matrix IA Apres IC=0 = \n " << ia << endl; cout << " :::: 3 Dim arrays ::::: " << endl; TArray::SetMaxPrint(1000); TArray ib(8,7,2); ib = 5; cout << " ----- matrix IB = \n " << ib << endl; ib(Range(1,4),Range(2,3)) *= 3; cout << " -- matrix IB , Apres ib(Range(1,3),Range(2,1))*=3 : " << endl; cout << ib; } catch (PThrowable exc) { cerr << " catched Exception " << exc.Msg() << endl; } catch (...) { cerr << " catched unknown (...) exception " << endl; } cout << " --------------- END of Programme -------------- " << endl; }