Changeset 1161 in Sophya for trunk/SophyaProg
- Timestamp:
- Aug 29, 2000, 6:14:59 PM (25 years ago)
- Location:
- trunk/SophyaProg/Tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/carrt.cc
r1107 r1161 76 76 ra = ia; 77 77 cout << " ra = ia(= RegularSequence(10., 2.)) = \n " << ra << endl; 78 cout << ra << endl;79 78 TArray<r_4> rb(5,3); 80 79 rb = RegularSequence(20., .5); -
trunk/SophyaProg/Tests/timg.cc
r837 r1161 3 3 // Utilisation de la classe Image<T> 4 4 #include "ntoolsinit.h" 5 #include "array.h" 5 6 #include "cimage.h" 6 7 // Utilisation des generateurs aleatoires … … 18 19 { 19 20 int i,j; 21 double mean,sig; 20 22 23 try { 21 24 // ----- ATTENTION ------- 22 25 // Initialisation de Sophya … … 32 35 for(j=0; j<200; j++) img(i,j) = imgo(i,j) = frand01()*1000.+1000.; 33 36 // Verification de la dynamique de l'image 34 img.CheckDyn(); 35 img.Print(); 37 MeanSigma(img, mean, sig); 38 cout << " img: Mean= " << mean << " Sigma= " << sig << endl; 39 cout << img ; 40 36 41 // On sauve l'image ds img.ppf (fichier format PPersist) 37 img.Write("img.ppf"); 42 { 43 POutPersist po("img.ppf"); 44 po << img; 45 } 38 46 39 47 // On rajoute du bruit a l'image (Gaussienne de sigma=3) … … 42 50 43 51 // Verification de la dynamique de l'image 44 img.CheckDyn();45 img.Print();52 MeanSigma(img, mean, sig); 53 cout << "ApresNoise img: Mean= " << mean << " Sigma= " << sig << endl; 46 54 47 55 // On verifie la date de creation du fichier .ppf … … 52 60 << " Created: " << pin.CreationDate() << endl; 53 61 } 62 54 63 // On cree une nouvelle image 55 64 ImageR4 img2; 56 65 // On lit le contenu du fichier imgin.ppf 57 img2.Read("img.ppf"); 66 { 67 PInPersist pi("img.ppf"); 68 pi >> img2; 69 } 70 58 71 // On calcule la difference entre les images img et img2 59 72 // Avant ajout de bruit … … 61 74 imgo -= img2; 62 75 // Verification de la dynamique de l'image soustraite 63 imgo.CheckDyn(); 64 imgo.Print(); 76 r_4 min,max; 77 imgo.MinMax(min, max); 78 cout << " Min(imgo) = " << min << " Max(imgo) = " << max << endl; 65 79 66 80 // Apres ajout de bruit 67 cout << " img(avecbruit) - img2 (fromfile) == Noise, sigma= 1? " << endl;81 cout << " img(avecbruit) - img2 (fromfile) == Noise, sigma=3 ? " << endl; 68 82 img -= img2; 69 83 // Verification de la dynamique de l'image soustraite 70 img.CheckDyn(); 71 img.Print(); 84 imgo.MinMax(min, max); 85 cout << " Min(img) = " << min << " Max(img) = " << max << endl; 86 MeanSigma(img, mean, sig); 87 cout << "Apres img -= img2 img: Mean= " << mean << " Sigma= " << sig << endl; 72 88 73 89 // ---- Test des NDataBlock … … 110 126 st = typeid(irp).name(); 111 127 cout << "typeid(irp).name() - " << st << endl; 128 } 129 130 catch (PThrowable & exc) { 131 cerr << "timg/Error Catched Exception " << (string)typeid(exc).name() 132 << " - Msg= " << exc.Msg() << endl; 133 } 134 catch (...) { 135 cerr << "timg/Error some other exception was caught ! " << endl; 136 } 137 112 138 cout << "\n ========= Fin de timg.cc ======== " << endl; 113 139 exit(0); -
trunk/SophyaProg/Tests/tnt.cc
r1082 r1161 58 58 nt1.Fill(xnt); k++; } 59 59 60 nt1.Info().Comment() = "NTuple de Test - Cree par tnt.cc"; 61 nt1.Info()["Version"] = SophyaVersion(); 60 62 nt1.Show(cout); 61 63 nt1.Print(0, 5); … … 89 91 DVList dvl; 90 92 91 cout << "\n ======= test_dvl: Testing DVList ======= " << endl; 93 cout << "\n ======= test_dvl: Testing MuTyV ======= " << endl; 94 MuTyV zvs = " ( 1.41 -2.71) "; 95 MuTyV dvs = "434.898"; 96 MuTyV fvu = 314.1596; 97 MuTyV ivu = 7654321; 98 cout << " float->string: fvu= " << fvu << " (string)fvu=" << (string)fvu << endl; 99 cout << " int->string: ivu= " << ivu << " (string)ivu=" << (string)ivu << endl; 100 cout << "String->complex<double>: zvs = " << zvs 101 << " (complex<double>)zvs= " << (complex<double>)zvs << endl; 102 cout << "String->double: dvs = " << dvs 103 << " (double)zvs= " << (double)dvs << endl; 104 105 106 cout << "\n\n ======= test_dvl: Testing DVList ======= " << endl; 92 107 dvl.SetI("Var XXX", 12345); 93 108 dvl.SetI("IV1-80", 80); … … 109 124 dvl.SetComment("IntegerValue", "This variable has a comment"); 110 125 dvl.Comment() = "This is a test DVL produced by the program tdvl.cc \n Using SOPHYA , Feb 2000"; 126 127 dvl["Sinf"] = "inf 0985"; 111 128 dvl.Print(); 129 112 130 113 131 double d = dvl("DV2-4.5");
Note:
See TracChangeset
for help on using the changeset viewer.