📄 util.h
字号:
//---------------------------------------------------------------------------#ifndef UtilityH#define UtilityH#define PI 3.1415926class ItemSets;typedef int Item;/* to find the minimum and maximum integer from two parameters */#define imax(a, b) (((a) > (b))?(a):(b))#define imin(a, b) (((a) < (b))?(a):(b))// Relationship between two ItemSet s#define TOTALEQUAL 0#define MAKEUP 1#define TOTALDIFF 2#define CROSS 3class ItemSet {private: Item* m_items;public: bool keeporder; int count; long support; ItemSet() { m_items = (Item *)NULL; count = 0; support = 0; keeporder = true; }; ~ItemSet() { delete m_items; }; void add(Item theitem); void clear(); Item remove(int index); int indexof(Item theitem); Item itemof(int index); void insert(int index, Item theitem); ItemSet *clone(); void cat(ItemSet *src); ItemSet *sub(int bgn, int end); int diff(ItemSet *theother); ItemSet *substract(ItemSet *itemSet);};typedef struct ItemSetChain ItemSetNode;struct ItemSetChain { ItemSet *m_data; ItemSetNode *priori; ItemSetNode *next;};class ItemSets {public: ItemSetNode *m_itemsethead; int count; int cur_pos; ItemSetNode *cur_itemset; int varnum; ItemSets(); ~ItemSets(); ItemSetNode *nodeof(int order); ItemSet *pointof(int order); ItemSet *itemsetof(int order); ItemSet *add(ItemSet *NewItemSet); bool remove(int order); int indexof(ItemSet *test); void writeto(char *filename); void cat(ItemSets *Additions);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -