forked from psanse/BITSCAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bbobject.h
45 lines (36 loc) · 1.23 KB
/
bbobject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* bbobject.h file from the BITSCAN library, a C++ library for bit set
* optimization. BITSCAN has been used to implement BBMC, a very
* succesful bit-parallel algorithm for exact maximum clique.
* (see license file for references)
*
* Copyright (C)
* Author: Pablo San Segundo
* Intelligent Control Research Group (CSIC-UPM)
*
* Permission to use, modify and distribute this software is
* granted provided that this copyright notice appears in all
* copies, in source code or in binaries. For precise terms
* see the accompanying LICENSE file.
*
* This software is provided "AS IS" with no warranty of any
* kind, express or implied, and with no claim as to its
* suitability for any purpose.
*
*/
#ifndef __BB_OBJECT_H__
#define __BB_OBJECT_H__
#include <iostream>
using namespace std;
class BBObject{
public:
enum scan_types {NON_DESTRUCTIVE, NON_DESTRUCTIVE_REVERSE, DESTRUCTIVE, DESTRUCTIVE_REVERSE}; //types of bit scans
friend ostream& operator<<(ostream& o , const BBObject& bb){bb.print(o); return o;}
protected:
BBObject(){}
virtual void print(ostream &o, bool show_pc=true) const {this->print(o, show_pc);}
////////
// bit scanning
virtual int init_scan(scan_types) {return 0;}
};
#endif