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 BIPARTITEGRAPHINPUTOUTPUT_H 00024 #define BIPARTITEGRAPHINPUTOUTPUT_H 00025 00026 namespace ColPack 00027 { 00036 class BipartiteGraphInputOutput : public BipartiteGraphCore 00037 { 00038 public: 00039 00040 // -----INPUT FUNCTIONS----- 00041 00042 // !!! TO BE DOCUMENTED 00043 int BuildBPGraphFromADICFormat(std::list<std::set<int> > * lsi_SparsityPattern, int i_ColumnCount); 00044 00046 00053 int BuildBPGraphFromCSRFormat(int* ip_RowIndex, int i_RowCount, int i_ColumnCount, int* ip_ColumnIndex); 00054 00056 00063 int BuildBPGraphFromRowCompressedFormat(unsigned int ** uip2_JacobianSparsityPattern, int i_RowCount, int i_ColumnCount); 00064 00066 00073 int RowCompressedFormat2BipartiteGraph(unsigned int ** uip2_JacobianSparsityPattern, int i_RowCount, int i_ColumnCount); 00074 00076 00100 int ReadBipartiteGraph(string s_InputFile, string s_fileFormat="AUTO_DETECTED"); 00101 00103 00122 int ReadGenericMatrixBipartiteGraph(string s_InputFile); 00123 00125 00136 int ReadGenericSquareMatrixBipartiteGraph(string s_InputFile); 00137 00139 00142 int ReadHarwellBoeingBipartiteGraph(string s_InputFile); 00143 00145 int ReadMatrixMarketBipartiteGraph(string s_InputFile); 00146 00148 int ReadMeTiSBipartiteGraph(string s_InputFile); 00149 00150 // -----OUTPUT FUNCTIONS----- 00151 00152 void PrintBipartiteGraph(); 00153 00154 void PrintVertexDegrees(); 00155 00157 00165 int BipartiteGraph2RowCompressedFormat(unsigned int *** uip3_JacobianSparsityPattern, unsigned int * uip1_RowCount, unsigned int * uip1_ColumnCount); 00166 00168 int WriteMatrixMarket(string s_OutputFile = "-ColPack_debug.mtx"); 00169 00170 00171 private: 00172 00173 void CalculateVertexDegrees(); 00174 00175 public: 00176 00177 BipartiteGraphInputOutput(); 00178 00179 ~BipartiteGraphInputOutput(); 00180 00181 virtual void Clear(); 00182 }; 00183 } 00184 #endif