Public Member Functions | Private Attributes

ColPack::BipartiteGraphPartialColoringInterface Class Reference
[Classes for Bipartite Graphs Partial Coloring]

class BipartiteGraphPartialColoringInterface in group21. More...

#include <BipartiteGraphPartialColoringInterface.h>

Inherits ColPack::BipartiteGraphPartialColoring.

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

List of all members.

Public Member Functions

 BipartiteGraphPartialColoringInterface (int i_type,...)
 Build a BipartiteGraphPartialColoringInterface object and create the bipartite graph based on the graph structure specified by the input source.
int PartialDistanceTwoColoring (string s_OrderingVariant="NATURAL", string s_ColoringVariant="COLUMN_PARTIAL_DISTANCE_TWO")
 (Partial-Distance-Two) Color the bipartite graph based on the requested s_ColoringVariant and s_OrderingVariant
void GenerateSeedJacobian (double ***dp3_seed, int *ip1_SeedRowCount, int *ip1_SeedColumnCount, string s_OrderingVariant="NATURAL", string s_ColoringVariant="COLUMN_PARTIAL_DISTANCE_TWO")
 Generate and return the seed matrix.
void GenerateSeedJacobian_unmanaged (double ***dp3_seed, int *ip1_SeedRowCount, int *ip1_SeedColumnCount, string s_OrderingVariant="NATURAL", string s_ColoringVariant="COLUMN_PARTIAL_DISTANCE_TWO")
 Same as GenerateSeedJacobian(), except that this Seed matrix is NOT managed by ColPack.
double ** GetSeedMatrix (int *ip1_SeedRowCount, int *ip1_SeedColumnCount)
 Based on m_s_VertexColoringVariant, either GetLeftSeedMatrix() or GetRightSeedMatrix() will be called.
void GetOrderedVertices (vector< int > &output)
 ~BipartiteGraphPartialColoringInterface ()
void Clear ()
void Reset ()

Private Attributes

Timer m_T_Timer

Detailed Description

class BipartiteGraphPartialColoringInterface in group21.

To be completed. Note that for each object, only one type of Coloring (either Row or Column) should be used. The reason is because both of RowColoring and ColumnColoring will update (share) the value of m_i_VertexColorCount. If RowColoring is run and then ColumnColoring is run, both PrintColumnPartialColoringMetrics() and PrintRowPartialColoringMetrics() will display the result of the later run (ColumnColoring) only.

Definition at line 37 of file BipartiteGraphPartialColoringInterface.h.


Constructor & Destructor Documentation

ColPack::BipartiteGraphPartialColoringInterface::BipartiteGraphPartialColoringInterface ( int  i_type,
  ... 
)

Build a BipartiteGraphPartialColoringInterface object and create the bipartite graph based on the graph structure specified by the input source.

This function will:

Structure of this variadic function's parameters: BipartiteGraphPartialColoringInterface(int i_type, [2 or more parameters for input source depending on the value of i_type]). Here are some examples:

About input parameters:

  • int i_type: specified the input source. i_type can be either:
    • -1 (SRC_WAIT): only step 0 will be done.
    • 0 (SRC_FILE): The graph structure will be read from file. The next 2 parameters are:
      • fileName: name of the input file. If the full path is not given, the file is assumed to be in the current directory
      • fileType can be either:
        • "AUTO_DETECTED" or "". ColPack will decide the format of the file based on the file extension:
          • ".mtx": MatrixMarket format
          • ".hb", or any combination of ".<r, c, p><s, u, h, x, r><a, e>": HarwellBoeing format
          • ".graph": MeTiS format
          • ".gen": Generic Matrix format
          • ".gens": Generic Square Matrix format
          • If the above extensions are not found, MatrixMarket format will be assumed.
        • "MM" for MatrixMarket format (http://math.nist.gov/MatrixMarket/formats.html#MMformat). Notes:
          • ColPack only accepts MatrixMarket coordinate format (NO array format)
          • List of arithmetic fields accepted by ColPack: real, pattern or integer
          • List of symmetry structures accepted by ColPack: general or symmetric
          • The first line of the input file should be similar to this: "%%MatrixMarket matrix coordinate real general"
        • "HB" for HarwellBoeing format (http://math.nist.gov/MatrixMarket/formats.html#hb)
        • "MeTiS" for MeTiS format (http://people.sc.fsu.edu/~burkardt/data/metis_graph/metis_graph.html)
        • "GEN" for Generic Matrix format
        • "GENS" for Generic Square Matrix format
    • 1 (SRC_MEM_ADOLC): The graph structure will be read from Row Compressed Structure (used by ADOLC). The next 3 parameters are:
      • unsigned int **uip2_SparsityPattern: The pattern of Jacobian matrix stored in Row Compressed Format
      • int i_rowCount: number of rows in the Jacobian matrix. Number of rows in uip2_SparsityPattern.
      • int i_ColumnCount: number of columns in the Jacobian matrix. Number of columns in uip2_SparsityPattern.
    • 2 (SRC_MEM_ADIC): TO BE IMPLEMENTED so that ColPack can interface with ADIC

!! add interface function that takes input from ADIC

Definition at line 115 of file BipartiteGraphPartialColoringInterface.cpp.

References ColPack::BipartiteGraphInputOutput::BuildBPGraphFromRowCompressedFormat(), Clear(), ColPack::BipartiteGraphInputOutput::ReadBipartiteGraph(), SRC_FILE, SRC_MEM_ADIC, SRC_MEM_ADOLC, and SRC_WAIT.

Here is the call graph for this function:

ColPack::BipartiteGraphPartialColoringInterface::~BipartiteGraphPartialColoringInterface (  ) 

Definition at line 29 of file BipartiteGraphPartialColoringInterface.cpp.

References Clear(), and ColPack::BipartiteGraphPartialColoring::Seed_reset().

Here is the call graph for this function:


Member Function Documentation

void ColPack::BipartiteGraphPartialColoringInterface::Clear (  )  [virtual]

Reimplemented from ColPack::BipartiteGraphPartialColoring.

Definition at line 37 of file BipartiteGraphPartialColoringInterface.cpp.

Referenced by BipartiteGraphPartialColoringInterface(), and ~BipartiteGraphPartialColoringInterface().

Here is the caller graph for this function:

void ColPack::BipartiteGraphPartialColoringInterface::GenerateSeedJacobian ( double ***  dp3_seed,
int *  ip1_SeedRowCount,
int *  ip1_SeedColumnCount,
string  s_OrderingVariant = "NATURAL",
string  s_ColoringVariant = "COLUMN_PARTIAL_DISTANCE_TWO" 
)

Generate and return the seed matrix.

This function will

  • 1. Color the graph by (Row or Column)-Partial-Distance-2-Coloring with the specified ordering
  • 2. Create and return the seed matrix (*dp3_seed) from the coloring information

About input parameters:

  • s_ColoringVariant:
  • s_OrderingVariant can be either
    • "NATURAL" (default)
    • "LARGEST_FIRST"
    • "SMALLEST_LAST"
    • "INCIDENCE_DEGREE"
    • "RANDOM"

Postcondition:

  • *dp3_seed: the size will be [*ip1_SeedRowCount] [*ip1_SeedColumnCount]
    • if (s_ColoringVariant == "COLUMN_PARTIAL_DISTANCE_TWO"): [num of columns of the original matrix == i_ColumnCount] [ColorCount]
    • if (s_ColoringVariant == "ROW_PARTIAL_DISTANCE_TWO"): [ColorCount] [num of rows of the original matrix == i_RowCount]

Definition at line 54 of file BipartiteGraphPartialColoringInterface.cpp.

References GetSeedMatrix(), and PartialDistanceTwoColoring().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void ColPack::BipartiteGraphPartialColoringInterface::GenerateSeedJacobian_unmanaged ( double ***  dp3_seed,
int *  ip1_SeedRowCount,
int *  ip1_SeedColumnCount,
string  s_OrderingVariant = "NATURAL",
string  s_ColoringVariant = "COLUMN_PARTIAL_DISTANCE_TWO" 
)

Same as GenerateSeedJacobian(), except that this Seed matrix is NOT managed by ColPack.

Notes:

  • This Seed matrix is NOT managed by ColPack. Therefore, the user should free the Seed matrix manually when the matrix is no longer needed.

Definition at line 70 of file BipartiteGraphPartialColoringInterface.cpp.

References ColPack::BipartiteGraphPartialColoring::GetSeedMatrix_unmanaged(), and PartialDistanceTwoColoring().

Here is the call graph for this function:

void ColPack::BipartiteGraphPartialColoringInterface::GetOrderedVertices ( vector< int > &  output  ) 
double ** ColPack::BipartiteGraphPartialColoringInterface::GetSeedMatrix ( int *  ip1_SeedRowCount,
int *  ip1_SeedColumnCount 
)

Based on m_s_VertexColoringVariant, either GetLeftSeedMatrix() or GetRightSeedMatrix() will be called.

Reimplemented from ColPack::BipartiteGraphPartialColoring.

Definition at line 217 of file BipartiteGraphPartialColoringInterface.cpp.

Referenced by GenerateSeedJacobian(), and main().

Here is the caller graph for this function:

int ColPack::BipartiteGraphPartialColoringInterface::PartialDistanceTwoColoring ( string  s_OrderingVariant = "NATURAL",
string  s_ColoringVariant = "COLUMN_PARTIAL_DISTANCE_TWO" 
)

(Partial-Distance-Two) Color the bipartite graph based on the requested s_ColoringVariant and s_OrderingVariant

This function will

  • 1. Order the vertices based on the requested Ordering variant (s_OrderingVariant)
  • 2. Bicolor the graph based on the requested Coloring variant (s_ColoringVariant)
  • Ordering Time and Coloring Time will be recorded.

About input parameters:

  • s_OrderingVariant can be either
    • "NATURAL" (default)
    • "LARGEST_FIRST"
    • "SMALLEST_LAST"
    • "INCIDENCE_DEGREE"
    • "RANDOM"
  • s_ColoringVariant can be either
    • "COLUMN_PARTIAL_DISTANCE_TWO" (default)
    • "ROW_PARTIAL_DISTANCE_TWO"

Postcondition:

  • The Bipartite Graph is (Partial-Distance-Two) colored, i.e., either m_vi_LeftVertexColors or m_vi_RightVertexColors will be populated.

Definition at line 79 of file BipartiteGraphPartialColoringInterface.cpp.

References _FALSE, _TRUE, ColPack::Timer::GetWallTime(), ColPack::BipartiteGraphPartialColoring::m_d_ColoringTime, ColPack::BipartiteGraphPartialOrdering::m_d_OrderingTime, m_T_Timer, ColPack::BipartiteGraphPartialOrdering::OrderVertices(), ColPack::BipartiteGraphPartialColoring::PartialDistanceTwoColumnColoring(), ColPack::BipartiteGraphPartialColoring::PartialDistanceTwoRowColoring(), ColPack::Timer::Start(), ColPack::Timer::Stop(), and toUpper().

Referenced by GenerateSeedJacobian(), GenerateSeedJacobian_unmanaged(), main(), and toFileBiPC().

Here is the call graph for this function:

Here is the caller graph for this function:

void ColPack::BipartiteGraphPartialColoringInterface::Reset (  )  [virtual]

Member Data Documentation