Changeset 2667 in Sophya for trunk/SophyaLib/HiStats
- Timestamp:
- Apr 15, 2005, 1:51:38 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/ntuple.cc
r2663 r2667 15 15 \class SOPHYA::NTuple 16 16 \ingroup HiStats 17 Simple NTuple class (a Table or 2-D data set) with floating value18 columns.17 Simple NTuple class (a Table or 2-D data set) with double or 18 single precision floating point value columns. 19 19 \sa SOPHYA::ObjFileIO<NTuple> 20 20 … … 23 23 // ... 24 24 char * names[3] = {"XPos", "YPos", "Val"}; 25 // NTuple (Table) creation with 3 columns 25 // NTuple (Table) creation with 3 columns (double precision) 26 26 NTuple nt(3, names); 27 27 // Filling the NTuple 28 r_ 4x[3];28 r_8 x[3]; 29 29 for(int i=0; i<63; i++) { 30 30 x[0] = (i%9)-4.; x[1] = (i/9)-3.; x[2] = x[0]*x[0]+x[1]*x[1]; … … 385 385 int numb = n/mBlk; 386 386 int 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]; 387 if (mFgDouble) memcpy(ret, (mPtrD[numb]+offb*mNVar), mNVar*sizeof(r_8)); 388 else for(i=0; i<mNVar; i++) ret[i] = (mPtr[numb]+offb*mNVar)[i]; 390 389 return(ret); 391 390 }
Note:
See TracChangeset
for help on using the changeset viewer.