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
TSparseTableI< TVal, GroupSize > Class Template Reference

#include <shash.h>

Collaboration diagram for TSparseTableI< TVal, GroupSize >:

Public Member Functions

 TSparseTableI ()
 
 TSparseTableI (const TGroupVI &BegIter, const TGroupVI &CurIter, const TGroupVI &EndIter, const int &Offset=0)
 
 TSparseTableI (const TSparseTableI &STI)
 
TSparseTableIoperator= (const TSparseTableI &STI)
 
bool operator== (const TSparseTableI &STI) const
 
bool operator< (const TSparseTableI &STI) const
 
TSparseTableIoperator++ (int)
 
TSparseTableIoperator-- (int)
 
int GetValN () const
 
bool IsEnd () const
 
TVal & operator* () const
 
TVal & operator() () const
 
TVal * operator-> () const
 

Private Types

typedef TSparseGroup< TVal,
GroupSize > 
TValGroup
 
typedef TVec< TValGroup >::TIter TGroupVI
 

Private Attributes

int CurOff
 
TGroupVI BegI
 
TGroupVI GroupI
 
TGroupVI EndI
 

Detailed Description

template<class TVal, uint16 GroupSize>
class TSparseTableI< TVal, GroupSize >

Definition at line 267 of file shash.h.

Member Typedef Documentation

template<class TVal , uint16 GroupSize>
typedef TVec<TValGroup>::TIter TSparseTableI< TVal, GroupSize >::TGroupVI
private

Definition at line 270 of file shash.h.

template<class TVal , uint16 GroupSize>
typedef TSparseGroup<TVal, GroupSize> TSparseTableI< TVal, GroupSize >::TValGroup
private

Definition at line 269 of file shash.h.

Constructor & Destructor Documentation

template<class TVal , uint16 GroupSize>
TSparseTableI< TVal, GroupSize >::TSparseTableI ( )
inline

Definition at line 274 of file shash.h.

274 : CurOff(0), GroupI(NULL), EndI(NULL) { }
TGroupVI EndI
Definition: shash.h:272
int CurOff
Definition: shash.h:271
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TSparseTableI< TVal, GroupSize >::TSparseTableI ( const TGroupVI BegIter,
const TGroupVI CurIter,
const TGroupVI EndIter,
const int &  Offset = 0 
)
inline

Definition at line 275 of file shash.h.

276  : CurOff(Offset), BegI(BegIter), GroupI(CurIter), EndI(EndIter) { }
TGroupVI EndI
Definition: shash.h:272
int CurOff
Definition: shash.h:271
TGroupVI BegI
Definition: shash.h:272
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TSparseTableI< TVal, GroupSize >::TSparseTableI ( const TSparseTableI< TVal, GroupSize > &  STI)
inline

Definition at line 277 of file shash.h.

277  :
278  CurOff(STI.CurOff), BegI(STI.BegI), GroupI(STI.GroupI), EndI(STI.EndI) { }
TGroupVI EndI
Definition: shash.h:272
int CurOff
Definition: shash.h:271
TGroupVI BegI
Definition: shash.h:272
TGroupVI GroupI
Definition: shash.h:272

Member Function Documentation

template<class TVal , uint16 GroupSize>
int TSparseTableI< TVal, GroupSize >::GetValN ( ) const
inline

Definition at line 300 of file shash.h.

References TSparseTableI< TVal, GroupSize >::BegI, TSparseTableI< TVal, GroupSize >::CurOff, and TSparseTableI< TVal, GroupSize >::GroupI.

300 { return int(GroupI-BegI)*GroupSize + GroupI->OffsetToPos(CurOff); }
int CurOff
Definition: shash.h:271
TGroupVI BegI
Definition: shash.h:272
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
bool TSparseTableI< TVal, GroupSize >::IsEnd ( ) const
inline

Definition at line 301 of file shash.h.

References TSparseTableI< TVal, GroupSize >::EndI, and TSparseTableI< TVal, GroupSize >::GroupI.

301 { return GroupI==EndI; }
TGroupVI EndI
Definition: shash.h:272
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TVal& TSparseTableI< TVal, GroupSize >::operator() ( ) const
inline

Definition at line 303 of file shash.h.

References TSparseTableI< TVal, GroupSize >::CurOff, and TSparseTableI< TVal, GroupSize >::GroupI.

303 { return GroupI->Offset(CurOff); }
int CurOff
Definition: shash.h:271
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TVal& TSparseTableI< TVal, GroupSize >::operator* ( ) const
inline

Definition at line 302 of file shash.h.

References TSparseTableI< TVal, GroupSize >::CurOff, and TSparseTableI< TVal, GroupSize >::GroupI.

Referenced by TSparseTableI< TVal, GroupSize >::operator->().

302 { return GroupI->Offset(CurOff); }
int CurOff
Definition: shash.h:271
TGroupVI GroupI
Definition: shash.h:272

Here is the caller graph for this function:

template<class TVal , uint16 GroupSize>
TSparseTableI& TSparseTableI< TVal, GroupSize >::operator++ ( int  )
inline

Definition at line 286 of file shash.h.

References TSparseTableI< TVal, GroupSize >::CurOff, TSparseTableI< TVal, GroupSize >::EndI, and TSparseTableI< TVal, GroupSize >::GroupI.

286  {
287  if (CurOff+1 == GroupI->Len()) { CurOff = 0;
288  if (GroupI < EndI) { GroupI++;
289  while (GroupI < EndI && GroupI->Empty()) { GroupI++; } }
290  } else { CurOff++; }
291  return *this;
292  }
TGroupVI EndI
Definition: shash.h:272
int CurOff
Definition: shash.h:271
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TSparseTableI& TSparseTableI< TVal, GroupSize >::operator-- ( int  )
inline

Definition at line 293 of file shash.h.

References TSparseTableI< TVal, GroupSize >::BegI, TSparseTableI< TVal, GroupSize >::CurOff, and TSparseTableI< TVal, GroupSize >::GroupI.

293  {
294  if (CurOff == 0) {
295  while (GroupI >= BegI && GroupI->Empty()) { GroupI--; }
296  if (GroupI >= BegI) CurOff = GroupI->Len()-1;
297  } else { CurOff--; }
298  return *this;
299  }
int CurOff
Definition: shash.h:271
TGroupVI BegI
Definition: shash.h:272
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TVal* TSparseTableI< TVal, GroupSize >::operator-> ( ) const
inline

Definition at line 304 of file shash.h.

References TSparseTableI< TVal, GroupSize >::operator*().

304 { return &(operator*()); }
TVal & operator*() const
Definition: shash.h:302

Here is the call graph for this function:

template<class TVal , uint16 GroupSize>
bool TSparseTableI< TVal, GroupSize >::operator< ( const TSparseTableI< TVal, GroupSize > &  STI) const
inline

Definition at line 284 of file shash.h.

References TSparseTableI< TVal, GroupSize >::CurOff, and TSparseTableI< TVal, GroupSize >::GroupI.

284  {
285  return GroupI < STI.GroupI || (GroupI == STI.GroupI && CurOff < STI.CurOff); }
int CurOff
Definition: shash.h:271
TGroupVI GroupI
Definition: shash.h:272
template<class TVal , uint16 GroupSize>
TSparseTableI& TSparseTableI< TVal, GroupSize >::operator= ( const TSparseTableI< TVal, GroupSize > &  STI)
inline
template<class TVal , uint16 GroupSize>
bool TSparseTableI< TVal, GroupSize >::operator== ( const TSparseTableI< TVal, GroupSize > &  STI) const
inline

Definition at line 282 of file shash.h.

References TSparseTableI< TVal, GroupSize >::CurOff, and TSparseTableI< TVal, GroupSize >::GroupI.

282  {
283  return GroupI == STI.GroupI && CurOff == STI.CurOff; }
int CurOff
Definition: shash.h:271
TGroupVI GroupI
Definition: shash.h:272

Member Data Documentation

template<class TVal , uint16 GroupSize>
TGroupVI TSparseTableI< TVal, GroupSize >::BegI
private
template<class TVal , uint16 GroupSize>
TGroupVI TSparseTableI< TVal, GroupSize >::EndI
private

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