Commit 2ebf91e0 authored by Björn Esser's avatar Björn Esser

fix trailing whitespaces

parent 44851d9e
......@@ -5465,7 +5465,7 @@ namespace ColPack
dp2_lSeed = GetLeftSeedMatrix_unmanaged(ip1_SeedRowCount, ip1_SeedColumnCount);
if(dp2_lSeed == NULL) return NULL;
i_lseed_rowCount = *ip1_SeedRowCount;
lseed_available = true;
......@@ -5478,7 +5478,7 @@ namespace ColPack
dp2_rSeed = GetRightSeedMatrix_unmanaged(ip1_SeedRowCount, ip1_SeedColumnCount);
if(dp2_rSeed == NULL) return NULL;
i_rseed_rowCount = *ip1_SeedRowCount;
rseed_available = true;
......@@ -5557,7 +5557,7 @@ namespace ColPack
return Seed;
}
double BipartiteGraphBicoloring::GetVertexColoringTime() {
return m_d_ColoringTime;
}
......
......@@ -58,7 +58,7 @@ namespace ColPack
/// Get the color IDs for the right vertices (columns) in the format similar to GetLeftVertexColor(). Color IDs start from 1, color ID 0 should be ignored
void GetRightVertexColors_Transformed(vector<int> &output);
///Generate and return the Left Seed matrix. This Seed matrix is managed and freed by ColPack
///Generate and return the Left Seed matrix. This Seed matrix is managed and freed by ColPack
/**Precondition:
- the Graph has been Bicolored
......@@ -74,13 +74,13 @@ namespace ColPack
*/
double** GetLeftSeedMatrix(int* ip1_SeedRowCount, int* ip1_SeedColumnCount);
/// Same as GetLeftSeedMatrix(), except that this Seed matrix is NOT managed by ColPack
/// Same as GetLeftSeedMatrix(), 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.
*/
double** GetLeftSeedMatrix_unmanaged(int* ip1_SeedRowCount, int* ip1_SeedColumnCount);
///Return the Right Seed matrix. This Seed matrix is managed and freed by ColPack
///Return the Right Seed matrix. This Seed matrix is managed and freed by ColPack
/** Precondition:
- the Graph has been Bicolored
......@@ -96,19 +96,19 @@ namespace ColPack
*/
double** GetRightSeedMatrix(int* ip1_SeedRowCount, int* ip1_SeedColumnCount);
/// Same as GetRightSeedMatrix(), except that this Seed matrix is NOT managed by ColPack
/// Same as GetRightSeedMatrix(), 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.
*/
double** GetRightSeedMatrix_unmanaged(int* ip1_SeedRowCount, int* ip1_SeedColumnCount);
///Return both the Left and Right Seed matrix. These Seed matrices are managed and freed by ColPack
///Return both the Left and Right Seed matrix. These Seed matrices are managed and freed by ColPack
/** Notes:
- These Seed matrices are NOT managed by ColPack. Therefore, the user should free the Seed matrices manually when the matrices are no longer needed.
*/
void GetSeedMatrix(double*** dp3_LeftSeed, int* ip1_LeftSeedRowCount, int* ip1_LeftSeedColumnCount, double*** dp3_RightSeed, int* ip1_RightSeedRowCount, int* ip1_RightSeedColumnCount);
/// Same as GetSeedMatrix(), except that These Seed matrices are NOT managed by ColPack
/// Same as GetSeedMatrix(), except that These Seed matrices are NOT managed by ColPack
/** Notes:
- These Seed matrices are NOT managed by ColPack. Therefore, the user should free the Seed matrices manually when the matrices are no longer needed.
*/
......@@ -285,7 +285,7 @@ namespace ColPack
//Public Function 3577
void PrintVertexBicolorClasses();
double GetVertexColoringTime();
};
}
......
......@@ -158,7 +158,7 @@ namespace ColPack
va_end(ap); /*cleanup*/
return;
}
#ifdef _COLPACK_CHECKPOINT_
#ifdef _COLPACK_CHECKPOINT_
string s_OutputFile = "-ColPack_debug.mtx";
s_OutputFile = "BipartiteGraphBicoloringInterface-InternalBPGraph"+s_OutputFile;
WriteMatrixMarket(s_OutputFile);
......
......@@ -107,7 +107,7 @@ namespace ColPack
void GenerateSeedJacobian(double*** dp3_LeftSeed, int *ip1_LeftSeedRowCount, int *ip1_LeftSeedColumnCount, double*** dp3_RightSeed, int *ip1_RightSeedRowCount, int *ip1_RightSeedColumnCount, string s_OrderingVariant="NATURAL", string s_BicoloringVariant = "IMPLICIT_COVERING__STAR_BICOLORING");
/// Same as GenerateSeedJacobian(), except that these Seed matrices are NOT managed by ColPack
/// Same as GenerateSeedJacobian(), except that these Seed matrices are NOT managed by ColPack
/** Notes:
- These Seed matrices are NOT managed by ColPack. Therefore, the user should free the Seed matrices manually when the matrices are no longer needed.
*/
......
......@@ -55,7 +55,7 @@ namespace ColPack
{
return(m_s_InputFile);
}
vector<int>* BipartiteGraphCore::GetLeftVerticesPtr()
{
return &m_vi_LeftVertices;
......@@ -211,30 +211,30 @@ namespace ColPack
{
return(m_d_AverageVertexDegree);
}
bool BipartiteGraphCore::operator==(const BipartiteGraphCore &other) const {
// Check for self-assignment!
if (this == &other) // Same object?
return true; // Yes, so the 2 objects are equal
//Compare vector<int> m_vi_LeftVertices; vector<int> m_vi_RightVertices; vector<int> m_vi_Edges;
vector<int> other_LeftVertices, other_RightVertices, other_Edges;
other.GetLeftVertices(other_LeftVertices);
other.GetRightVertices(other_RightVertices);
other.GetEdges(other_Edges);
/*
if(m_vi_LeftVertices==other_LeftVertices) cout<<"m_vi_LeftVertices==other_LeftVertices"<<endl;
else cout<<"m_vi_LeftVertices!=other_LeftVertices"<<endl;
if(m_vi_Edges==other_Edges) cout<<"m_vi_Edges==other_Edges"<<endl;
else cout<<"m_vi_Edges!=other_Edges"<<endl;
if( m_vi_RightVertices==other_RightVertices) cout<<" m_vi_RightVertices==other_RightVertices"<<endl;
else cout<<"m_vi_RightVertices!=other_RightVertices"<<endl;
//*/
if(m_vi_LeftVertices==other_LeftVertices && m_vi_Edges==other_Edges && m_vi_RightVertices==other_RightVertices ) return true;
else return false;
......
......@@ -39,7 +39,7 @@ namespace ColPack
/// LeftVertexCount = RowVertexCount = m_vi_LeftVertices.size() -1
int GetLeftVertexCount();
/// RightVertexCount = ColumnVertexCount = m_vi_RightVertices.size() -1
int GetColumnVertexCount();
/// RightVertexCount = ColumnVertexCount = m_vi_RightVertices.size() -1
......@@ -69,22 +69,22 @@ namespace ColPack
vector<int> m_vi_Edges;
map< int, map<int, int> > m_mimi2_VertexEdgeMap;
public:
virtual ~BipartiteGraphCore(){}
virtual void Clear();
string GetInputFile();
vector<int>* GetLeftVerticesPtr() ;
vector<int>* GetRightVerticesPtr() ;
void GetRowVertices(vector<int> &output) const;
void GetLeftVertices(vector<int> &output) const;
void GetColumnVertices(vector<int> &output) const;
void GetRightVertices(vector<int> &output) const;
......@@ -92,7 +92,7 @@ namespace ColPack
unsigned int GetColumnIndices(unsigned int** ip2_ColumnIndex);
void GetEdges(vector<int> &output) const;
void GetVertexEdgeMap(map< int, map<int, int> > &output);
int GetEdgeCount();
......@@ -110,9 +110,9 @@ namespace ColPack
int GetMinimumVertexDegree();
double GetAverageRowVertexDegree();
double GetAverageColumnVertexDegree();
double GetAverageVertexDegree();
};
}
......
......@@ -113,34 +113,34 @@ namespace ColPack
cout<<"Error creating file: \""<<s_OutputFile<<"\""<<endl;
exit(1);
}
int max = m_vi_LeftVertices.size()-1;
out<<"%%MatrixMarket matrix coordinate real general"<<endl;
out<<GetLeftVertexCount()<<" "<<GetRightVertexCount()<<" "<< GetEdgeCount()<<endl;
for(int i = 0; i<max;i++) {
for(int j = m_vi_LeftVertices[i]; j < m_vi_LeftVertices[i+1]; j++) {
out<<i+1<<" "<<m_vi_Edges[j]+1;
out<<endl;
}
}
return 0;
}
int BipartiteGraphInputOutput::ReadMatrixMarketBipartiteGraph(string s_InputFile)
{
bool b_symmetric;
istringstream in2;
int entry_counter = 0, num_of_entries = 0, nz_counter=0;
bool value_not_specified = false;
int i_LineCount = _TRUE;
int i, j;
int i_RowCount, i_ColumnCount;
......@@ -186,7 +186,7 @@ namespace ColPack
printf("Could not process Matrix Market banner.\n");
exit(1);
}
if(mm_is_symmetric(matcode)) {
b_symmetric = true;
}
......@@ -262,7 +262,7 @@ namespace ColPack
value_not_specified=false;
in2>>i_LeftVertex>>i_RightVertex>>d_Value;
entry_counter++;
if(d_Value == -999999999. && in2.eof()) {
if(d_Value == -999999999. && in2.eof()) {
// "d_Value" entry is not specified
value_not_specified = true;
}
......@@ -500,7 +500,7 @@ namespace ColPack
{
cout<<"Found File "<<m_s_InputFile<<endl;
}
int i_Dummy, i, j;
int num;
int nnz;
......@@ -508,31 +508,31 @@ namespace ColPack
istringstream iin;
vector< vector<int> > vvi_LeftVertexAdjacency, vvi_RightVertexAdjacency;
vector<int> vi_ColumnStartPointers;
//ignore the first line, which is the tittle and key
getline(in, line);
// Get line 2
int TOTCRD; // (ignored) Total number of lines excluding header
int PTRCRD; // (ignored) Number of lines for pointers
int INDCRD; // (ignored) Number of lines for row (or variable) indices
int VALCRD; // (ignored) Number of lines for numerical values. VALCRD == 0 if no values is presented
int RHSCRD; // (ignored) Number of lines for right-hand sides. RHSCRD == 0 if no right-hand side data is presented
getline(in, line);
iin.clear();
iin.str(line);
iin >> TOTCRD >> PTRCRD >> INDCRD >> VALCRD >> RHSCRD;
// Get line 3
string MXTYPE; //Matrix type. We only accept: (R | P) (*) (A)
int NROW; // Number of rows (or left vertices)
int NCOL; // Number of columns (or right vertices)
int NNZERO; // (ignored) Number of nonzeros
int NNZERO; // (ignored) Number of nonzeros
// in case of symmetric matrix, it is the number of nonzeros IN THE UPPER TRIANGULAR including the diagonal
int NELTVL; // (ignored) Number of elemental matrix entries (zero in the case of assembled matrices)
int NELTVL; // (ignored) Number of elemental matrix entries (zero in the case of assembled matrices)
bool b_symmetric; // true if this matrix is symmetric (MXTYPE[1] == 'S'), false otherwise.
getline(in, line);
iin.clear();
iin.str(line);
......@@ -549,13 +549,13 @@ namespace ColPack
b_symmetric = true;
}
else b_symmetric = false;
// Ignore line 4 for now
getline(in, line);
//If the right-hand side data is presented, ignore the 5th header line
if(RHSCRD) getline(in, line);
m_vi_LeftVertices.clear();
m_vi_LeftVertices.resize(NROW+1, _UNKNOWN);
m_vi_RightVertices.clear();
......@@ -566,12 +566,12 @@ namespace ColPack
vvi_RightVertexAdjacency.resize(NCOL);
vi_ColumnStartPointers.clear();
vi_ColumnStartPointers.resize(NCOL+1);
// get the 2nd data block: column start pointers
// get the 2nd data block: column start pointers
for(int i=0; i<NCOL+1; i++) {
in>> vi_ColumnStartPointers[i];
}
//populate vvi_LeftVertexAdjacency & vvi_RightVertexAdjacency
nnz = 0;
for(i=0; i<NCOL; i++) {
......@@ -581,7 +581,7 @@ namespace ColPack
vvi_RightVertexAdjacency[i].push_back(num);
vvi_LeftVertexAdjacency[num].push_back(i);
nnz++;
if(b_symmetric && num != i) {
vvi_RightVertexAdjacency[num].push_back(i);
vvi_LeftVertexAdjacency[i].push_back(num);
......@@ -589,7 +589,7 @@ namespace ColPack
}
}
}
m_vi_Edges.clear();
m_vi_Edges.resize(2*nnz, _UNKNOWN);
//populate the m_vi_LeftVertices and their edges at the same time
......@@ -598,23 +598,23 @@ namespace ColPack
for(j=0; j<vvi_LeftVertexAdjacency[i].size();j++) {
m_vi_Edges[m_vi_LeftVertices[i]+j] = vvi_LeftVertexAdjacency[i][j];
}
m_vi_LeftVertices[i+1] = m_vi_LeftVertices[i]+vvi_LeftVertexAdjacency[i].size();
}
//populate the m_vi_RightVertices and their edges at the same time
m_vi_RightVertices[0]=m_vi_LeftVertices[NROW];
for(i=0; i<NCOL; i++) {
for(j=0; j<vvi_RightVertexAdjacency[i].size();j++) {
m_vi_Edges[m_vi_RightVertices[i]+j] = vvi_RightVertexAdjacency[i][j];
}
m_vi_RightVertices[i+1] = m_vi_RightVertices[i]+vvi_RightVertexAdjacency[i].size();
}
return 0;
}
//Public Function 2258;3258
int BipartiteGraphInputOutput::ReadGenericMatrixBipartiteGraph(string s_InputFile)
{
......@@ -925,7 +925,7 @@ namespace ColPack
int i;
unsigned int j;
map< int,vector<int> > colList;
m_vi_LeftVertices.clear();
m_vi_LeftVertices.reserve(i_RowCount+1);
m_vi_RightVertices.clear();
......@@ -945,7 +945,7 @@ namespace ColPack
//PrintBipartiteGraph ();
//Pause();
}
//for(i=0; i < i_RowCount; i++) {
// for(j=1; j <= uip2_JacobianSparsityPattern[i][0]; j++) {
// m_vi_Edges.push_back(uip2_JacobianSparsityPattern[i][j]);
......@@ -965,11 +965,11 @@ namespace ColPack
m_vi_RightVertices.push_back(m_vi_Edges.size());
}
CalculateVertexDegrees();
CalculateVertexDegrees();
return (_TRUE);
}
int BipartiteGraphInputOutput::BuildBPGraphFromADICFormat(std::list<std::set<int> > * lsi_SparsityPattern, int i_ColumnCount) {
int i;
unsigned int j;
......@@ -981,16 +981,16 @@ namespace ColPack
m_vi_RightVertices.clear();
m_vi_RightVertices.reserve(i_ColumnCount+1);
m_vi_Edges.clear();
m_vi_LeftVertices.push_back(0); // equivalent to m_vi_LeftVertices.push_back(m_vi_Edges.size());
int rowIndex=-1, colIndex=-1;
std::list<std::set<int> >::iterator valsetlistiter = (*lsi_SparsityPattern).begin();
for (; valsetlistiter != (*lsi_SparsityPattern).end(); valsetlistiter++){
rowIndex++;
std::set<int>::iterator valsetiter = (*valsetlistiter).begin();
for (; valsetiter != (*valsetlistiter).end() ; valsetiter++) {
colIndex = *valsetiter;
m_vi_Edges.push_back(colIndex);
......@@ -999,7 +999,7 @@ namespace ColPack
m_vi_LeftVertices.push_back(m_vi_Edges.size());
}
m_vi_Edges.reserve(2*m_vi_Edges.size());
//put together the right vertices
map< int,vector<int> >::iterator curr;
m_vi_RightVertices.push_back(m_vi_Edges.size());
......
......@@ -38,12 +38,12 @@ namespace ColPack
public:
// -----INPUT FUNCTIONS-----
// !!! TO BE DOCUMENTED
int BuildBPGraphFromADICFormat(std::list<std::set<int> > * lsi_SparsityPattern, int i_ColumnCount);
/// Read the sparsity pattern of Jacobian matrix represented in zero-based indexing, 3-array variation CSR format and build a corresponding adjacency graph.
/**
/**
Zero-based indexing, 3-array variation CSR format:
http://software.intel.com/sites/products/documentation/hpc/mkl/webhelp/appendices/mkl_appA_SMSF.html#table_79228E147DA0413086BEFF4EFA0D3F04
......@@ -152,7 +152,7 @@ namespace ColPack
void PrintBipartiteGraph();
void PrintVertexDegrees();
/// Given a bipartite graph representation, build the corresponding compressed sparse row representation
/**
Postcondition:
......@@ -167,7 +167,7 @@ namespace ColPack
/// Write the structure of the bipartite graph into a file using Matrix Market format
int WriteMatrixMarket(string s_OutputFile = "-ColPack_debug.mtx");
private:
void CalculateVertexDegrees();
......
......@@ -86,7 +86,7 @@ namespace ColPack
void GetOrderedVertices(vector<int> &output);
void PrintVertexOrdering();
double GetVertexOrderingTime();
};
}
......
......@@ -52,7 +52,7 @@ namespace ColPack
/// Based on m_s_VertexColoringVariant, either GetLeftSeedMatrix_unmanaged() or GetRightSeedMatrix_unmanaged() will be called.
double** GetSeedMatrix_unmanaged(int* i_SeedRowCount, int* i_SeedColumnCount);
///Generate and return the Left Seed matrix. This Seed matrix is managed and freed by ColPack
///Generate and return the Left Seed matrix. This Seed matrix is managed and freed by ColPack
/**Precondition:
- the Graph has been colored by PartialDistanceTwoRowColoring()
......@@ -60,19 +60,19 @@ namespace ColPack
- Size of the returned matrix is (*i_SeedRowCount) rows x (*i_SeedColumnCount) columns.
(*i_SeedColumnCount) == num of rows of the original matrix == GetRowVertexCount()
(*i_SeedRowCount) == num of colors used to color the left (row) vertices == GetVertexColorCount().
Notes:
- This Seed matrix is managed and automatically freed by ColPack when the Graph object is deleted. Therefore, the user should NOT attempt to free the Seed matrix again.
*/
double** GetLeftSeedMatrix(int* i_SeedRowCount, int* i_SeedColumnCount);
/// Same as GetLeftSeedMatrix(), except that this Seed matrix is NOT managed by ColPack
/// Same as GetLeftSeedMatrix(), 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.
*/
double** GetLeftSeedMatrix_unmanaged(int* i_SeedRowCount, int* i_SeedColumnCount);
/// Return the Right Seed matrix. This Seed matrix is managed and freed by ColPack
/// Return the Right Seed matrix. This Seed matrix is managed and freed by ColPack
/** Precondition:
- the Graph has been colored by PartialDistanceTwoColumnColoring()
......@@ -80,13 +80,13 @@ namespace ColPack
- Size of the returned matrix is (*i_SeedRowCount) rows x (*i_SeedColumnCount) columns.
(*i_SeedRowCount) == num of columns of the original matrix == GetColumnVertexCount()
(*i_SeedColumnCount) == num of colors used to color the right (column) vertices == GetVertexColorCount().
Notes:
- This Seed matrix is managed and automatically freed by ColPack when the Graph object is deleted. Therefore, the user should NOT attempt to free the Seed matrix again.
*/
double** GetRightSeedMatrix(int* i_SeedRowCount, int* i_SeedColumnCount);
/// Same as GetRightSeedMatrix(), except that this Seed matrix is NOT managed by ColPack
/// Same as GetRightSeedMatrix(), 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.
*/
......@@ -206,9 +206,9 @@ namespace ColPack
//Public Function 2469
void PrintVertexPartialColorClasses();
double GetVertexColoringTime();
void SetVertexColoringVariant(string s_VertexColoringVariant);
};
}
......
......@@ -75,7 +75,7 @@ namespace ColPack
- 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): The graph structure will be read from the sparsity structure generated by ADIC. The next 2 parameters are:
- std::list<std::set<int> >* lsi_SparsityPattern: The pattern of Jacobian matrix.
- std::list<std::set<int> >* lsi_SparsityPattern: The pattern of Jacobian matrix.
This structure has a list of rows and the positions of the nonzeros in a row is hold in a set.
- int i_ColumnCount: number of columns in the Jacobian matrix.
- 3 (SRC_MEM_SSF) or 4 (SRC_MEM_CSR): The graph structure will be read from zero-based indexing, 3-array variation CSR format
......@@ -83,8 +83,8 @@ namespace ColPack
The next 3 parameters are:
- int* ip_RowIndex: Element j of the array gives the index of the element in the ip_ColumnIndex array that is first non-zero element in a row j.
Size of vector (*ip_RowIndex) = i_rowCount + 1.
- int i_RowCount: number of rows in the Jacobian matrix.
- int i_ColumnCount: number of columns in the Jacobian matrix.
- int i_RowCount: number of rows in the Jacobian matrix.
- int i_ColumnCount: number of columns in the Jacobian matrix.
- int* ip_ColumnIndex: Element I of the array is the number of the column that contains the I-th non-zero element in the matrix.
Size of vector (*ip_ColumnIndex) = ip_RowIndex[i_rowCount]
//*/
......
......@@ -89,7 +89,7 @@ namespace ColPack
void GetOrderedVertices(vector<int> &output);
void PrintVertexOrdering();
double GetVertexOrderingTime();
};
}
......
......@@ -10,7 +10,7 @@
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
......@@ -111,7 +111,7 @@ the following:
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
......
......@@ -17,14 +17,14 @@
running "make clean && make -j EXTRA_FLAGS=-D_COLPACK_CHECKPOINT_". When the program is executed,
ColPack library will generate a Matrix Market format file ColPack_input_graph.mtx in the same directory as the running program.
If this does not work, you can also force ColPack to generate the file by calling g->WriteMatrixMarket()
with g is a GraphColoringInterface, BipartiteGraphPartialColoringInterface, or BipartiteGraphBicoloringInterface object
with g is a GraphColoringInterface, BipartiteGraphPartialColoringInterface, or BipartiteGraphBicoloringInterface object
Interface functions for ADIC partially developed
BipartiteGraphPartialColoringInterface() now accepts input from ADIC (int i_type=SRC_MEM_ADIC)
BipartiteGraphPartialColoringInterface(int i_type, std::list<std::set<int> >* valsetlist, int rowCount)
a bipartite graph can be built by calling:
BipartiteGraphPartialColoringInterface *g = new BipartiteGraphPartialColoringInterface(SRC_MEM_ADIC, &valsetlist, rowCount);
add int JacobianRecovery1D::RecoverD2Cln_ADICFormat(
BipartiteGraphPartialColoringInterface* g,
double** dp2_CompressedMatrix,
std::list<std::set<int> >& lsi_SparsityPattern,
BipartiteGraphPartialColoringInterface* g,
double** dp2_CompressedMatrix,
std::list<std::set<int> >& lsi_SparsityPattern,
std::list<std::vector<double> > &lvd_NewValue)
\ No newline at end of file
This diff is collapsed.
......@@ -39,7 +39,7 @@ namespace ColPack
{
public: //DOCUMENTED
///Return the Seed matrix based on existing coloring. This Seed matrix is managed and freed by ColPack
///Return the Seed matrix based on existing coloring. This Seed matrix is managed and freed by ColPack
/** Precondition:
- the Graph has been colored
......@@ -47,13 +47,13 @@ namespace ColPack
- Size of the returned matrix is (*ip1_SeedRowCount) rows x (*ip1_SeedColumnCount) columns.
(*ip1_SeedRowCount) == num of columns of the original matrix == GetVertexCount()
(*ip1_SeedColumnCount) == num of colors used to color vertices == GetVertexColorCount().
Notes:
- This Seed matrix is managed and automatically freed by ColPack when the Graph object is deleted. Therefore, the user should NOT attempt to free the Seed matrix again.
*/
double** GetSeedMatrix(int* ip1_SeedRowCount, int* ip1_SeedColumnCount);
/// Same as GetSeedMatrix(), except that this Seed matrix is NOT managed by ColPack
/// Same as GetSeedMatrix(), 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.
*/
......@@ -182,7 +182,7 @@ namespace ColPack
* - Else, we can just reuse the color of that D2 neighbor
*/
int RestrictedStarColoring();
//Public Function 1458
/*
* Related paper: A. Gebremedhin, A. Tarafdar, F. Manne and A. Pothen, New Acyclic and Star Coloring Algorithms with Applications to Hessian Computation, SIAM Journal on Scientific Computing, Vol 29, No 3, pp 1042--1072, 2007.
......@@ -191,17 +191,17 @@ namespace ColPack
*/
int StarColoring_serial();
int StarColoring_serial2(); // Essentially based on StarColoring_OMP() v1
// TO BE IMPLEMENTED
int StarColoring();
/// Build the collection of 2-color star from the coloring result
/**
* NOTE: At this point, this routine will not work correctly if there are conflicts
*/
int BuildStarCollection(vector<int> & vi_VerticesToBeRecolored);
int PrintStarCollection(vector<int>& vi_EdgeStarMap, vector<int>& vi_StarHubMap, map< int, map<int, int> >& mimi2_VertexEdgeMap);
struct lt_pii
{
bool operator()(const pair<int, int> pii_ColorCombination1, const pair<int, int> pii_ColorCombination2) const
......@@ -216,7 +216,7 @@ namespace ColPack
return (pii_ColorCombination1.second < pii_ColorCombination2.second);
}
};
struct Colors2Edge_Value {
Colors2Edge_Value() {
visited=false;
......@@ -230,12 +230,12 @@ namespace ColPack
* If vi_VerticesToBeRecolored.size() == 0, then the coloring is a valid star coloring.
* The algorithm is done in parallel
*/
int DetectConflictInColorCombination(int i_MaxNumThreads, int i_thread_num, pair<int, int> pii_ColorCombination, map< pair<int, int>, Colors2Edge_Value , lt_pii>* Colors2Edge_Private,
int DetectConflictInColorCombination(int i_MaxNumThreads, int i_thread_num, pair<int, int> pii_ColorCombination, map< pair<int, int>, Colors2Edge_Value , lt_pii>* Colors2Edge_Private,
map< int, vector< pair<int, int> > > *Vertex2ColorCombination_Private, map< int, int> * PotentialHub_Private, vector< pair<int, int> >* ConflictedEdges_Private, vector<int>* ConflictCount_Private);
/// This function assume that there is no conflicts in the color assignment
int BuildStarFromColorCombination(int i_MaxNumThreads, int i_thread_num, pair<int, int> pii_ColorCombination, map< pair<int, int>, Colors2Edge_Value , lt_pii>* Colors2Edge_Private,
map< int, vector< pair<int, int> > > *Vertex2ColorCombination_Private, map< int, int> * PotentialHub_Private);
ofstream fout; // !!!
int i_ProcessedEdgeCount; // !!!