SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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, TSizeTy > Class Template Reference

#include <ds.h>

Collaboration diagram for TVVVec< TVal, TSizeTy >:

Public Member Functions

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

Private Attributes

TInt64 XDim
 
TInt64 YDim
 
TInt64 ZDim
 
TVec< TVal, TSizeTy > ValV
 

Detailed Description

template<class TVal, class TSizeTy = int>
class TVVVec< TVal, TSizeTy >

Definition at line 2409 of file ds.h.

Constructor & Destructor Documentation

template<class TVal, class TSizeTy = int>
TVVVec< TVal, TSizeTy >::TVVVec ( )
inline

Definition at line 2414 of file ds.h.

2414 : XDim(), YDim(), ZDim(), ValV(){}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
TVVVec< TVal, TSizeTy >::TVVVec ( const TVVVec< TVal, TSizeTy > &  Vec)
inline

Definition at line 2415 of file ds.h.

2415  :
2416  XDim(Vec.XDim), YDim(Vec.YDim), ZDim(Vec.ZDim), ValV(Vec.ValV){}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
TVVVec< TVal, TSizeTy >::TVVVec ( const TSizeTy &  _XDim,
const TSizeTy &  _YDim,
const TSizeTy &  _ZDim 
)
inline

Definition at line 2417 of file ds.h.

References TVVVec< TVal, TSizeTy >::Gen().

2417  :
2418  XDim(), YDim(), ZDim(), ValV(){Gen(_XDim, _YDim, _ZDim);}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
void Gen(const TSizeTy &_XDim, const TSizeTy &_YDim, const TSizeTy &_ZDim)
Definition: ds.h:2434

Here is the call graph for this function:

template<class TVal, class TSizeTy = int>
TVVVec< TVal, TSizeTy >::TVVVec ( TSIn SIn)
inlineexplicit

Definition at line 2419 of file ds.h.

2419  :
2420  XDim(SIn), YDim(SIn), ZDim(SIn), ValV(SIn){}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412

Member Function Documentation

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

Definition at line 2437 of file ds.h.

References Assert, TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

Referenced by TVVVec< TVal, TSizeTy >::operator()().

2437  {
2438  Assert((0<=X)&&(X<TSizeTy(XDim))&&(0<=Y)&&(Y<TSizeTy(YDim))&&(0<=Z)&&(Z<TSizeTy(ZDim)));
2439  return ValV[X*YDim*ZDim+Y*ZDim+Z];}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
#define Assert(Cond)
Definition: bd.h:251
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412

Here is the caller graph for this function:

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

Definition at line 2440 of file ds.h.

References Assert, TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

2440  {
2441  Assert((0<=X)&&(X<TSizeTy(XDim))&&(0<=Y)&&(Y<TSizeTy(YDim))&&(0<=Z)&&(Z<TSizeTy(ZDim)));
2442  return ValV[X*YDim*ZDim+Y*ZDim+Z];}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
#define Assert(Cond)
Definition: bd.h:251
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
void TVVVec< TVal, TSizeTy >::Clr ( )
inline

Definition at line 2433 of file ds.h.

References TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

2433 {XDim=0; YDim=0; ZDim=0; ValV.Clr();}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
bool TVVVec< TVal, TSizeTy >::Empty ( ) const
inline

Definition at line 2432 of file ds.h.

References TVVVec< TVal, TSizeTy >::ValV.

2432 {return ValV.Len()==0;}
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
void TVVVec< TVal, TSizeTy >::Gen ( const TSizeTy &  _XDim,
const TSizeTy &  _YDim,
const TSizeTy &  _ZDim 
)
inline

Definition at line 2434 of file ds.h.

References Assert, TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

Referenced by TVVVec< TVal, TSizeTy >::TVVVec().

2434  {
2435  Assert((_XDim>=0)&&(_YDim>=0)&&(_ZDim>=0));
2436  XDim=_XDim; YDim=_YDim; ZDim=_ZDim; ValV.Gen(XDim*YDim*ZDim);}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
#define Assert(Cond)
Definition: bd.h:251
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412

Here is the caller graph for this function:

template<class TVal, class TSizeTy = int>
TSizeTy TVVVec< TVal, TSizeTy >::GetXDim ( ) const
inline

Definition at line 2447 of file ds.h.

References TVVVec< TVal, TSizeTy >::XDim.

2447 {return XDim;}
TInt64 XDim
Definition: ds.h:2411
template<class TVal, class TSizeTy = int>
TSizeTy TVVVec< TVal, TSizeTy >::GetYDim ( ) const
inline

Definition at line 2448 of file ds.h.

References TVVVec< TVal, TSizeTy >::YDim.

2448 {return YDim;}
TInt64 YDim
Definition: ds.h:2411
template<class TVal, class TSizeTy = int>
TSizeTy TVVVec< TVal, TSizeTy >::GetZDim ( ) const
inline

Definition at line 2449 of file ds.h.

References TVVVec< TVal, TSizeTy >::ZDim.

2449 {return ZDim;}
TInt64 ZDim
Definition: ds.h:2411
template<class TVal, class TSizeTy = int>
TVal& TVVVec< TVal, TSizeTy >::operator() ( const TSizeTy &  X,
const TSizeTy &  Y,
const TSizeTy &  Z 
)
inline

Definition at line 2443 of file ds.h.

References TVVVec< TVal, TSizeTy >::At().

2443  {
2444  return At(X, Y, Z);}
TVal & At(const TSizeTy &X, const TSizeTy &Y, const TSizeTy &Z)
Definition: ds.h:2437

Here is the call graph for this function:

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

Definition at line 2445 of file ds.h.

References TVVVec< TVal, TSizeTy >::At().

2445  {
2446  return At(X, Y, Z);}
TVal & At(const TSizeTy &X, const TSizeTy &Y, const TSizeTy &Z)
Definition: ds.h:2437

Here is the call graph for this function:

template<class TVal, class TSizeTy = int>
TVVVec<TVal, TSizeTy>& TVVVec< TVal, TSizeTy >::operator= ( const TVVVec< TVal, TSizeTy > &  Vec)
inline

Definition at line 2424 of file ds.h.

References TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

2424  {
2425  XDim=Vec.XDim; YDim=Vec.YDim; ZDim=Vec.ZDim; ValV=Vec.ValV;
2426  return *this;
2427  }
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
bool TVVVec< TVal, TSizeTy >::operator== ( const TVVVec< TVal, TSizeTy > &  Vec) const
inline

Definition at line 2428 of file ds.h.

References TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

2428  {
2429  return (XDim==Vec.XDim)&&(YDim==Vec.YDim)&&(ZDim==Vec.ZDim)&&
2430  (ValV==Vec.ValV);}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412
template<class TVal, class TSizeTy = int>
void TVVVec< TVal, TSizeTy >::Save ( TSOut SOut) const
inline

Definition at line 2421 of file ds.h.

References TNum< int64 >::Save(), TVVVec< TVal, TSizeTy >::ValV, TVVVec< TVal, TSizeTy >::XDim, TVVVec< TVal, TSizeTy >::YDim, and TVVVec< TVal, TSizeTy >::ZDim.

2421  {
2422  XDim.Save(SOut); YDim.Save(SOut); ZDim.Save(SOut); ValV.Save(SOut);}
TInt64 YDim
Definition: ds.h:2411
TInt64 ZDim
Definition: ds.h:2411
TInt64 XDim
Definition: ds.h:2411
void Save(TSOut &SOut) const
Definition: dt.h:904
TVec< TVal, TSizeTy > ValV
Definition: ds.h:2412

Here is the call graph for this function:

Member Data Documentation


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