| 
    SNAP Library 2.0, Developer Reference
    2013-05-13 16:33:57
    
   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.
References 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));}

| PBSet TBSet::Clone | ( | ) |  const [inline] | 
        
| void TBSet::Clr | ( | ) | 
| void TBSet::Excl | ( | const int & | BitN | ) |  [inline] | 
        
Definition at line 348 of file bits.h.
References Assert, TB4Def::B4Bits, TB4Def::B4Def, and TB4Def::B4P2T.
                            {
    Assert((0<=BitN)&&(BitN<Bits));
    B4T[BitN/TB4Def::B4Def.B4Bits]&=
     ~TB4Def::B4Def.B4P2T[BitN%TB4Def::B4Def.B4Bits];}
| void TBSet::Fill | ( | ) | 
Definition at line 195 of file bits.cpp.
References B4s, B4T, and TB4Def::MxB4.
                {
  for (int B4N=0; B4N<B4s; B4N++){B4T[B4N]=TB4Def::B4Def.MxB4;}}
| void TBSet::Gen | ( | const int & | _Bits | ) | 
Definition at line 182 of file bits.cpp.
References TB4Def::B4Bits, TB4Def::B4P2T, B4s, B4T, Bits, Clr(), LastB4Mask, and TB4Def::MxB4.
Referenced by operator=(), TBSet(), and TXmlChDef::TXmlChDef().
                               {
  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 | ( | ) | 
Definition at line 198 of file bits.cpp.
References B4s, B4T, TB4Def::GetB4Bits(), and SetLastB4().
                {
  int Ones=0; SetLastB4();
  for (int B4N=0; B4N<B4s; B4N++){Ones += TB4Def::B4Def.GetB4Bits(B4T[B4N]);}
  return Ones;
}

| bool TBSet::GetBit | ( | const int & | BitN | ) |  const [inline] | 
        
Definition at line 358 of file bits.h.
References Assert, and TB4Def::B4Def.
Referenced by Wr().
                                     {
    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.
References Assert, and TB4Def::B4Def.
                                 {
    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.
References Assert, TB4Def::B4Bits, TB4Def::B4Def, and TB4Def::B4P2T.
Referenced by TXmlChDef::SetChTy().
                            {
    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 | 
Definition at line 176 of file bits.cpp.
References B4s, B4T, Bits, and LastB4Mask.
                                              {
  if (Bits!=BSet.Bits){return false;}
  for (int B4N=0; B4N<B4s-1; B4N++){if (B4T[B4N]!=BSet.B4T[B4N]){return false;}}
  return (B4s>0)&&((B4T[B4s-1]&LastB4Mask)==(BSet.B4T[B4s-1]&BSet.LastB4Mask));
}
| 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.
References TSOut::Save(), and TSOut::SaveBf().
                               {
    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] | 
        
| void TBSet::SwitchBit | ( | const int & | BitN | ) |  [inline] | 
        
| void TBSet::Wr | ( | ) | 
int TBSet::B4s [private] | 
        
Definition at line 315 of file bits.h.
Referenced by Clr(), Fill(), Gen(), Get1s(), operator&=(), operator=(), operator==(), operator^=(), operator|=(), and TBSet().
TB4Def::TB4* TBSet::B4T [private] | 
        
Definition at line 317 of file bits.h.
Referenced by Clr(), Fill(), Gen(), Get1s(), operator&=(), operator=(), operator==(), operator^=(), operator|=(), and TBSet().
int TBSet::Bits [private] | 
        
Definition at line 315 of file bits.h.
Referenced by Gen(), operator=(), operator==(), TBSet(), and Wr().
TCRef TBSet::CRef [private] | 
        
TB4Def::TB4 TBSet::LastB4Mask [private] | 
        
Definition at line 316 of file bits.h.
Referenced by Gen(), and operator==().