SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TFSet Class Reference

#include <bits.h>

Public Member Functions

 TFSet ()
 
 TFSet (const TFSet &FSet)
 
 TFSet (const int &FlagN1, const int &FlagN2=-1, const int &FlagN3=-1, const int &FlagN4=-1, const int &FlagN5=-1, const int &FlagN6=-1, const int &FlagN7=-1, const int &FlagN8=-1, const int &FlagN9=-1)
 
 TFSet (const TFSet &FSet1, const TFSet &FSet2)
 
 ~TFSet ()
 
 TFSet (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
TFSetoperator= (const TFSet &FSet)
 
bool operator== (const TFSet &FSet) const
 
TFSetoperator| (const int &FlagN)
 
TFSetoperator| (const TFSet &FSet)
 
void Clr ()
 
bool Empty () const
 
void Incl (const int &FlagN)
 
void Incl (const TFSet &FSet)
 
bool In (const int &FlagN) const
 

Static Public Attributes

static const TFSet EmptyFSet
 

Private Attributes

TUIntV B4V
 

Static Private Attributes

static const int B4s =4
 
static const int Bits =TFSet::B4s*TB4Def::B4Bits
 

Detailed Description

Definition at line 119 of file bits.h.

Constructor & Destructor Documentation

TFSet::TFSet ( )
inline

Definition at line 125 of file bits.h.

125 : B4V(4, 4){}
TUIntV B4V
Definition: bits.h:123
TFSet::TFSet ( const TFSet FSet)
inline

Definition at line 126 of file bits.h.

126 : B4V(FSet.B4V){}
TUIntV B4V
Definition: bits.h:123
TFSet::TFSet ( const int &  FlagN1,
const int &  FlagN2 = -1,
const int &  FlagN3 = -1,
const int &  FlagN4 = -1,
const int &  FlagN5 = -1,
const int &  FlagN6 = -1,
const int &  FlagN7 = -1,
const int &  FlagN8 = -1,
const int &  FlagN9 = -1 
)

Definition at line 109 of file bits.cpp.

112  :
113  B4V(4, 4){
114  if (FlagN1!=-1){Incl(FlagN1);}
115  if (FlagN2!=-1){Incl(FlagN2);}
116  if (FlagN3!=-1){Incl(FlagN3);}
117  if (FlagN4!=-1){Incl(FlagN4);}
118  if (FlagN5!=-1){Incl(FlagN5);}
119  if (FlagN6!=-1){Incl(FlagN6);}
120  if (FlagN7!=-1){Incl(FlagN7);}
121  if (FlagN8!=-1){Incl(FlagN8);}
122  if (FlagN9!=-1){Incl(FlagN9);}
123 }
void Incl(const int &FlagN)
Definition: bits.h:149
TUIntV B4V
Definition: bits.h:123
TFSet::TFSet ( const TFSet FSet1,
const TFSet FSet2 
)
inline

Definition at line 131 of file bits.h.

131  :
132  B4V(4, 4){Incl(FSet1); Incl(FSet2);}
void Incl(const int &FlagN)
Definition: bits.h:149
TUIntV B4V
Definition: bits.h:123
TFSet::~TFSet ( )
inline

Definition at line 133 of file bits.h.

133 {}
TFSet::TFSet ( TSIn SIn)
inline

Definition at line 134 of file bits.h.

134 : B4V(SIn){}
TUIntV B4V
Definition: bits.h:123

Member Function Documentation

void TFSet::Clr ( )
inline

Definition at line 143 of file bits.h.

143  {
144  B4V[0]=0; B4V[1]=0; B4V[2]=0; B4V[3]=0;}
TUIntV B4V
Definition: bits.h:123
bool TFSet::Empty ( ) const
inline

Definition at line 145 of file bits.h.

145  {
146  return
147  (uint(B4V[0])==0)&&(uint(B4V[1])==0)&&
148  (uint(B4V[2])==0)&&(uint(B4V[3])==0);}
unsigned int uint
Definition: bd.h:11
TUIntV B4V
Definition: bits.h:123
bool TFSet::In ( const int &  FlagN) const
inline

Definition at line 156 of file bits.h.

156  {
157  Assert((0<=FlagN)&&(FlagN<Bits));
158  return (B4V[FlagN/TB4Def::B4Def.B4Bits] &
159  TB4Def::B4Def.B4P2T[FlagN%TB4Def::B4Def.B4Bits])!=0;}
TUIntV B4V
Definition: bits.h:123
#define Assert(Cond)
Definition: bd.h:251
static const TB4Def B4Def
Definition: bits.h:68
static const int Bits
Definition: bits.h:122
void TFSet::Incl ( const int &  FlagN)
inline

Definition at line 149 of file bits.h.

149  {
150  Assert((0<=FlagN)&&(FlagN<Bits));
151  B4V[FlagN/TB4Def::B4Def.B4Bits]|=
TUIntV B4V
Definition: bits.h:123
#define Assert(Cond)
Definition: bd.h:251
static const TB4Def B4Def
Definition: bits.h:68
static const int Bits
Definition: bits.h:122
static const int B4Bits
Definition: bits.h:54
TB4 * B4P2T
Definition: bits.h:57
void TFSet::Incl ( const TFSet FSet)
inline

Definition at line 153 of file bits.h.

153  {
154  B4V[0]|=FSet.B4V[0]; B4V[1]|=FSet.B4V[1];
155  B4V[2]|=FSet.B4V[2]; B4V[3]|=FSet.B4V[3];}
TUIntV B4V
Definition: bits.h:123
TFSet& TFSet::operator= ( const TFSet FSet)
inline

Definition at line 137 of file bits.h.

137  {
138  if (this!=&FSet){B4V=FSet.B4V;} return *this;}
TUIntV B4V
Definition: bits.h:123
bool TFSet::operator== ( const TFSet FSet) const
inline

Definition at line 139 of file bits.h.

139 {return B4V==FSet.B4V;}
TUIntV B4V
Definition: bits.h:123
TFSet& TFSet::operator| ( const int &  FlagN)
inline

Definition at line 140 of file bits.h.

140 {Incl(FlagN); return *this;}
void Incl(const int &FlagN)
Definition: bits.h:149
TFSet& TFSet::operator| ( const TFSet FSet)
inline

Definition at line 141 of file bits.h.

141 {Incl(FSet); return *this;}
void Incl(const int &FlagN)
Definition: bits.h:149
void TFSet::Save ( TSOut SOut) const
inline

Definition at line 135 of file bits.h.

135 {B4V.Save(SOut);}
TUIntV B4V
Definition: bits.h:123
void Save(TSOut &SOut) const
Definition: ds.h:954

Member Data Documentation

const int TFSet::B4s =4
staticprivate

Definition at line 121 of file bits.h.

TUIntV TFSet::B4V
private

Definition at line 123 of file bits.h.

const int TFSet::Bits =TFSet::B4s*TB4Def::B4Bits
staticprivate

Definition at line 122 of file bits.h.

const TFSet TFSet::EmptyFSet
static

Definition at line 161 of file bits.h.


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