SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <ds.h>
Public Member Functions | |
TTuple () | |
TTuple (const TVal &InitVal) | |
TTuple (const TTuple &Tup) | |
TTuple (TSIn &SIn) | |
void | Save (TSOut &SOut) const |
void | Load (TSIn &SIn) |
int | Len () const |
TVal & | operator[] (const int &ValN) |
const TVal & | operator[] (const int &ValN) const |
TTuple & | operator= (const TTuple &Tup) |
bool | operator== (const TTuple &Tup) const |
bool | operator< (const TTuple &Tup) const |
void | Sort (const bool &Asc=true) |
int | FindMx () const |
int | FindMn () const |
int | GetPrimHashCd () const |
int | GetSecHashCd () const |
TStr | GetStr () const |
Private Attributes | |
TVal | ValV [NVals] |
Definition at line 251 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
TTuple< TVal, NVals >::TTuple | ( | const TTuple< TVal, NVals > & | Tup | ) | [inline] |
Definition at line 252 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
Definition at line 253 of file ds.h.
References TTuple< TVal, NVals >::Len(), TTuple< TVal, NVals >::Load(), and TTuple< TVal, NVals >::ValV.
int TTuple< TVal, NVals >::GetPrimHashCd | ( | ) | const [inline] |
Definition at line 276 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
{ uint HashCd = 5381; for (int i=0; i<Len(); i++) { HashCd = ((HashCd << 13) + HashCd) + ValV[i].GetPrimHashCd(); } return int(HashCd&0x7fffffff); }
int TTuple< TVal, NVals >::GetSecHashCd | ( | ) | const [inline] |
Definition at line 278 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
{ uint HashCd = 5381; for (int i=0; i<Len(); i++) { HashCd = ((HashCd << 19) + HashCd) + ValV[i].GetSecHashCd(); } return int(HashCd&0x7fffffff); }
Definition at line 280 of file ds.h.
References TStr::Fmt(), TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
{ TChA ValsStr; for (int i=0; i<Len(); i++) { ValsStr+=" "+ValV[i].GetStr(); } return TStr::Fmt("Tuple(%d):", Len())+ValsStr; }
Definition at line 257 of file ds.h.
Referenced by TTuple< TVal, NVals >::GetPrimHashCd(), TTuple< TVal, NVals >::GetSecHashCd(), TTuple< TVal, NVals >::GetStr(), TTuple< TVal, NVals >::Load(), TTuple< TVal, NVals >::operator<(), TTuple< TVal, NVals >::operator=(), TTuple< TVal, NVals >::operator==(), TTuple< TVal, NVals >::Save(), and TTuple< TVal, NVals >::TTuple().
{ return NVals; }
Definition at line 255 of file ds.h.
References TTuple< TVal, NVals >::Len(), TTuple< TVal, NVals >::Load(), and TTuple< TVal, NVals >::ValV.
Referenced by TTuple< TVal, NVals >::Load(), and TTuple< TVal, NVals >::TTuple().
bool TTuple< TVal, NVals >::operator< | ( | const TTuple< TVal, NVals > & | Tup | ) | const [inline] |
Definition at line 265 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
{ if (Len() == Tup.Len()) { for (int i=0; i<Len(); i++) { if(ValV[i]<Tup[i]){return true;} else if(ValV[i]>Tup[i]){return false;} } return false; } else { return Len() < Tup.Len(); } }
TTuple& TTuple< TVal, NVals >::operator= | ( | const TTuple< TVal, NVals > & | Tup | ) | [inline] |
Definition at line 260 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
bool TTuple< TVal, NVals >::operator== | ( | const TTuple< TVal, NVals > & | Tup | ) | const [inline] |
Definition at line 262 of file ds.h.
References TTuple< TVal, NVals >::Len(), and TTuple< TVal, NVals >::ValV.
{ if (Len()!=Tup.Len()) { return false; } if (&Tup==this) { return true; } for (int i=0; i<Len(); i++) if(ValV[i]!=Tup[i]){return false;} return true; }
TVal& TTuple< TVal, NVals >::operator[] | ( | const int & | ValN | ) | [inline] |
const TVal& TTuple< TVal, NVals >::operator[] | ( | const int & | ValN | ) | const [inline] |
Definition at line 254 of file ds.h.
References TTuple< TVal, NVals >::Len(), TTuple< TVal, NVals >::Save(), and TTuple< TVal, NVals >::ValV.
Referenced by TTuple< TVal, NVals >::Save().
Definition at line 286 of file ds.h.
References TVec< TVal >::Add(), and TVec< TVal >::Sort().
{ TVec<TVal> V(NVals); for (int i=0; i<NVals; i++) { V.Add(ValV[i]); } V.Sort(Asc); for (int i=0; i<NVals; i++) { ValV[i] = V[i]; } }
Definition at line 248 of file ds.h.
Referenced by TTuple< TVal, NVals >::GetPrimHashCd(), TTuple< TVal, NVals >::GetSecHashCd(), TTuple< TVal, NVals >::GetStr(), TTuple< TVal, NVals >::Load(), TTuple< TVal, NVals >::operator<(), TTuple< TVal, NVals >::operator=(), TTuple< TVal, NVals >::operator==(), TTuple< TVal, NVals >::operator[](), TTuple< TVal, NVals >::Save(), and TTuple< TVal, NVals >::TTuple().