| Last change
 on this file since 496 was             491, checked in by ansari, 26 years ago | 
        
          | 
Ajout programmes test (TMatrix Vector ...) Reza+cmv 21/10/99
 | 
        
          | File size:
            1.2 KB | 
      
      
| Rev | Line |  | 
|---|
| [224] | 1 | #include <stdio.h> | 
|---|
|  | 2 | #include <stdlib.h> | 
|---|
|  | 3 | #include <math.h> | 
|---|
|  | 4 | #include <iostream.h> | 
|---|
|  | 5 |  | 
|---|
| [274] | 6 | #include "outilsinit.h" | 
|---|
| [224] | 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"); | 
|---|
| [491] | 32 | { | 
|---|
|  | 33 | // nt1.Write("nt.ppf");  c'etait du PEIDA | 
|---|
|  | 34 | POutPersist s("nt.ppf"); | 
|---|
|  | 35 | s << nt1 ; | 
|---|
|  | 36 | } | 
|---|
| [224] | 37 |  | 
|---|
|  | 38 | printf("Lecture NTuple (nt2) ds nt.ppf ... \n"); | 
|---|
|  | 39 |  | 
|---|
|  | 40 | NTuple nt2("nt.ppf"); | 
|---|
|  | 41 | nt2.Show(cout); | 
|---|
|  | 42 | nt2.Print(0, 5); | 
|---|
|  | 43 | nt2.Print(18, 5); | 
|---|
|  | 44 | nt2.Print(94, 5); | 
|---|
|  | 45 |  | 
|---|
|  | 46 | printf("ReLecture NTuple (nt1) ds nt.ppf ... \n"); | 
|---|
|  | 47 |  | 
|---|
| [491] | 48 | { | 
|---|
|  | 49 | //  nt1.Read("nt.ppf");   c'etait du PEIDA ! | 
|---|
|  | 50 | PInPersist s("nt.ppf"); | 
|---|
|  | 51 | s >> nt1; | 
|---|
|  | 52 | } | 
|---|
|  | 53 |  | 
|---|
| [224] | 54 | nt1.Show(cout); | 
|---|
|  | 55 | nt1.Print(0, 5); | 
|---|
|  | 56 | nt1.Print(18, 5); | 
|---|
|  | 57 | nt1.Print(94, 5); | 
|---|
|  | 58 |  | 
|---|
| [491] | 59 | printf("Creation/Lecture Lecture NTuple (nt3) ds nt.ppf ... \n"); | 
|---|
| [224] | 60 | NTuple nt3; | 
|---|
| [491] | 61 | { | 
|---|
|  | 62 | //  nt3.Read("nt.ppf");   c'etait du PEIDA ! | 
|---|
|  | 63 | PInPersist s("nt.ppf"); | 
|---|
|  | 64 | s >> nt3; | 
|---|
|  | 65 | } | 
|---|
|  | 66 |  | 
|---|
| [224] | 67 | nt3.Show(cout); | 
|---|
|  | 68 | nt3.Print(0, 5); | 
|---|
|  | 69 | nt3.Print(18, 5); | 
|---|
|  | 70 | nt3.Print(94, 5); | 
|---|
|  | 71 |  | 
|---|
|  | 72 | exit(0); | 
|---|
|  | 73 | } | 
|---|
|  | 74 |  | 
|---|
|  | 75 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.