1 | #include "sopnamsp.h"
|
---|
2 | #include "machdefs.h"
|
---|
3 | #include <stdlib.h>
|
---|
4 | #include <typeinfo>
|
---|
5 | #include <iostream>
|
---|
6 | #include <string>
|
---|
7 | #include <complex>
|
---|
8 |
|
---|
9 | #include "datatype.h"
|
---|
10 |
|
---|
11 | #include "tvector.h"
|
---|
12 | #include "objfitter.h"
|
---|
13 | #include "nomtmatvecadapter.h"
|
---|
14 | #include "piyfxdrw.h"
|
---|
15 | #include "pitvmaad.h"
|
---|
16 |
|
---|
17 | #include "cimage.h" // Pour la prise en charge des Image<T> (Avr 2007)
|
---|
18 | #include "pimgadapter.h" // Adaptateur de tableaux PIImage pour Image<T>
|
---|
19 |
|
---|
20 | #include "fioarr.h"
|
---|
21 |
|
---|
22 | #include "nobjmgr.h"
|
---|
23 |
|
---|
24 | //----------------------------------------------------------------
|
---|
25 | // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet TMatrix<T>
|
---|
26 | //----------------------------------------------------------------
|
---|
27 |
|
---|
28 |
|
---|
29 | /* --Methode-- */
|
---|
30 | template <class T>
|
---|
31 | NOMAdapter_TMatrix<T>::NOMAdapter_TMatrix(TMatrix<T>* o)
|
---|
32 | : NObjMgrAdapter(o)
|
---|
33 | {
|
---|
34 | mMtx = o;
|
---|
35 | }
|
---|
36 |
|
---|
37 | /* --Methode-- */
|
---|
38 | template <class T>
|
---|
39 | NOMAdapter_TMatrix<T>::~NOMAdapter_TMatrix()
|
---|
40 | {
|
---|
41 | }
|
---|
42 |
|
---|
43 | /* --Methode-- */
|
---|
44 | template <class T>
|
---|
45 | NObjMgrAdapter* NOMAdapter_TMatrix<T>::Clone(AnyDataObj* o)
|
---|
46 | {
|
---|
47 | TMatrix<T>* m = dynamic_cast<TMatrix<T> *>(o);
|
---|
48 | if (m) return ( new NOMAdapter_TMatrix<T>(m) );
|
---|
49 | return ( new NObjMgrAdapter(o) );
|
---|
50 | }
|
---|
51 |
|
---|
52 | /* --Methode-- */
|
---|
53 | template <class T>
|
---|
54 | string NOMAdapter_TMatrix<T>::GetDataObjType()
|
---|
55 | {
|
---|
56 | string type = "TMatrix< ";
|
---|
57 |
|
---|
58 | TVector<T>* v = dynamic_cast<TVector<T> *>(mMtx);
|
---|
59 | if (v != NULL) type = "TVector< ";
|
---|
60 | else {
|
---|
61 | Image<T>* img = dynamic_cast<Image<T> *>(mMtx);
|
---|
62 | if (img != NULL) type = "Image< ";
|
---|
63 | }
|
---|
64 | // type += DecodeTypeIdName(typeid(T).name());
|
---|
65 | type += DataTypeInfo<T>::getTypeName();
|
---|
66 | type += " > ";
|
---|
67 | return(type);
|
---|
68 | }
|
---|
69 |
|
---|
70 | /* --Methode-- */
|
---|
71 | template <class T>
|
---|
72 | AnyDataObj* NOMAdapter_TMatrix<T>::CloneDataObj(bool share)
|
---|
73 | {
|
---|
74 | if (mMtx == NULL) return(NULL);
|
---|
75 | TVector<T>* v = dynamic_cast<TVector<T> *>(mMtx);
|
---|
76 | if (v != NULL) return( new TVector<T>(*v, share) );
|
---|
77 | else {
|
---|
78 | Image<T>* img = dynamic_cast<Image<T> *>(mMtx);
|
---|
79 | if (img != NULL) return ( new Image<T>(*img, share) );
|
---|
80 | else return ( new TMatrix<T>(*mMtx, share) );
|
---|
81 | }
|
---|
82 |
|
---|
83 | }
|
---|
84 |
|
---|
85 | /* --Methode-- */
|
---|
86 | template <class T>
|
---|
87 | string NOMAdapter_TMatrix<T>::GetInfoString(vector<string>& opts)
|
---|
88 | {
|
---|
89 | if (opts.size() == 0) return mMtx->InfoString();
|
---|
90 | else {
|
---|
91 | if (opts[0] == "rank") return string("2");
|
---|
92 | else if (opts[0] == "sizes") {
|
---|
93 | char buff[64];
|
---|
94 | TVector<T>* v = dynamic_cast<TVector<T> *>(mMtx);
|
---|
95 | if (v != NULL) sprintf(buff, "%ld", (long)mMtx->Size());
|
---|
96 | else sprintf(buff, "%ld %ld", (long)mMtx->NRows(), (long)mMtx->NCols());
|
---|
97 | return string(buff);
|
---|
98 | }
|
---|
99 | else if ((opts[0] == "size") || (opts[0] == "nelts")) {
|
---|
100 | char buff[32];
|
---|
101 | sprintf(buff, "%ld", (long)mMtx->Size());
|
---|
102 | return string(buff);
|
---|
103 | }
|
---|
104 | else if ((opts[0] == "nrow") || (opts[0] == "nrows")) {
|
---|
105 | char buff[32];
|
---|
106 | sprintf(buff, "%ld", (long)mMtx->NRows());
|
---|
107 | return string(buff);
|
---|
108 | }
|
---|
109 | else if ((opts[0] == "ncol") || (opts[0] == "ncols")) {
|
---|
110 | char buff[32];
|
---|
111 | sprintf(buff, "%ld", (long)mMtx->NCols());
|
---|
112 | return string(buff);
|
---|
113 | }
|
---|
114 | else if (opts[0] == "sum") {
|
---|
115 | MuTyV mtv(mMtx->Sum());
|
---|
116 | string s;
|
---|
117 | return mtv.Convert(s);
|
---|
118 | }
|
---|
119 | else if (opts[0] == "info") { // Acces aux valeurs stockes ds le DVList Info()
|
---|
120 | if (opts.size() < 2) return string("");
|
---|
121 | else if (mMtx->Info().HasKey(opts[1]) == false) return string("");
|
---|
122 | else return mMtx->Info().GetS(opts[1]);
|
---|
123 | }
|
---|
124 | else return "TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum info.varname";
|
---|
125 | }
|
---|
126 | }
|
---|
127 |
|
---|
128 | /* --Methode-- */
|
---|
129 | template <class T>
|
---|
130 | int NOMAdapter_TMatrix<T>::PerformOperation(vector<string>& opts)
|
---|
131 | {
|
---|
132 | bool ok = false;
|
---|
133 | if (opts.size() >= 2) {
|
---|
134 | int_4 kk = atoi(opts[1].c_str());
|
---|
135 | TVector<T> * vrc = new TVector<T>;
|
---|
136 | char buff[40];
|
---|
137 | if ((opts[0] == "row") || (opts[0] == "line")) {
|
---|
138 | vrc->Share(mMtx->Row((sa_size_t)kk));
|
---|
139 | ok = true;
|
---|
140 | sprintf(buff,"row_%ld",(long)kk);
|
---|
141 | cout << "PerformOperation(): Extracting Row(" << kk << ") from matrix" << endl;
|
---|
142 | }
|
---|
143 | else if ((opts[0] == "col") || (opts[0] == "column")) {
|
---|
144 | vrc->Share(mMtx->Column((sa_size_t)kk));
|
---|
145 | ok = true;
|
---|
146 | sprintf(buff,"col_%ld",(long)kk);
|
---|
147 | cout << "PerformOperation(): Extracting Column(" << kk << ") from matrix" << endl;
|
---|
148 | }
|
---|
149 | if (ok) {
|
---|
150 | string nvrc;
|
---|
151 | if (opts.size() > 2) nvrc = opts[2];
|
---|
152 | else nvrc = buff;
|
---|
153 | NamedObjMgr omg;
|
---|
154 | omg.AddObj(vrc, nvrc, true);
|
---|
155 | return 0;
|
---|
156 | }
|
---|
157 | }
|
---|
158 |
|
---|
159 | cout << "NOMAdapter_TMatrix<T>::PerformOperation(): Error operation/arguments !" << endl;
|
---|
160 | cout << "...Valid args: row/line r [rowname] , col/column c [rowname]" << endl;
|
---|
161 | return 1;
|
---|
162 | }
|
---|
163 |
|
---|
164 | /* --Methode-- */
|
---|
165 | template <class T>
|
---|
166 | void NOMAdapter_TMatrix<T>::SavePPF(POutPersist& pos, string const & nom)
|
---|
167 | {
|
---|
168 | if (mMtx == NULL) return;
|
---|
169 | TVector<T>* v = dynamic_cast<TVector<T> *>(mMtx);
|
---|
170 | if (v != NULL) {
|
---|
171 | FIO_TArray<T> fio(v);
|
---|
172 | fio.Write(pos, nom);
|
---|
173 | }
|
---|
174 | else {
|
---|
175 | Image<T>* img = dynamic_cast<Image<T> *>(mMtx);
|
---|
176 | if (img != NULL) {
|
---|
177 | FIO_Image<T> fio(img);
|
---|
178 | fio.Write(pos, nom);
|
---|
179 | }
|
---|
180 | else {
|
---|
181 | FIO_TArray<T> fio(mMtx);
|
---|
182 | fio.Write(pos, nom);
|
---|
183 | }
|
---|
184 | }
|
---|
185 | return;
|
---|
186 | }
|
---|
187 |
|
---|
188 | /* --Methode-- */
|
---|
189 | template <class T>
|
---|
190 | void NOMAdapter_TMatrix<T>::Print(ostream& os, int lev)
|
---|
191 | {
|
---|
192 | if (lev < 3) mMtx->Show(os, false);
|
---|
193 | else mMtx->Show(os, true);
|
---|
194 | if (lev > 0) mMtx->Print(os, 10*lev);
|
---|
195 | }
|
---|
196 |
|
---|
197 | /* --Methode-- */
|
---|
198 | template <class T>
|
---|
199 | PIDrawer* NOMAdapter_TMatrix<T>::GetDrawer(string & dopt)
|
---|
200 | {
|
---|
201 | TVector<T>* v = dynamic_cast<TVector<T> *>(mMtx);
|
---|
202 | if (v == NULL) return(NULL);
|
---|
203 | else {
|
---|
204 | dopt = "thinline " + dopt;
|
---|
205 | return( new PIYfXDrawer( new POTVectorAdapter<T>(v, false), NULL, true) );
|
---|
206 | }
|
---|
207 | }
|
---|
208 |
|
---|
209 | /* --Methode-- */
|
---|
210 | template <class T>
|
---|
211 | P2DArrayAdapter* NOMAdapter_TMatrix<T>::Get2DArray(string &)
|
---|
212 | {
|
---|
213 | Image<T>* img = dynamic_cast<Image<T> *>(mMtx);
|
---|
214 | if (img != NULL) return ( new ImageAdapter<T>(img, false) );
|
---|
215 | else return ( new POTMatrixAdapter<T>(mMtx, false) );
|
---|
216 | }
|
---|
217 |
|
---|
218 | // ---- Specialisation pour complexes -----
|
---|
219 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
220 | P2DArrayAdapter* NOMAdapter_TMatrix< complex<r_4> >::Get2DArray(string &)
|
---|
221 | {
|
---|
222 | return ( new POTMatrixAdapter< complex<r_4> >(mMtx, false) );
|
---|
223 | }
|
---|
224 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
225 | P2DArrayAdapter* NOMAdapter_TMatrix< complex<r_8> >::Get2DArray(string &)
|
---|
226 | {
|
---|
227 | return ( new POTMatrixAdapter< complex<r_8> >(mMtx, false) );
|
---|
228 | }
|
---|
229 | // -------------------------------------------------------------
|
---|
230 |
|
---|
231 | /* --Methode-- */
|
---|
232 | template <class T>
|
---|
233 | NTupleInterface* NOMAdapter_TMatrix<T>::GetNTupleInterface(bool& adel)
|
---|
234 | {
|
---|
235 | adel = true;
|
---|
236 | return( new NTupInt_TMatrix<T>(mMtx) );
|
---|
237 | }
|
---|
238 |
|
---|
239 |
|
---|
240 | /* --Methode-- */
|
---|
241 | template <class T>
|
---|
242 | GeneralFitData* NOMAdapter_TMatrix<T>::GetGeneralFitData(bool& adel
|
---|
243 | ,GeneralFitData::FitErrType errtype,double errscale,double errmin
|
---|
244 | ,int i1,int i2,int j1,int j2)
|
---|
245 | {
|
---|
246 | adel = false;
|
---|
247 | if(!mMtx) return(NULL);
|
---|
248 |
|
---|
249 | int nx,ny;
|
---|
250 | TVector<T>* vec = dynamic_cast<TVector<T> *>(mMtx);
|
---|
251 |
|
---|
252 | if(vec) { // C'est un TVector
|
---|
253 | nx = vec->NElts();
|
---|
254 | ny = 1;
|
---|
255 | } else {
|
---|
256 | nx = mMtx->NRows();
|
---|
257 | ny = mMtx->NCol();
|
---|
258 | if(nx<=0 || ny<=0) return(NULL);
|
---|
259 | }
|
---|
260 |
|
---|
261 | i1 = (i1<0||i1>=nx)? 0: i1;
|
---|
262 | i2 = (i2<0||i2>=nx||i2<i1)? nx-1: i2;
|
---|
263 | j1 = (j1<0||j1>=ny)? 0: j1;
|
---|
264 | j2 = (j2<0||j2>=ny||j2<j1)? ny-1: j2;
|
---|
265 |
|
---|
266 | GeneralFitData* mGData = NULL;
|
---|
267 |
|
---|
268 | if(vec) { // C'est un TVector
|
---|
269 | mGData = new GeneralFitData(1,(i2-i1+1),0);
|
---|
270 | adel = true;
|
---|
271 | for(int i=i1;i<=i2;i++) {
|
---|
272 | double x = (double) i;
|
---|
273 | double f = (*vec)(i);
|
---|
274 | double e = 1.;
|
---|
275 | e = GeneralFitData::ComputeError(f,e,errtype,errscale,errmin);
|
---|
276 | mGData->AddData1(x,f,e);
|
---|
277 | }
|
---|
278 | } else {
|
---|
279 | mGData = new GeneralFitData(2,(i2-i1+1)*(j2-j1+1),0);
|
---|
280 | adel = true;
|
---|
281 | for(int i=i1;i<=i2;i++) for(int j=j1;j<=j2;j++) {
|
---|
282 | double x = (double) i;
|
---|
283 | double y = (double) j;
|
---|
284 | double f = (*mMtx)(i,j);
|
---|
285 | double e = 1.;
|
---|
286 | e = GeneralFitData::ComputeError(f,e,errtype,errscale,errmin);
|
---|
287 | mGData->AddData2(x,y,f,e);
|
---|
288 | }
|
---|
289 | }
|
---|
290 |
|
---|
291 | return mGData;
|
---|
292 | }
|
---|
293 |
|
---|
294 | template <class T>
|
---|
295 | AnyDataObj* NOMAdapter_TMatrix<T>::FitResidusObj(GeneralFit& mfit)
|
---|
296 | {
|
---|
297 | TVector<T>* vec = dynamic_cast<TVector<T> *>(mMtx);
|
---|
298 | if(vec) {
|
---|
299 | TVector<T>* v = new TVector<T>(ObjectFitter::FitResidus(*vec,mfit),true);
|
---|
300 | return v;
|
---|
301 | } else {
|
---|
302 | TMatrix<T>* m = new TMatrix<T>(ObjectFitter::FitResidus(*mMtx,mfit),true);
|
---|
303 | return m;
|
---|
304 | }
|
---|
305 | }
|
---|
306 |
|
---|
307 | template <class T>
|
---|
308 | AnyDataObj* NOMAdapter_TMatrix<T>::FitFunctionObj(GeneralFit& mfit)
|
---|
309 | {
|
---|
310 | TVector<T>* vec = dynamic_cast<TVector<T> *>(mMtx);
|
---|
311 | if(vec) {
|
---|
312 | TVector<T>* v = new TVector<T>(ObjectFitter::FitFunction(*vec,mfit),true);
|
---|
313 | return v;
|
---|
314 | } else {
|
---|
315 | TMatrix<T>* m = new TMatrix<T>(ObjectFitter::FitFunction(*mMtx,mfit),true);
|
---|
316 | return m;
|
---|
317 | }
|
---|
318 | }
|
---|
319 |
|
---|
320 | // ---- Specialisation pour complexes -----
|
---|
321 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
322 | GeneralFitData* NOMAdapter_TMatrix< complex<r_4> >::GetGeneralFitData(bool& adel
|
---|
323 | ,GeneralFitData::FitErrType errtype,double errscale,double errmin
|
---|
324 | ,int i1,int i2,int j1,int j2)
|
---|
325 | {
|
---|
326 | return(NULL);
|
---|
327 | }
|
---|
328 |
|
---|
329 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
330 | AnyDataObj* NOMAdapter_TMatrix< complex<r_4> >::FitResidusObj(GeneralFit& mfit)
|
---|
331 | {
|
---|
332 | return(NULL);
|
---|
333 | }
|
---|
334 |
|
---|
335 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
336 | AnyDataObj* NOMAdapter_TMatrix< complex<r_4> >::FitFunctionObj(GeneralFit& mfit)
|
---|
337 | {
|
---|
338 | return(NULL);
|
---|
339 | }
|
---|
340 |
|
---|
341 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
342 | GeneralFitData* NOMAdapter_TMatrix< complex<r_8> >::GetGeneralFitData(bool& adel
|
---|
343 | ,GeneralFitData::FitErrType errtype,double errscale,double errmin
|
---|
344 | ,int i1,int i2,int j1,int j2)
|
---|
345 | {
|
---|
346 | return(NULL);
|
---|
347 | }
|
---|
348 |
|
---|
349 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
350 | AnyDataObj* NOMAdapter_TMatrix< complex<r_8> >::FitResidusObj(GeneralFit& mfit)
|
---|
351 | {
|
---|
352 | return(NULL);
|
---|
353 | }
|
---|
354 |
|
---|
355 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
356 | AnyDataObj* NOMAdapter_TMatrix< complex<r_8> >::FitFunctionObj(GeneralFit& mfit)
|
---|
357 | {
|
---|
358 | return(NULL);
|
---|
359 | }
|
---|
360 |
|
---|
361 | // -------------------------------------------------------------
|
---|
362 |
|
---|
363 | /* --Methode-- */
|
---|
364 | template <class T>
|
---|
365 | NTupInt_TMatrix<T>::NTupInt_TMatrix(TMatrix<T>* m)
|
---|
366 | {
|
---|
367 | mMtx = m;
|
---|
368 | }
|
---|
369 |
|
---|
370 | /* --Methode-- */
|
---|
371 | template <class T>
|
---|
372 | NTupInt_TMatrix<T>::~NTupInt_TMatrix()
|
---|
373 | {
|
---|
374 | }
|
---|
375 |
|
---|
376 | /* --Methode-- */
|
---|
377 | template <class T>
|
---|
378 | sa_size_t NTupInt_TMatrix<T>::NbLines() const
|
---|
379 | {
|
---|
380 | return( mMtx->NRows()*mMtx->NCols() );
|
---|
381 | }
|
---|
382 |
|
---|
383 | /* --Methode-- */
|
---|
384 | template <class T>
|
---|
385 | sa_size_t NTupInt_TMatrix<T>::NbColumns() const
|
---|
386 | {
|
---|
387 | return(8);
|
---|
388 | }
|
---|
389 |
|
---|
390 | /* --Methode-- */
|
---|
391 | template <class T>
|
---|
392 | r_8* NTupInt_TMatrix<T>::GetLineD(sa_size_t n) const
|
---|
393 | {
|
---|
394 | int i,j;
|
---|
395 | if ((n < 0) || (n >= (int)(mMtx->NRows()*mMtx->NCols()) )) {
|
---|
396 | mRet[0] = n;
|
---|
397 | for(i=1; i<8; i++) mRet[i] = 0.;
|
---|
398 | }
|
---|
399 | else {
|
---|
400 | i = n/mMtx->NCols(); j = n%mMtx->NCols();
|
---|
401 | mRet[0] = n; mRet[1] = i; mRet[2] = j;
|
---|
402 | mRet[3] = (*mMtx)(i,j);
|
---|
403 | mRet[4] = mRet[2]; mRet[5] = 0.;
|
---|
404 | mRet[6] = mRet[2]; mRet[7] = 0.;
|
---|
405 | }
|
---|
406 | return(mRet);
|
---|
407 | }
|
---|
408 |
|
---|
409 | /* --Methode-- */
|
---|
410 | template <class T>
|
---|
411 | string NTupInt_TMatrix<T>::VarList_C(const char* nx) const
|
---|
412 | {
|
---|
413 | string nomx;
|
---|
414 | if (nx) nomx = nx;
|
---|
415 | else nomx = "_xh_";
|
---|
416 | string vardec = "double n,r,c,val,real,imag,mod,phas; \n";
|
---|
417 | vardec += "n = " + nomx + "[0]; r = " + nomx + "[1]; c = " + nomx + "[2]; \n";
|
---|
418 | vardec += "val = " + nomx + "[3]; \n";
|
---|
419 | vardec += "real = " + nomx + "[4]; imag = " + nomx + "[5]; \n";
|
---|
420 | vardec += "mod = " + nomx + "[6]; phas = " + nomx + "[7]; \n";
|
---|
421 | return(vardec);
|
---|
422 | }
|
---|
423 |
|
---|
424 | /* --Methode-- */
|
---|
425 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
426 | r_8* NTupInt_TMatrix< complex<r_4> >::GetLineD(sa_size_t n) const
|
---|
427 | {
|
---|
428 | int i,j;
|
---|
429 | if ((n < 0) || (n >= (int)(mMtx->NRows()*mMtx->NCols()) )) {
|
---|
430 | mRet[0] = n;
|
---|
431 | for(i=1; i<8; i++) mRet[i] = 0.;
|
---|
432 | }
|
---|
433 | else {
|
---|
434 | i = n/mMtx->NCols(); j = n%mMtx->NCols();
|
---|
435 | mRet[0] = n; mRet[1] = i; mRet[2] = j;
|
---|
436 | mRet[4] = (*mMtx)(i,j).real(); mRet[5] = (*mMtx)(i,j).imag();
|
---|
437 | mRet[3] = mRet[6] = sqrt(mRet[4]*mRet[4]+mRet[5]*mRet[5]);
|
---|
438 | mRet[7] = atan2(mRet[5], mRet[4]);
|
---|
439 | }
|
---|
440 | return(mRet);
|
---|
441 | }
|
---|
442 |
|
---|
443 | DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */
|
---|
444 | r_8* NTupInt_TMatrix< complex<r_8> >::GetLineD(sa_size_t n) const
|
---|
445 | {
|
---|
446 | int i,j;
|
---|
447 | if ((n < 0) || (n >= (int)(mMtx->NRows()*mMtx->NCols()) )) {
|
---|
448 | mRet[0] = n;
|
---|
449 | for(i=1; i<8; i++) mRet[i] = 0.;
|
---|
450 | }
|
---|
451 | else {
|
---|
452 | i = n/mMtx->NCols(); j = n%mMtx->NCols();
|
---|
453 | mRet[0] = n; mRet[1] = i; mRet[2] = j;
|
---|
454 | mRet[4] = (*mMtx)(i,j).real(); mRet[5] = (*mMtx)(i,j).imag();
|
---|
455 | mRet[3] = mRet[6] = sqrt(mRet[4]*mRet[4]+mRet[5]*mRet[5]);
|
---|
456 | mRet[7] = atan2(mRet[5], mRet[4]);
|
---|
457 | }
|
---|
458 | return(mRet);
|
---|
459 | }
|
---|
460 |
|
---|
461 |
|
---|
462 | #ifdef __CXX_PRAGMA_TEMPLATES__
|
---|
463 | #pragma define_template NOMAdapter_TMatrix<uint_2>
|
---|
464 | #pragma define_template NOMAdapter_TMatrix<int_2>
|
---|
465 | #pragma define_template NOMAdapter_TMatrix<int_4>
|
---|
466 | #pragma define_template NOMAdapter_TMatrix<int_8>
|
---|
467 | #pragma define_template NOMAdapter_TMatrix<r_4>
|
---|
468 | #pragma define_template NOMAdapter_TMatrix<r_8>
|
---|
469 | #pragma define_template NOMAdapter_TMatrix< complex<r_4> >
|
---|
470 | #pragma define_template NOMAdapter_TMatrix< complex<r_8> >
|
---|
471 | #pragma define_template NTupInt_TMatrix<uint_2>
|
---|
472 | #pragma define_template NTupInt_TMatrix<int_2>
|
---|
473 | #pragma define_template NTupInt_TMatrix<int_4>
|
---|
474 | #pragma define_template NTupInt_TMatrix<int_8>
|
---|
475 | #pragma define_template NTupInt_TMatrix<r_4>
|
---|
476 | #pragma define_template NTupInt_TMatrix<r_8>
|
---|
477 | #pragma define_template NTupInt_TMatrix< complex<r_4> >
|
---|
478 | #pragma define_template NTupInt_TMatrix< complex<r_8> >
|
---|
479 | #endif
|
---|
480 |
|
---|
481 | #if defined(ANSI_TEMPLATES)
|
---|
482 | template class NOMAdapter_TMatrix<uint_2>;
|
---|
483 | template class NOMAdapter_TMatrix<int_2>;
|
---|
484 | template class NOMAdapter_TMatrix<int_4>;
|
---|
485 | template class NOMAdapter_TMatrix<int_8>;
|
---|
486 | template class NOMAdapter_TMatrix<r_4>;
|
---|
487 | template class NOMAdapter_TMatrix<r_8>;
|
---|
488 | template class NOMAdapter_TMatrix< complex<r_4> >;
|
---|
489 | template class NOMAdapter_TMatrix< complex<r_8> >;
|
---|
490 | template class NTupInt_TMatrix<uint_2>;
|
---|
491 | template class NTupInt_TMatrix<int_2>;
|
---|
492 | template class NTupInt_TMatrix<int_4>;
|
---|
493 | template class NTupInt_TMatrix<int_8>;
|
---|
494 | template class NTupInt_TMatrix<r_4>;
|
---|
495 | template class NTupInt_TMatrix<r_8>;
|
---|
496 | template class NTupInt_TMatrix< complex<r_4> >;
|
---|
497 | template class NTupInt_TMatrix< complex<r_8> >;
|
---|
498 | #endif
|
---|