亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cftree.c~

?? 數據挖掘算法BIRCH源碼 c語言版本。
?? C~
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************File Name:   cftree.CAuthor: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995               Copyright(c) 1995 by Tian Zhang                   All Rights ReservedPermission to use, copy and modify this software must be grantedby the author and provided that the above copyright notice appear in all relevant copies and that both that copyright notice and this permission notice appear in all relevant supporting documentations. Comments and additions may be sent the author at zhang@cs.wisc.edu.******************************************************************/#include "global.h"#include "util.h"#include "vector.h"#include "rectangle.h"#include "cfentry.h"#include "cutil.h"#include "status.h"#include "contree.h"#include "cftree.h"#include "path.h"int Node::N() const {	int tmp = 0;	for (int i=0; i<actsize; i++) 		tmp+=entry[i].n;	return tmp;}	void Node::SX(Vector& tmpsx) const {	tmpsx.Reset();	for (int i=0; i<actsize; i++)		tmpsx+=entry[i].sx;	}double Node::SXX() const {	double tmp=0;	for (int i=0; i<actsize; i++) 		tmp+=entry[i].sxx;	return tmp;}void Node::CF(Entry& tmpcf) const {	tmpcf.Reset();	for (int i=0; i<actsize; i++)		tmpcf+=entry[i];	}double Node::Radius() const {	Entry tmpent;	tmpent.Init(entry[0].sx.dim);	this->CF(tmpent);	return tmpent.Radius();	}double Node::Diameter() const {	Entry tmpent;	tmpent.Init(entry[0].sx.dim);	this->CF(tmpent);	return tmpent.Diameter();	}double Node::Fitness(short ftype) const {	Entry tmpent;	tmpent.Init(entry[0].sx.dim);	this->CF(tmpent);	return tmpent.Fitness(ftype);	}#ifdef RECTANGLEvoid Node::Rect(Rectangle& tmprect) const {	tmprect.Reset();	for (int i=0; i<actsize; i++)		tmprect+=entry[i].rect;	}#endif RECTANGLEdouble Leaf::AbsVofLevel(int i, short ftype, short dim) const {if (i>0) print_error("Leaf::AbsVofLevel","can not go further");if (i==0) return pow(sqrt(this->Fitness(ftype)),dim);}double Nonleaf::AbsVofLevel(int i, short ftype, short dim) const {double AbsV=0.0;if (i>Depth()-1) print_error("Nonleaf::AbsVofLevel","can not go further"); if (i==0) return pow(sqrt(this->Fitness(ftype)),dim);else { for (int j=0; j<actsize; j++) 	AbsV+=child[j]->AbsVofLevel(i-1,ftype,dim);       return AbsV;       }}int Leaf::Size() const { return 1; }int Nonleaf::Size() const {	int size=1;	for (int i=0; i<actsize; i++) 		size+=child[i]->Size();	return size;}int Leaf::Depth() const { return 1; }int Nonleaf::Depth() const {	if (actsize==0) return 1;         else return 1+child[0]->Depth();	}int Leaf::LeafNum() const { return 1; }int Nonleaf::LeafNum() const {	int num=0;	for (int i=0; i<actsize; i++) 		num+=child[i]->LeafNum();	return num;}int Leaf::NonleafNum() const { return 0; }int Nonleaf::NonleafNum() const {	int num=1;	for (int i=0; i<actsize; i++)		num+=child[i]->NonleafNum();	return num;}int Leaf::NumLeafEntry() const { return actsize; }int Leaf::NumNonleafEntry() const { return 0; }int Nonleaf::NumLeafEntry() const {	int tmpn = 0;	for (int i=0; i<actsize; i++)		tmpn+=child[i]->NumLeafEntry();	return tmpn;	}int Nonleaf::NumNonleafEntry() const {	int tmpn = actsize;	for (int i=0; i<actsize; i++)		tmpn+=child[i]->NumNonleafEntry();	return tmpn;	}int Leaf::NumEntry() const{ return actsize; }int Nonleaf::NumEntry() const {	int tmpn = actsize;	for (int i=0; i<actsize; i++) 		tmpn+=child[i]->NumEntry();	return tmpn;}double Leaf::Occupancy(Stat *Stats) const {	return actsize/(1.0*MaxSize(Stats));}double Nonleaf::Occupancy(Stat *Stats) const {	int leafsize, nonleafsize;#ifdef RECTANGLE	leafsize=(Stats->PageSize-2*sizeof(int))/		 (sizeof(int)+sizeof(double)*(3*Stats->Dimension+1));#else 	leafsize=(Stats->PageSize-2*sizeof(int))/		 (sizeof(int)+sizeof(double)*(Stats->Dimension+1));#endif	nonleafsize=MaxSize(Stats);	return NumEntry()/(1.0*nonleafsize*NonleafNum()+1.0*leafsize*LeafNum());}void Node::Print_Summary(Stat *Stats, ostream &fo) const {Entry tmpent;tmpent.Init(entry[0].sx.dim);CF(tmpent);fo<<"Root CF\t"<<tmpent<<endl;fo<<"FootPrint\t"<<sqrt(tmpent.Radius())<<endl;#ifdef RECTANGLERectangle tmprect;tmprect.Init(entry[0].sx.dim);Rect(tmprect);fo<<"Root Rectangle\t"<<tmprect<<endl;#endif RECTANGLEfo<<"Leaf Nodes\t"<<LeafNum()<<endl;fo<<"Nonleaf Nodes\t"<<NonleafNum()<<endl;fo<<"Tree Size\t"<<Size()<<endl;fo<<"Tree Depth\t"<<Depth()<<endl;fo<<"Leaf Entries\t"<<NumLeafEntry()<<endl;fo<<"Nonleaf Entries\t"<<NumNonleafEntry()<< endl;fo<<"Occupancy\t"<<Occupancy(Stats)<<endl;}void Node::Print_Summary(Stat *Stats, ofstream &fo) const {Entry tmpent;tmpent.Init(entry[0].sx.dim);CF(tmpent);fo<<"Root CF\t"<<tmpent<<endl;fo<<"FootPrint\t"<<sqrt(tmpent.Radius())<<endl;#ifdef RECTANGLERectangle tmprect;tmprect.Init(entry[0].sx.dim);Rect(tmprect);fo<<"Root Rectangle\t"<<tmprect<<endl;#endif RECTANGLEfo<<"Leaf Nodes\t"<<LeafNum()<<endl;fo<<"Nonleaf Nodes\t"<<NonleafNum()<<endl;fo<<"Tree Size\t"<<Size()<<endl;fo<<"Tree Depth\t"<<Depth()<<endl;fo<<"Leaf Entries\t"<<NumLeafEntry()<<endl;fo<<"Nonleaf Entries\t"<<NumNonleafEntry()<< endl;fo<<"Occupancy\t"<<Occupancy(Stats)<<endl;}Node* Leaf::DenseNode(){if (actsize>1) return this;else return NULL;}short Leaf::FreeEmptyNode(Stat *Stats){short flag=TRUE;for (int i=0; i<actsize; i++) 	if (entry[i].n>0) {flag=FALSE; break;}if (flag==TRUE) {	this->AssignNextPrev(Stats); 	delete this; 	Stats->MemUsed--; 	Stats->TreeSize--;	}return flag;}// fit without expanding or splittingshort Leaf::BestFitPath1(Stat *Stats, const Entry &ent, Path& BestPath){int EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	BestPath.Push(EntryI,this);	return TRUE;	}else return FALSE;}// fit with expanding but without splittingshort Leaf::BestFitPath2(Stat *Stats, const Entry &ent, Path& BestPath){int EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	BestPath.Push(EntryI,this);	return TRUE;	}else if (actsize<MaxSize(Stats)) {	BestPath.Push(actsize,this);	return TRUE;	}else return FALSE;}// absorb without expanding and splittingshort Leaf::AbsorbEntry1(Stat *Stats, const Entry &ent){int EntryI;EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	entry[EntryI]+=ent;	return TRUE;	}else return FALSE;}// absorb with expanding but without splittingshort Leaf::AbsorbEntry2(Stat *Stats, const Entry &ent){int EntryI;EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	entry[EntryI]+=ent;	return TRUE;	}else if (actsize<MaxSize(Stats)) {	entry[actsize]=ent;	actsize++; 	Stats->CurrEntryCnt++;	return TRUE;	}     else return FALSE;}ConNode* Leaf::Copy(Stat *Stats) const{ConNode* node=new ConNode(actsize,Stats);for (int i=0; i<actsize; i++) node->entry[i]=entry[i];return node;}ConNode* Nonleaf::Copy(Stat *Stats) const{ConNode* node=new ConNode(actsize,Stats);for (int i=0; i<actsize; i++) {	node->entry[i]=entry[i];	node->child[i]=child[i]->Copy(Stats);	}return node;}Node* Leaf::AdjustTree(Stat *Stats, const Entry &ent) {int  EntryI;Node *NewNode;if (actsize==0) {	entry[actsize]=ent;	actsize++; 	Stats->CurrEntryCnt++;	return NULL;	}EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	entry[EntryI]+=ent;	return NULL;	}else {	NewNode = InsertMightSplit(Stats,ent,NULL);	if (NewNode==NULL) return NULL;	else {		if (this!=Stats->OldRoot)			return NewNode;		else {  Stats->CreateNewRoot(this,NewNode);			return NULL;	             }             }	}}Node* Nonleaf::DenseNode(){Node *tmp;// less than 2 entries: this->N()<=1||this->actsize<=1 if (this->N()<=1) return NULL;if (this->actsize<=1) {	tmp = child[0]->DenseNode();	if (tmp==NULL) return NULL;	else return tmp;	}// more than 2 entries: this->N()>1&&this->actsize>1int EntryI = DensestEntry();tmp=child[EntryI]->DenseNode();if (tmp==NULL) return this;else return tmp;}short Nonleaf::FreeEmptyNode(Stat *Stats){short flag=TRUE;int i=0;while (i<actsize) {	if (child[i]->FreeEmptyNode(Stats)==TRUE) {		actsize--;		entry[i]=entry[actsize];		child[i]=child[actsize];		}	else {  flag=FALSE;		i++;		}	}if (flag==TRUE) {	delete this; 	Stats->MemUsed--; 	Stats->TreeSize--;	}return flag;}		// fit without expanding and splittingshort Nonleaf::BestFitPath1(Stat *Stats, const Entry &ent, Path& BestPath){int EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	BestPath.Push(EntryI,this);		if (child[EntryI]->BestFitPath1(Stats,ent,BestPath)==TRUE) 		return TRUE;	else 	return FALSE;	}else return FALSE;}// fit with expanding but without splittingshort Nonleaf::BestFitPath2(Stat *Stats, const Entry &ent, Path& BestPath){int EntryI=ClosestOne(Stats,ent);if (EntryI>=0) {	BestPath.Push(EntryI,this);		if (child[EntryI]->BestFitPath2(Stats,ent,BestPath)==TRUE) 		return TRUE;	else 	return FALSE;	}else return FALSE;}// absorb without expanding and splittingshort Nonleaf::AbsorbEntry1(Stat *Stats, const Entry &ent){int EntryI;EntryI = ClosestOne(Stats,ent);if (child[EntryI]->AbsorbEntry1(Stats,ent)==TRUE) {	entry[EntryI]+=ent;	return TRUE;	}else return FALSE;}// absorb with expanding but without splittingshort Nonleaf::AbsorbEntry2(Stat *Stats, const Entry &ent){int EntryI;EntryI=ClosestOne(Stats,ent);if (child[EntryI]->AbsorbEntry2(Stats,ent)==TRUE) {	entry[EntryI]+=ent;	return TRUE;	}else return FALSE;}Node* Nonleaf::AdjustTree(Stat *Stats, const Entry &ent){int EntryI;int i,j;double d;Node *ResNode, *NewNode;Entry ResEnt;ResEnt.Init(Stats->Dimension);EntryI=ClosestOne(Stats,ent);ResNode=child[EntryI]->AdjustTree(Stats,ent);if (ResNode!=NULL) { // Split Propagate	child[EntryI]->CF(entry[EntryI]);	ResNode->CF(ResEnt);	NewNode=InsertMightSplit(Stats,ResEnt,ResNode); 	if (NewNode==NULL) { // Split Propagate Stops	   if (actsize>2) {		d=ClosestTwo(Stats, i, j);		if (!(i==EntryI&&j==actsize-1))	       		MergeMightResplit(Stats, i, j);		}	  return NULL;	  }	 else { if (this!=Stats->OldRoot) 			return NewNode;	        else { // Create New Root	  		Stats->CreateNewRoot(this,NewNode);	  		return NULL;	        	}              }	}else { // No Split Coming Up	entry[EntryI]+=ent; 	return NULL;	}}int Nonleaf::DensestEntry() const{int i, imax, nmax;imax = 0;nmax = entry[0].n;for (i=1; i<actsize; i++) {	if (entry[i].n>nmax) {		imax = i;		nmax = entry[i].n;		}	}return imax;}int Nonleaf::ClosestOne(Stat *Stats, const Entry& ent) const {int i, imin;double d, dmin;// empty nodeif (actsize<=1) return 0;// nonemptry nodeimin = 0;dmin = HUGE_DOUBLE;for (i=0; i<actsize; i++) {    if (entry[i].n>0) {	d = distance(Stats->BDtype,entry[i],ent);	if (d<dmin) {dmin=d;imin=i;}	}    }if (dmin<HUGE_DOUBLE) return imin;else return -1;}int Leaf::DensestEntry() const{// do nothing and never be called.}int Leaf::ClosestOne(Stat *Stats, const Entry& ent) const {int i, imin;double d, dmin;// empty nodeif (actsize<1) return 0;// nonempty nodeimin = 0;dmin = HUGE_DOUBLE;/***************************************************// option1: min average D: tend to cause overlapping for (i=0; i<actsize; i++) {    if (entry[i].n>0) {	d = fitness(Stats->Ftype,entry[i],ent);	if (d<dmin) {		dmin=d;		imin=i;		}	}    }if (dmin<=Stats->CurFt+PRECISION_ERROR) return imin;else return -1;***************************************************/// option2: min average Di: less overlappingfor (i=0; i<actsize; i++) {    if (entry[i].n>0) {	d = distance(Stats->BDtype,entry[i],ent);	if (d<dmin) {		dmin=d;		imin=i;		}	}    }if (dmin<HUGE_DOUBLE) {	dmin = fitness(Stats->Ftype,entry[imin],ent);        if (dmin<=Stats->CurFt+PRECISION_ERROR) return imin;        else return -1;	}else return -1;}double Leaf::ClosestTwo(Stat *Stats, int &i, int &j) const {int i1,j1,imin,jmin;double d, dmin;if (actsize<2) 	print_error("Leaf::ClosestTwo","Less than 2 entries");if (actsize==2) {	i=0; j=1; 	return distance(Stats->BDtype,entry[0],entry[1]);	}imin = 0; jmin = 1;dmin = distance(Stats->BDtype,entry[0],entry[1]);for (i1=0;i1<actsize-1;i1++)   for (j1=i1+1;j1<actsize;j1++) {		d = distance(Stats->BDtype,entry[i1],entry[j1]);		if (d<dmin) { 			imin = i1; 			jmin = j1; 			dmin = d;			}	}i=imin; j=jmin;return dmin;}// only relevant to phase 3 and hierarchical clusteringdouble Leaf::ClosestDiffTwo(Stat *Stats, int &i, int &j) const {Entry tmpent;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩毛片在线免费观看| 亚洲成av人**亚洲成av**| 亚洲乱码中文字幕| 美女www一区二区| av在线不卡网| 欧美大片国产精品| 樱桃视频在线观看一区| 国产伦精品一区二区三区视频青涩 | 精品久久人人做人人爰| 亚洲品质自拍视频| 国产乱人伦偷精品视频不卡 | 67194成人在线观看| 久久精品网站免费观看| 天堂va蜜桃一区二区三区漫画版 | 欧美色成人综合| 国产精品国产三级国产普通话99| 日韩av高清在线观看| 色综合中文综合网| 午夜精品免费在线观看| 99视频一区二区三区| 欧美精品一区二区高清在线观看 | 欧美一区二区三区在线观看视频| 中文字幕在线不卡国产视频| 韩国在线一区二区| 久久久国产午夜精品| 亚洲一区二区三区在线播放| 成人美女在线观看| 国产视频一区二区在线观看| 久久精品国产一区二区三区免费看 | 欧美日韩一级二级三级| 一区二区成人在线| 色综合久久综合网| 亚洲欧美日韩成人高清在线一区| 26uuu精品一区二区在线观看| 在线免费观看日本欧美| 欧美国产一区视频在线观看| 国产一区二区调教| 欧美电视剧在线看免费| 久久国产麻豆精品| 日韩精品一区二区三区在线播放| 日日夜夜免费精品| 9191成人精品久久| 日本aⅴ亚洲精品中文乱码| 555www色欧美视频| 久久国产成人午夜av影院| 日韩一区二区免费在线观看| 日韩avvvv在线播放| 日韩欧美中文字幕制服| 精品一区二区三区不卡| 亚洲精品一区在线观看| 国产高清不卡二三区| 国产精品麻豆欧美日韩ww| 91亚洲大成网污www| 一区二区三区在线观看视频| 精品欧美乱码久久久久久 | 精品伊人久久久久7777人| 久久综合九色综合97婷婷女人| 激情深爱一区二区| 国产偷国产偷精品高清尤物| 99精品视频免费在线观看| 一区二区三区精品在线观看| 欧美日本韩国一区二区三区视频| 免费在线成人网| 久久尤物电影视频在线观看| av在线不卡电影| 亚洲一区二区视频在线观看| 欧美一二三区在线| 成人性生交大片| 亚洲高清免费在线| 久久久精品免费网站| 色综合久久88色综合天天6| 日韩综合小视频| 国产日韩欧美一区二区三区乱码| 一本一道久久a久久精品综合蜜臀| 午夜电影一区二区| 国产喷白浆一区二区三区| 欧美午夜一区二区三区 | 成人免费看视频| 午夜精品久久久久久久久久久| 精品国产乱码久久久久久图片 | 九九国产精品视频| 一区二区三区在线免费视频| 精品国产免费一区二区三区香蕉| 精品日韩在线一区| 91免费版在线| 国产综合成人久久大片91| 亚洲午夜电影在线| 中文字幕精品在线不卡| 欧美高清视频一二三区| av爱爱亚洲一区| 国产一区二区三区久久久| 亚洲高清一区二区三区| 亚洲欧洲一区二区三区| 精品成人a区在线观看| 欧美日韩一级视频| 97se亚洲国产综合自在线观| 国产在线精品一区二区三区不卡 | 老司机精品视频线观看86| 亚洲视频小说图片| 国产亚洲成av人在线观看导航 | 免费成人在线影院| 伊人婷婷欧美激情| 国产精品国产精品国产专区不蜜 | 麻豆精品视频在线观看免费| 亚洲免费资源在线播放| 国产精品丝袜一区| 日韩视频123| 欧美一区二区在线免费观看| 欧美制服丝袜第一页| 国产精品一区二区三区乱码 | 午夜影院久久久| 亚洲精品午夜久久久| 国产精品你懂的| 久久综合九色综合欧美就去吻| 欧美一区二区久久久| 91精品国产欧美一区二区成人| 欧美男女性生活在线直播观看| 欧美三级欧美一级| 欧美日韩在线精品一区二区三区激情| 91免费版在线看| 欧美亚洲日本国产| 欧美精品一二三区| 日韩一区二区三区免费看 | 国产亚洲综合性久久久影院| 欧美变态tickling挠脚心| 日韩免费高清av| 久久精品人人做人人爽97| 欧美国产日韩精品免费观看| 中文字幕中文乱码欧美一区二区 | 99久久伊人久久99| 99精品在线观看视频| 奇米精品一区二区三区在线观看 | 在线观看日韩av先锋影音电影院| 成人动漫一区二区| 成人动漫av在线| 成人中文字幕合集| 成人免费观看男女羞羞视频| 懂色一区二区三区免费观看| 美腿丝袜亚洲三区| 久久99精品国产91久久来源| 国产成人精品免费在线| 成人国产精品免费观看| 成人18精品视频| 色悠悠久久综合| 色综合一区二区三区| 777色狠狠一区二区三区| 日韩一区二区在线免费观看| 日韩欧美国产午夜精品| 精品不卡在线视频| 一区二区三区在线视频免费| 亚洲国产精品久久艾草纯爱| 日韩国产成人精品| 国产一区在线视频| www.av亚洲| 日韩欧美成人午夜| 日本一区二区免费在线| 亚洲欧洲99久久| 亚洲国产成人tv| av成人免费在线观看| 在线观看国产91| 日韩久久久久久| 国产精品午夜在线观看| 亚洲福利视频导航| 国产伦精品一区二区三区视频青涩| 成人爱爱电影网址| 欧美区一区二区三区| 2021久久国产精品不只是精品| 亚洲综合色成人| 激情文学综合丁香| 91精品1区2区| 久久蜜桃av一区二区天堂 | 国产亚洲美州欧州综合国| 亚洲另类色综合网站| 美女在线观看视频一区二区| 国产精品一区二区三区网站| 欧美一区二区三区免费在线看| 中文一区二区完整视频在线观看| 亚洲综合在线视频| 国产一区在线观看麻豆| 不卡一卡二卡三乱码免费网站| 日韩精品一区二区三区三区免费| 亚洲日本在线观看| 韩日欧美一区二区三区| 91免费视频观看| 国产精品久久久久影院色老大| 午夜精彩视频在线观看不卡| av日韩在线网站| 日韩欧美一级二级三级久久久| 亚洲成人第一页| 成人av在线电影| 精品91自产拍在线观看一区| 亚洲精品老司机| 色国产精品一区在线观看| 久久久亚洲欧洲日产国码αv| 午夜精品久久久久久| 99在线视频精品| 亚洲人成亚洲人成在线观看图片| 激情小说亚洲一区| 91麻豆精品国产91久久久 | 精品无码三级在线观看视频|