// This may look like C code, but it is really -*- C++ -*-
//  Adaptateurs pour TMatrix TVector du package Sophya
//                             R. Ansari  1/99
// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA

#ifndef PITVMAAD_H_SEEN
#define PITVMAAD_H_SEEN

#include "machdefs.h"
#include "parradapter.h"

#include "tmatrix.h"
#include "tvector.h"


// Adaptateur de vecteurs SOPHYA a P1DArrayAdapter
template <class T> 
class POTVectorAdapter : public P1DArrayAdapter {
public :
		  POTVectorAdapter(TVector<T>* v, bool ad=false); 
  virtual         ~POTVectorAdapter();
  virtual double  Value(int i);

protected:
  bool aDel;
  TVector<T>* mVec;
};

typedef POTVectorAdapter<r_8> POVectorAdapter;


// Adaptateur de matrice SOPHYA a P2DArrayAdapter
// Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col)  
template <class T> 
class POTMatrixAdapter :  public P2DArrayAdapter {
public :
                  POTMatrixAdapter(TMatrix<T>* mtx, bool ad=false);
  virtual         ~POTMatrixAdapter();
  virtual double  Value(int ix, int iy);

protected:
  bool aDel;
  TMatrix<T>* mMtx;
};

typedef POTMatrixAdapter<r_8> POMatrixAdapter;

#endif
