ColPack
GraphColoring/GraphCore.h
Go to the documentation of this file.
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 GRAPHCORE_H
00024 #define GRAPHCORE_H
00025 namespace ColPack
00026 {
00032         class GraphCore
00033         {
00034         public: //DOCUMENTED
00035 
00037                 void PrintVertexD1Neighbor(int VertexIndex, int excludedVertex = -1);
00038                 void GetD1Neighbor(int VertexIndex, vector<int> &D1Neighbor, int excludedVertex = -1);
00039 
00041                 void PrintVertexD2Neighbor(int VertexIndex);
00042 
00044 
00050                 bool AreD2Neighbor(int VertexIndex1, int VertexIndex2);
00051                 
00052                 bool operator==(const GraphCore &other) const;
00053                 bool areEqual(const GraphCore &other, bool structureOnly = 1) const;
00054 
00055         protected:
00056 
00057                 int m_i_MaximumVertexDegree;
00058                 int m_i_MinimumVertexDegree;
00059 
00060                 double m_d_AverageVertexDegree;
00061 
00062                 string m_s_InputFile;
00063 
00064                 vector<int> m_vi_Vertices;
00065 
00066                 vector<int> m_vi_Edges;
00067 
00068                 vector<double> m_vd_Values; 
00069 
00074                 map< int, map< int, int> > m_mimi2_VertexEdgeMap; //moved from int GraphColoring::AcyclicColoring()
00075 
00079                 DisjointSets m_ds_DisjointSets; //moved from int GraphColoring::AcyclicColoring()
00080         public:
00081 
00082                 virtual ~GraphCore() {}
00083 
00084                 virtual void Clear();
00085 
00086                 int GetVertexCount();
00087 
00088                 int GetEdgeCount();
00089 
00090                 int GetMaximumVertexDegree();
00091 
00092                 int GetMinimumVertexDegree();
00093 
00094                 double GetAverageVertexDegree();
00095 
00096                 string GetInputFile();
00097 
00098                 void GetVertices(vector<int> &output) const;
00099                 vector <int>* GetVerticesPtr(){ return &m_vi_Vertices; }
00100                 
00101                 void GetEdges(vector<int> &output) const;
00102                 vector <int>* GetEdgesPtr(){ return &m_vi_Edges; }
00103 
00104                 void GetValues(vector<double> &output) const;
00105 
00106                 void GetVertexEdgeMap(map< int, map< int, int> > &output);
00107 
00108                 void GetDisjointSets(DisjointSets &output);
00109 
00110 
00111         };
00112 }
00113 #endif
00114 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines