qunionfind.h
来自「算断裂的」· C头文件 代码 · 共 49 行
H
49 行
// ------------------------------------------------------------------// qunionfind.h//// This file contains a class for implementing a union-find data structure.// ------------------------------------------------------------------// Author: Stephen A. Vavasis// Copyright (c) 1999 by Cornell University. All rights reserved.// // See the accompanying file 'Copyright' for authorship information,// the terms of the license governing this software, and disclaimers// concerning this software.// ------------------------------------------------------------------// This file is part of the QMG software. // Version 2.0 of QMG, release date September 3, 1999.// ------------------------------------------------------------------#ifndef QUNIONFIND_H#define QUNIONFIND_H#include "qnamesp.h"class QMG::UnionFind {private: void operator=(const UnionFind&) { } UnionFind(const UnionFind&) { } int size_; vector<int> lsize_; vector<int> rename_label_; vector<int> inv_rename_label_; mutable vector<int> labels_; mutable vector<int> tmplist_; mutable vector<int> parent_; // parent_ modified by get_label op int get_label_unrenamed_(int) const;public: UnionFind() { } ~UnionFind() { } void merge(int i1, int i2); const vector<int>& retrieve_labels() const; int pack_labels(); int size() const {return size_;} int get_label(int i) const; int label_size(int i) const; void initialize(int sz);};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?