#include #include"CLHEP/Matrix/Matrix.h" #include"CLHEP/Matrix/SymMatrix.h" /* ------------------------------------------------- Test comparatif (pour SOPHYA) des matrices CLHep R. Ansari , Juin 2005 Pour compiler : definir flag/chemin include et librariries CLHep, Au CC-IN2P3 par exemple, csh> set inchep = '-I/usr/local/lhcxx/CLHEP/pro/include/' csh> set libhep = '-L/usr/local/lhcxx/CLHEP/pro/lib -lCLHEP' csh> cc -c timing.c csh> g++ -c $inchep mtxclhep.cc csh> g++ -o mtxclhep mtxclhep.o timing.o $libhep Execution : Acces aux elements et operation add/multcst csh> time ./mtxclhep 50 1000 500 Inversion / multiplication csh> time ./mtxclhep 1 1000 1000 ------------------------------------------- */ extern "C" { void InitTim(void); void PrtTim(const char *Comm); } using namespace std; int main(int narg, char* arg[]) { if (narg < 3) { cout << "\n mtxclhep - missing arguments\n" << " Usage: mtxclhep NLoop NRow NCol \n" << " if nrow==ncol ==> test inverse/mtx multiply (one time)" << endl; return 1; } int N = 10; int nrow = 2; int ncol = 2; N = atoi(arg[1]); nrow = atoi(arg[2]); ncol = atoi(arg[3]); cout << " ---- mtxclhep: NLoop=" << N << " NRow= " << nrow << " NCol= " << ncol << " ---- " << endl; InitTim(); srand48(10); //ATTENTION : L'indexage commence a 1 try { int i,j,k; HepMatrix m1(nrow, ncol); HepMatrix m2(nrow, ncol); HepMatrix m3(nrow, ncol); HepMatrix m4(nrow, ncol); HepMatrix m5(nrow, ncol); for(k=0; k