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

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

Div. prog test - Reza 16/11/99

File size: 1.1 KB
RevLine 
[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
9int main(int, char **)
10{
11PeidaInit();
12
13char * names[3] = {"XPos", "YPos", "Val"};
14int i,j, k;
15float xnt[3];
16
17printf("Creation Ntuple avec X,Y,Val ... \n");
18NTuple nt1(3, names, 20);
19
20k = 0;
21for(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
26nt1.Show(cout);
27nt1.Print(0, 5);
28nt1.Print(18, 5);
29nt1.Print(94, 5);
30
[583]31string fn = "nt.ppf";
32{
[224]33printf("Ecriture NTuple ds nt.ppf ... \n");
[583]34ObjFileIO<NTuple> fio(&nt1);
35fio.Write(fn);
36}
[224]37
[583]38{
[224]39printf("Lecture NTuple (nt2) ds nt.ppf ... \n");
40
[583]41ObjFileIO<NTuple> fio(fn);
42NTuple* nt2 = (NTuple*)fio.DataObj();
43nt2->Show(cout);
44nt2->Print(0, 5);
45nt2->Print(18, 5);
46nt2->Print(94, 5);
47}
[224]48
[583]49/*
[224]50printf("ReLecture NTuple (nt1) ds nt.ppf ... \n");
51
[573]52nt1.Read("nt.ppf");
[224]53nt1.Show(cout);
54nt1.Print(0, 5);
55nt1.Print(18, 5);
56nt1.Print(94, 5);
57
[573]58printf("Creation/Lecture Lecture NTuple (nt1) ds nt.ppf ... \n");
[224]59NTuple nt3;
[573]60nt3.Read("nt.ppf");
[224]61nt3.Show(cout);
62nt3.Print(0, 5);
63nt3.Print(18, 5);
64nt3.Print(94, 5);
[583]65*/
[224]66
67exit(0);
68}
69
70
Note: See TracBrowser for help on using the repository browser.