Index: branches/Reza/Eval/JET/cmds.list
===================================================================
--- branches/Reza/Eval/JET/cmds.list	(revision 2362)
+++ branches/Reza/Eval/JET/cmds.list	(revision 2362)
@@ -0,0 +1,5 @@
+rm tjet.o tjet ; make DBGFLAG='-fast -arch host' OPTFLAG='-fast' tjet
+cc -c ftim.c
+f77 -o fmtx -O3 fmtx.f ftim.o -lcxml -lm
+f90 -o fmtx -fast -arch host fmtx.f ftim.o -lcxml -lm
+
Index: branches/Reza/Eval/JET/fmtx.f
===================================================================
--- branches/Reza/Eval/JET/fmtx.f	(revision 2362)
+++ branches/Reza/Eval/JET/fmtx.f	(revision 2362)
@@ -0,0 +1,115 @@
+      PROGRAM MAIN
+      IMPLICIT NONE
+C      PARAMETER M = 50000
+      DOUBLE PRECISION MX1(1000,500), MX2(1000,500), MX3(1000,500)
+      DOUBLE PRECISION MX4(1000,500), MX5(1000,500)
+      INTEGER I,J,K,NTIME,TYP
+      DOUBLE PRECISION X,Y,Z,C1,C2,C3
+
+      CALL FInitTim()   
+      NTIME = 50 
+      TYP = 3
+      PRINT *,' Remplissage MX1 MX2 (1000x500) - NTimes=', NTIME
+      DO K=1,NTIME
+        X = FLOAT(K)*0.00314
+        Y = SIN(X)
+        CALL FILLMTX(K,X,Y,MX1,MX2,MX3)
+      ENDDO
+
+      PRINT *, 'FIN Remplissage ' 
+      CALL FPrtTim(1)
+
+      DO K=1,NTIME
+        C1 = K*0.035
+        C2 = COS(C1)+0.04
+        C3 = SIN(C1*5.)
+        CALL OPERMTX(K, MX1, MX2, MX5, C1, C2, C3)
+      ENDDO
+      PRINT *, 'FIN  MX5 = C1*MX1 + MX1 * MX2*C2 + MX2C3 ' 
+      CALL FPrtTim(2)
+
+      DO K=1,NTIME
+        C1 = K*0.055
+        C2 = COS(C1*1.6)+0.023
+        C3 = SIN(C1*2.5)
+        CALL OPADDMTX(K, MX1, MX2, MX3, MX5, C1, C2, C3)
+      ENDDO
+      PRINT *, 'FIN  MX5 = C1*MX1 + C2*MX2 + C3*MX3 ' 
+      CALL FPrtTim(3)
+
+      DO K=1,NTIME
+        C1 = K*0.055
+        C2 = COS(C1*1.6)+0.023
+        C3 = SIN(C1*2.5)
+        CALL MTXBLAS(K, MX1, MX2, MX3, MX4, MX5, C1, C2, C3)
+      ENDDO
+      PRINT *, 'FIN  MTXBLAS MX5 = C1*MX1 + C2*MX2 + C3*MX3 ' 
+      CALL FPrtTim(4)
+
+      PRINT *, ' ------ FIN programme ---------- ' 
+      END
+
+      SUBROUTINE FILLMTX(K, X,Y, MX1, MX2, MX3)
+      DOUBLE PRECISION X,Y
+      DOUBLE PRECISION MX1(1000,500), MX2(1000,500), MX3(1000,500)
+      INTEGER I,J,K
+      DO I=1,1000
+         DO J=1,500
+            MX1(I,J) = K*300.+10.*I+J+X
+            MX2(I,J) = K*550.+20.*I+2.*J+Y
+            MX3(I,J) = K*860.+40.*I+7.*J+Y*3.14
+         ENDDO
+      ENDDO
+      IF (K.EQ.5) PRINT *, 'FILLMTX - 5 -> ', MX1(12,14) 
+      IF (K.EQ.15) PRINT *, 'FILLMTX - 15 -> ', MX2(12,15) 
+
+      RETURN
+      END
+
+      SUBROUTINE OPERMTX(K, MX1, MX2, MX5, C1, C2, C3)
+      INTEGER I,J,K
+      DOUBLE PRECISION MX1(1000,500), MX2(1000,500)
+      DOUBLE PRECISION MX5(1000,500)
+      DOUBLE PRECISION C1,C2,C3
+      DO I=1,1000
+         DO J=1,500
+            MX5(I,J) = C1*MX1(I,J)+MX1(I,J)*(MX2(I,J)*C2)+MX2(I,J)*C3
+         ENDDO
+      ENDDO
+      IF (K.EQ.5) PRINT *, 'OPERMTX - 5 -> ', MX5(20,5)
+      IF (K.EQ.15) PRINT *, 'OPEEMTX - 15 -> ', MX5(20,15)
+      RETURN
+      END
+
+      SUBROUTINE OPADDMTX(K, MX1, MX2, MX3, MX5, C1, C2, C3)
+      INTEGER I,J,K
+      DOUBLE PRECISION MX1(1000,500), MX2(1000,500)
+      DOUBLE PRECISION MX3(1000,500), MX5(1000,500)
+      DOUBLE PRECISION C1,C2,C3
+      DO I=1,1000
+         DO J=1,500
+            MX5(I,J) = C1*MX1(I,J)+C2*MX2(I,J)+MX3(I,J)*C3
+         ENDDO
+      ENDDO
+      IF (K.EQ.5) PRINT *, 'OPADDMTX - 5 -> ', MX5(20,5)
+      IF (K.EQ.15) PRINT *, 'OPADDMTX - 15 -> ', MX5(20,15)
+
+      RETURN
+      END
+
+      SUBROUTINE MTXBLAS(K, MX1, MX2, MX3, MX4, MX5, C1, C2, C3)
+      INTEGER I,J,K,NTOT
+      DOUBLE PRECISION MX1(1000,500), MX2(1000,500)
+      DOUBLE PRECISION MX5(1000,500)
+      DOUBLE PRECISION C1,C2,C3
+      NTOT = 1000*500
+      CALL DVCAL(NTOT, C1, MX1, 1, MX5, 1)
+      CALL DZAXPY(NTOT, C2, MX2, 1, MX5, 1, MX4, 1)
+      CALL DZAXPY(NTOT, C3, MX3, 1, MX4, 1, MX5, 1)
+      IF (K.EQ.5) PRINT *, 'MTXBLAS - 5 -> ', MX5(20,5),
+     + ' NTot=' , NTOT
+      IF (K.EQ.15) PRINT *, 'MTXBLAS - 15 -> ', MX5(20,15), 
+     + ' NTot=' , NTOT
+      RETURN
+      END
+
Index: branches/Reza/Eval/JET/ftim.c
===================================================================
--- branches/Reza/Eval/JET/ftim.c	(revision 2362)
+++ branches/Reza/Eval/JET/ftim.c	(revision 2362)
@@ -0,0 +1,53 @@
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+
+static clock_t CPUT0, CPUT;
+static time_t ELT0, ELT;
+ 
+ 
+/* Nouvelle-Fonction */
+/*!
+   \ingroup SysTools
+   Initializes CPU and elapsed time timer (C function).
+   The values of the CPU and elapsed time can then be printed 
+   using \b PrtTim() 
+*/
+void finittim_(void)
+{
+CPUT0 = CPUT = clock();
+ELT0 = ELT = time(NULL);
+return;
+}
+ 
+/* Nouvelle-Fonction */
+/*!
+   \ingroup SysTools
+   Prints the values of the CPU and elapsed time, since call to \b InitTim().
+*/
+void fprttim_(int * num)
+{
+float tcal,tcalt;
+clock_t cput;
+time_t elt;
+int etm,etmt;
+ 
+elt = time(NULL);  cput = clock();
+tcalt = ( (float)(cput) - (float)(CPUT0) ) / (float)(CLOCKS_PER_SEC);
+tcal = ( (float)(cput) - (float)(CPUT) ) / (float)(CLOCKS_PER_SEC);
+etm = elt - ELT;
+etmt = elt - ELT0;
+printf("FPrtTim[%d] CPUTime: Total= %g  (Partial= %g) Sec. \n",
+       *num, tcalt, tcal);
+printf("ElapsedTime(hh:mm:ss): Total= %02d:%02d:%02d ",
+       etmt/3600, (etmt%3600)/60, etmt%60);
+printf(" (Partial= %02d:%02d:%02d)\n",
+       etm/3600, (etm%3600)/60, etm%60);
+ 
+ELT = elt;
+CPUT = cput;
+return;
+}
Index: branches/Reza/Eval/JET/jet.h
===================================================================
--- branches/Reza/Eval/JET/jet.h	(revision 2362)
+++ branches/Reza/Eval/JET/jet.h	(revision 2362)
@@ -0,0 +1,177 @@
+#ifndef JET_H_SEEN
+#define JET_H_SEEN
+
+#include "machdefs.h"
+
+//========================================================
+//   Test d'expression template sur tableaux 
+//       Reza - Avril 2003
+//========================================================
+
+// ---------------------------------------------------
+// -------- Classe Taille objet Matrice --------------
+// ---------------------------------------------------
+class MtxSize {
+public:
+  MtxSize() : nrow_(0), ncol_(0) { }
+  MtxSize(MtxSize const & a) : nrow_(a.nrow_), ncol_(a.ncol_) { }
+  MtxSize(sa_size_t nr, sa_size_t nc) { nrow_ = nr;  ncol_ = nc; } 
+  ~MtxSize() {};
+  void ReSize(const MtxSize  & a) { nrow_ = a.nrow_;  ncol_ = a.ncol_; } 
+  bool CompareSize(const MtxSize & a) const ;
+protected:
+  sa_size_t nrow_, ncol_;
+};
+
+
+class JETEvaluator {
+public:
+  JETEvaluator() {}
+  //  virtual ~JETEvaluator() {}
+  virtual void EvaluateAll(AnyDataObj& dest) const = 0;
+  /*
+  { throw PError("JETEvaluator::EvaluateAll(AnyDataObj &) Unsupported operation"); }
+  virtual void EvaluateAll(NDataBlock<T> & dest) const 
+  { throw PError("JETEvaluator::EvaluateAll( &) Unsupported operation"); }
+  */
+};
+
+// -------- Classe generique d'expression  --------------
+
+template <class T, class E>
+class JETExpression : public JETEvaluator {
+public:
+  JETExpression() : e_() { }
+  JETExpression(E const & e) : e_(e) { }
+  JETExpression( JETExpression<T, E> const & e) : e_(e.e_) { } 
+  inline T EvaluateAndStep() const { return e_.EvaluateAndStep(); }
+  inline MtxSize const & RefSize()  const { return e_.RefSize(); }
+  inline void Reset() const { e_.Reset(); } 
+  virtual void EvaluateAll(AnyDataObj& dest)  const;
+  inline E & Expression() { return e_; }
+protected:
+  E e_;
+};
+
+// -------- Classe Expression+Constante  --------------
+
+template <class T, class E>
+class JETExprAddConst  {
+public:
+  JETExprAddConst(E e, T c) :  e_(e) , c_(c)  
+  {   }
+  JETExprAddConst(JETExprAddConst<T, E> const & a) : e_(a.e_), c_(a.c_) { } 
+
+  inline T EvaluateAndStep() const { return (e_.EvaluateAndStep()+c_); }
+  MtxSize const & RefSize() const { return e_.RefSize() ; }
+  inline void Reset() const { e_.Reset();  }
+
+protected:
+  E e_;
+  T c_;
+};
+
+// -------- Classe Expression*Constante  --------------
+
+template <class T, class E>
+class JETExprMulConst  {
+public:
+  JETExprMulConst(E e, T c) :  e_(e) , c_(c)  
+  {   }
+  JETExprMulConst(JETExprMulConst<T, E> const & a) : e_(a.e_), c_(a.c_) { } 
+
+  inline T EvaluateAndStep() const { return (e_.EvaluateAndStep()*c_); }
+  MtxSize const & RefSize() const { return e_.RefSize() ; }
+  inline void Reset() const { e_.Reset();  }
+
+protected:
+  E e_;
+  T c_;
+};
+
+
+
+// -------- Classe Expression+Expression  --------------
+template <class T, class E1, class E2>
+class JETExprAdd {
+public:
+  JETExprAdd(E1 e1, E2 e2) :
+    e1_(e1) , e2_(e2)
+  { 
+    if (! e1.RefSize().CompareSize(e2.RefSize()) ) 
+      throw SzMismatchError("JETExprAdd() Unequal matrix size");
+  }
+  JETExprAdd(JETExprAdd<T, E1, E2> const & a) : e1_(a.e1_), e2_(a.e2_) { }
+
+  inline T EvaluateAndStep() const { return (e1_.EvaluateAndStep() + e2_.EvaluateAndStep()); }
+  virtual MtxSize const & RefSize() const { return e1_.RefSize() ; }
+  inline void Reset() const { e1_.Reset(); e2_.Reset(); }
+protected:
+  E1 e1_;
+  E2 e2_;
+};
+
+// -------- Classe Expression*Expression  --------------
+template <class T, class E1, class E2>
+class JETExprMult {
+public:
+  JETExprMult(E1 e1, E2 e2) :
+    e1_(e1) , e2_(e2)
+  { 
+    if (! e1.RefSize().CompareSize(e2.RefSize()) ) 
+      throw SzMismatchError("JETExprAdd() Unequal matrix size");
+  }
+  JETExprMult(JETExprMult<T, E1, E2> const & a) : e1_(a.e1_), e2_(a.e2_) { }
+
+  inline T EvaluateAndStep() const { return (e1_.EvaluateAndStep() * e2_.EvaluateAndStep()); }
+  virtual MtxSize const & RefSize() const { return e1_.RefSize() ; }
+  inline void Reset() const { e1_.Reset(); e2_.Reset(); }
+protected:
+  E1 e1_;
+  E2 e2_;
+};
+
+
+
+//----- Definition operateur Expression + Cste
+template <class T, class E> 
+JETExpression< T, JETExprAddConst<T,E> > operator + 
+  (JETExpression<T,E> e, T c) 
+  { return  JETExpression< T, JETExprAddConst<T,E> > 
+  (JETExprAddConst<T,E>(e.Expression(), c) ); }
+
+template <class T, class E> 
+JETExpression< T, JETExprAddConst<T,E> > operator + 
+  (T c, JETExpression<T,E> e) 
+  { return  JETExpression< T, JETExprAddConst<T,E> > 
+  (JETExprAddConst<T,E>(e.Expression(), c) ); }
+
+//----- Definition operateur Expression * Cste
+template <class T, class E> 
+JETExpression< T, JETExprMulConst<T,E> > operator * 
+  (JETExpression<T,E> e, T c) 
+  { return  JETExpression< T, JETExprMulConst<T,E> > 
+  (JETExprMulConst<T,E>(e.Expression(), c) ); }
+
+template <class T, class E> 
+JETExpression< T, JETExprMulConst<T,E> > operator * 
+  (T c, JETExpression<T,E> e) 
+  { return  JETExpression< T, JETExprMulConst<T,E> > 
+  (JETExprMulConst<T,E>(e.Expression(), c) ); }
+
+//----- Definition operateur Expression + Expression
+template <class T, class E1, class E2> 
+JETExpression< T, JETExprAdd<T,E1, E2> > operator + 
+  (JETExpression<T,E1> e1, JETExpression<T,E2> e2) 
+  { return  JETExpression< T, JETExprAdd<T, E1, E2> > 
+  (JETExprAdd<T,E1,E2>(e1.Expression(), e2.Expression()) ); }
+
+//----- Definition operateur Expression * Expression
+template <class T, class E1, class E2> 
+JETExpression< T, JETExprMult<T,E1, E2> > operator * 
+  (JETExpression<T,E1> e1, JETExpression<T,E2> e2) 
+  { return  JETExpression< T, JETExprMult<T, E1, E2> > 
+  (JETExprMult<T,E1,E2>(e1.Expression(), e2.Expression()) ); }
+
+#endif
+
Index: branches/Reza/Eval/JET/makefile
===================================================================
--- branches/Reza/Eval/JET/makefile	(revision 2362)
+++ branches/Reza/Eval/JET/makefile	(revision 2362)
@@ -0,0 +1,53 @@
+#  ------------------ SOPHYA -------------------------
+#    Makefile fot compiling and linking a simple C++ 
+#         program with SOPHYA class library 
+#  ---------------------------------------------------
+#  GNU make program should be used with this makefile
+#  ---------------------------------------------------
+#  Usage: make prog_name
+#     - compiles prog_name.cc -> prog_name.o 
+#     - links prog_name.o -> prog_name 
+
+#   SOPHYA compilation rules - OPTFLAG and DBGFLAG 
+# can be used to define Debug and optimization flags
+# Additional options can be specified using USERFLAGS
+# USERFLAGS := -I/.../myincludes 
+
+include $(DPCBASEREP)/Include/MakefileUser.h
+
+
+# ----- List of SOPHYA libraries 
+ifdef NOSHLIB
+LIBF =  $(LIB)libLinAlg.a $(LIB)libIFFTW.a $(LIB)libFitsIOServer.a $(LIB)libSamba.a $(LIB)libSkyMap.a $(LIB)libSkyT.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libTArray.a $(LIB)libSysTools.a
+LIBS = -L$(LIB) -lLinAlg -lIFFTW -lFitsIOServer -lSamba -lSkyMap -lSkyT -lNTools -lHiStats -lTArray -lSysTools -lm
+ifeq ($(CXX),cxx)
+# librairie des instances de templates cxx
+LIBS := $(LIBS) -lsotcxx
+endif
+else
+LIBF =  $(SLB)libsophya.so $(SLB)libextsophya.so
+LIBS = -L$(SLB) -lextsophya -lsophya  -lm
+endif
+
+LDLIBS := $(LIBS) $(LDLIBS) 
+
+%:%.cc
+%:%.o
+%.o:%.cc
+%.o:%.c
+%:%.c
+
+.PRECIOUS: % %.o
+
+
+#  --- Compilation and linking rules
+%:%.o
+	$(LINK.cc)  -o $@ $< $(LIBS)
+
+%.o:%.cc
+	$(COMPILE.cc)   $(USERFLAGS) -o $@ $<
+
+%:%.c
+	$(LINK.c)  $(USERFLAGS) -o $@ $< $(LIBS) 
+
+
Index: branches/Reza/Eval/JET/smtx.cc
===================================================================
--- branches/Reza/Eval/JET/smtx.cc	(revision 2362)
+++ branches/Reza/Eval/JET/smtx.cc	(revision 2362)
@@ -0,0 +1,154 @@
+#include "machdefs.h"
+
+#include <math.h>
+
+#include "smtx.h"
+
+//--------------------------------------------------------
+//   Test d'expression template sur tableaux 
+//       Reza - Avril 2003
+//--------------------------------------------------------
+
+// ---------------------------------------------------
+// -------- Classe Taille objet Matrice --------------
+// ---------------------------------------------------
+
+
+bool MtxSize::CompareSize(const MtxSize & a) const
+{
+  if ((a.nrow_ == 0) || (a.ncol_ == 0) )
+    throw RangeCheckError("MtxSize::CompareSize(mx) Size(mx) = 0");
+  if ((nrow_ == a.nrow_) && (ncol_ == a.ncol_))  return true;
+  else return false;
+}
+
+// ---------------------------------------------------
+// ------------- Classe de matrice -------------------
+// ---------------------------------------------------
+
+template <class T>
+SimpleMatrix<T>::SimpleMatrix()
+  : MtxSize(), JETExpression<T, JETExpMtx<T> >(), dbv_(&data_, this) 
+{
+  Expression().JETExpMtxSet(&data_, this);
+}
+
+template <class T>
+SimpleMatrix<T>::SimpleMatrix(sa_size_t nr, sa_size_t nc)
+  : MtxSize(nr, nc), JETExpression<T, JETExpMtx<T> >(), data_(nr*nc), dbv_(&data_, this)
+{
+  Expression().JETExpMtxSet(&data_, this);
+}
+
+template <class T>
+SimpleMatrix<T>::SimpleMatrix(const SimpleMatrix & m)
+  : MtxSize(m), JETExpression<T, JETExpMtx<T> >(), data_(m.data_), dbv_(&data_, this)
+{
+  Expression().JETExpMtxSet(&data_, this);
+}
+
+template <class T>
+SimpleMatrix<T>::SimpleMatrix(const SimpleMatrix & m, bool share)
+  : MtxSize(m), JETExpression<T, JETExpMtx<T> >(dbv_), data_(m.data_, share), dbv_(&data_, this)
+{
+}
+
+template <class T>
+SimpleMatrix<T>::~SimpleMatrix()
+{
+}
+
+
+template <class T>
+void SimpleMatrix<T>::ReSize(const MtxSize & a)
+{
+  if (CompareSize(a)) return;
+  if (this == &a) return;
+  MtxSize::ReSize(a);
+  data_.Realloc(nrow_*ncol_);
+  return;
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::Set(const SimpleMatrix & b)
+{
+  if (this == &b) return(*this);
+  if ((b.nrow_ == 0) || (b.ncol_ == 0) )
+    throw RangeCheckError("SimpleMatrix::Set() Size(b) = 0");
+  if (nrow_ == 0) {
+    nrow_ = b.nrow_; ncol_ = b.ncol_; 
+  }
+  else if ((nrow_ > 0) && ((nrow_ != b.nrow_) || (ncol_ != b.ncol_)) )
+    throw(SzMismatchError("SimpleMatrix::Set() Size(a) != Size(b)"));
+  data_ = b.data_;
+  return(*this);
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::Init(T c)
+{
+  if ((nrow_ == 0) || (ncol_ == 0))
+    throw RangeCheckError("SimpleMatrix<T>::Init(T c) Size=0");
+  data_ = c;
+  return(*this);
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::Init(T c, T step)
+{
+  if ((nrow_ == 0) || (ncol_ == 0))
+    throw RangeCheckError("SimpleMatrix<T>::Init(T c. T s) Size=0");
+  for(sa_size_t k=0; k<nrow_*ncol_; k++) {
+    data_(k) = c; c += step;
+  }
+  return(*this);
+}
+
+template <class T>
+void SimpleMatrix<T>::Print(ostream& os) const
+{
+  os << " SimpleMatrix<T>(nr=" << nrow_ << ",nc=" << ncol_ << ")" << endl;
+  for(sa_size_t r=0; r<nrow_; r++) {
+    for(sa_size_t c=0; c<ncol_; c++) 
+      os << (*this)(r,c) << " , " ;
+    os << endl;
+  } 
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::AddCst(T c)
+{
+  if ((nrow_ == 0) || (ncol_ == 0))
+    throw RangeCheckError("SimpleMatrix<T>::AddCst() Size=0");
+  data_ += c;
+  return(*this);
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::MulCst(T c)
+{
+  if ((nrow_ == 0) || (ncol_ == 0))
+    throw RangeCheckError("SimpleMatrix<T>::MulCst() Size=0");
+  data_ *= c;
+  return(*this);
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::AddElt(const SimpleMatrix & b)
+{
+  if (! CompareSize(b) ) 
+    throw(SzMismatchError("SimpleMatrix::AddElt() Size(a) != Size(b)"));
+  data_ += b.data_;
+  return(*this);
+}
+
+template <class T>
+SimpleMatrix<T>& SimpleMatrix<T>::MulElt(const SimpleMatrix & b)
+{
+  if (! CompareSize(b) ) 
+    throw(SzMismatchError("SimpleMatrix::MulElt() Size(a) != Size(b)"));
+  data_ *= b.data_;
+  return(*this);
+}
+
+  
Index: branches/Reza/Eval/JET/smtx.h
===================================================================
--- branches/Reza/Eval/JET/smtx.h	(revision 2362)
+++ branches/Reza/Eval/JET/smtx.h	(revision 2362)
@@ -0,0 +1,134 @@
+#ifndef SMTX_H_SEEN 
+#define SMTX_H_SEEN 
+
+#include "machdefs.h"
+#include <iostream>
+
+#include "ndatablock.h"
+#include "ctimer.h"
+#include "timing.h"
+
+#include "jet.h"
+
+
+//========================================================
+//   Test d'expression template sur tableaux 
+//       Reza - Avril 2003
+//========================================================
+
+
+// ---------------------------------------------------
+//------- Expression/iterateur sur matrice -----------
+// ---------------------------------------------------
+template <class T>
+class JETExpMtx {
+public:
+  JETExpMtx() : db_(NULL), msz_(NULL), pd_(NULL) { } 
+  //cout << " DBG-AA" << hex << db_ << " - " << msz_ << dec << endl;}
+  JETExpMtx(NDataBlock<T>   * db, MtxSize const * msz) : 
+    db_(db), msz_(msz), pd_(NULL) { } 
+  // cout << " DBG-BBB" << hex << db_ << " - " << msz_ << dec << endl; }
+  JETExpMtx(JETExpMtx const & a) : db_(a.db_), msz_(a.msz_), pd_(a.pd_) { } 
+  // cout << " DBG-CCC" << hex << db_ << " - " << msz_ << dec << endl;}
+  inline T EvaluateAndStep() const { return (*pd_++); }
+  inline void Reset() const { pd_ = db_->Begin(); } 
+  //{ if (db_ == NULL) cout << " AAA-BUG db_" << endl;
+  //pd_ = db_->Begin(); if (pd_ == NULL) cout << " BBB-BUG db_" << endl;} 
+  inline MtxSize const & RefSize()  const { return *msz_; } 
+  // if (msz_ == NULL) cout << " BUG msz_ " << endl; return *msz_; }
+  void JETExpMtxSet(NDataBlock<T> * db, MtxSize const * msz)
+  { db_ = db; msz_ = msz; pd_ = NULL; }
+protected:
+  NDataBlock<T> * db_;
+  MtxSize const * msz_;
+  mutable T * pd_;
+};
+
+
+// ---------------------------------------------------
+// ------------- Classe de matrice -------------------
+// ---------------------------------------------------
+
+template <class T>
+class SimpleMatrix : public AnyDataObj, public MtxSize, 
+		     public JETExpression<T, JETExpMtx<T> > {
+public:
+		SimpleMatrix();
+		SimpleMatrix(sa_size_t nr, sa_size_t nc);
+		SimpleMatrix(const SimpleMatrix<T> & m);
+		SimpleMatrix(const SimpleMatrix<T> & m, bool share);
+  virtual       ~SimpleMatrix();
+
+  virtual void ReSize(const MtxSize & a);
+  
+  virtual SimpleMatrix<T>& Set(const SimpleMatrix<T> & a);
+
+  inline  SimpleMatrix<T>& Set(JETEvaluator const &  exp)  
+  {  exp.EvaluateAll(*this);  return(*this); }
+
+  virtual SimpleMatrix<T>& Init(T c);
+  virtual SimpleMatrix<T>& Init(T c, T step);
+
+  inline SimpleMatrix<T>& operator = (const SimpleMatrix<T> & a)
+  { return Set(a); }
+  inline SimpleMatrix<T>& operator = (JETEvaluator const & a)
+  { return Set(a); }
+  inline SimpleMatrix<T>& operator = (T c)
+  { return Init(c); }
+ 
+  inline T operator()(int r, int c) const 
+                { return data_(r*ncol_+c); }
+  inline T& operator()(int r, int c) 
+                { return data_(r*ncol_+c); }
+
+  inline sa_size_t NRows() const {return nrow_; }
+  inline sa_size_t NCols() const {return ncol_; }
+  inline sa_size_t Size() const {return nrow_*ncol_; }
+
+  virtual void Print(ostream& os) const;
+
+  inline NDataBlock<T> const & DataBlock() const { return data_; }
+  inline NDataBlock<T>& DataBlock() { return data_; }
+
+  SimpleMatrix<T>& AddCst(T c);
+  SimpleMatrix<T>& MulCst(T c);
+
+  SimpleMatrix<T>& AddElt(const SimpleMatrix<T> & b);
+  SimpleMatrix<T>& MulElt(const SimpleMatrix<T> & b);
+
+  inline SimpleMatrix<T>& operator += (T c) 
+  { return AddCst(c); }
+  inline SimpleMatrix<T>& operator *= (T c) 
+  { return MulCst(c); }
+  inline SimpleMatrix<T>& operator += (const SimpleMatrix<T> & b)
+  { return AddElt(b); }
+  inline SimpleMatrix<T>& operator *= (const SimpleMatrix<T> & b)
+  { return MulElt(b); }
+
+protected:
+  NDataBlock<T> data_;
+  JETExpMtx<T> dbv_;
+};
+
+
+template <class T>
+inline ostream& operator << (ostream& os, const SimpleMatrix<T> & m)
+{ m.Print(os); return(os); }
+
+// -------------------------------------------------------------
+template <class T, class E>
+void JETExpression<T,E>::EvaluateAll(AnyDataObj& dest) const
+  {
+    //  cout << " JETExpression<T,E>::EvaluateAll(AnyDataObj& dest) " << endl;
+    SimpleMatrix<T>* dmx = dynamic_cast<SimpleMatrix<T> *>(&dest);
+    if (dmx == NULL) throw ParmError("SMExprMult<T>::EvaluateAll() - dest not a SimpleMatrix");
+    //  cout << " --- Doing Reset() " << endl;
+    e_.Reset();
+    //  cout << " --- Reset() OK " << endl;
+    dmx->ReSize(e_.RefSize());
+    //  cout << " --- Resize OK " << endl;
+    for(sa_size_t k=0; k<dmx->Size(); k++) dmx->DataBlock()(k) = e_.EvaluateAndStep();
+  }
+
+
+#endif
Index: branches/Reza/Eval/JET/tjet.cc
===================================================================
--- branches/Reza/Eval/JET/tjet.cc	(revision 2362)
+++ branches/Reza/Eval/JET/tjet.cc	(revision 2362)
@@ -0,0 +1,143 @@
+#include "machdefs.h"
+
+#include <math.h>
+#include <iostream>
+#include <fstream>
+
+#include "tarrinit.h"
+#include "array.h"
+
+#include "pexceptions.h"
+#include "srandgen.h"
+
+#include "sophyainit.h"
+#include "ctimer.h"
+#include "timing.h"
+
+#include "smtx.h"
+
+//--------------------------------------------------------
+//   Test d'expression template sur tableaux 
+//       Reza - Avril 2003
+//--------------------------------------------------------
+
+//-------  Le code de smtx.cc
+
+#include "smtx.cc"
+
+//-------
+// ------------------------------------------------
+//   programme de test template expressions 
+// ------------------------------------------------
+
+int main(int narg, char* arg[])
+{
+
+  SophyaInit();
+  InitTim();   // Initializing the CPU timer
+
+  if (narg < 3) {
+    cout << "\n te/ TemplateExpression Test - missing arguments\n" 
+	 << "     Usage: te NLoop NRow NCol \n"  << 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 << " te/ TemplateExpression Test - NLoop = " << N 
+       << "  NRow=" << nrow << " NCol= " << ncol 
+       << "  Size=nr*nc= " << nrow*ncol << endl;
+
+  try {
+    cout << " ---- Verification operation ------ " << endl;
+    SimpleMatrix<int_4> mx1(4,6);
+    mx1 = 3;
+    mx1 *= 2;
+    cout << " mx1=3; mx1*=2; : " << endl;
+    cout << mx1 << endl;
+    SimpleMatrix<int_4> mx2(4,6);
+    mx2.Init(1,1);
+    SimpleMatrix<int_4> mx3(4,6), mx4;
+    mx3.Init(1000,100);
+    mx4 = mx3+mx2*2 ;
+    cout << " mx2, mx3, mx4=mx3+2mx2 " << endl;
+    cout << mx2 << endl << mx3 << endl << mx4 << endl;
+
+    int i,j,k;
+    SimpleMatrix<r_8> m1(nrow, ncol);
+    SimpleMatrix<r_8> m2(nrow, ncol);
+    SimpleMatrix<r_8> m3(nrow, ncol);
+    SimpleMatrix<r_8> m4(nrow, ncol);
+    SimpleMatrix<r_8> m5(nrow, ncol);
+    for(k=0; k<N; k++) {
+      double xxr = frand01();
+      double yyr = 2.*frand01();
+      for(i=0; i<nrow; i++)
+	for(j=0; j<ncol; j++) {
+	  m1(i,j) = k*300+10.*i+j+xxr;	
+	  m2(i,j) = k*550+20.*i+2.*j+yyr;
+	  m3(i,j) = k*860.+40.*i+7.*j+yyr*3.14;
+	}
+    }
+    PrtTim(" (1) Element access done ---");
+    // Calcul m1*c1 + m2*c2 + m3*c3;
+    for(k=0; k<N; k++) {
+      double c1 = frand01() + 1.2;
+      double c2 = frand01() + 3.5;
+      double c3 = frand01() + 6.7;
+      m5 = m1;  m5.MulCst(c1); 
+      m4 = m2;  m4.MulCst(c2);
+      m5.AddElt(m4);
+      m4 = m3;  m3.MulCst(c2);
+      m5.AddElt(m4);
+    }
+    PrtTim(" (2) Add/MulElt/Cst m1*c1 + m2*c2 + m3*c3 done ---");
+
+    for(k=0; k<N; k++) {
+      double c1 = frand01() + 1.2;
+      double c2 = frand01() + 3.5;
+      double c3 = frand01() + 6.7;
+      m5 = m1*c1+m2*c2+m3*c3;
+    }
+    PrtTim(" (3) JET: m1*c1 + m2*c2 + m3*c3 done ---");
+    // Calcul m1*c1 + m1*(m2+c2) + m2*c3; 
+    for(k=0; k<N; k++) {
+      double c1 = frand01() + 1.2;
+      double c2 = frand01() + 3.5;
+      double c3 = frand01() + 6.7;
+      m3 = m1;  m3.MulCst(c1); 
+      m4 = m2;  m4.AddCst(c2); m4.MulElt(m1);
+      m5 = m2;  m5.MulCst(c3);
+      m5.AddElt(m3); m5.AddElt(m4);
+    }
+    PrtTim(" (4) Add/MulElt/Cst m1*c1 + m1*(m2+c2) + m2*c3 done ---");
+
+    for(k=0; k<N; k++) {
+      double c1 = frand01() + 1.2;
+      double c2 = frand01() + 3.5;
+      double c3 = frand01() + 6.7;
+      //      m4 = SMExprAdd< r_8, SMExprMtx<r_8>, SMExprMtx<r_8> >( SMExprMtx<r_8>(m1), SMExprMtx<r_8> (m2) );  
+    // Calcul m1*c1 + m1*(m2+c2) + m2*c3; 
+      m5 = m1*c1 + m1*(m2+c2) + m2*c3;
+    }
+    PrtTim(" (5) JET: m5 = m1*c1 + m1*(m2+c2) + m2*c3 ---");
+  }
+  catch (PThrowable exc) {
+    cerr << " te/catched Exception " << exc.Msg() << endl;
+  }  
+  catch (...) {
+    cerr << " te/catched unknown (...) exception " << endl; 
+  }  
+
+  cout << "\n --------------------------------------------------------" << endl;
+  PrtTim("--- End of te ---");
+  cout << " ----  END of te/TemplateExpression programme ------ " << endl;
+  return 0;
+}
+  
