Changeset 2667 in Sophya for trunk/SophyaLib/HiStats/ntuple.cc


Ignore:
Timestamp:
Apr 15, 2005, 1:51:38 PM (20 years ago)
Author:
ansari
Message:

Correction bug ds NTuple::GetVecD() (else manquant) suite a passage a NTuple double/ou/float - Reza 15/4/2005

File:
1 edited

Legend:

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

    r2663 r2667  
    1515   \class SOPHYA::NTuple
    1616   \ingroup HiStats
    17    Simple NTuple class (a Table or 2-D data set) with floating value
    18    columns.
     17   Simple NTuple class (a Table or 2-D data set) with double or
     18   single precision floating point value columns.
    1919   \sa SOPHYA::ObjFileIO<NTuple>
    2020
     
    2323   // ...
    2424   char * names[3] = {"XPos", "YPos", "Val"};
    25    // NTuple (Table) creation with 3 columns
     25   // NTuple (Table) creation with 3 columns (double precision)
    2626   NTuple  nt(3, names);
    2727   // Filling the NTuple
    28    r_4 x[3];
     28   r_8 x[3];
    2929   for(int i=0; i<63; i++) {
    3030     x[0] = (i%9)-4.;  x[1] = (i/9)-3.;  x[2] = x[0]*x[0]+x[1]*x[1];
     
    385385int numb = n/mBlk;
    386386int offb = n-numb*mBlk;
    387 if (mFgDouble)
    388   memcpy(ret, (mPtrD[numb]+offb*mNVar), mNVar*sizeof(r_8));
    389 for(i=0; i<mNVar; i++) ret[i] = (mPtr[numb]+offb*mNVar)[i];
     387if (mFgDouble) memcpy(ret, (mPtrD[numb]+offb*mNVar), mNVar*sizeof(r_8));
     388else for(i=0; i<mNVar; i++) ret[i] = (mPtr[numb]+offb*mNVar)[i];
    390389return(ret);
    391390}
Note: See TracChangeset for help on using the changeset viewer.