source: Sophya/trunk/Poubelle/DPC:FitsIOServer/NTools/tmatrix.cc@ 658

Last change on this file since 658 was 658, checked in by ansari, 26 years ago

no message

File size: 19.2 KB
Line 
1// $Id: tmatrix.cc,v 1.1.1.1 1999-11-26 16:37:12 ansari Exp $
2// C.Magneville 04/99
3#include "machdefs.h"
4#include <stdio.h>
5#include <stdlib.h>
6#include <iostream.h>
7#include <values.h>
8#include <complex>
9#include "pexceptions.h"
10#include "tmatrix.h"
11#include "objfio.h"
12
13////////////////////////////////////////////////////////////////
14//**** Createur, Destructeur
15
16template <class T>
17TMatrix<T>::TMatrix()
18// Constructeur par defaut.
19: mNr(0), mNc(0), mNDBlock()
20{
21}
22
23template <class T>
24TMatrix<T>::TMatrix(uint_4 r,uint_4 c)
25// Construit une matrice de r lignes et c colonnes.
26: mNr(r), mNc(c), mNDBlock(r*c)
27{
28}
29
30template <class T>
31TMatrix<T>::TMatrix(uint_4 r,uint_4 c,T* values,Bridge* br)
32// Construit une matrice de r lignes et c colonnes. On fournit
33// le tableau des valeurs et eventuellement un Bridge.
34: mNr(r), mNc(c), mNDBlock(r*c,values,br)
35{
36}
37
38template <class T>
39TMatrix<T>::TMatrix(const TMatrix<T>& a)
40// Constructeur par copie (partage si "a" temporaire).
41: mNr(a.mNr), mNc(a.mNc), mNDBlock(a.mNDBlock)
42{
43}
44
45template <class T>
46TMatrix<T>::TMatrix(const TMatrix<T>& a,bool share)
47// Constructeur par copie avec possibilite de forcer le partage ou non.
48: mNr(a.mNr), mNc(a.mNc), mNDBlock(a.mNDBlock,share)
49{
50}
51
52template <class T>
53TMatrix<T>::~TMatrix()
54// Destructeur
55{
56}
57
58////////////////////////////////////////////////////////////////
59// Operations matricielles
60template <class T>
61TMatrix<T> TMatrix<T>::Transpose(void) const
62// Transposition
63{
64TMatrix<T> a; a.Clone(*this); a.SetTemp(true);
65a.mNr = mNc; a.mNc = mNr;
66{for(uint_4 i=0; i<mNr; i++)
67 for(uint_4 j=0; j<mNc; j++) {
68 a(j,i) = (*this)(i,j);
69}}
70return a;
71}
72
73////////////////////////////////////////////////////////////////
74//**** Impression
75
76template <class T>
77void TMatrix<T>::Print(ostream& os,int lp
78 ,uint_4 i0,uint_4 ni,uint_4 j0,uint_4 nj) const
79// Impression de la sous-matrice (i:i+ni-1,i:j+nj-1)
80{
81os<<"TMatrix::Print("<<mNr<<","<<mNc<<")"<<endl;
82if(lp>0)
83 {os<<" this="<<this<<endl; mNDBlock.Print(0,0);}
84if(mNr==0 || mNc==0) return;
85if(i0>=mNr || j0>=mNc || ni==0 || nj==0) return;
86uint_4 i1 = i0+ni; if(i1>mNr) i1 = mNr;
87uint_4 j1 = j0+nj; if(j1>mNc) j1 = mNc;
88for(uint_4 i=i0;i<i1;i++) {
89 for(uint_4 j=j0;j<j1;j++) cout<<" "<<(*this)(i,j);
90 cout<<endl;
91}
92}
93
94////////////////////////////////////////////////////////////////
95//**** Surcharge de *= (INPLACE): TMatrix *= TMatrix;
96
97template <class T>
98TMatrix<T>& TMatrix<T>::operator *= (const TMatrix<T>& a)
99// A = A*B -> A(n,m) = A(n,m)*B(m,m)
100{
101uint_4 ndata = mNr*mNc;
102if(ndata==0 || mNc!=a.mNr || a.mNr!=a.mNc)
103 throw(SzMismatchError("TMatrix::operator*=A size mismatch"));
104// A(i,j) = Sum(k) A(i,k)*B(k,j) ... il faut sauver la ligne "i" de A
105// Vecteur oi : vecteur ou est sauve la ligne i de la matrice *this
106// oi,oe = pointeur de debut et de fin du vecteur temporaire
107// oij = pointeur parcourant le vecteur oi
108// Matrice *this: i = pointeur du debut de la ligne i
109// ij = pointeur parcourant la ligne i
110// Matrice a : aj = pointeur de debut de la colonne j
111// aji = pointeur parcourant la colonne j
112T* oi = new T[mNc]; T* oe = oi+mNc;
113for(T *i=Data(); i<Data()+ndata; i+=mNc) {
114 {for(T *oij=oi,*ij=i; oij<oe;) *oij++ = *ij++;}
115 {for(T *ij=i,*aj=const_cast<T *>(a.Data()); aj<a.Data()+a.mNc; ij++,aj++) {
116 T sum = 0;
117 for(T *oij=oi,*aji=aj; oij<oe; oij++,aji+=a.mNc) sum += *oij * *aji;
118 *ij = sum;
119 }}
120}
121delete [] oi;
122return *this;
123}
124
125////////////////////////////////////////////////////////////////
126//**** Pour surcharge d'operateurs C = A (+,-,*,/) B
127
128template <class T> TMatrix<T> TMatrix<T>::Add(const TMatrix<T>& b) const
129{
130if(mNr!=b.mNr || mNc!=b.mNc)
131 throw(SzMismatchError("TMatrix operator C=A+B size mismatch\n"));
132TMatrix<T> result; result.SetTemp(true); result.mNr=mNr; result.mNc=mNc;
133result.mNDBlock = mNDBlock+b.mNDBlock;
134return result;
135}
136
137template <class T> TMatrix<T> TMatrix<T>::Sub(const TMatrix<T>& b) const
138{
139if(mNr!=b.mNr || mNc!=b.mNc)
140 throw(SzMismatchError("TMatrix operator C=A-B size mismatch\n"));
141TMatrix<T> result; result.SetTemp(true); result.mNr=mNr; result.mNc=mNc;
142result.mNDBlock = mNDBlock-b.mNDBlock;
143return result;
144}
145
146template <class T> TMatrix<T> TMatrix<T>::Mul(const TMatrix<T>& b) const
147// C = A(this)*B : Cij = Aik Bkj (allocation forcee dans tous les cas)
148{
149if(mNr==0 || mNc==0 || b.mNc==0 || mNc!=b.mNr)
150 throw(SzMismatchError("TMatrix operator C=A*B size mismatch\n"));
151TMatrix<T> r; r.SetTemp(true); r.ReSize(mNr,b.mNc);
152T *ai,*aik,*bj,*bkj,*ri,*rij;
153for(ri=const_cast<T *>(r.Data()),ai=const_cast<T *>(Data());
154 ri<r.Data()+r.mNr*r.mNc;ri+=r.mNc,ai+=mNc) {
155 for(rij=ri,bj=const_cast<T *>(b.Data());rij<ri+r.mNc;rij++,bj++) {
156 *rij = 0;
157 for(aik=ai,bkj=bj;aik<ai+mNc;aik++,bkj+=b.mNc) *rij += *aik * *bkj;
158 }
159}
160return r;
161}
162
163////////////////////////////////////////////////////////////////
164//**** Pour gestion des lignes et des colonnes
165
166template <class T> TMatrixRC<T> TMatrix<T>::Row(uint_4 r) const
167{
168TMatrixRC<T> rc((TMatrix<T>&)*this, TmatrixRow, r);
169return rc;
170}
171
172template <class T> TMatrixRC<T> TMatrix<T>::Col(uint_4 c) const
173{
174TMatrixRC<T> rc((TMatrix<T>&)*this, TmatrixCol, c);
175return rc;
176}
177
178template <class T> TMatrixRC<T> TMatrix<T>::Diag() const
179{
180TMatrixRC<T> rc((TMatrix<T>&)*this, TmatrixDiag);
181return rc;
182}
183
184////////////////////////////////////////////////////////////////
185//**** Pour inversion
186#ifndef M_LN2
187#define M_LN2 0.69314718055994530942
188#endif
189#ifndef LN_MINDOUBLE
190#define LN_MINDOUBLE (M_LN2 * (DMINEXP - 1))
191#endif
192#ifndef LN_MAXDOUBLE
193#define LN_MAXDOUBLE (M_LN2 * DMAXEXP)
194#endif
195
196r_8 TMatrix<r_8>::GausPiv(TMatrix<r_8>& a, TMatrix<r_8>& b)
197// Pivot de Gauss
198// * Attention: egcs impose que cette fonction soit mise dans le .cc
199// avant ::Inverse() (car Inverse() l'utilise)
200// {TMatrix A(a); TMatrix B(b); return (r_8) TMatrix::GausPiv(A,B);}
201{
202uint_4 n = a.NRows();
203if(n!=b.NRows())
204 throw(SzMismatchError("TMatrix::GausPiv size mismatch\n"));
205// On fait une normalisation un peu brutale...
206double vmin=MAXDOUBLE;
207double vmax=0;
208for(uint_4 iii=0; iii<a.NRows(); iii++)
209 for(uint_4 jjj=0; jjj<a.NCols(); jjj++) {
210 double v = TMatrixRC<r_8>::Abs_Value(a(iii,jjj));
211 if(v>vmax) vmax = v;
212 if(v<vmin && v>0) vmin = v;
213}
214double nrm = sqrt(vmin*vmax);
215if(nrm > 1.e5 || nrm < 1.e-5) {
216 a /= nrm;
217 b /= nrm;
218 //cout << "normalisation matrice " << nrm << endl;
219} else nrm=1;
220
221double det = 1.0;
222if(nrm != 1) {
223 double ld = a.NRows() * log(nrm);
224 if (ld <= LN_MINDOUBLE || ld >= LN_MAXDOUBLE) {
225 // cerr << "TMatrix warning, overflow for det" << endl;
226 } else {
227 det = exp(ld);
228 }
229}
230
231TMatrixRC<r_8> pivRowa(a,TmatrixRow);
232TMatrixRC<r_8> pivRowb(b,TmatrixRow);
233
234for(uint_4 k=0; k<n-1; k++) {
235 uint_4 iPiv = a.Col(k).IMaxAbs(k);
236 if(iPiv != k) {
237 TMatrixRC<r_8> aIPiv(a.Row(iPiv));
238 TMatrixRC<r_8> aK(a.Row(k));
239 TMatrixRC<r_8>::Swap(aIPiv,aK);
240 TMatrixRC<r_8> bIPiv(b.Row(iPiv));
241 TMatrixRC<r_8> bK(b.Row(k));
242 TMatrixRC<r_8>::Swap(bIPiv,bK);
243 }
244 double pivot = a(k,k);
245 if (fabs(pivot) < 1.e-50) return 0.0;
246 //det *= pivot;
247 pivRowa.SetRow(k); // to avoid constructors
248 pivRowb.SetRow(k);
249 for (uint_4 i=k+1; i<n; i++) {
250 double r = -a(i,k)/pivot;
251 a.Row(i).LinComb(r, pivRowa); // + rapide que -= r * pivRowa
252 b.Row(i).LinComb(r, pivRowb);
253 }
254}
255det *= a(n-1, n-1);
256
257// on remonte
258for(uint_4 kk=n-1; kk>0; kk--) {
259 double pivot = a(kk,kk);
260 if (fabs(pivot) <= 1.e-50) return 0.0;
261 pivRowa.SetRow(kk); // to avoid constructors
262 pivRowb.SetRow(kk);
263 for(uint_4 jj=0; jj<kk; jj++) {
264 double r = -a(jj,kk)/pivot;
265 a.Row(jj).LinComb(r, pivRowa);
266 b.Row(jj).LinComb(r, pivRowb);
267 }
268}
269
270for(uint_4 l=0; l<n; l++) {
271 if (fabs(a(l,l)) <= 1.e-50) return 0.0;
272 b.Row(l) /= a(l,l);
273}
274
275return det;
276}
277
278TMatrix<r_8> TMatrix<r_8>::Inverse() const
279// Inversion
280{
281TMatrix<r_8> b(mNc,mNr); TMatrix<r_8> a(*this); b = 1.;
282if(fabs(TMatrix<r_8>::GausPiv(a,b)) < 1.e-50)
283 throw(MathExc("TMatrix Inverse() Singular OMatrix"));
284return b;
285}
286
287#include "generalfit.h"
288//////////////////////////////////////////////////////////
289//**** Residus des fits
290TMatrix<r_8> TMatrix<r_8>::FitResidus(GeneralFit& gfit
291 ,double xorg,double yorg,double dx,double dy)
292// Retourne une classe contenant les residus du fit ``gfit''.
293// On suppose que x=j (colonnes) et y=i (lignes) pour m(i,j).
294// Les coordonnees de l'element (i,j) sont :
295// (i,j) -> x = xorg+j*dx , y = yorg+i*dy
296{
297if(NCols()<=0||NRows()<=0)
298 throw(SzMismatchError("TMatrix::FitResidus size mismatch\n"));
299GeneralFunction* f = gfit.GetFunction();
300if(f==NULL)
301 throw(NullPtrError("TMatrix::FitResidus GeneraFit==NULL\n"));
302int npar = gfit.GetNPar();
303if(npar==0)
304 throw(SzMismatchError("TMatrix::FitResidus GeneraFit 0 parametre\n"));
305double* par = new double[npar];
306{for(int i=0;i<npar;i++) par[i] = gfit.GetParm(i);}
307TMatrix<r_8> m(*this);
308for(uint_4 i=0;i<NRows();i++) for(uint_4 j=0;j<NCols();j++) {
309 double x[2] = {xorg+j*dx,yorg+i*dy};
310 m(i,j) -= f->Value(x,par);
311}
312delete [] par;
313return m;
314}
315
316TMatrix<r_8> TMatrix<r_8>::FitFunction(GeneralFit& gfit
317 ,double xorg,double yorg,double dx,double dy)
318// Retourne une classe contenant la fonction du fit ``gfit''.
319// On suppose que x=j (colonnes) et y=i (lignes) pour m(i,j).
320// Les coordonnees de l'element (i,j) sont :
321// (i,j) -> x = xorg + j*dx , y = yorg + i*dy
322{
323if(NCols()<=0||NRows()<=0)
324 throw(SzMismatchError("TMatrix::FitFunction size mismatch\n"));
325GeneralFunction* f = gfit.GetFunction();
326if(f==NULL)
327 throw(NullPtrError("TMatrix::FitFunction GeneraFit==NULL\n"));
328int npar = gfit.GetNPar();
329if(npar==0)
330 throw(SzMismatchError("TMatrix::FitFunction GeneraFit 0 parametre\n"));
331double* par = new double[npar];
332{for(int i=0;i<npar;i++) par[i] = gfit.GetParm(i);}
333TMatrix<r_8> m(*this);
334for(uint_4 i=0;i<NRows();i++) for(uint_4 j=0;j<NCols();j++) {
335 double x[2] = {xorg+j*dx,yorg+i*dy};
336 m(i,j) = f->Value(x,par);
337}
338delete [] par;
339return m;
340}
341
342///////////////////////////////////////////////////////////
343// --------------------------------------------------------
344// Les objets delegues pour la gestion de persistance
345// --------------------------------------------------------
346///////////////////////////////////////////////////////////
347
348template <class T>
349FIO_TMatrix<T>::FIO_TMatrix()
350{
351dobj=new TMatrix<T>;
352ownobj=true;
353}
354
355template <class T>
356FIO_TMatrix<T>::FIO_TMatrix(string const & filename)
357{
358dobj=new TMatrix<T>;
359ownobj=true;
360Read(filename);
361}
362
363template <class T>
364FIO_TMatrix<T>::FIO_TMatrix(const TMatrix<T> & obj)
365{
366dobj = new TMatrix<T>(obj);
367ownobj=true;
368}
369
370template <class T>
371FIO_TMatrix<T>::FIO_TMatrix(TMatrix<T> * obj)
372{
373dobj = obj;
374ownobj=false;
375}
376
377template <class T>
378FIO_TMatrix<T>::~FIO_TMatrix()
379{
380if (ownobj && dobj) delete dobj;
381}
382
383template <class T>
384AnyDataObj* FIO_TMatrix<T>::DataObj()
385{
386return(dobj);
387}
388
389template <class T>
390void FIO_TMatrix<T>::ReadSelf(PInPersist& is)
391{
392// On lit les 3 premiers uint_4
393// 0: Numero de version, 1 : NRows, 2 : NCol
394uint_4 itab[3];
395is.Get(itab,3);
396if (dobj == NULL) dobj = new TMatrix<T>(itab[1],itab[2]);
397else dobj->ReSize(itab[1],itab[2]);
398// On lit le NDataBlock
399FIO_NDataBlock<T> fio_nd(&dobj->DataBlock());
400fio_nd.Read(is);
401}
402
403template <class T>
404void FIO_TMatrix<T>::WriteSelf(POutPersist& os) const
405{
406if (dobj == NULL) return;
407// On ecrit 3 uint_4 ....
408// 0: Numero de version, 1 : NRows, 2 : NCol
409uint_4 itab[3];
410 itab[0] = 1; // Numero de version a 1
411itab[1] = dobj->NRows();
412itab[2] = dobj->NCols();
413os.Put(itab,3);
414// On ecrit le NDataBlock
415FIO_NDataBlock<T> fio_nd(&dobj->DataBlock());
416fio_nd.Write(os);
417}
418
419////////////////////////////////////////////////////////////////
420// -------------------------------------------------------------
421// La classe de gestion des lignes et colonnes d'une matrice
422// -------------------------------------------------------------
423////////////////////////////////////////////////////////////////
424#include "tvector.h"
425
426template <class T> TMatrixRC<T>::TMatrixRC()
427: matrix(NULL), data(NULL), index(0), step(0)
428{}
429
430template <class T> TMatrixRC<T>::TMatrixRC(TMatrix<T>& m,TRCKind rckind,uint_4 ind)
431: matrix(&m), data(Org(m,rckind,ind)),
432 index(ind), step(Step(m,rckind)), kind(rckind)
433{
434if (kind == TmatrixDiag && m.mNc != m.mNr)
435 throw(SzMismatchError("TMatrixRC::TMatrixRC(...,TmatrixDiag,...) size mismatch\n"));
436}
437
438template <class T> int_4 TMatrixRC<T>::Next()
439{
440if (!matrix || kind==TmatrixDiag) return -1;
441index++;
442if(kind == TmatrixRow) {
443 if(index > (int_4)matrix->mNr) {index = (int_4)matrix->mNr; return -1;}
444 data += matrix->mNc;
445} else {
446 if (index > (int_4)matrix->mNc) {index = (int_4)matrix->mNc; return -1;}
447 data++;
448}
449return index;
450}
451
452template <class T> int_4 TMatrixRC<T>::Prev()
453{
454if (!matrix || kind == TmatrixDiag) return -1;
455index--;
456if(index < 0) {index = 0; return -1;}
457if(kind == TmatrixRow) data -= matrix->mNc;
458else data--;
459return index;
460}
461
462template <class T> int_4 TMatrixRC<T>::SetCol(int_4 c)
463{
464if(!matrix) return -1;
465if(c<0 || c>(int_4)matrix->mNc) return -1;
466kind = TmatrixCol;
467index = c;
468step = Step(*matrix, TmatrixCol);
469data = Org(*matrix, TmatrixCol, c);
470return c;
471}
472
473template <class T> int_4 TMatrixRC<T>::SetRow(int_4 r)
474{
475if(!matrix) return -1;
476if(r<0 && r>(int_4)matrix->mNr) return -1;
477kind = TmatrixRow;
478index = r;
479step = Step(*matrix, TmatrixRow);
480data = Org(*matrix, TmatrixRow, r);
481return r;
482}
483
484template <class T> int_4 TMatrixRC<T>::SetDiag()
485{
486if (!matrix) return -1;
487if (matrix->mNc != matrix->mNr)
488 throw(SzMismatchError("TMatrixRC::SetDiag size mismatch\n"));
489kind = TmatrixDiag;
490index = 0;
491step = Step(*matrix, TmatrixDiag);
492data = Org(*matrix, TmatrixDiag);
493return 0;
494}
495
496
497template <class T> TMatrixRC<T>& TMatrixRC<T>::operator = (const TMatrixRC<T>& rc)
498{
499matrix = rc.matrix;
500data = rc.data;
501index = rc.index;
502step = rc.step;
503kind = rc.kind;
504return *this;
505}
506
507template <class T> TVector<T> TMatrixRC<T>::GetVect() const
508{
509TVector<T> v(NElts());
510for (uint_4 i=0; i<NElts(); i++) v(i) = (*this)(i);
511return v;
512}
513
514template <class T> TMatrixRC<T>& TMatrixRC<T>::operator += (const TMatrixRC<T>& rc)
515{
516if ( NElts() != rc.NElts() )
517 throw(SzMismatchError("TMatrixRC::operator+= size mismatch\n"));
518if ( kind != rc.kind )
519 throw(SzMismatchError("TMatrixRC::operator+= type mismatch\n"));
520for (uint_4 i=0; i<NElts(); i++) (*this)(i) += rc(i);
521return *this;
522}
523
524template <class T> TMatrixRC<T>& TMatrixRC<T>::operator -= (const TMatrixRC<T>& rc)
525{
526if( NElts() != rc.NElts() )
527 throw(SzMismatchError("TMatrixRC::operator-= size mismatch\n"));
528if( kind != rc.kind )
529 throw(SzMismatchError("TMatrixRC::operator-= type mismatch\n"));
530for(uint_4 i=0; i<NElts(); i++) (*this)(i) -= rc(i);
531return *this;
532}
533
534
535template <class T> TMatrixRC<T>& TMatrixRC<T>::operator *= (T x)
536{
537for(uint_4 i=0; i<NElts(); i++) (*this)(i) *= x;
538return *this;
539}
540
541template <class T> TMatrixRC<T>& TMatrixRC<T>::operator /= (T x)
542{
543for(uint_4 i=0; i<NElts(); i++) (*this)(i) /= x;
544return *this;
545}
546
547
548template <class T> TMatrixRC<T>& TMatrixRC<T>::operator -= (T x)
549{
550for(uint_4 i=0; i<NElts(); i++) (*this)(i) -= x;
551return *this;
552}
553
554template <class T> TMatrixRC<T>& TMatrixRC<T>::operator += (T x)
555{
556for(uint_4 i=0; i<NElts(); i++) (*this)(i) += x;
557return *this;
558}
559
560template <class T>
561TMatrixRC<T>& TMatrixRC<T>::LinComb(T a, T b, const TMatrixRC<T>& rc, uint_4 first)
562{
563if ( NElts() != rc.NElts() )
564 throw(SzMismatchError("TMatrixRC::LinComb size mismatch\n"));
565if ( kind != rc.kind )
566 throw(SzMismatchError("TMatrixRC::LinComb type mismatch\n"));
567for(uint_4 i=first; i<NElts(); i++) (*this)(i) = (*this)(i)*a + rc(i)*b;
568return *this;
569}
570
571template <class T>
572TMatrixRC<T>& TMatrixRC<T>::LinComb(T b, const TMatrixRC<T>& rc, uint_4 first)
573{
574if ( NElts() != rc.NElts() )
575 throw(SzMismatchError("TMatrixRC::LinComb size mismatch\n"));
576if ( kind != rc.kind )
577 throw(SzMismatchError("TMatrixRC::LinComb type mismatch\n"));
578for(uint_4 i=first; i<NElts(); i++) (*this)(i) += rc(i)*b;
579return *this;
580}
581
582template <class T> uint_4 TMatrixRC<T>::IMaxAbs(uint_4 first)
583{
584if (first>NElts())
585 throw(SzMismatchError("TMatrixRC::IMaxAbs size mismatch\n"));
586uint_4 imax = first;
587double vmax = Abs_Value((*this)(first));
588for(uint_4 i=first+1; i<NElts(); i++) {
589 double v = Abs_Value((*this)(i));
590 if(v > vmax) {vmax = v; imax = i;}
591}
592return imax;
593}
594
595template <class T>
596void TMatrixRC<T>::Swap(TMatrixRC<T>& rc1, TMatrixRC<T>& rc2)
597{
598if(rc1.NElts() != rc2.NElts())
599 throw(SzMismatchError("TMatrixRC::Swap size mismatch\n"));
600if(rc1.kind != rc2.kind)
601 throw(SzMismatchError("TMatrixRC::Swap type mismatch\n"));
602if(rc1.data == rc2.data) return;
603for(uint_4 i=0; i<rc1.NElts(); i++)
604 {T tmp = rc1(i); rc1(i) = rc2(i); rc2(i) = tmp;}
605}
606
607///////////////////////////////////////////////////////////////
608#ifdef __CXX_PRAGMA_TEMPLATES__
609#pragma define_template TMatrix<uint_1>
610#pragma define_template TMatrix<uint_2>
611#pragma define_template TMatrix<int_2>
612#pragma define_template TMatrix<int_4>
613#pragma define_template TMatrix<int_8>
614#pragma define_template TMatrix<uint_4>
615#pragma define_template TMatrix<uint_8>
616#pragma define_template TMatrix<r_4>
617#pragma define_template TMatrix<r_8>
618#pragma define_template TMatrix< complex<float> >
619#pragma define_template TMatrix< complex<double> >
620// Instances des delegues FileIO (PPersist)
621#pragma define_template FIO_TMatrix<uint_1>
622#pragma define_template FIO_TMatrix<uint_2>
623#pragma define_template FIO_TMatrix<int_2>
624#pragma define_template FIO_TMatrix<int_4>
625#pragma define_template FIO_TMatrix<int_8>
626#pragma define_template FIO_TMatrix<uint_4>
627#pragma define_template FIO_TMatrix<uint_8>
628#pragma define_template FIO_TMatrix<r_8>
629#pragma define_template FIO_TMatrix<r_4>
630#pragma define_template FIO_TMatrix< complex<float> >
631#pragma define_template FIO_TMatrix< complex<double> >
632// Instances gestion lignes/colonnes
633#pragma define_template TMatrixRC<uint_1>
634#pragma define_template TMatrixRC<uint_2>
635#pragma define_template TMatrixRC<int_2>
636#pragma define_template TMatrixRC<int_4>
637#pragma define_template TMatrixRC<int_8>
638#pragma define_template TMatrixRC<uint_4>
639#pragma define_template TMatrixRC<uint_8>
640#pragma define_template TMatrixRC<r_4>
641#pragma define_template TMatrixRC<r_8>
642#pragma define_template TMatrixRC< complex<float> >
643#pragma define_template TMatrixRC< complex<double> >
644#endif
645
646#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
647template class TMatrix<uint_1>;
648template class TMatrix<uint_2>;
649template class TMatrix<int_2>;
650template class TMatrix<int_4>;
651template class TMatrix<int_8>;
652template class TMatrix<uint_4>;
653template class TMatrix<uint_8>;
654template class TMatrix<r_4>;
655template class TMatrix<r_8>;
656template class TMatrix< complex<float> >;
657template class TMatrix< complex<double> >;
658// Instances des delegues FileIO (PPersist)
659template class FIO_TMatrix<uint_1>;
660template class FIO_TMatrix<uint_2>;
661template class FIO_TMatrix<int_2>;
662template class FIO_TMatrix<int_4>;
663template class FIO_TMatrix<int_8>;
664template class FIO_TMatrix<uint_4>;
665template class FIO_TMatrix<uint_8>;
666template class FIO_TMatrix<r_8>;
667template class FIO_TMatrix<r_4>;
668template class FIO_TMatrix< complex<float> >;
669template class FIO_TMatrix< complex<double> >;
670// Instances gestion lignes/colonnes
671template class TMatrixRC<uint_1>;
672template class TMatrixRC<uint_2>;
673template class TMatrixRC<int_2>;
674template class TMatrixRC<int_4>;
675template class TMatrixRC<int_8>;
676template class TMatrixRC<uint_4>;
677template class TMatrixRC<uint_8>;
678template class TMatrixRC<r_4>;
679template class TMatrixRC<r_8>;
680template class TMatrixRC< complex<float> >;
681template class TMatrixRC< complex<double> >;
682#endif
Note: See TracBrowser for help on using the repository browser.