SNAP Library 2.3, User Reference  2014-06-16 11:58:46
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
TGLib_OLD::TVecPool< TVal > Class Template Reference

#include <ds.h>

Public Types

typedef TPt< TVecPool< TVal > > PVecPool
 
typedef TVec< TVal > TValV
 

Public Member Functions

 TVecPool (const ::TSize &ExpectVals=0, const ::TSize &_GrowBy=1000000, const bool &_FastCopy=false, const TVal &_EmptyVal=TVal())
 
 TVecPool (const TVecPool &Pool)
 
 TVecPool (TSIn &SIn)
 
 ~TVecPool ()
 
void Save (TSOut &SOut) const
 
TVecPooloperator= (const TVecPool &Pool)
 
::TSize GetVals () const
 
::TSize GetVecs () const
 
bool IsVId (const int &VId) const
 
::TSize Reserved () const
 
void Reserve (const ::TSize &MxVals)
 
const TVal & GetEmptyVal () const
 
void SetEmptyVal (const TVal &_EmptyVal)
 
::TSize GetMemUsed () const
 
int AddV (const TValV &ValV)
 
int AddEmptyV (const int &ValVLen)
 
uint GetVLen (const int &VId) const
 
TVal * GetValVPt (const int &VId) const
 
void GetV (const int &VId, TValV &ValV) const
 
void PutV (const int &VId, const TValV &ValV)
 
void CompactPool (const TVal &DelVal)
 
void ShuffleAll (TRnd &Rnd=TInt::Rnd)
 
void Clr (bool DoDel=true)
 
void PutAll (const TVal &Val)
 

Static Public Member Functions

static PVecPool New (const ::TSize &ExpectVals=0, const ::TSize &GrowBy=1000000, const bool &FastCopy=false)
 
static PVecPool Load (TSIn &SIn)
 
static PVecPool Load (const TStr &FNm)
 

Private Member Functions

void Resize (const ::TSize &_MxVals)
 

Private Attributes

TCRef CRef
 
TBool FastCopy
 
::TSize GrowBy
 
::TSize MxVals
 
::TSize Vals
 
TVal EmptyVal
 
TVal * ValBf
 
TVec< ::TSizeIdToOffV
 

Friends

class TPt< TVecPool< TVal > >
 

Detailed Description

template<class TVal>
class TGLib_OLD::TVecPool< TVal >

Definition at line 2816 of file ds.h.

Member Typedef Documentation

template<class TVal >
typedef TPt<TVecPool<TVal> > TGLib_OLD::TVecPool< TVal >::PVecPool

Definition at line 2818 of file ds.h.

template<class TVal >
typedef TVec<TVal> TGLib_OLD::TVecPool< TVal >::TValV

Definition at line 2819 of file ds.h.

Constructor & Destructor Documentation

template<class TVal >
TVecPool< TVal >::TVecPool ( const ::TSize ExpectVals = 0,
const ::TSize _GrowBy = 1000000,
const bool &  _FastCopy = false,
const TVal &  _EmptyVal = TVal() 
)

Definition at line 2915 of file ds.h.

2915  :
2916  GrowBy(_GrowBy), MxVals(0), Vals(0), EmptyVal(_EmptyVal), ValBf(NULL) {
2917  IdToOffV.Add(0);
2918  Resize(ExpectVals);
2919 }
::TSize Vals
Definition: ds.h:2823
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
::TSize MxVals
Definition: ds.h:2823
void Resize(const ::TSize &_MxVals)
Definition: ds.h:2888
TVal * ValBf
Definition: ds.h:2825
int Add()
Definition: ds.h:1563
template<class TVal >
TVecPool< TVal >::TVecPool ( const TVecPool< TVal > &  Pool)

Definition at line 2922 of file ds.h.

2922  :
2923  FastCopy(Pool.FastCopy), GrowBy(Pool.GrowBy),
2924  MxVals(Pool.MxVals), Vals(Pool.Vals), EmptyVal(Pool.EmptyVal), IdToOffV(Pool.IdToOffV) {
2925  try { ValBf = new TVal [MxVals]; }
2926  catch (std::exception Ex) { FailR(TStr::Fmt("TVecPool::TVecPool: %s, MxVals: %d", Ex.what(), MxVals).CStr()); }
2927  IAssert(ValBf != NULL);
2928  if (FastCopy) {
2929  memcpy(ValBf, Pool.ValBf, MxVals*sizeof(TVal)); }
2930  else {
2931  for (TSize ValN = 0; ValN < MxVals; ValN++){ ValBf[ValN] = Pool.ValBf[ValN]; } }
2932 }
#define IAssert(Cond)
Definition: bd.h:262
::TSize Vals
Definition: ds.h:2823
TVal * ValBf
Definition: ds.h:2559
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
TSize GrowBy
Definition: ds.h:2557
TVal EmptyVal
Definition: ds.h:2558
::TSize MxVals
Definition: ds.h:2823
size_t TSize
Definition: bd.h:58
#define FailR(Reason)
Definition: bd.h:240
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TBool FastCopy
Definition: ds.h:2556
TVal * ValBf
Definition: ds.h:2825
TVec< uint64, int > IdToOffV
Definition: ds.h:2560
TBool FastCopy
Definition: ds.h:2822
TSize Vals
Definition: ds.h:2557
TSize MxVals
Definition: ds.h:2557
template<class TVal >
TVecPool< TVal >::TVecPool ( TSIn SIn)

Definition at line 2935 of file ds.h.

2935  :
2936  FastCopy(SIn) {
2937  uint64 _GrowBy, _MxVals, _Vals;
2938  SIn.Load(_GrowBy); SIn.Load(_MxVals); SIn.Load(_Vals);
2939  IAssert(_GrowBy<TSizeMx && _MxVals<TSizeMx && _Vals<TSizeMx);
2940  GrowBy=TSize(_GrowBy); MxVals=TSize(_Vals); Vals=TSize(_Vals); //note MxVals==Vals
2941  EmptyVal = TVal(SIn);
2942  if (MxVals==0) { ValBf = NULL; } else { ValBf = new TVal [MxVals]; }
2943  for (TSize ValN = 0; ValN < Vals; ValN++) { ValBf[ValN] = TVal(SIn); }
2944  { TInt MxVals(SIn), Vals(SIn);
2945  IdToOffV.Gen(Vals);
2946  for (int ValN = 0; ValN < Vals; ValN++) {
2947  uint64 Offset; SIn.Load(Offset); IAssert(Offset < TSizeMx);
2948  IdToOffV[ValN]=TSize(Offset);
2949  } }
2950 }
#define IAssert(Cond)
Definition: bd.h:262
::TSize Vals
Definition: ds.h:2823
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
void Gen(const int &_Vals)
Definition: ds.h:1524
::TSize MxVals
Definition: ds.h:2823
unsigned long long uint64
Definition: bd.h:38
void Load(bool &Bool)
Definition: fl.h:84
#define TSizeMx
Definition: bd.h:59
size_t TSize
Definition: bd.h:58
Definition: dt.h:1041
TVal * ValBf
Definition: ds.h:2825
TBool FastCopy
Definition: ds.h:2822
template<class TVal >
TGLib_OLD::TVecPool< TVal >::~TVecPool ( )
inline

Definition at line 2833 of file ds.h.

2833 { if (ValBf != NULL) { delete [] ValBf; } ValBf=NULL; }
TVal * ValBf
Definition: ds.h:2825

Member Function Documentation

template<class TVal >
int TVecPool< TVal >::AddEmptyV ( const int &  ValVLen)

Definition at line 2997 of file ds.h.

2997  {
2998  if (ValVLen==0){return 0;}
2999  if (MxVals < Vals+ValVLen){Resize(Vals+max(TSize(ValVLen), GrowBy)); }
3000  Vals+=ValVLen; IdToOffV.Add(Vals);
3001  return IdToOffV.Len()-1;
3002 }
::TSize Vals
Definition: ds.h:2823
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
::TSize MxVals
Definition: ds.h:2823
void Resize(const ::TSize &_MxVals)
Definition: ds.h:2888
size_t TSize
Definition: bd.h:58
#define max(a, b)
Definition: bd.h:350
int Len() const
Definition: ds.h:1547
int Add()
Definition: ds.h:1563
template<class TVal >
int TVecPool< TVal >::AddV ( const TValV ValV)

Definition at line 2986 of file ds.h.

2986  {
2987  const ::TSize ValVLen = ValV.Len();
2988  if (ValVLen == 0) { return 0; }
2989  if (MxVals < Vals+ValVLen) { Resize(Vals+max(ValVLen, GrowBy)); }
2990  if (FastCopy) { memcpy(ValBf+Vals, ValV.BegI(), sizeof(TVal)*ValV.Len()); }
2991  else { for (uint ValN=0; ValN < ValVLen; ValN++) { ValBf[Vals+ValN]=ValV[ValN]; } }
2992  Vals+=ValVLen; IdToOffV.Add(Vals);
2993  return IdToOffV.Len()-1;
2994 }
::TSize Vals
Definition: ds.h:2823
unsigned int uint
Definition: bd.h:11
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
::TSize MxVals
Definition: ds.h:2823
void Resize(const ::TSize &_MxVals)
Definition: ds.h:2888
size_t TSize
Definition: bd.h:58
#define max(a, b)
Definition: bd.h:350
TVal * ValBf
Definition: ds.h:2825
int Len() const
Definition: ds.h:1547
TBool FastCopy
Definition: ds.h:2822
int Add()
Definition: ds.h:1563
template<class TVal >
void TGLib_OLD::TVecPool< TVal >::Clr ( bool  DoDel = true)
inline

Definition at line 2876 of file ds.h.

2876  {
2877  IdToOffV.Clr(DoDel); MxVals=0; Vals=0;
2878  if (DoDel && ValBf!=NULL) { delete [] ValBf; ValBf=NULL;}
2879  if (! DoDel) { PutAll(EmptyVal); }
2880  }
::TSize Vals
Definition: ds.h:2823
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
void PutAll(const TVal &Val)
Definition: ds.h:2881
::TSize MxVals
Definition: ds.h:2823
TVal * ValBf
Definition: ds.h:2825
void Clr(const bool &DoDel=true, const int &NoDelLim=-1)
Definition: ds.h:1904
template<class TVal >
void TVecPool< TVal >::CompactPool ( const TVal &  DelVal)

Definition at line 3007 of file ds.h.

3007  {
3008  ::TSize TotalDel=0, NDel=0;
3009  // printf("Compacting %d vectors\n", IdToOffV.Len());
3010  for (int vid = 1; vid < IdToOffV.Len(); vid++) {
3011  // if (vid % 10000000 == 0) { printf(" %dm", vid/1000000); fflush(stdout); }
3012  const uint Len = GetVLen(vid);
3013  TVal* ValV = GetValVPt(vid);
3014  if (TotalDel > 0) { IdToOffV[vid-1] -= TotalDel; } // update end of vector
3015  if (Len == 0) { continue; }
3016  NDel = 0;
3017  for (TVal* v = ValV; v < ValV+Len-NDel; v++) {
3018  if (*v == DelVal) {
3019  TVal* Beg = v;
3020  while (*v == DelVal && v < ValV+Len) { v++; NDel++; }
3021  memcpy(Beg, v, sizeof(TVal)*int(Len - ::TSize(v - ValV)));
3022  v -= NDel;
3023  }
3024  }
3025  memcpy(ValV-TotalDel, ValV, sizeof(TVal)*Len); // move data
3026  TotalDel += NDel;
3027  }
3028  IdToOffV.Last() -= TotalDel;
3029  for (::TSize i = Vals-TotalDel; i < Vals; i++) { ValBf[i] = EmptyVal; }
3030  Vals -= TotalDel;
3031  // printf(" deleted %llu elements from the pool\n", TotalDel);
3032 }
::TSize Vals
Definition: ds.h:2823
unsigned int uint
Definition: bd.h:11
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
uint GetVLen(const int &VId) const
Definition: ds.h:2854
size_t TSize
Definition: bd.h:58
TVal * ValBf
Definition: ds.h:2825
const TVal & Last() const
Definition: ds.h:1549
int Len() const
Definition: ds.h:1547
TVal * GetValVPt(const int &VId) const
Definition: ds.h:2857
template<class TVal >
const TVal& TGLib_OLD::TVecPool< TVal >::GetEmptyVal ( ) const
inline

Definition at line 2847 of file ds.h.

2847 { return EmptyVal; }
template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::GetMemUsed ( ) const
inline

Definition at line 2849 of file ds.h.

2849  {
2850  return sizeof(TCRef)+sizeof(TBool)+3*sizeof(TSize)+sizeof(TVal*)+MxVals*sizeof(TVal);}
Definition: bd.h:440
::TSize MxVals
Definition: ds.h:2823
size_t TSize
Definition: bd.h:58
Definition: dt.h:881
template<class TVal >
void TGLib_OLD::TVecPool< TVal >::GetV ( const int &  VId,
TValV ValV 
) const
inline

Definition at line 2860 of file ds.h.

2860  {
2861  if (GetVLen(VId)==0){ValV.Clr();}
2862  else { ValV.GenExt(GetValVPt(VId), GetVLen(VId)); } }
uint GetVLen(const int &VId) const
Definition: ds.h:2854
TVal * GetValVPt(const int &VId) const
Definition: ds.h:2857
template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::GetVals ( ) const
inline

Definition at line 2842 of file ds.h.

2842 { return Vals; }
::TSize Vals
Definition: ds.h:2823
template<class TVal >
TVal* TGLib_OLD::TVecPool< TVal >::GetValVPt ( const int &  VId) const
inline

Definition at line 2857 of file ds.h.

2857  {
2858  if (GetVLen(VId)==0){return (TVal*)&EmptyVal;}
2859  else {return ValBf+IdToOffV[VId-1];}}
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
uint GetVLen(const int &VId) const
Definition: ds.h:2854
TVal * ValBf
Definition: ds.h:2825
template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::GetVecs ( ) const
inline

Definition at line 2843 of file ds.h.

2843 { return IdToOffV.Len(); }
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
int Len() const
Definition: ds.h:1547
template<class TVal >
uint TGLib_OLD::TVecPool< TVal >::GetVLen ( const int &  VId) const
inline

Definition at line 2854 of file ds.h.

2854  {
2855  if (VId==0){return 0;}
2856  else {return uint(IdToOffV[VId]-IdToOffV[VId-1]);}}
unsigned int uint
Definition: bd.h:11
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
template<class TVal >
bool TGLib_OLD::TVecPool< TVal >::IsVId ( const int &  VId) const
inline

Definition at line 2844 of file ds.h.

2844 { return (0 <= VId) && (VId < IdToOffV.Len()); }
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
int Len() const
Definition: ds.h:1547
template<class TVal >
static PVecPool TGLib_OLD::TVecPool< TVal >::Load ( TSIn SIn)
inlinestatic

Definition at line 2836 of file ds.h.

2836 { return new TVecPool(SIn); }
TVecPool(const ::TSize &ExpectVals=0, const ::TSize &_GrowBy=1000000, const bool &_FastCopy=false, const TVal &_EmptyVal=TVal())
Definition: ds.h:2915
template<class TVal >
static PVecPool TGLib_OLD::TVecPool< TVal >::Load ( const TStr FNm)
inlinestatic

Definition at line 2837 of file ds.h.

2837 { TFIn FIn(FNm); return Load(FIn); }
Definition: fl.h:275
static PVecPool Load(TSIn &SIn)
Definition: ds.h:2836
template<class TVal >
static PVecPool TGLib_OLD::TVecPool< TVal >::New ( const ::TSize ExpectVals = 0,
const ::TSize GrowBy = 1000000,
const bool &  FastCopy = false 
)
inlinestatic

Definition at line 2834 of file ds.h.

2834  {
2835  return new TVecPool(ExpectVals, GrowBy, FastCopy); }
::TSize GrowBy
Definition: ds.h:2823
TVecPool(const ::TSize &ExpectVals=0, const ::TSize &_GrowBy=1000000, const bool &_FastCopy=false, const TVal &_EmptyVal=TVal())
Definition: ds.h:2915
TBool FastCopy
Definition: ds.h:2822
template<class TVal >
TVecPool< TVal > & TVecPool< TVal >::operator= ( const TVecPool< TVal > &  Pool)

Definition at line 2966 of file ds.h.

2966  {
2967  if (this!=&Pool) {
2968  FastCopy = Pool.FastCopy;
2969  GrowBy = Pool.GrowBy;
2970  MxVals = Pool.MxVals;
2971  Vals = Pool.Vals;
2972  EmptyVal = Pool.EmptyVal;
2973  IdToOffV=Pool.IdToOffV;
2974  try { ValBf = new TVal [MxVals]; }
2975  catch (std::exception Ex) { FailR(TStr::Fmt("TVec::operator= : %s, MxVals: %d", Ex.what(), MxVals).CStr()); }
2976  IAssert(ValBf != NULL);
2977  if (FastCopy) {
2978  memcpy(ValBf, Pool.ValBf, Vals*sizeof(TVal)); }
2979  else {
2980  for (uint64 ValN = 0; ValN < Vals; ValN++){ ValBf[ValN] = Pool.ValBf[ValN]; } }
2981  }
2982  return *this;
2983 }
#define IAssert(Cond)
Definition: bd.h:262
::TSize Vals
Definition: ds.h:2823
TVal * ValBf
Definition: ds.h:2559
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
TSize GrowBy
Definition: ds.h:2557
TVal EmptyVal
Definition: ds.h:2558
::TSize MxVals
Definition: ds.h:2823
unsigned long long uint64
Definition: bd.h:38
#define FailR(Reason)
Definition: bd.h:240
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TBool FastCopy
Definition: ds.h:2556
TVal * ValBf
Definition: ds.h:2825
TVec< uint64, int > IdToOffV
Definition: ds.h:2560
TBool FastCopy
Definition: ds.h:2822
TSize Vals
Definition: ds.h:2557
TSize MxVals
Definition: ds.h:2557
template<class TVal >
void TGLib_OLD::TVecPool< TVal >::PutAll ( const TVal &  Val)
inline

Definition at line 2881 of file ds.h.

2881  {
2882  for (TSize ValN = 0; ValN < MxVals; ValN++) { ValBf[ValN]=Val; } }
::TSize MxVals
Definition: ds.h:2823
size_t TSize
Definition: bd.h:58
TVal * ValBf
Definition: ds.h:2825
template<class TVal >
void TGLib_OLD::TVecPool< TVal >::PutV ( const int &  VId,
const TValV ValV 
)
inline

Definition at line 2863 of file ds.h.

2863  {
2864  IAssert(IsVId(VId) && GetVLen(VId) == ValV.Len());
2865  if (FastCopy) {
2866  memcpy(GetValVPt(VId), ValV.BegI(), sizeof(TVal)*ValV.Len()); }
2867  else { TVal* ValPt = GetValVPt(VId);
2868  for (uint ValN=0; ValN < uint(ValV.Len()); ValN++, ValPt++) { *ValPt=ValV[ValN]; }
2869  }
2870  }
#define IAssert(Cond)
Definition: bd.h:262
unsigned int uint
Definition: bd.h:11
bool IsVId(const int &VId) const
Definition: ds.h:2844
uint GetVLen(const int &VId) const
Definition: ds.h:2854
TBool FastCopy
Definition: ds.h:2822
TVal * GetValVPt(const int &VId) const
Definition: ds.h:2857
template<class TVal >
void TGLib_OLD::TVecPool< TVal >::Reserve ( const ::TSize MxVals)
inline

Definition at line 2846 of file ds.h.

2846 { Resize(MxVals); }
::TSize MxVals
Definition: ds.h:2823
void Resize(const ::TSize &_MxVals)
Definition: ds.h:2888
template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::Reserved ( ) const
inline

Definition at line 2845 of file ds.h.

2845 { return MxVals; }
::TSize MxVals
Definition: ds.h:2823
template<class TVal >
void TVecPool< TVal >::Resize ( const ::TSize _MxVals)
private

Definition at line 2888 of file ds.h.

2888  {
2889  if (_MxVals <= MxVals){ return; } else { MxVals = _MxVals; }
2890  if (ValBf == NULL) {
2891  try { ValBf = new TVal [MxVals]; }
2892  catch (std::exception Ex) {
2893  FailR(TStr::Fmt("TVecPool::Resize 1: %s, MxVals: %d. [Program failed to allocate more memory. Solution: Get a bigger machine and a 64-bit compiler.]", Ex.what(), _MxVals).CStr()); }
2894  IAssert(ValBf != NULL);
2895  if (EmptyVal != TVal()) { PutAll(EmptyVal); }
2896  } else {
2897  // printf("*** Resize vector pool: %llu -> %llu\n", uint64(Vals), uint64(MxVals));
2898  TVal* NewValBf = NULL;
2899  try { NewValBf = new TVal [MxVals]; }
2900  catch (std::exception Ex) { FailR(TStr::Fmt("TVecPool::Resize 2: %s, MxVals: %d. [Program failed to allocate more memory. Solution: Get a bigger machine and a 64-bit compiler.]", Ex.what(), _MxVals).CStr()); }
2901  IAssert(NewValBf != NULL);
2902  if (FastCopy) {
2903  memcpy(NewValBf, ValBf, Vals*sizeof(TVal)); }
2904  else {
2905  for (TSize ValN = 0; ValN < Vals; ValN++){ NewValBf[ValN] = ValBf[ValN]; } }
2906  if (EmptyVal != TVal()) { // init empty values
2907  for (TSize ValN = Vals; ValN < MxVals; ValN++) { NewValBf[ValN] = EmptyVal; }
2908  }
2909  delete [] ValBf;
2910  ValBf = NewValBf;
2911  }
2912 }
#define IAssert(Cond)
Definition: bd.h:262
::TSize Vals
Definition: ds.h:2823
void PutAll(const TVal &Val)
Definition: ds.h:2881
::TSize MxVals
Definition: ds.h:2823
size_t TSize
Definition: bd.h:58
#define FailR(Reason)
Definition: bd.h:240
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal * ValBf
Definition: ds.h:2825
TBool FastCopy
Definition: ds.h:2822
template<class TVal >
void TVecPool< TVal >::Save ( TSOut SOut) const

Definition at line 2953 of file ds.h.

2953  {
2954  SOut.Save(FastCopy);
2955  uint64 _GrowBy=GrowBy, _MxVals=MxVals, _Vals=Vals;
2956  SOut.Save(_GrowBy); SOut.Save(_MxVals); SOut.Save(_Vals);
2957  SOut.Save(EmptyVal);
2958  for (TSize ValN = 0; ValN < Vals; ValN++) { ValBf[ValN].Save(SOut); }
2959  { SOut.Save(IdToOffV.Len()); SOut.Save(IdToOffV.Len());
2960  for (int ValN = 0; ValN < IdToOffV.Len(); ValN++) {
2961  const uint64 Offset=IdToOffV[ValN]; SOut.Save(Offset);
2962  } }
2963 }
::TSize Vals
Definition: ds.h:2823
TVec< ::TSize > IdToOffV
Definition: ds.h:2826
::TSize GrowBy
Definition: ds.h:2823
::TSize MxVals
Definition: ds.h:2823
unsigned long long uint64
Definition: bd.h:38
size_t TSize
Definition: bd.h:58
void Save(const bool &Bool)
Definition: fl.h:173
TVal * ValBf
Definition: ds.h:2825
int Len() const
Definition: ds.h:1547
TBool FastCopy
Definition: ds.h:2822
template<class TVal >
void TGLib_OLD::TVecPool< TVal >::SetEmptyVal ( const TVal &  _EmptyVal)
inline

Definition at line 2848 of file ds.h.

2848 { EmptyVal = _EmptyVal; }
template<class TVal >
void TVecPool< TVal >::ShuffleAll ( TRnd Rnd = TInt::Rnd)

Definition at line 3036 of file ds.h.

3036  {
3037  for (::TSize n = Vals-1; n > 0; n--) {
3038  const ::TSize k = ::TSize(((uint64(Rnd.GetUniDevInt())<<32) | uint64(Rnd.GetUniDevInt())) % (n+1));
3039  const TVal Tmp = ValBf[n];
3040  ValBf[n] = ValBf[k];
3041  ValBf[k] = Tmp;
3042  }
3043 }
::TSize Vals
Definition: ds.h:2823
unsigned long long uint64
Definition: bd.h:38
size_t TSize
Definition: bd.h:58
TVal * ValBf
Definition: ds.h:2825
int GetUniDevInt(const int &Range=0)
Definition: dt.cpp:39

Friends And Related Function Documentation

template<class TVal >
friend class TPt< TVecPool< TVal > >
friend

Definition at line 2884 of file ds.h.

Member Data Documentation

template<class TVal >
TCRef TGLib_OLD::TVecPool< TVal >::CRef
private

Definition at line 2821 of file ds.h.

template<class TVal >
TVal TGLib_OLD::TVecPool< TVal >::EmptyVal
private

Definition at line 2824 of file ds.h.

template<class TVal >
TBool TGLib_OLD::TVecPool< TVal >::FastCopy
private

Definition at line 2822 of file ds.h.

template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::GrowBy
private

Definition at line 2823 of file ds.h.

template<class TVal >
TVec< ::TSize> TGLib_OLD::TVecPool< TVal >::IdToOffV
private

Definition at line 2826 of file ds.h.

template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::MxVals
private

Definition at line 2823 of file ds.h.

template<class TVal >
TVal* TGLib_OLD::TVecPool< TVal >::ValBf
private

Definition at line 2825 of file ds.h.

template<class TVal >
::TSize TGLib_OLD::TVecPool< TVal >::Vals
private

Definition at line 2823 of file ds.h.


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