SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TVVVec< TVal > Class Template Reference

#include <ds.h>

Public Member Functions

 TVVVec ()
 
 TVVVec (const TVVVec &Vec)
 
 TVVVec (const int &_XDim, const int &_YDim, const int &_ZDim)
 
 TVVVec (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
TVVVec< TVal > & operator= (const TVVVec< TVal > &Vec)
 
bool operator== (const TVVVec &Vec) const
 
bool Empty () const
 
void Clr ()
 
void Gen (const int &_XDim, const int &_YDim, const int &_ZDim)
 
TVal & At (const int &X, const int &Y, const int &Z)
 
const TVal & At (const int &X, const int &Y, const int &Z) const
 
TVal & operator() (const int &X, const int &Y, const int &Z)
 
const TVal & operator() (const int &X, const int &Y, const int &Z) const
 
int GetXDim () const
 
int GetYDim () const
 
int GetZDim () const
 

Private Attributes

TInt XDim
 
TInt YDim
 
TInt ZDim
 
TVec< TVal > ValV
 

Detailed Description

template<class TVal>
class TVVVec< TVal >

Definition at line 2344 of file ds.h.

Constructor & Destructor Documentation

template<class TVal>
TVVVec< TVal >::TVVVec ( )
inline

Definition at line 2349 of file ds.h.

2349 : XDim(), YDim(), ZDim(), ValV(){}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346
template<class TVal>
TVVVec< TVal >::TVVVec ( const TVVVec< TVal > &  Vec)
inline

Definition at line 2350 of file ds.h.

2350  :
2351  XDim(Vec.XDim), YDim(Vec.YDim), ZDim(Vec.ZDim), ValV(Vec.ValV){}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346
template<class TVal>
TVVVec< TVal >::TVVVec ( const int &  _XDim,
const int &  _YDim,
const int &  _ZDim 
)
inline

Definition at line 2352 of file ds.h.

2352  :
2353  XDim(), YDim(), ZDim(), ValV(){Gen(_XDim, _YDim, _ZDim);}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346
void Gen(const int &_XDim, const int &_YDim, const int &_ZDim)
Definition: ds.h:2369
template<class TVal>
TVVVec< TVal >::TVVVec ( TSIn SIn)
inlineexplicit

Definition at line 2354 of file ds.h.

2354  :
2355  XDim(SIn), YDim(SIn), ZDim(SIn), ValV(SIn){}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346

Member Function Documentation

template<class TVal>
TVal& TVVVec< TVal >::At ( const int &  X,
const int &  Y,
const int &  Z 
)
inline

Definition at line 2372 of file ds.h.

2372  {
2373  Assert((0<=X)&&(X<int(XDim))&&(0<=Y)&&(Y<int(YDim))&&(0<=Z)&&(Z<int(ZDim)));
2374  return ValV[X*YDim*ZDim+Y*ZDim+Z];}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
#define Assert(Cond)
Definition: bd.h:251
TInt YDim
Definition: ds.h:2346
template<class TVal>
const TVal& TVVVec< TVal >::At ( const int &  X,
const int &  Y,
const int &  Z 
) const
inline

Definition at line 2375 of file ds.h.

2375  {
2376  Assert((0<=X)&&(X<int(XDim))&&(0<=Y)&&(Y<int(YDim))&&(0<=Z)&&(Z<int(ZDim)));
2377  return ValV[X*YDim*ZDim+Y*ZDim+Z];}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
#define Assert(Cond)
Definition: bd.h:251
TInt YDim
Definition: ds.h:2346
template<class TVal>
void TVVVec< TVal >::Clr ( )
inline

Definition at line 2368 of file ds.h.

2368 {XDim=0; YDim=0; ZDim=0; ValV.Clr();}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:971
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346
template<class TVal>
bool TVVVec< TVal >::Empty ( ) const
inline

Definition at line 2367 of file ds.h.

2367 {return ValV.Len()==0;}
TVec< TVal > ValV
Definition: ds.h:2347
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
template<class TVal>
void TVVVec< TVal >::Gen ( const int &  _XDim,
const int &  _YDim,
const int &  _ZDim 
)
inline

Definition at line 2369 of file ds.h.

2369  {
2370  Assert((_XDim>=0)&&(_YDim>=0)&&(_ZDim>=0));
2371  XDim=_XDim; YDim=_YDim; ZDim=_ZDim; ValV.Gen(XDim*YDim*ZDim);}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
#define Assert(Cond)
Definition: bd.h:251
TInt YDim
Definition: ds.h:2346
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
template<class TVal>
int TVVVec< TVal >::GetXDim ( ) const
inline

Definition at line 2382 of file ds.h.

2382 {return XDim;}
TInt XDim
Definition: ds.h:2346
template<class TVal>
int TVVVec< TVal >::GetYDim ( ) const
inline

Definition at line 2383 of file ds.h.

2383 {return YDim;}
TInt YDim
Definition: ds.h:2346
template<class TVal>
int TVVVec< TVal >::GetZDim ( ) const
inline

Definition at line 2384 of file ds.h.

2384 {return ZDim;}
TInt ZDim
Definition: ds.h:2346
template<class TVal>
TVal& TVVVec< TVal >::operator() ( const int &  X,
const int &  Y,
const int &  Z 
)
inline

Definition at line 2378 of file ds.h.

2378  {
2379  return At(X, Y, Z);}
TVal & At(const int &X, const int &Y, const int &Z)
Definition: ds.h:2372
template<class TVal>
const TVal& TVVVec< TVal >::operator() ( const int &  X,
const int &  Y,
const int &  Z 
) const
inline

Definition at line 2380 of file ds.h.

2380  {
2381  return At(X, Y, Z);}
TVal & At(const int &X, const int &Y, const int &Z)
Definition: ds.h:2372
template<class TVal>
TVVVec<TVal>& TVVVec< TVal >::operator= ( const TVVVec< TVal > &  Vec)
inline

Definition at line 2359 of file ds.h.

2359  {
2360  XDim=Vec.XDim; YDim=Vec.YDim; ZDim=Vec.ZDim; ValV=Vec.ValV;
2361  return *this;
2362  }
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346
template<class TVal>
bool TVVVec< TVal >::operator== ( const TVVVec< TVal > &  Vec) const
inline

Definition at line 2363 of file ds.h.

2363  {
2364  return (XDim==Vec.XDim)&&(YDim==Vec.YDim)&&(ZDim==Vec.ZDim)&&
2365  (ValV==Vec.ValV);}
TVec< TVal > ValV
Definition: ds.h:2347
TInt ZDim
Definition: ds.h:2346
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346
template<class TVal>
void TVVVec< TVal >::Save ( TSOut SOut) const
inline

Definition at line 2356 of file ds.h.

2356  {
2357  XDim.Save(SOut); YDim.Save(SOut); ZDim.Save(SOut); ValV.Save(SOut);}
TVec< TVal > ValV
Definition: ds.h:2347
void Save(TSOut &SOut) const
Definition: dt.h:1060
TInt ZDim
Definition: ds.h:2346
void Save(TSOut &SOut) const
Definition: ds.h:903
TInt XDim
Definition: ds.h:2346
TInt YDim
Definition: ds.h:2346

Member Data Documentation

template<class TVal>
TVec<TVal> TVVVec< TVal >::ValV
private

Definition at line 2347 of file ds.h.

template<class TVal>
TInt TVVVec< TVal >::XDim
private

Definition at line 2346 of file ds.h.

template<class TVal>
TInt TVVVec< TVal >::YDim
private

Definition at line 2346 of file ds.h.

template<class TVal>
TInt TVVVec< TVal >::ZDim
private

Definition at line 2346 of file ds.h.


The documentation for this class was generated from the following file: