fpt.h

来自「FP-growth算法的改进C++程序,具有较好的扩展性和应用性,本程序改成用行」· C头文件 代码 · 共 57 行

H
57
字号
#ifndef FPT_H_
#define FPT_H_

#define PLAT_WIN	1

/***** Data Structure *****/
/* Description:
 *	Each node of an FP-tree is represented by a 'FPnode' structure.
 *	Each node contains an item ID, count value of the item, and
 *	node-link as stated in the paper.
 *	
 */
typedef struct FPnode *FPTreeNode;	/* Pointer to a FP-tree node */

typedef struct Childnode *childLink;	/* Pointer to children of a FP-tree node */

/*
 * Children of a FP-tree node
 */
typedef struct Childnode {
	FPTreeNode node;	/* A child node of an item */
	childLink next;		/* Next child */
} ChildNode;

/*
 * A FP-tree node
 */
typedef struct FPnode {
        int item;		/* ID of the item.  
				   Value of ID is within the range [0, m-1]
				   where m is the total number of different items in the database. */
        int count;		/* Value of count of the item.
				   This is the number of transactions containing items in the portion
				   of the path reaching this node. */
	int numPath;  		/* Number of leaf nodes in the subtree
			           rooted at this node.  It is used to
				   check whether there is only a single path 
				   in the FPgrowth function. */
	FPTreeNode parent;	/* Pointer to parent node */
        childLink children;	/* Pointer to children */
        FPTreeNode hlink;	/* Horizontal link to next node with same item */
} FPNode;


/*
 * A list to store large itemsets in descending order of their supports.
 * It stores all the itemsets of supports >= threshold.
 */
typedef struct Itemsetnode *LargeItemPtr;
typedef struct Itemsetnode {
	int support;
	int *itemset;
	LargeItemPtr next;
} ItemsetNode;

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?