tuple.cpp

来自「关联分类算法采用贪心算法发现高质量分类规则」· C++ 代码 · 共 52 行

CPP
52
字号
// TUPLE.cpp: implementation of the TUPLE class.////////////////////////////////////////////////////////////////////////#include "stdio.h"#include "HashTable.h"#include "DESCRIPTION.h"#include "TUPLE.h"//////////////////////////////////////////////////////////////////////// Construction/Destruction//////////////////////////////////////////////////////////////////////TUPLE::TUPLE(){	num_attr=0;	attr=0;	cls=0;	weight=1.0;}TUPLE::TUPLE(const TUPLE& tuple){	cls=tuple.cls;	num_attr=tuple.num_attr;	if(attr!=0) delete[] attr;	attr=new int[num_attr];	weight=tuple.weight;}TUPLE::~TUPLE(){	if(attr!=0) delete[] attr;}void TUPLE::Initialize(const DESCRIPTION& descript){	num_attr=descript.GetNumAttr();	if(attr!=0) delete[] attr;	attr=new int[num_attr];	weight=1.0;}void TUPLE::operator =(const TUPLE& tuple){	cls=tuple.cls;	num_attr=tuple.num_attr;	if(attr!=0) delete[] attr;	attr=new int[num_attr];	weight=tuple.weight;}

⌨️ 快捷键说明

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