Public Member Functions | Private Member Functions

ColPack::GraphInputOutput Class Reference
[Classes for Graphs]

class GraphInputOutput in group1. More...

#include <GraphInputOutput.h>

Inherits ColPack::GraphCore.

Inherited by ColPack::GraphOrdering.

Collaboration diagram for ColPack::GraphInputOutput:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int ReadAdjacencyGraph (string s_InputFile, string s_fileFormat="AUTO_DETECTED")
 Read the sparsity pattern of a symmetric matrix in the specified file format from the specified filename and build an adjacency graph.
int BuildGraphFromRowCompressedFormat (unsigned int **uip2_HessianSparsityPattern, int i_RowCount)
 Read the sparsity pattern of Hessian matrix represented in ADOLC format (Compressed Sparse Row format) and build a corresponding adjacency graph.
int ReadMatrixMarketAdjacencyGraph (string s_InputFile, bool b_getStructureOnly=false)
 GraphInputOutput ()
 ~GraphInputOutput ()
virtual void Initialize ()
virtual void Clear ()
string GetInputFile ()
int ReadHarwellBoeingAdjacencyGraph (string s_InputFile)
 Read the entries of symmetric matrix in Harwell Boeing format and build the corresponding adjacency graph.
int ReadMeTiSAdjacencyGraph (string s_InputFile)
 Read the entries of symmetric matrix in MeTiS format and build the corresponding adjacency graph.
int ReadMeTiSAdjacencyGraph2 (string s_InputFile)
int PrintGraph ()
int PrintGraphStructure ()
int PrintMatrix ()
int PrintMatrix (vector< int > &, vector< int > &, vector< double > &)
void PrintVertexDegrees ()

Private Member Functions

int ParseWidth (string FortranFormat)
void CalculateVertexDegrees ()

Detailed Description

class GraphInputOutput in group1.

This class provides the input methods for reading in matrix or graph files in supported formats for generating general graphs. Three input formats are supported by default - Matrix Market, Harwell Boeing and MeTiS.

Definition at line 35 of file GraphInputOutput.h.


Constructor & Destructor Documentation

ColPack::GraphInputOutput::GraphInputOutput (  ) 

Definition at line 105 of file GraphInputOutput.cpp.

References Clear().

Here is the call graph for this function:

ColPack::GraphInputOutput::~GraphInputOutput (  ) 

Definition at line 114 of file GraphInputOutput.cpp.

References Clear().

Here is the call graph for this function:


Member Function Documentation

int ColPack::GraphInputOutput::BuildGraphFromRowCompressedFormat ( unsigned int **  uip2_HessianSparsityPattern,
int  i_RowCount 
)

Read the sparsity pattern of Hessian matrix represented in ADOLC format (Compressed Sparse Row format) and build a corresponding adjacency graph.

Precondition:

  • The Hessian matrix must be stored in Row Compressed Format

Return value:

  • i_HighestDegree

Definition at line 1383 of file GraphInputOutput.cpp.

References _FALSE, CalculateVertexDegrees(), ColPack::GraphCore::m_vi_Edges, ColPack::GraphCore::m_vi_Vertices, STEP_DOWN, and STEP_UP.

Referenced by ColPack::GraphColoringInterface::GraphColoringInterface().

Here is the call graph for this function:

Here is the caller graph for this function:

void ColPack::GraphInputOutput::CalculateVertexDegrees (  )  [private]
void ColPack::GraphInputOutput::Clear (  )  [virtual]
string ColPack::GraphInputOutput::GetInputFile (  ) 

Reimplemented from ColPack::GraphCore.

Definition at line 134 of file GraphInputOutput.cpp.

References ColPack::GraphCore::m_s_InputFile.

void ColPack::GraphInputOutput::Initialize (  )  [virtual]

Implements ColPack::GraphCore.

Definition at line 120 of file GraphInputOutput.cpp.

int ColPack::GraphInputOutput::ParseWidth ( string  FortranFormat  )  [private]

Definition at line 28 of file GraphInputOutput.cpp.

References TRUE.

Referenced by ReadHarwellBoeingAdjacencyGraph().

Here is the caller graph for this function:

int ColPack::GraphInputOutput::PrintGraph (  ) 

Definition at line 1190 of file GraphInputOutput.cpp.

References _TRUE, ColPack::GraphCore::m_s_InputFile, ColPack::GraphCore::m_vd_Values, ColPack::GraphCore::m_vi_Edges, ColPack::GraphCore::m_vi_Vertices, STEP_DOWN, and STEP_UP.

Referenced by f().

Here is the caller graph for this function:

int ColPack::GraphInputOutput::PrintGraphStructure (  ) 

Definition at line 1268 of file GraphInputOutput.cpp.

References _TRUE, ColPack::GraphCore::m_s_InputFile, ColPack::GraphCore::m_vi_Edges, ColPack::GraphCore::m_vi_Vertices, STEP_DOWN, and STEP_UP.

Referenced by main().

Here is the caller graph for this function:

int ColPack::GraphInputOutput::PrintMatrix (  ) 
int ColPack::GraphInputOutput::PrintMatrix ( vector< int > &  vi_Vertices,
vector< int > &  vi_Edges,
vector< double > &  vd_Values 
)

Definition at line 1346 of file GraphInputOutput.cpp.

References _TRUE, ColPack::GraphCore::m_s_InputFile, and STEP_UP.

void ColPack::GraphInputOutput::PrintVertexDegrees (  ) 
int ColPack::GraphInputOutput::ReadAdjacencyGraph ( string  s_InputFile,
string  s_fileFormat = "AUTO_DETECTED" 
)

Read the sparsity pattern of a symmetric matrix in the specified file format from the specified filename and build an adjacency graph.

This function will

  • 1. Read the name of the matrix file and decide which matrix format the file used (based on the file extension). If the file name has no extension, the user will need to pass the 2nd parameter "fileType" explicitly to tell ColPack which matrix format is used
  • 2. Call the corresponding reading routine to build the graph

About input parameters:

  • fileName: name of the input file for a symmetric matrix. If the full path is not given, the file is assumed to be in the current directory
  • fileType can be either

Definition at line 1505 of file GraphInputOutput.cpp.

References _TRUE, ColPack::File::GetFileExtension(), ColPack::isHarwellBoeingFormat(), ColPack::isMatrixMarketFormat(), ColPack::isMeTiSFormat(), ReadHarwellBoeingAdjacencyGraph(), ReadMatrixMarketAdjacencyGraph(), and ReadMeTiSAdjacencyGraph().

Referenced by ColPack::GraphColoringInterface::GraphColoringInterface().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::GraphInputOutput::ReadHarwellBoeingAdjacencyGraph ( string  s_InputFile  ) 

Read the entries of symmetric matrix in Harwell Boeing format and build the corresponding adjacency graph.

Definition at line 332 of file GraphInputOutput.cpp.

References _FALSE, _TRUE, CalculateVertexDegrees(), Clear(), ColPack::GraphCore::m_s_InputFile, ColPack::GraphCore::m_vi_Edges, ColPack::GraphCore::m_vi_Vertices, ParseWidth(), STEP_DOWN, and STEP_UP.

Referenced by ReadAdjacencyGraph().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::GraphInputOutput::ReadMatrixMarketAdjacencyGraph ( string  s_InputFile,
bool  b_getStructureOnly = false 
)

!! NEED TO BE FIXED Read the entries of a symmetric matrix in Matrix Market format and build the corresponding adjacency graph Precondition:

  • s_InputFile should point to the MatrixMarket-format input file (file name usually ends with .mtx)
  • If (b_getStructureOnly == true) only the structure of the matrix is read. All the values for the non-zeros in the matrix will be ignored. If the input file contains only the graph structure, the value of b_getStructureOnly will be ignored

Definition at line 141 of file GraphInputOutput.cpp.

References _TRUE, CalculateVertexDegrees(), Clear(), ColPack::GraphCore::m_s_InputFile, ColPack::GraphCore::m_vd_Values, ColPack::GraphCore::m_vi_Edges, ColPack::GraphCore::m_vi_Vertices, mm_is_coordinate, mm_is_general, mm_is_integer, mm_is_pattern, mm_is_real, mm_is_symmetric, mm_read_banner(), and mm_typecode_to_str().

Referenced by ReadAdjacencyGraph().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::GraphInputOutput::ReadMeTiSAdjacencyGraph ( string  s_InputFile  ) 

Read the entries of symmetric matrix in MeTiS format and build the corresponding adjacency graph.

Definition at line 713 of file GraphInputOutput.cpp.

References _FALSE, _TRUE, CalculateVertexDegrees(), Clear(), ColPack::GraphCore::m_s_InputFile, ColPack::GraphCore::m_vi_Edges, ColPack::GraphCore::m_vi_Vertices, STEP_DOWN, and STEP_UP.

Referenced by ReadAdjacencyGraph().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::GraphInputOutput::ReadMeTiSAdjacencyGraph2 ( string  s_InputFile  )