SNAP Library, Developer Reference  2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
bits.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TB1Def
class  TB2Def
class  TB4Def
class  TFSet
class  TB8Set
class  TB32Set

Typedefs

typedef TVec< TB8SetTB8SetV
typedef TVec< TB32SetTB32SetV

Functions

void SetLastB4 ()
 TBSet ()
 TBSet (const TBSet &BSet)
PBSet Clone () const
 TBSet (const int &_Bits)
static PBSet New (const int &Bits)
 ~TBSet ()
 TBSet (TSIn &SIn)
static PBSet Load (TSIn &SIn)
void Save (TSOut &SOut) const
TBSetoperator= (const TBSet &BSet)
bool operator== (const TBSet &BSet) const
void Gen (const int &_Bits)
void Clr ()
void Fill ()
void Incl (const int &BitN)
void Excl (const int &BitN)
bool In (const int &BitN) const
void SetBit (const int &BitN, const bool &Bool)
bool GetBit (const int &BitN) const
void SwitchBit (const int &BitN)
int GetBits () const
int Get1s ()
int Get0s ()
uint64 GetUInt64 () const
void Wr ()
TBSetoperator~ ()
TBSetoperator&= (const TBSet &BSet)
TBSetoperator|= (const TBSet &BSet)
TBSetoperator|= (const int &BitN)
TBSetoperator^= (const TBSet &BSet)
TBSet operator~ (const TBSet &BSet)
TBSet operator& (const TBSet &LBSet, const TBSet &RBSet)
TBSet operator| (const TBSet &LBSet, const TBSet &RBSet)
TBSet operator^ (const TBSet &LBSet, const TBSet &RBSet)
TBSet operator& (const TBSet &LBSet, const int &BitN)
TBSet operator| (const TBSet &LBSet, const int &BitN)
TBSet operator^ (const TBSet &LBSet, const int &BitN)

Variables

ClassTPV(TBSet, PBSet, TBSetV)
private TB4Def::TB4 
LastB4Mask
TB4Def::TB4B4T

Typedef Documentation

typedef TVec<TB32Set> TB32SetV

Definition at line 307 of file bits.h.

typedef TVec<TB8Set> TB8SetV

Definition at line 233 of file bits.h.


Function Documentation

PBSet Clone ( ) const

Definition at line 320 of file bits.h.

References TBSet().

{return PBSet(new TBSet(*this));}

Here is the call graph for this function:

void Excl ( const int &  BitN)

Definition at line 346 of file bits.h.

References Assert, TB4Def::B4Bits, TB4Def::B4Def, TB4Def::B4P2T, and B4T.

Referenced by SetBit().

                            {
    Assert((0<=BitN)&&(BitN<Bits));
    B4T[BitN/TB4Def::B4Def.B4Bits]&=
     ~TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits];}

Here is the caller graph for this function:

void Fill ( )
void Gen ( const int &  _Bits)

Definition at line 113 of file dt.h.

References Clr(), and Resize().

Referenced by TCliqueOverlap::CalculateOverlapMtx(), TVec< TVal >::LoadXml(), and TBSet().

                           {
    Clr(); Resize(_BfL); BfL=_BfL;}

Here is the call graph for this function:

Here is the caller graph for this function:

int Get0s ( )

Definition at line 364 of file bits.h.

References Get1s().

{return Bits-Get1s();}

Here is the call graph for this function:

int Get1s ( )

Referenced by Get0s().

Here is the caller graph for this function:

bool GetBit ( const int &  BitN) const

Definition at line 356 of file bits.h.

References Assert, TB4Def::B4Def, and B4T.

Referenced by SwitchBit().

                                     {
    Assert((0<=BitN)&&(BitN<Bits));
    return (B4T[BitN/TB4Def::B4Def.B4Bits] &
     TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits])!=0;}

Here is the caller graph for this function:

int GetBits ( ) const

Definition at line 362 of file bits.h.

{return Bits;}
uint64 GetUInt64 ( ) const

Definition at line 365 of file bits.h.

References Assert, and B4T.

                           {
    Assert(Bits>=64); uint64 Val; memcpy(&Val, B4T, 8); return Val;}
bool In ( const int &  BitN) const

Definition at line 350 of file bits.h.

References Assert, TB4Def::B4Def, and B4T.

Referenced by TMAGFitBern::UpdateApxPhiMI().

                                 {
    Assert((0<=BitN)&&(BitN<Bits));
    return (B4T[BitN/TB4Def::B4Def.B4Bits] &
     TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits])!=0;}

Here is the caller graph for this function:

void Incl ( const int &  BitN)

Definition at line 342 of file bits.h.

References Assert, TB4Def::B4Bits, TB4Def::B4Def, TB4Def::B4P2T, and B4T.

Referenced by operator|=(), and SetBit().

                            {
    Assert((0<=BitN)&&(BitN<Bits));
    B4T[BitN/TB4Def::B4Def.B4Bits]|=
     TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits];}

Here is the caller graph for this function:

static PBSet Load ( TSIn SIn) [static]

Definition at line 329 of file bits.h.

References TBSet().

Referenced by GetFFreeBlobPtV(), TKeyDatFl< TKey, TDat, THashFunc >::LoadHash(), TKeyDatFl< TKey, TDat, THashFunc >::Save(), TKronMomentsFit::Test(), and TPt< TRec >::TPt().

{return new TBSet(SIn);}

Here is the call graph for this function:

Here is the caller graph for this function:

static PBSet New ( const int &  Bits) [static]

Definition at line 323 of file bits.h.

References TBSet().

Referenced by _IsTagRedir(), TStrHash< TDat, TStringPool, THashFunc >::AddKey(), TFfGGen::AddNodes(), TUndirFFire::AddNodes(), TCliqueOverlap::CalculateOverlapMtx(), TSnap::ConvertESubGraph(), TSnap::ConvertGraph(), TSnap::TSnapDetail::TGetSubGraph< PGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TGetSubGraph< PGraph, false >::Do(), TSnap::TSnapDetail::TConvertSubGraph< POutGraph, PInGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TConvertSubGraph< POutGraph, PInGraph, false >::Do(), EvalExp(), EvalExpOp(), TAGM::GenAGM(), TSnap::GenBaraHierar(), TSnap::GenCircle(), TSnap::GenConfModel(), TSnap::GenCopyModel(), TSnap::GenDegSeq(), TKronMtx::GenDetKronecker(), TKronMtx::GenFastKronecker(), TFfGGen::GenFFGraphs(), TSnap::GenFull(), TSnap::GenGeoPrefAttach(), TFfGGen::GenGraph(), TSnap::GenGrid(), TKronMtx::GenKronecker(), TSnap::GenPrefAttach(), TSnap::GenRewire(), TSnap::GenRMat(), TSnap::GenRndBipart(), TSnap::GenRndGnm(), TKronMtx::GenRndGraph(), TSnap::GenSmallWorld(), TSnap::GenStar(), TKronMtx::GenThreshGraph(), TSnap::GenTree(), TSnap::Get1CnCom(), TSnap::Get1CnComSzCnt(), GetAbsFromBase(), TSnap::GetBfsTree(), TExpBi::GetBiFuncVal(), TSnap::GetEDatSubGraph(), TSnap::GetESubGraph(), TD34GraphCounter::GetGraph(), TGraphEnumUtils::GetIsoGraphs(), GetMd5SigStr(), TSnap::GetMxBiCon(), TSnap::GetMxScc(), TSnap::GetMxWcc(), TGraphKey::GetNGraph(), THtmlLx::GetNoTag(), GetOutDescUrlStrKdV(), GetOutUrlV(), TSnap::GetSubGraph(), TBigNet< TNodeData, IsDir >::GetSubGraph(), THtmlLx::GetTokStrV(), GetTopDownDocNm(), GetUndefExpVal(), TSnap::GetUnDir(), GetUrl(), GetUrlFromShortcut(), GetValFromLx(), TSecTm::GetXmlTok(), GetZeroExpVal(), IsSite(), TUniChDb::LoadBin(), TSnap::LoadConnList(), TSnap::LoadConnListStr(), TSnap::LoadDyNet(), TSnap::LoadDyNetGraphV(), TSnap::LoadEdgeList(), TSnap::LoadEdgeListStr(), TLAMisc::LoadMatlabTFltVV(), TSnap::LoadPajek(), TStr::LoadTxt(), LoadTxtFact(), New(), NewV(), NewVV(), TDGHashGraphCounter::operator()(), ParseHttpRq(), PutTagTokStr(), TUniChDb::SaveBin(), TLAMisc::SaveMatlabTFltV(), TLAMisc::SaveMatlabTFltVV(), TLAMisc::SaveMatlabTFltVVCol(), TLAMisc::SaveMatlabTFltVVMjrSubMtrx(), TLAMisc::SaveMatlabTIntV(), TStr::SaveTxt(), TUniChDb::Test(), TSnap::TestAnf(), TExpBi::TExpBi(), TMd5Sig::TMd5Sig(), TPreproc::TPreproc(), and TStatTest::TTest().

{return PBSet(new TBSet(Bits));}

Here is the call graph for this function:

Here is the caller graph for this function:

friend TBSet operator& ( const TBSet LBSet,
const TBSet RBSet 
)

Definition at line 385 of file bits.h.

References TBSet().

                                                                {
    return TBSet(LBSet)&=RBSet;}

Here is the call graph for this function:

friend TBSet operator& ( const TBSet LBSet,
const int &  BitN 
)

Definition at line 392 of file bits.h.

References TBSet().

                                                             {
    return TBSet(LBSet)&=BitN;}

Here is the call graph for this function:

TBSet& operator&= ( const TBSet BSet)

Definition at line 371 of file bits.h.

References Assert, and B4T.

                                      {
    Assert(B4s==BSet.B4s);
    for (int B4N=0; B4N<B4s; B4N++){B4T[B4N]&=BSet.B4T[B4N];} return *this;}
TBSet& operator= ( const TBSet BSet)

Referenced by THash< TKey, TDat, THashFunc >::Defrag(), and THashSet< TKey, THashFunc >::Defrag().

Here is the caller graph for this function:

bool operator== ( const TBSet BSet) const
friend TBSet operator^ ( const TBSet LBSet,
const TBSet RBSet 
)

Definition at line 389 of file bits.h.

References TBSet().

                                                                {
    return TBSet(LBSet)^=RBSet;}

Here is the call graph for this function:

friend TBSet operator^ ( const TBSet LBSet,
const int &  BitN 
)

Definition at line 396 of file bits.h.

References TBSet().

                                                             {
    return TBSet(LBSet)^=BitN;}

Here is the call graph for this function:

TBSet& operator^= ( const TBSet BSet)

Definition at line 379 of file bits.h.

References Assert, and B4T.

                                      {
    Assert(B4s==BSet.B4s);
    for (int B4N=0; B4N<B4s; B4N++){B4T[B4N]^=BSet.B4T[B4N];} return *this;}
friend TBSet operator| ( const TBSet LBSet,
const TBSet RBSet 
)

Definition at line 387 of file bits.h.

References TBSet().

                                                                {
    return TBSet(LBSet)|=RBSet;}

Here is the call graph for this function:

friend TBSet operator| ( const TBSet LBSet,
const int &  BitN 
)

Definition at line 394 of file bits.h.

References TBSet().

                                                             {
    return TBSet(LBSet)|=BitN;}

Here is the call graph for this function:

TBSet& operator|= ( const TBSet BSet)

Definition at line 374 of file bits.h.

References Assert, and B4T.

                                      {
    Assert(B4s==BSet.B4s);
    for (int B4N=0; B4N<B4s; B4N++){B4T[B4N]|=BSet.B4T[B4N];} return *this;}
TBSet& operator|= ( const int &  BitN)

Definition at line 377 of file bits.h.

References Incl().

                                    {
    Incl(BitN); return *this;}

Here is the call graph for this function:

Definition at line 369 of file bits.h.

References B4T.

                    {
    for (int B4N=0; B4N<B4s; B4N++){B4T[B4N]=~B4T[B4N];} return *this;}
friend TBSet operator~ ( const TBSet BSet)

Definition at line 383 of file bits.h.

References ~TBSet().

                                           {
    return ~TBSet(BSet);}

Here is the call graph for this function:

void Save ( TSOut SOut) const

Definition at line 330 of file bits.h.

Referenced by TFHashKey< TKey, TFDat, TVDat >::OnDelFromCache(), and Save().

                               {
    SOut.Save(B4s); SOut.Save(Bits);
    SOut.SaveBf(&LastB4Mask, sizeof(TB4Def::TB4));
    SOut.SaveBf(B4T, B4s*sizeof(TB4Def::TB4));}

Here is the caller graph for this function:

void SetBit ( const int &  BitN,
const bool &  Bool 
)

Definition at line 354 of file bits.h.

References Excl(), and Incl().

Referenced by TGraphAnf< PGraph >::InitAnfBits(), and SwitchBit().

                                                {
    if (Bool){Incl(BitN);} else {Excl(BitN);}}

Here is the call graph for this function:

Here is the caller graph for this function:

void SetLastB4 ( )

Definition at line 316 of file bits.h.

References LastB4Mask.

{B4T[B4s-1]&=LastB4Mask;}
void SwitchBit ( const int &  BitN)

Definition at line 360 of file bits.h.

References GetBit(), and SetBit().

                                 {
    SetBit(BitN, !GetBit(BitN));}

Here is the call graph for this function:

TBSet ( )

Definition at line 318 of file bits.h.

Referenced by Clone(), Load(), New(), operator&(), operator^(), operator|(), and TXmlChDef().

: B4s(0), Bits(0), LastB4Mask(0), B4T(NULL){}

Here is the caller graph for this function:

TBSet::TBSet ( const TBSet BSet)

Definition at line 163 of file bits.cpp.

References B4T, and Gen().

                             :
  B4s(0), Bits(0), LastB4Mask(0), B4T(NULL){
  Gen(BSet.Bits);
  for (int B4N=0; B4N<B4s; B4N++){B4T[B4N]=BSet.B4T[B4N];}
}

Here is the call graph for this function:

TBSet ( const int &  _Bits)

Definition at line 321 of file bits.h.

References Gen().

                         :
    B4s(0), Bits(0), LastB4Mask(0), B4T(NULL){Gen(_Bits);}

Here is the call graph for this function:

TBSet ( TSIn SIn)

Definition at line 325 of file bits.h.

References B4T, LastB4Mask, TSIn::Load(), TSIn::LoadBf(), and TSIn::LoadNewBf().

                  {
    SIn.Load(B4s); SIn.Load(Bits);
    SIn.LoadBf(&LastB4Mask, sizeof(TB4Def::TB4));
    B4T=(TB4Def::TB4*)SIn.LoadNewBf(B4s*sizeof(TB4Def::TB4));}

Here is the call graph for this function:

void Wr ( )
~TBSet ( )

Definition at line 324 of file bits.h.

References B4T.

Referenced by operator~().

{delete[] B4T;}

Here is the caller graph for this function:


Variable Documentation

ClassTPV (TBSet, PBSet, TBSetV) private TB4Def::TB4 LastB4Mask

Definition at line 311 of file bits.h.

Referenced by Save(), SetLastB4(), and TBSet().