itemset.h
来自「本程序实现的是关联规则挖掘领域中规则发现算法.」· C头文件 代码 · 共 93 行
H
93 行
//
// Class for itemset.
//
//
#ifndef _ITEMSET_H_
#define _ITEMSET_H_
#include "tzObject.h"
#include <stdio.h>
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 3
class itemSet : public tzObject
{
public:
itemSet()
{
m_items = (Item *)NULL;
count = 0;
m_support = 0;
m_weight = 0.0;
m_keeporder = true;
};
~itemSet()
{
delete m_items;
};
void add(Item theitem);
void add(int index, Item theitem);
void concat(itemSet *src);
void clear();
tzObject *clone();
int compare(tzObject *obj);
Item get(int index);
int indexOf(Item theitem, bool ascend = true);
Item remove(int index);
itemSet *left(int nCount);
itemSet *sub(int bgn, int end);
itemSet *substract(itemSet *aset);
void dump();
bool keeporder() { return m_keeporder; };
void keeporder(bool value) { m_keeporder = value; };
int size() { return count; };
long support() { return m_support; };
void support(long value) { m_support = value; };
double weight() { return m_weight; };
void weight(double value) { m_weight = value; }
private:
Item *m_items;
int count;
bool m_keeporder;
long m_support;
double m_weight;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?