Changeset 857 in Sophya
- Timestamp:
- Apr 10, 2000, 3:04:05 PM (25 years ago)
- Location:
- trunk/SophyaProg/Tests
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/arrt.cc
r820 r857 4 4 #include <iostream.h> 5 5 6 #include "nbrandom.h"7 6 #include "tarrinit.h" 8 7 #include "array.h" 9 // #include "fioarr.h"10 // #include "matharr.h"11 8 #include "timing.h" 12 9 … … 136 133 137 134 138 for(int i=0; i<n; i++) 139 for(int j=0; j<n; j++) a(j,i) = GauRnd(0., 1.); 140 cout << " ----- Matrix a = \n " << a << endl; 135 // for(int i=0; i<n; i++) 136 // for(int j=0; j<n; j++) a(j,i) = GauRnd(0., 1.); 137 a = Sequence(RandomSequence(RandomSequence::Gaussian, 0., 2.5)); 138 cout << " ----- Matrix a=Sequence(RandomSequence(RandomSequence::Gaussian, 0., 2.5)) = \n " << a << endl; 141 139 Vector x(n); 142 140 x = Sequence(1.,3.); -
trunk/SophyaProg/Tests/lpk.cc
r812 r857 4 4 #include <iostream.h> 5 5 6 #include " nbrandom.h"6 #include "srandgen.h" 7 7 #include "tarrinit.h" 8 #include "tarray.h" 9 #include "tvector.h" 8 #include "array.h" 10 9 #include "timing.h" 11 10 #include "intflapack.h" -
trunk/SophyaProg/Tests/sphg0.cc
r768 r857 2 2 #include "sambainit.h" 3 3 #include "tod.h" 4 #include "sphere gorski.h"4 #include "spherehealpix.h" 5 5 6 6 … … 11 11 12 12 int m=32; 13 Sphere Gorski<double> sph(m);13 SphereHEALPix<double> sph(m); 14 14 for (int j=0;j<sph.NbPixels();j++) 15 15 { … … 19 19 // Projection dans une image 20 20 21 cout << " ===== Fin de test0 ======== " << endl;21 cout << " ===== Fin de sphg0 ======== " << endl; 22 22 return 0; 23 23 } -
trunk/SophyaProg/Tests/tspm.cc
r768 r857 1 1 #include <iostream.h> 2 2 #include "skymapinit.h" 3 #include "spheregorski.h" 4 #include "spherethetaphi.h" 3 #include "skymap.h" 5 4 6 5 #include "tod.h" … … 30 29 InitTim(); // Initializing the CPU timer 31 30 if ((narg > 1) && (strcmp(arg[1],"-h") == 0) ) { 32 cout << " tspm [ Gorski_M=32] [M_TetaPhi=64] : Spherical Map Test " << endl;31 cout << " tspm [HEALPix_M=32] [M_TetaPhi=64] : Spherical Map Test " << endl; 33 32 exit(0); 34 33 } … … 36 35 int m=32; 37 36 if (narg >1) m = atoi(arg[1]); 38 cout << " ===== GorskiSpherical Map Test M= " << m << endl;37 cout << " ===== HEALPix Spherical Map Test M= " << m << endl; 39 38 40 Sphere Gorski<double> sph(m);39 SphereHEALPix<double> sph(m); 41 40 42 41 cout << "Filling spherical map NPixels= " << sph.NbPixels() << endl; … … 50 49 // Computing mean and sigma on the sphere 51 50 MeanSig(sph, gmoy, gsig); 52 cout << "Sphere Gorski<double> Mean= " << gmoy << " Sigma = " << gsig << endl;51 cout << "SphereHEALPix<double> Mean= " << gmoy << " Sigma = " << gsig << endl; 53 52 PrtTim("End of Mean-Sig "); 54 53 … … 56 55 { 57 56 POutPersist s("sphg.ppf"); 58 FIO_Sphere Gorski<double> fiog(&sph) ;57 FIO_SphereHEALPix<double> fiog(&sph) ; 59 58 fiog.Write(s); 60 cout << "Sphere Gorski<double> written to sphg.ppf " << endl;59 cout << "SphereHEALPix<double> written to sphg.ppf " << endl; 61 60 } 62 61 63 62 // Reading from the file 64 63 { 65 FIO_Sphere Gorski<double> fiog("sphg.ppf");66 Sphere Gorski<double> sph2 = fiog;64 FIO_SphereHEALPix<double> fiog("sphg.ppf"); 65 SphereHEALPix<double> sph2 = fiog; 67 66 PrtTim("End of Write/Read "); 68 67 -
trunk/SophyaProg/Tests/tspm2.cc
r819 r857 1 1 #include <iostream.h> 2 2 #include <math.h> 3 #include "skymapinit.h" 4 #include "spheregorski.h" 5 #include "spherethetaphi.h" 3 #include "sambainit.h" 4 #include "skymap.h" 6 5 7 6 #include "tod.h" … … 87 86 InitTim(); // Initializing the CPU timer 88 87 if ((narg > 1) && (strcmp(arg[1],"-h") == 0) ) { 89 cout << " tspm [ Gorski_M=32] : GorskiSpherical Map Test " << endl;88 cout << " tspm [HEALPix_M=32] : HEALPix Spherical Map Test " << endl; 90 89 exit(0); 91 90 } … … 93 92 int m=32; 94 93 if (narg >1) m = atoi(arg[1]); 95 cout << " ===== GorskiSpherical Map Test M= " << m << endl;94 cout << " ===== HEALPix Spherical Map Test M= " << m << endl; 96 95 97 96 POutPersist s("spheres.ppf"); … … 99 98 100 99 { 101 Sphere Gorski<double> sph(m);100 SphereHEALPix<double> sph(m); 102 101 103 102 cout << "Filling spherical map NPixels= " << sph.NbPixels() << endl; … … 110 109 111 110 { 112 FIO_Sphere Gorski<double> fiog(&sph) ;111 FIO_SphereHEALPix<double> fiog(&sph) ; 113 112 nomobj = "sphg1"; 114 113 fiog.Write(s, nomobj); 115 cout << "SphMap Sphere Gorski<double> written to POutPersist with name " << nomobj << endl;114 cout << "SphMap SphereHEALPix<double> written to POutPersist with name " << nomobj << endl; 116 115 } 117 116 … … 149 148 150 149 { 151 Sphere Gorski<float> sph(m);150 SphereHEALPix<float> sph(m); 152 151 153 152 cout << "Filling spherical map2 NPixels= " << sph.NbPixels() << endl; … … 166 165 167 166 { 168 FIO_Sphere Gorski<float> fiog(&sph) ;167 FIO_SphereHEALPix<float> fiog(&sph) ; 169 168 nomobj = "sphg2"; 170 169 fiog.Write(s, nomobj); 171 cout << "SphMap Sphere Gorski<float> written to POutPersist with name " << nomobj << endl;170 cout << "SphMap SphereHEALPix<float> written to POutPersist with name " << nomobj << endl; 172 171 } 173 172 … … 176 175 FitsIoServer fios; 177 176 { 178 cout << "Test of Write/Read Sphere Gorski<float> to FITS (sphg_r4.fits) " << endl;177 cout << "Test of Write/Read SphereHEALPix<float> to FITS (sphg_r4.fits) " << endl; 179 178 fios.save(sph, "sphg_r4.fits"); 180 179 181 Sphere Gorski<float> sphr(4);180 SphereHEALPix<float> sphr(4); 182 181 fios.load(sphr, "sphg_r4.fits", 2); 183 cout << " Read from file - Sphere Gorski<float> NPixels= " << sphr.NbPixels() << endl;182 cout << " Read from file - SphereHEALPix<float> NPixels= " << sphr.NbPixels() << endl; 184 183 int ndiff = 0; 185 184 for(int k=0; k<sphr.NbPixels(); k++) { -
trunk/SophyaProg/Tests/tsttmat.cc
r768 r857 7 7 #include "ntoolsinit.h" 8 8 #include "pexceptions.h" 9 #include " tmatrix.h"10 #include " nbrandom.h"9 #include "array.h" 10 #include "srandgen.h" 11 11 12 12 //////////////////////////////////////////////////////////////////////////////////////// … … 24 24 { 25 25 cout << " Test ecriture PPersist TMatrix " << endl; 26 FIO_T Matrix<r_8> ftm(A);26 FIO_TArray<r_8> ftm(A); 27 27 ftm.Write("tmtx.ppf"); 28 28 } 29 29 { 30 30 cout << " Test lecture PPersist TMatrix " << endl; 31 FIO_T Matrix<r_8> ftm("tmtx.ppf");31 FIO_TArray<r_8> ftm("tmtx.ppf"); 32 32 cout<<"Alue:"<<(TMatrix<r_8>)ftm<<endl; 33 33 } … … 182 182 { 183 183 Matrix M(X); cout<<"Matrix M"<<endl<<M<<endl; 184 Matrix MI = M.Inverse(); cout<<"MI"<<endl<<MI;184 Matrix MI = Inverse(M); cout<<"MI"<<endl<<MI; 185 185 MI *= M; cout<<"MI*M"<<endl<<MI; 186 186 r_8 xmin=-1.; … … 196 196 cout<<"TMatrix X"<<endl<<X; 197 197 TMatrix<r_8> Xinv; 198 Xinv = X.Inverse();198 Xinv = Inverse(X); 199 199 cout<<"TMatrix Xinv"<<endl<<Xinv; 200 200 Xinv *= X; … … 213 213 cout<<"MI"<<endl<<MI; 214 214 { 215 TMatrix<r_8> L(MI.NRows(),MI.NCol(),MI.Data(),new Bridge); 216 cout<<"L"<<endl<<L; 217 L *= 100.; cout<<"L*=100."<<endl<<L; 215 uint_4 siz[5]; 216 siz[0] = MI.NCols(); 217 siz[1] = MI.NRows(); 218 TArray<r_8> A(2, siz, MI.Data(), 1, 0, new Bridge); 219 TMatrix<r_8> L(A); 220 cout<<"L"<<endl<<L; 221 L *= 100.; cout<<"L*=100."<<endl<<L; 218 222 } // destruction de L 219 223 cout<<"MI(4,4)="<<MI(4,4)<<endl; -
trunk/SophyaProg/Tests/tsttvec.cc
r768 r857 8 8 #include "pexceptions.h" 9 9 10 #include " tvector.h"11 #include " nbrandom.h"10 #include "array.h" 11 #include "srandgen.h" 12 12 13 13 //////////////////////////////////////////////////////////////////////////////////////// … … 24 24 { 25 25 cout << " Test ecriture PPersist TVector " << endl; 26 FIO_T Vector<r_8> ftv(v1);26 FIO_TArray<r_8> ftv(v1); 27 27 ftv.Write("tvec.ppf"); 28 28 } 29 29 { 30 30 cout << " Test lecture PPersist TVector " << endl; 31 FIO_T Vector<r_8> ftv("tvec.ppf");31 FIO_TArray<r_8> ftv("tvec.ppf"); 32 32 cout<<"Vlue:"<<(TVector<r_8>)ftv<<endl; 33 33 } 34 34 35 35 36 cout<<"TVector(10,v,br)"<<endl; 37 TVector<r_8> v2(10,v,new Bridge); cout<<v2; 36 cout<<"TVector(10,v,br) (v2)"<<endl; 37 uint_4 siz[5]; 38 siz[1] = 10; 39 siz[0] = 1; 40 TVector<r_8> v2(TArray<r_8>(2,siz,v,1,0,new Bridge)); cout<<v2; 38 41 39 42 cout<<"TVector()"<<endl; … … 46 49 v3 = 123456.; cout<<v3; 47 50 48 cout<<"ps = v1 * v2"<<endl;49 r_8 ps = v1 * v2; cout<<"ps="<<ps<<endl;51 cout<<"ps = v2.Transpose() * v1"<<endl; 52 r_8 ps = (v2.Transpose()*v1).toScalar(); cout<<"ps="<<ps<<endl; 50 53 51 54 cout<<"v2 = 10.*v1"<<endl;
Note:
See TracChangeset
for help on using the changeset viewer.