| 1 | // This may look like C code, but it is really -*- C++ -*-
 | 
|---|
| 2 | // Adaptateur d objets (pour NamedObjMgr) 
 | 
|---|
| 3 | // pour les classes TMatrix<T>, TVector<T> de Sophya
 | 
|---|
| 4 | //                                      Reza 11/99
 | 
|---|
| 5 | //  LAL-IN2P3/CNRS               CEA-DAPNIA     
 | 
|---|
| 6 |  
 | 
|---|
| 7 | #ifndef NOMTMATVECADAPTER_H_SEEN
 | 
|---|
| 8 | #define NOMTMATVECADAPTER_H_SEEN
 | 
|---|
| 9 | 
 | 
|---|
| 10 | #include "nomgadapter.h"
 | 
|---|
| 11 | #include "tmatrix.h"
 | 
|---|
| 12 | #include "generaldata.h"
 | 
|---|
| 13 | 
 | 
|---|
| 14 | //---------------------------------------------------------------
 | 
|---|
| 15 | // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet TMatrix 
 | 
|---|
| 16 | //---------------------------------------------------------------
 | 
|---|
| 17 | 
 | 
|---|
| 18 | template <class T> 
 | 
|---|
| 19 | class NOMAdapter_TMatrix : public NObjMgrAdapter {
 | 
|---|
| 20 | public:
 | 
|---|
| 21 |                                 NOMAdapter_TMatrix(TMatrix<T>* m = NULL);
 | 
|---|
| 22 |   virtual                       ~NOMAdapter_TMatrix();
 | 
|---|
| 23 | 
 | 
|---|
| 24 |   virtual NObjMgrAdapter*       Clone(AnyDataObj* o);
 | 
|---|
| 25 | 
 | 
|---|
| 26 |   virtual string                GetDataObjType();
 | 
|---|
| 27 | 
 | 
|---|
| 28 |   virtual AnyDataObj*           CloneDataObj(bool share=false);
 | 
|---|
| 29 | 
 | 
|---|
| 30 | // Returns a string with synthetic information about the object 
 | 
|---|
| 31 | // opts : additional optional argument 
 | 
|---|
| 32 |   virtual string                GetInfoString(vector<string>& opts);
 | 
|---|
| 33 | // Perform an operation on the object definded 
 | 
|---|
| 34 | // opts : operation definition 
 | 
|---|
| 35 |   virtual int                   PerformOperation(vector<string>& opts);
 | 
|---|
| 36 | 
 | 
|---|
| 37 |   virtual void                  SavePPF(POutPersist& s, string const & nom);
 | 
|---|
| 38 | 
 | 
|---|
| 39 |   virtual void                  Print(ostream& os, int lev=0);
 | 
|---|
| 40 |   virtual PIDrawer*             GetDrawer(string& dopt);
 | 
|---|
| 41 |   virtual P2DArrayAdapter*      Get2DArray(string& dopt);
 | 
|---|
| 42 |   virtual NTupleInterface*      GetNTupleInterface(bool& adel);
 | 
|---|
| 43 | 
 | 
|---|
| 44 |   virtual GeneralFitData* GetGeneralFitData(bool& adel
 | 
|---|
| 45 |           ,GeneralFitData::FitErrType errtype=GeneralFitData::DefaultError
 | 
|---|
| 46 |           ,double errscale=1.,double errmin=0.
 | 
|---|
| 47 |           ,int i1=0,int i2=-1,int j1=0,int j2=-1);
 | 
|---|
| 48 |   virtual AnyDataObj* FitResidusObj(GeneralFit& mfit);
 | 
|---|
| 49 |   virtual AnyDataObj* FitFunctionObj(GeneralFit& mfit);
 | 
|---|
| 50 | 
 | 
|---|
| 51 | protected:
 | 
|---|
| 52 |   TMatrix<T>* mMtx;
 | 
|---|
| 53 | };
 | 
|---|
| 54 | 
 | 
|---|
| 55 | // Class Interface NTuple pour TMatrix<T>
 | 
|---|
| 56 | 
 | 
|---|
| 57 | template <class T> 
 | 
|---|
| 58 | class NTupInt_TMatrix : public NTupleInterface {
 | 
|---|
| 59 | public:
 | 
|---|
| 60 |                         NTupInt_TMatrix(TMatrix<T>* m);
 | 
|---|
| 61 |   virtual               ~NTupInt_TMatrix();
 | 
|---|
| 62 |   virtual sa_size_t     NbLines() const ;
 | 
|---|
| 63 |   virtual sa_size_t     NbColumns() const ;
 | 
|---|
| 64 |   virtual r_8 *         GetLineD(sa_size_t n) const ;
 | 
|---|
| 65 |   virtual string        VarList_C(const char* nomx=NULL) const ;
 | 
|---|
| 66 | protected:
 | 
|---|
| 67 |   TMatrix<T>* mMtx;
 | 
|---|
| 68 |   mutable r_8 mRet[8];
 | 
|---|
| 69 | };
 | 
|---|
| 70 | 
 | 
|---|
| 71 | 
 | 
|---|
| 72 | #endif
 | 
|---|