ColPack
|
00001 /************************************************************************************ 00002 Copyright (C) 2005-2008 Assefaw H. Gebremedhin, Arijit Tarafdar, Duc Nguyen, 00003 Alex Pothen 00004 00005 This file is part of ColPack. 00006 00007 ColPack is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published 00009 by the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 ColPack is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with ColPack. If not, see <http://www.gnu.org/licenses/>. 00019 ************************************************************************************/ 00020 00021 using namespace std; 00022 00023 #ifndef BIPARTITEGRAPHPARTIALORDERING_H 00024 #define BIPARTITEGRAPHPARTIALORDERING_H 00025 00026 #define RIGHT_PARTIAL_DISTANCE_TWO COLUMN_PARTIAL_DISTANCE_TWO 00027 #define LEFT_PARTIAL_DISTANCE_TWO ROW_PARTIAL_DISTANCE_TWO 00028 00029 namespace ColPack 00030 { 00037 class BipartiteGraphPartialOrdering : public BipartiteGraphInputOutput 00038 { 00039 public: 00040 00041 int OrderVertices(string s_OrderingVariant = "NATURAL", string s_ColoringVariant = "COLUMN_PARTIAL_DISTANCE_TWO"); 00042 00043 private: 00044 00045 int CheckVertexOrdering(string s_VertexOrderingVariant); 00046 00047 protected: 00048 00049 double m_d_OrderingTime; 00050 00051 string m_s_VertexOrderingVariant; 00052 00053 vector<int> m_vi_OrderedVertices; 00054 00055 public: 00056 00057 BipartiteGraphPartialOrdering(); 00058 00059 ~BipartiteGraphPartialOrdering(); 00060 00061 virtual void Clear(); 00062 00063 virtual void Reset(); 00064 00065 int RowNaturalOrdering(); 00066 int ColumnNaturalOrdering(); 00067 00068 int RowRandomOrdering(); 00069 int ColumnRandomOrdering(); 00070 00071 int RowLargestFirstOrdering(); 00072 int ColumnLargestFirstOrdering(); 00073 00074 int RowSmallestLastOrdering(); 00075 int RowSmallestLastOrdering_serial(); 00076 int RowSmallestLastOrdering_OMP(); 00077 int ColumnSmallestLastOrdering(); 00078 int ColumnSmallestLastOrdering_serial(); 00079 int ColumnSmallestLastOrdering_OMP(); 00080 00081 int RowIncidenceDegreeOrdering(); 00082 int ColumnIncidenceDegreeOrdering(); 00083 00084 int RowDynamicLargestFirstOrdering(); 00085 int ColumnDynamicLargestFirstOrdering(); 00086 00087 string GetVertexOrderingVariant(); 00088 00089 void GetOrderedVertices(vector<int> &output); 00090 00091 void PrintVertexOrdering(); 00092 00093 double GetVertexOrderingTime(); 00094 }; 00095 } 00096 #endif