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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? dijkstra.cpp

?? ISOMAP算法
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
//***************************************************************************// FIBTEST.CPP//// Test program for the F-heap implementation.// Copyright (c) 1996 by John Boyer.// See header file for free usage information.//***************************************************************************#include <math.h>#include "mex.h"extern void _main();#include <stdlib.h>#include <iostream.h>#include <stdio.h>#include <conio.h>#include <ctype.h>#include <memory.h>#include <time.h>#include "fibheap.h"#define _FIBHEAP_CPP//***************************************************************************// This Fibonacci heap implementation is Copyright (c) 1996 by John Boyer.// See the header file for free usage information.//***************************************************************************//***************************************************************************// The classes in this package are designed to allow the package user// to quickly and easily develop applications that require a heap data// structure.  Using amortized analysis, the asymptotically fastest heap// data structure is the Fibonacci heap.  The constants are a little// high so the real speed gain will not be seen until larger data sets// are required, but in most cases, if the data set is small, then the// run-time will be neglible anyway.//// To use this heap class you need do only two things.  First, subclass// the FibHeapNode class to create the class of objects that you'd// like to store in a heap.  Second, create an instance of the FibHeap// class, which can then be used to Insert(), ExtractMin(), etc.,// instances of your FibHeapNode subclass.  Notice that you don't need// to create a subclass of the FibHeap class.//// The application-specific data object that you'd like to store in a heap// will have a key value.  In the class that you derive from FibHeapNode,// you will need to define the key structure then provide assignment (=),// equality (==) and less-than operators and a destructor.  These functions// are declared virtual so that the code in the FibHeap class can compare,// assign and destroy your objects by calling on your code.//// The overloaded operators in your defined class MUST call functions in// the Fibonacci heap node class first.  For assignment, the function// FHN_Assign() should be called before code that deals with the copy of// the key value.  For comparison operators, the function FHN_Cmp() should// appear first.  If it returns 0, then keys can be compared as normal.// The following indicates what the three most common operators must do// based on the return value of FHN_Cmp() //// For ==, if zero returned, then compare keys//	   if non-zero X returned, then return 0// For <,  if zero returned, then compare keys//         if non-zero X returned, then return X<0?1:0// For >,  if zero returned, then compare keys//         if non-zero X returned, then return X>0?1:0   //***************************************************************************#include <stdlib.h>#include <iostream.h>#include <stdio.h>#include <conio.h>#include "fibheap.h"//***************************************************************************//=========================================================// FibHeapNode Constructor//=========================================================//***************************************************************************FibHeapNode::FibHeapNode(){     Left = Right = Parent = Child = NULL;     Degree = Mark = NegInfinityFlag = 0;}//=========================================================// FibHeapNode Destructor//// Body is empty, but declaration is required in order to// force virtual.  This will ensure that FibHeap class// calls derived class destructors.//=========================================================FibHeapNode::~FibHeapNode(){}//=========================================================// FHN_Assign()//// To be used as first step of an assignment operator in a// derived class.  The derived class will handle assignment// of key value, and this function handles copy of the// NegInfinityFlag (which overrides the key value if it is// set).//=========================================================void FibHeapNode::FHN_Assign(FibHeapNode& RHS){     NegInfinityFlag = RHS.NegInfinityFlag;}//=========================================================// FHN_Cmp()//// To be used as the first step of ALL comparators in a// derived class.//// Compares the relative state of the two neg. infinity// flags.  Note that 'this' is the left hand side.  If// LHS neg. infinity is set, then it will be less than (-1)// the RHS unless RHS neg. infinity flag is also set.// Only if function returns 0 should the key comparison// defined in the derived class be performed, e.g.//// For ==, if zero returned, then compare keys//	   if non-zero X returned, then return 0// For <,  if zero returned, then compare keys//         if non-zero X returned, then return X<0?1:0// For >,  if zero returned, then compare keys//         if non-zero X returned, then return X>0?1:0    //=========================================================int  FibHeapNode::FHN_Cmp(FibHeapNode& RHS){     if (NegInfinityFlag)	 return RHS.NegInfinityFlag ? 0 : -1;     return RHS.NegInfinityFlag ? 1 : 0; }//========================================================================// We do, on occasion, compare and assign objects of type FibHeapNode, but// only when the NegInfinityFlag is set.  See for example FibHeap::Delete().//// Also, these functions exemplify what a derived class should do.//========================================================================void FibHeapNode::operator =(FibHeapNode& RHS){     FHN_Assign(RHS);     // Key assignment goes here in derived classes}int  FibHeapNode::operator ==(FibHeapNode& RHS){     if (FHN_Cmp(RHS)) return 0;     // Key compare goes here in derived classes     return 1;}int  FibHeapNode::operator <(FibHeapNode& RHS){int X;     if ((X=FHN_Cmp(RHS)) != 0)	  return X < 0 ? 1 : 0;     // Key compare goes here in derived classes     return 0;}//=========================================================// Print()//=========================================================void FibHeapNode::Print(){     if (NegInfinityFlag)	 cout << "-inf.";}//***************************************************************************//===========================================================================// FibHeap Constructor//===========================================================================//***************************************************************************FibHeap::FibHeap(){     MinRoot = NULL;     NumNodes = NumTrees = NumMarkedNodes = 0;     ClearHeapOwnership();}//===========================================================================// FibHeap Destructor//===========================================================================FibHeap::~FibHeap(){FibHeapNode *Temp;     if (GetHeapOwnership())     {         while (MinRoot != NULL)         {             Temp = ExtractMin();             delete Temp;	 }     }}//===========================================================================// Insert() - O(1) actual; O(2) amortized//// I am using O(2) here to indicate that although Insert() is// constant time, its amortized rating is more costly because some// of the work of inserting is done by other operations such as// ExtractMin(), which is where tree-balancing occurs.//// The child pointer is deliberately not set to NULL because Insert()// is also used internally to help put whole trees onto the root list.//===========================================================================void FibHeap::Insert(FibHeapNode *NewNode){     if (NewNode == NULL) return;// If the heap is currently empty, then new node becomes singleton// circular root list      if (MinRoot == NULL)	 MinRoot = NewNode->Left = NewNode->Right = NewNode;     else     {// Pointers from NewNode set to insert between MinRoot and MinRoot->Right         NewNode->Right = MinRoot->Right;	 NewNode->Left = MinRoot;// Set Pointers to NewNode  	 NewNode->Left->Right = NewNode;         NewNode->Right->Left = NewNode;// The new node becomes new MinRoot if it is less than current MinRoot         if (*NewNode < *MinRoot)	     MinRoot = NewNode;     }// We have one more node in the heap, and it is a tree on the root list     NumNodes++;     NumTrees++;     NewNode->Parent = NULL;}//===========================================================================// Union() - O(1) actual; O(1) amortized//===========================================================================void FibHeap::Union(FibHeap *OtherHeap){FibHeapNode *Min1, *Min2, *Next1, *Next2;     if (OtherHeap == NULL || OtherHeap->MinRoot == NULL) return;// We join the two circular lists by cutting each list between its// min node and the node after the min.  This code just pulls those// nodes into temporary variables so we don't get lost as changes// are made.     Min1 = MinRoot;     Min2 = OtherHeap->MinRoot;     Next1 = Min1->Right;     Next2 = Min2->Right;// To join the two circles, we join the minimum nodes to the next// nodes on the opposite chains.  Conceptually, it looks like the way// two bubbles join to form one larger bubble.  They meet at one point// of contact, then expand out to make the bigger circle.      Min1->Right = Next2;     Next2->Left = Min1;     Min2->Right = Next1;     Next1->Left = Min2;// Choose the new minimum for the heap      if (*Min2 < *Min1)         MinRoot = Min2;// Set the amortized analysis statistics and size of the new heap                        NumNodes += OtherHeap->NumNodes;     NumMarkedNodes += OtherHeap->NumMarkedNodes;     NumTrees += OtherHeap->NumTrees;// Complete the union by setting the other heap to emptiness// then destroying it     OtherHeap->MinRoot  = NULL;     OtherHeap->NumNodes =     OtherHeap->NumTrees =     OtherHeap->NumMarkedNodes = 0;     delete OtherHeap;}//===========================================================================// Minimum - O(1) actual; O(1) amortized//===========================================================================FibHeapNode *FibHeap::Minimum(){     return MinRoot;}//===========================================================================// ExtractMin() - O(n) worst-case actual; O(lg n) amortized//===========================================================================FibHeapNode *FibHeap::ExtractMin(){FibHeapNode *Result;FibHeap *ChildHeap = NULL;// Remove minimum node and set MinRoot to next node     if ((Result = Minimum()) == NULL)          return NULL;     MinRoot = Result->Right;     Result->Right->Left = Result->Left;     Result->Left->Right = Result->Right;     Result->Left = Result->Right = NULL;     NumNodes --;     if (Result->Mark)     {	 NumMarkedNodes --;         Result->Mark = 0;     }     Result->Degree = 0;// Attach child list of Minimum node to the root list of the heap// If there is no child list, then do no work     if (Result->Child == NULL)     {	 if (MinRoot == Result)	     MinRoot = NULL;     }// If MinRoot==Result then there was only one root tree, so the// root list is simply the child list of that node (which is// NULL if this is the last node in the list)     else if (MinRoot == Result)         MinRoot = Result->Child;// If MinRoot is different, then the child list is pushed into a// new temporary heap, which is then merged by Union() onto the// root list of this heap.     else      {         ChildHeap = new FibHeap();         ChildHeap->MinRoot = Result->Child;     }// Complete the disassociation of the Result node from the heap     if (Result->Child != NULL)	 Result->Child->Parent = NULL;     Result->Child = Result->Parent = NULL;// If there was a child list, then we now merge it with the//	rest of the root list     if (ChildHeap)         Union(ChildHeap);// Consolidate heap to find new minimum and do reorganize work     if (MinRoot != NULL)         _Consolidate();// Return the minimum node, which is now disassociated with the heap// It has Left, Right, Parent, Child, Mark and Degree cleared.     return Result;}//===========================================================================// DecreaseKey() - O(lg n) actual; O(1) amortized//// The O(lg n) actual cost stems from the fact that the depth, and// therefore the number of ancestor parents, is bounded by O(lg n).//===========================================================================int  FibHeap::DecreaseKey(FibHeapNode *theNode, FibHeapNode& NewKey){FibHeapNode *theParent;     if (theNode==NULL || *theNode < NewKey)         return NOTOK;     *theNode = NewKey;     theParent = theNode->Parent;     if (theParent != NULL && *theNode < *theParent)     {         _Cut(theNode, theParent);         _CascadingCut(theParent);     }     if (*theNode < *MinRoot)         MinRoot = theNode;     return OK;}//===========================================================================// Delete() - O(lg n) amortized; ExtractMin() dominates//// Notice that if we don't own the heap nodes, then we clear the// NegInfinityFlag on the deleted node.  Presumably, the programmer// will be reusing the node.//===========================================================================int  FibHeap::Delete(FibHeapNode *theNode){FibHeapNode Temp;int Result;     if (theNode == NULL) return NOTOK;     Temp.NegInfinityFlag = 1;     Result = DecreaseKey(theNode, Temp);     if (Result == OK)         if (ExtractMin() == NULL)             Result = NOTOK;     if (Result == OK)     {         if (GetHeapOwnership())	      delete theNode;	 else theNode->NegInfinityFlag = 0;     }              return Result;}//========================================================================// Print()//// Used internally for debugging purposes.  The function prints the key// value for each node along the root list, then it calls itself on each// child list.   //========================================================================void FibHeap::Print(FibHeapNode *Tree, FibHeapNode *theParent){FibHeapNode* Temp = NULL;     if (Tree == NULL) Tree = MinRoot;     Temp = Tree;     do {	if (Temp->Left == NULL)	    mexPrintf( "(Left is NULL)" );	Temp->Print();	if (Temp->Parent != theParent)	    mexPrintf("(Parent is incorrect)" );	if (Temp->Right == NULL)	     mexPrintf( "(Right is NULL)" );	else if (Temp->Right->Left != Temp)	     mexPrintf( "(Error in left link left) ->" );	else mexPrintf( " <-> " );	Temp = Temp->Right;	if (kbhit() && getch() == 27)	{	    cout << "Hit a key to resume or ESC to break\n";	    if (getch() == 27)                break;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜芽一区二区三区| 久久亚洲二区三区| 福利电影一区二区| 国产一区二区三区美女| 美女视频一区在线观看| 天天av天天翘天天综合网| 一区二区三区欧美亚洲| 亚洲美女在线一区| 樱花影视一区二区| 亚洲国产精品一区二区久久| 亚洲一区在线播放| 亚洲.国产.中文慕字在线| 亚洲成av人影院| 免费一区二区视频| 精品一区二区在线免费观看| 久久爱另类一区二区小说| 精品亚洲免费视频| 成人性生交大片免费看中文网站| 成人综合在线观看| 欧洲精品在线观看| 欧美老肥妇做.爰bbww视频| 日韩精品一区二区三区四区视频| 精品免费视频.| 国产精品日产欧美久久久久| 樱花影视一区二区| 麻豆国产精品官网| 99在线精品视频| 色呦呦一区二区三区| 7878成人国产在线观看| 久久久国产精品麻豆| 一色桃子久久精品亚洲| 亚洲成人一区在线| 国产福利91精品| 在线观看亚洲成人| 精品久久久久一区二区国产| 国产精品每日更新| 天堂在线一区二区| 99久久免费视频.com| 欧美日韩小视频| 国产香蕉久久精品综合网| 成人欧美一区二区三区1314| 天堂精品中文字幕在线| 成人精品在线视频观看| 欧美日本一道本| 中文字幕精品—区二区四季| 亚洲不卡一区二区三区| 国产99久久久精品| 日韩视频中午一区| 自拍偷自拍亚洲精品播放| 久久精品国产亚洲高清剧情介绍| 91一区一区三区| 国产午夜精品久久久久久久| 午夜精品123| 99久久国产综合精品麻豆| 欧美一区2区视频在线观看| 亚洲免费观看视频| 国产福利一区在线| 精品国产一区a| 舔着乳尖日韩一区| 99国产精品久久久久| 精品第一国产综合精品aⅴ| 亚洲成a天堂v人片| 色猫猫国产区一区二在线视频| 精品久久久久久久久久久久久久久久久| 亚洲日穴在线视频| 成人app网站| 国产精品传媒在线| 波多野结衣精品在线| 国产亚洲精品bt天堂精选| 国产在线播精品第三| 精品国产一区二区三区av性色| 天堂影院一区二区| 欧美一区二区三区色| 日日夜夜精品视频天天综合网| 欧美性xxxxxx少妇| 午夜精品在线视频一区| 欧美日韩免费一区二区三区| 午夜一区二区三区视频| 欧美亚洲国产怡红院影院| 亚洲黄色av一区| 欧美精品三级日韩久久| 婷婷夜色潮精品综合在线| 欧美另类videos死尸| 男男视频亚洲欧美| 精品国产伦一区二区三区观看体验 | 青娱乐精品在线视频| 欧美日韩午夜精品| 日韩制服丝袜先锋影音| 欧美一区二区不卡视频| 寂寞少妇一区二区三区| 久久婷婷久久一区二区三区| 国产精品综合二区| 日韩伦理av电影| 欧美日韩亚洲另类| 韩国欧美一区二区| 国产精品丝袜黑色高跟| 91福利精品第一导航| 石原莉奈一区二区三区在线观看| 日韩欧美国产小视频| 国产福利一区在线| 亚洲精品高清在线| 精品国产一区二区精华| 波多野结衣中文字幕一区二区三区| 亚洲精品国久久99热| 欧美日韩国产小视频| 国产精品一区在线观看乱码| 国产精品热久久久久夜色精品三区| 色婷婷综合视频在线观看| 亚洲成人av在线电影| 2023国产精品自拍| 97精品超碰一区二区三区| 香蕉成人伊视频在线观看| 久久人人超碰精品| 欧洲一区二区三区免费视频| 精品在线免费观看| 亚洲国产精品久久艾草纯爱| 精品黑人一区二区三区久久| 成人高清视频在线| 日本成人在线不卡视频| 国产精品久久影院| 日韩一区二区在线看片| 成人av在线资源网站| 人人爽香蕉精品| 亚洲男人的天堂在线aⅴ视频 | 另类的小说在线视频另类成人小视频在线 | 亚洲国产一区视频| 国产亚洲女人久久久久毛片| 欧美日韩第一区日日骚| 国产乱色国产精品免费视频| 亚洲高清视频中文字幕| 国产午夜精品一区二区| 欧美成人艳星乳罩| 欧美在线视频不卡| 成人一区二区视频| 麻豆久久久久久| 亚洲在线观看免费| 亚洲日本成人在线观看| 久久久99久久| 欧美videofree性高清杂交| 欧美性欧美巨大黑白大战| 国产91色综合久久免费分享| 蜜桃一区二区三区在线| 亚洲成人av免费| 亚洲va中文字幕| 一区二区三区四区不卡视频| 亚洲美腿欧美偷拍| 亚洲精品伦理在线| 亚洲精品视频在线观看网站| 中文字幕国产精品一区二区| www国产成人免费观看视频 深夜成人网| 欧美人狂配大交3d怪物一区| 91久久一区二区| 欧美性xxxxx极品少妇| 欧美亚州韩日在线看免费版国语版| 成人中文字幕合集| 波多野结衣中文一区| 99在线视频精品| 91欧美激情一区二区三区成人| av一区二区三区在线| www.一区二区| 日本电影亚洲天堂一区| 色综合久久六月婷婷中文字幕| 色哟哟亚洲精品| 欧美日韩免费在线视频| 欧美一级生活片| 2024国产精品| |精品福利一区二区三区| 亚洲欧洲综合另类| 亚洲成人免费av| 卡一卡二国产精品| 丁香桃色午夜亚洲一区二区三区| 成人小视频在线观看| 99久久久国产精品| 欧美精三区欧美精三区| 精品入口麻豆88视频| 国产精品理论在线观看| 亚洲激情中文1区| 五月天婷婷综合| 国产成人午夜精品5599| 91啪亚洲精品| 日韩欧美美女一区二区三区| 国产喷白浆一区二区三区| 亚洲日本一区二区| 裸体健美xxxx欧美裸体表演| 国产成人在线视频网站| 色美美综合视频| 精品少妇一区二区三区免费观看| 中文字幕av在线一区二区三区| 一区二区三区在线观看国产| 裸体一区二区三区| 在线观看一区二区视频| 久久久天堂av| 午夜伦理一区二区| 91玉足脚交白嫩脚丫在线播放| 欧美精品tushy高清| 国产精品视频在线看| 日本亚洲天堂网| 日本道色综合久久| 国产精品视频在线看| 国产一区视频网站|