1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 | // Adaptateurs pour TMatrix TVector du package Sophya
|
---|
3 | // R. Ansari 1/99
|
---|
4 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
5 |
|
---|
6 | #ifndef PITVMAAD_H_SEEN
|
---|
7 | #define PITVMAAD_H_SEEN
|
---|
8 |
|
---|
9 | #include "machdefs.h"
|
---|
10 | #include "parradapter.h"
|
---|
11 |
|
---|
12 | #include "tmatrix.h"
|
---|
13 | #include "tvector.h"
|
---|
14 |
|
---|
15 | // Definition d'enum pour choix de la quantite affichee pour les tableaux de complexes.
|
---|
16 | enum PICmplxDispOption { PICDO_Module, PICDO_Real, PICDO_Imag, PICDO_Phase, PICDO_Module2 };
|
---|
17 | // Decode la presence d'une chaine opt contenant cdreal , cdimag , cdphase , cdmod , cdmod2
|
---|
18 | PICmplxDispOption StringToCmplxDispOption( string & opt );
|
---|
19 |
|
---|
20 | // Adaptateur de vecteurs SOPHYA a P1DArrayAdapter
|
---|
21 | template <class T>
|
---|
22 | class POTVectorAdapter : public P1DArrayAdapter {
|
---|
23 | public :
|
---|
24 | POTVectorAdapter(TVector<T>* v, bool ad=false, PICmplxDispOption dopt=PICDO_Module);
|
---|
25 | virtual ~POTVectorAdapter();
|
---|
26 | virtual double Value(int i);
|
---|
27 |
|
---|
28 | protected:
|
---|
29 | PICmplxDispOption dOpt;
|
---|
30 | bool aDel;
|
---|
31 | TVector<T>* mVec;
|
---|
32 | };
|
---|
33 |
|
---|
34 | typedef POTVectorAdapter<r_8> POVectorAdapter;
|
---|
35 |
|
---|
36 |
|
---|
37 | // Adaptateur de matrice SOPHYA a P2DArrayAdapter
|
---|
38 | // Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col)
|
---|
39 | template <class T>
|
---|
40 | class POTMatrixAdapter : public P2DArrayAdapter {
|
---|
41 | public :
|
---|
42 | POTMatrixAdapter(TMatrix<T>* mtx, bool ad=false, PICmplxDispOption dopt=PICDO_Module);
|
---|
43 | virtual ~POTMatrixAdapter();
|
---|
44 | virtual double Value(int ix, int iy);
|
---|
45 | virtual double MeanVal(int ix1, int ix2, int jy1, int jy2);
|
---|
46 |
|
---|
47 | protected:
|
---|
48 | PICmplxDispOption dOpt;
|
---|
49 | bool aDel;
|
---|
50 | TMatrix<T>* mMtx;
|
---|
51 | };
|
---|
52 |
|
---|
53 | typedef POTMatrixAdapter<r_8> POMatrixAdapter;
|
---|
54 |
|
---|
55 | #endif
|
---|