Sat Mar 26, 2011 2:20 am
enum Bool {false, true};
typedef unsigned char uchar;
class BitVec {
public:
BitVec (const short dim);
BitVec (const char* bits);
BitVec (const BitVec&);
~BitVec (void)
{ delete vec;
}
BitVec& operator = (const BitVec&);
BitVec& operator &= (const BitVec&);
BitVec& operator |= (const BitVec&);
BitVec& operator ^= (const BitVec&);
BitVec& operator <<= (const short);
BitVec& operator >>= (const short);
int operator [] (const short idx);
void Set (const short idx);
void Reset (const short idx);
BitVec operator ~ (void);
BitVec operator & (const BitVec&);
BitVec operator | (const BitVec&);
BitVec operator ^ (const BitVec&);
BitVec operator << (const short n);
BitVec operator >> (const short n);
Bool operator == (const BitVec&);
Bool operator != (const BitVec&);
friend ostream& operator << (ostream&, BitVec&);
private: uchar *vec; // vector of 8*bytes bits
short bytes; // bytes in the vector
};
Sat Mar 26, 2011 10:14 am
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.