source: Sophya/trunk/SophyaProg/Tests/tnt.cc@ 224

Last change on this file since 224 was 224, checked in by ansari, 26 years ago

Creation module DPC/Tests Reza 09/04/99

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