| Last change
 on this file since 343 was             274, checked in by ansari, 27 years ago | 
        
          | 
Ameliorations Tests Reza 27/04/99
 | 
        
          | File size:
            1.0 KB | 
      
      
| Line |  | 
|---|
| 1 | #include <stdio.h> | 
|---|
| 2 | #include <stdlib.h> | 
|---|
| 3 | #include <math.h> | 
|---|
| 4 | #include <iostream.h> | 
|---|
| 5 |  | 
|---|
| 6 | #include "outilsinit.h" | 
|---|
| 7 | #include "ntuple.h" | 
|---|
| 8 |  | 
|---|
| 9 | int main(int, char **) | 
|---|
| 10 | { | 
|---|
| 11 | PeidaInit(); | 
|---|
| 12 |  | 
|---|
| 13 | char * names[3] = {"XPos", "YPos", "Val"}; | 
|---|
| 14 | int i,j, k; | 
|---|
| 15 | float xnt[3]; | 
|---|
| 16 |  | 
|---|
| 17 | printf("Creation Ntuple avec X,Y,Val ... \n"); | 
|---|
| 18 | NTuple  nt1(3, names, 20); | 
|---|
| 19 |  | 
|---|
| 20 | k = 0; | 
|---|
| 21 | for(j=0; j<8; j++) | 
|---|
| 22 | for(i=0; i<12; i++) | 
|---|
| 23 | { xnt[0] = i+0.5;  xnt[1] = j+0.5;  xnt[2] = k; | 
|---|
| 24 | nt1.Fill(xnt); k++; } | 
|---|
| 25 |  | 
|---|
| 26 | nt1.Show(cout); | 
|---|
| 27 | nt1.Print(0, 5); | 
|---|
| 28 | nt1.Print(18, 5); | 
|---|
| 29 | nt1.Print(94, 5); | 
|---|
| 30 |  | 
|---|
| 31 | printf("Ecriture NTuple ds nt.ppf ... \n"); | 
|---|
| 32 | nt1.Write("nt.ppf"); | 
|---|
| 33 |  | 
|---|
| 34 | printf("Lecture NTuple (nt2) ds nt.ppf ... \n"); | 
|---|
| 35 |  | 
|---|
| 36 | NTuple nt2("nt.ppf"); | 
|---|
| 37 | nt2.Show(cout); | 
|---|
| 38 | nt2.Print(0, 5); | 
|---|
| 39 | nt2.Print(18, 5); | 
|---|
| 40 | nt2.Print(94, 5); | 
|---|
| 41 |  | 
|---|
| 42 | printf("ReLecture NTuple (nt1) ds nt.ppf ... \n"); | 
|---|
| 43 |  | 
|---|
| 44 | nt1.Read("nt.ppf"); | 
|---|
| 45 | nt1.Show(cout); | 
|---|
| 46 | nt1.Print(0, 5); | 
|---|
| 47 | nt1.Print(18, 5); | 
|---|
| 48 | nt1.Print(94, 5); | 
|---|
| 49 |  | 
|---|
| 50 | printf("Creation/Lecture Lecture NTuple (nt1) ds nt.ppf ... \n"); | 
|---|
| 51 | NTuple nt3; | 
|---|
| 52 | nt3.Read("nt.ppf"); | 
|---|
| 53 | nt3.Show(cout); | 
|---|
| 54 | nt3.Print(0, 5); | 
|---|
| 55 | nt3.Print(18, 5); | 
|---|
| 56 | nt3.Print(94, 5); | 
|---|
| 57 |  | 
|---|
| 58 | exit(0); | 
|---|
| 59 | } | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.