www.pudn.com > DTreebydhm.rar > Node.cpp


#include "Stdafx.h" 
#include "Node.h" 
 
Node:: Node() 
{ 
    value = -1; 
	attribute = -1; 
	isLeaf = 0; 
	depth=-1; 
	leftchild = NULL; 
	rightchild =NULL; 
} 
 
Node:: Node(double value,int attribute,int isLeaf = 0) 
{ 
	this->value = value; 
	this->index = index; 
	this->isLeaf = isLeaf; 
	leftchild = rightchild =0; 
} 
	 
void Node:: SetValue(double value) 
{ 
	this->value = value; 
} 
	 
double Node:: GetValue() 
{ 
	return this->value; 
} 
	 
void Node:: SetAttribute(int attribute) 
{ 
	this->attribute = attibute; 
} 
 
int Node:: GetAttribute() 
{ 
	return this->attribute; 
} 
	 
void Node:: SetLeaf(bool isLeaf) 
{ 
	this->isLeaf = isLeaf; 
} 
	 
int Node:: IsLeaf() 
{ 
	return this->isLeaf; 
}