示例#1
0
文件: fheap.cpp 项目: Yangsilu/daoopt
void fh_remove(fheap_t *h, int vertex_no){
//	printf("heap:remove %d\n", vertex_no);
	fheap_node_t *cut_node = h->nodes[vertex_no];
	if(cut_node == 0){
		printf("FATAL ERROR IN FH_REMOVE WITHIN FIBONACCI HEAP!\n");	
		printf("Key %d has index 0\n", vertex_no);	
		exit(-1);
	}
	fh_decrease_key(h, vertex_no, -1e30);
	if( fh_delete_min(h) != vertex_no ){
		printf("FATAL ERROR IN FH_REMOVE WITHIN FIBONACCI HEAP!\n");	
		printf("After decreasing its key to -e30, %d is not the smallest element!\nEXITING\n", vertex_no);	
		exit(-1);
	};
}
示例#2
0
void _fh_decrease_key(void *h, long v, float k) {
    fh_decrease_key((fheap_t *)h, v, k);
}