SNAP Library , User Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <bits.h>
Public Member Functions | |
TBSet () | |
TBSet (const TBSet &BSet) | |
PBSet | Clone () const |
TBSet (const int &_Bits) | |
~TBSet () | |
TBSet (TSIn &SIn) | |
void | Save (TSOut &SOut) const |
TBSet & | operator= (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 () |
TBSet & | operator~ () |
TBSet & | operator&= (const TBSet &BSet) |
TBSet & | operator|= (const TBSet &BSet) |
TBSet & | operator|= (const int &BitN) |
TBSet & | operator^= (const TBSet &BSet) |
Static Public Member Functions | |
static PBSet | New (const int &Bits) |
static PBSet | Load (TSIn &SIn) |
Private Member Functions | |
void | SetLastB4 () |
Private Attributes | |
TCRef | CRef |
int | B4s |
int | Bits |
TB4Def::TB4 | LastB4Mask |
TB4Def::TB4 * | B4T |
Friends | |
class | TPt< TBSet > |
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) |
TBSet::TBSet | ( | ) | [inline] |
TBSet::TBSet | ( | const TBSet & | BSet | ) |
TBSet::TBSet | ( | const int & | _Bits | ) | [inline] |
TBSet::~TBSet | ( | ) | [inline] |
TBSet::TBSet | ( | TSIn & | SIn | ) | [inline] |
Definition at line 327 of file bits.h.
{ SIn.Load(B4s); SIn.Load(Bits); SIn.LoadBf(&LastB4Mask, sizeof(TB4Def::TB4)); B4T=(TB4Def::TB4*)SIn.LoadNewBf(B4s*sizeof(TB4Def::TB4));}
PBSet TBSet::Clone | ( | ) | const [inline] |
void TBSet::Clr | ( | ) |
void TBSet::Excl | ( | const int & | BitN | ) | [inline] |
void TBSet::Fill | ( | ) |
void TBSet::Gen | ( | const int & | _Bits | ) |
Definition at line 182 of file bits.cpp.
{ if (B4T!=NULL){delete[] B4T;} Bits=_Bits; B4T=new TB4Def::TB4[B4s=(Bits-1)/TB4Def::B4Def.B4Bits+1]; LastB4Mask=TB4Def::B4Def.MxB4; for (int BitN=Bits; BitN<B4s*TB4Def::B4Def.B4Bits; BitN++){ LastB4Mask&= ~TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits];} Clr(); }
int TBSet::Get0s | ( | ) | [inline] |
int TBSet::Get1s | ( | ) |
bool TBSet::GetBit | ( | const int & | BitN | ) | const [inline] |
Definition at line 358 of file bits.h.
{ Assert((0<=BitN)&&(BitN<Bits)); return (B4T[BitN/TB4Def::B4Def.B4Bits] & TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits])!=0;}
int TBSet::GetBits | ( | ) | const [inline] |
uint64 TBSet::GetUInt64 | ( | ) | const [inline] |
bool TBSet::In | ( | const int & | BitN | ) | const [inline] |
Definition at line 352 of file bits.h.
{ Assert((0<=BitN)&&(BitN<Bits)); return (B4T[BitN/TB4Def::B4Def.B4Bits] & TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits])!=0;}
void TBSet::Incl | ( | const int & | BitN | ) | [inline] |
Definition at line 344 of file bits.h.
{ Assert((0<=BitN)&&(BitN<Bits)); B4T[BitN/TB4Def::B4Def.B4Bits]|= TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits];}
static PBSet TBSet::Load | ( | TSIn & | SIn | ) | [inline, static] |
static PBSet TBSet::New | ( | const int & | Bits | ) | [inline, static] |
bool TBSet::operator== | ( | const TBSet & | BSet | ) | const |
TBSet& TBSet::operator|= | ( | const int & | BitN | ) | [inline] |
TBSet& TBSet::operator~ | ( | ) | [inline] |
void TBSet::Save | ( | TSOut & | SOut | ) | const [inline] |
Definition at line 332 of file bits.h.
{ SOut.Save(B4s); SOut.Save(Bits); SOut.SaveBf(&LastB4Mask, sizeof(TB4Def::TB4)); SOut.SaveBf(B4T, B4s*sizeof(TB4Def::TB4));}
void TBSet::SetBit | ( | const int & | BitN, |
const bool & | Bool | ||
) | [inline] |
void TBSet::SetLastB4 | ( | ) | [inline, private] |
Definition at line 318 of file bits.h.
{B4T[B4s-1]&=LastB4Mask;}
void TBSet::SwitchBit | ( | const int & | BitN | ) | [inline] |
void TBSet::Wr | ( | ) |
int TBSet::B4s [private] |
TB4Def::TB4* TBSet::B4T [private] |
int TBSet::Bits [private] |
TCRef TBSet::CRef [private] |
TB4Def::TB4 TBSet::LastB4Mask [private] |