Changeset 1405 in Sophya for trunk/SophyaLib/HiStats/ntuple.cc
- Timestamp:
- Feb 15, 2001, 6:58:16 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/ntuple.cc
r1371 r1405 16 16 Simple NTuple class (a Table or 2-D data set) with floating value 17 17 columns. 18 \sa SOPHYA::ObjFileIO<NTuple> 19 20 \code 21 #include "ntuple.h" 22 // ... 23 char * names[3] = {"XPos", "YPos", "Val"}; 24 // NTuple (Table) creation with 3 columns 25 NTuple nt(3, names); 26 // Filling the NTuple 27 r_4 x[3]; 28 for(int i=0; i<63; i++) { 29 x[0] = (i%9)-4.; x[1] = (i/9)-3.; x[2] = x[0]*x[0]+x[1]*x[1]; 30 nt.Fill(x); 31 } 32 // Printing table info 33 cout << nt ; 34 // Saving object into a PPF file 35 POutPersist po("nt.ppf"); 36 po << nt ; 37 \endcode 18 38 */ 19 39 … … 32 52 33 53 /* --Methode-- */ 54 //! Default constructor 34 55 //++ 35 56 NTuple::NTuple() … … 46 67 47 68 69 //! Constructor with specification of number of columns and column name 70 /*! 71 \param nvar : Number of columns in the table 72 \param noms : Array of column names (length(name) < 8 characters) 73 \param blk : Optional argument specifying number of table lines 74 in a given data block 75 */ 48 76 //++ 49 77 NTuple::NTuple(int nvar, char** noms, int blk) … … 77 105 } 78 106 107 //! Copy constructor - Copies the table definition and associated data 79 108 // cmv 8/10/99 80 109 //++ … … 108 137 109 138 /* --Methode-- */ 139 //! Constructor with table initialized from a PPF file 110 140 //++ 111 141 NTuple::NTuple(char *flnm) … … 131 161 132 162 /* --Methode-- */ 163 //! Clear the data table definition and deletes the associated data 133 164 void NTuple::Clean() 134 165 { … … 149 180 150 181 /* --Methode-- cmv 08/10/99 */ 182 //! = operator, copies the data table definition and its contents 151 183 //++ 152 184 NTuple& NTuple::operator = (const NTuple& NT) … … 181 213 182 214 /* --Methode-- */ 215 //! Adds an entry (a line) to the table 216 /*! 217 \param x : content of the line to be appended to the table 218 */ 183 219 //++ 184 220 void NTuple::Fill(r_4* x) … … 317 353 318 354 /* --Methode-- */ 355 //! Prints table definition and number of entries 319 356 //++ 320 357 void NTuple::Show(ostream& os) const … … 339 376 340 377 /* --Methode-- */ 378 //! Fills the table, reading lines from an ascii file 379 /*! 380 \param fn : file name 381 \param defval : default value for empty cells in the ascii file 382 */ 341 383 //++ 342 384 int NTuple::FillFromASCIIFile(string const& fn, float defval) … … 544 586 } 545 587 588 /*! 589 \class SOPHYA::ObjFileIO<NTuple> 590 \ingroup HiStats 591 Persistence (serialisation) handler for class NTuple 592 */ 546 593 547 594 /* --Methode-- */
Note:
See TracChangeset
for help on using the changeset viewer.