Diana
0.8.3
|
Graph compressed storage format. More...
#include <CSRGraph.hpp>
Public Member Functions | |
void | SetNewValues (std::vector< std::vector< EdgeStruct > > AdjancyVector, CapeArrayLong _VerticesWeights, CapeLong EdgesQuantity) |
void | SetEdgesNames (const CapeArrayString &_EdgesNames) |
void | SetVerticesNames (const CapeArrayString &_EdgesNames) |
void | WriteToFile (const CapeString &_szFileName) |
void | SetGraphName (const CapeString &_szNewFileName) |
void | Divide (CapeLong lPartsQuantity, CapeArrayLong *Layout) |
CapeLong | GetVerticesQuantity () |
void | GetVerticesNames (CapeArrayString *_VerticesNames) |
CapeLong | GetEdgesQuantity () |
const CapeString & | GetGraphName () |
void | GetAllValues (int *_xadj, int *_adjncy, int *_adjvwgt) |
Private Attributes | |
CapeString | m_szGraphName |
int * | m_pXadj |
int * | m_pAdjncy |
int * | m_pVwgt |
vertices weights | |
int * | m_pAdjwgt |
edges weights | |
CapeLong | m_lEdgesQuantity |
quantity of edges in graph | |
CapeLong | m_lVerticesQuantity |
quantity of edges in graph | |
int | m_nGraphType |
graph type (undirected, weighted, ...) | |
CapeArrayString | EdgesNames |
names of the edges | |
CapeArrayString | VerticesNames |
names of the vertices |
Graph compressed storage format.
CSRGraph. This class is used for represent graphs in CSR (compressed storage) format. The CSR format is widely used scheme for storing sparse graphs. In this format adjancy structure of a graph with n vertices and m edges is represented using two arrays xadj and adjncy. The xadj array is of size n+1 whereas the adjncy array is of size 2m. The weights of the vertices are stored in an additional array called vwgt. The weights of the edges are stoed in an additional array called adjvwgt.
void Divide | ( | CapeLong | lPartsQuantity, |
CapeArrayLong * | Layout | ||
) |
Divide graph to lPartsQuantity. Each part should have the same size. It return array of number of parts where situated vertice. I.e. if ( Layout[ i ] == k ) than vertice i is situated on part k.
void SetEdgesNames | ( | const CapeArrayString & | _EdgesNames | ) |
Set edges names.
void SetGraphName | ( | const CapeString & | _szNewFileName | ) |
Set the graph name.
void SetVerticesNames | ( | const CapeArrayString & | _EdgesNames | ) |
Set vertices names.
void WriteToFile | ( | const CapeString & | _szFileName | ) |
Write this graph in output file in format:
Graph_name
vertices_quantity
edges_quantity
wgtflag (used to indicate if the graph weighted)
xadj .....
adjncy .....
vwgt .....
adhvwgt ....
Vertices_Names....
Edges_Names .....