All Classes Files Functions Variables Pages
graph.h
Go to the documentation of this file.
1 
8 #ifndef GRAPH_H
9 #define GRAPH_H
10 #include<string>
11 #include<vector>
12 
13 
22 struct CSC_MATRIX {
23 
24  int n;
25  int nnz;
26  std::vector<int> irow;
27  std::vector<int> pcol;
28  std::vector<double> vals;
29 };
30 
37 class Graph {
38 
39  public:
40  Graph();
41  Graph(std::string filename);
42  Graph(int numNodes, int numEdges);
43  int getEdgePoint(int i,int j);
44  int getNumNodes();
45  int getNumEdges();
46  int getNodeWeight(int node);
47  double getEdgeWeight(int node, int neighborInd);
48  int getNodeMatch(int node);
49  void setNodeMatch(int node, int val);
50  std::vector<int> getMatchList();
51  std::vector<int> getNeighbors(int node);
52  std::vector<double> getEdges(int node);
53  std::vector<int> reorderGraph(std::vector<int> indMap);
54  std::vector<int> getChildren(int node);
55  int coarsenFrom(Graph & g, std::vector<std::vector<double> >& timeKeeper);
56  int writeEdgeList(std::string filename);
57  void sortNeighborList();
58 
59  CSC_MATRIX computeGraphLaplacian(CSC_MATRIX adj);
60  CSC_MATRIX computeAdjacencyMatrix();
61  private:
62  int numEdges, numNodes, numChildren;
63  std::vector<std::vector<int> > edge;
64  std::vector<std::vector<int> > neighborList;
65  std::vector<std::vector<double> > edgeWeights;
66  std::vector<int> nodeWeights;
67  std::vector<int> matchList;
68  std::vector<std::vector<int> > parentList;
69  std::vector<int> child2Parent;
70 };
71 #endif
TODO: Give description of Graph class and add comments to each function.
Definition: graph.h:37
std::vector< int > irow
Definition: graph.h:26
std::vector< int > pcol
Definition: graph.h:27
int nnz
Definition: graph.h:25
std::vector< double > vals
Definition: graph.h:28
Struct defining matrix in Compact Sparse Column (CSC) format.
Definition: graph.h:22

Generated on Thu Oct 11 2018 12:36:17 for by  doxygen 1.8.5