⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itemset.h

📁 Aprioriall的频繁序列发觉源码
💻 H
字号:
//
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -