Changeset 1405 in Sophya for trunk/SophyaLib/HiStats/xntuple.cc


Ignore:
Timestamp:
Feb 15, 2001, 6:58:16 PM (25 years ago)
Author:
ansari
Message:

Ajout documentation - Reza 15/2/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/xntuple.cc

    r1371 r1405  
    2020   columns with int, float or string type content. In addition, this class
    2121   can handle large data sets, using swap space on disk.
     22   \sa SOPHYA::ObjFileIO<XNTuple>
     23
     24   \code
     25   #include "xntuple.h"
     26   // ...
     27   char * names[4] = {"X", "X2", "XInt","XStr"};
     28   // XNTuple (Table) creation with 4 columns, of integer,
     29   // double(2) and string type
     30   XNTuple  xnt(2,0,1,1, names);
     31   // Filling the NTuple
     32   r_8 xd[2];
     33   int_4 xi[2];
     34   char xss[2][32];
     35   char * xs[2] = {xss[0], xss[1]} ;
     36   for(int i=0; i<50; i++) {
     37     xi[0] = i;  xd[0] = i+0.5;  xd[1] = xd[0]*xd[0];
     38     sprintf(xs[0],"X=%g", xd[0]);
     39     xnt.Fill(xd, NULL, xi, xs);
     40   }
     41   // Printing table info
     42   cout << xnt ;
     43   // Saving object into a PPF file
     44   POutPersist po("xnt.ppf");
     45   po << xnt ;
     46   \endcode
     47   
    2248*/
    2349
     
    218244//--
    219245
     246//! Constructor with specification colum types and names
     247/*!
     248  \param ndvar : Number of columns with type double (r_8)
     249  \param nfvar : Number of columns with type float (r_4)
     250  \param nivar : Number of columns with type integer (int_4)
     251  \param nsvar : Number of columns with type string
     252  \param vnames : Column names (in the order r_8 r_4 int_4 string)
     253  (colum names are limited to 31 characters)
     254  \param blk : data block size (in number of table lines)
     255  \param maxblk : Maximum number of data block in memory
     256  \param strsz : string length (for string type columns)
     257 */
    220258XNTuple::XNTuple(int ndvar, int nfvar, int nivar, int nsvar,
    221259                   char** vnames,
     
    249287
    250288
     289//! Constructor with table initialized from a PPF file
    251290XNTuple::XNTuple(string const& flnm)
    252291    : mNEnt(0), mNBlk(0), mNSwBlk(0),
     
    268307
    269308
     309//! Copy constructor - Copies the table definition and associated data
    270310XNTuple::XNTuple(XNTuple const& nt)
    271311    : mNEnt(0), mNBlk(0), mNSwBlk(0),
     
    294334
    295335
     336//! Clear the data table definition and deletes the associated data
    296337void XNTuple::clean()
    297338{
     
    341382//      Opérateur égal (=) , copie "nt" dans le premier NTuple
    342383//--
     384//! Appends an entry (line) to the table
     385/*!
     386  \param d_data : double (r_8) line elements
     387  \param f_data : float (r_4) line elements
     388  \param i_data : integer (int_4) line elements
     389  \param s_data : string line elements
     390 */
    343391void XNTuple::Fill(r_8* d_data, r_4* f_data, int_4* i_data, char** s_data)
    344392{
     
    552600//--
    553601
     602//! Returns the associated DVList object
    554603DVList&  XNTuple::Info()
    555604{
     
    597646
    598647
     648//! Prints table definition and number of entries
    599649void   XNTuple::Show(ostream& os) const
    600650{
     
    636686}
    637687
     688//! NOT YET IMPLEMENTED ! - Fills table from an ascii file
    638689int    XNTuple::FillFromASCIIFile(string const& fn, r_8 ddval,  r_4 dfval,
    639690                                        int dival, const char * dsval)
     
    646697
    647698
     699//! Defines swap file path for XNTuple objects (Default=/tmp)
    648700void  XNTuple::SetSwapPath(char* p)
    649701{
     
    843895}
    844896
     897/*!
     898   \class SOPHYA::ObjFileIO<XNTuple>
     899   \ingroup HiStats
     900   Persistence (serialisation) handler for class XNTuple
     901*/
    845902
    846903void   ObjFileIO<XNTuple>::WriteSelf(POutPersist& ppout) const
Note: See TracChangeset for help on using the changeset viewer.