source: Sophya/trunk/SophyaProg/Examples/arrwrt.icc@ 3511

Last change on this file since 3511 was 1969, checked in by ansari, 23 years ago

ajout d'exemple lecture/ecriture tableaux ds PPF , Reza 26/4/2002

File size: 1.0 KB
Line 
1 // We create a integer array SizeX=7, SizeY=5
2 TArray<int_4> ia(7,5);
3 // We fill it with a sequence of numbers starting at 10., with step = 2.
4 ia = RegularSequence(10., 2.);
5 cout << " ----- Array IA = \n " << ia << endl;
6 TArray<int_4> ib = ia(Range(0,3), Range(3,4), Range(0));
7 cout << " ----- Array IB IA(Range(0,3), Range(3,2)) = \n" << ib << endl;
8 // sub array extraction, Range(2,4) : starting position=2 , End=4
9 TArray<int_4> ic = ia(Range(2,3),Range(1,3),Range(0));
10 cout << " ----- Array IC IA(Range(2,3),Range(1,3)) = \n " << ic << endl;
11 // we set the sub-array to zero, this should reflect in the original array
12 // sub-arrays share their data with parent array
13 ic = 0;
14 cout << " ----- Array IC Apres (=0) = \n " << ic << endl;
15 cout << " ----- Array IB Apres IC=0 = \n " << ib << endl;
16 cout << " ----- Array IA Apres IC=0 = \n " << ia << endl;
17 cout << " >>>>>> Writing in arrt.ppf <<<<<<< " << endl;
18 POutPersist pos("arrt.ppf");
19 // We write the three arrays in the stream
20 pos << ia << ib << ic;
21
Note: See TracBrowser for help on using the repository browser.