Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Public Member Functions
HitCShape Struct Reference

#include <hit_shape.h>

Inheritance diagram for HitCShape:
Inheritance graph
[legend]
Collaboration diagram for HitCShape:
Collaboration graph
[legend]

Public Member Functions

HitShape hit_csrShape (int nvertices, int nedges)
 
void hit_cShapeFree (HitShape shape)
 
#define hit_cShapeNvertices(shape)   (hit_cShapeCard(shape, 0))
 
#define hit_cShapeNedges(shape)   hit_cShapeNZElems(shape)
 
#define hit_cShapeXadj(shape)   (hit_cShapeAccess(shape).xadj)
 
#define hit_cShapeAdjncy(shape)   (hit_cShapeAccess(shape).adjncy)
 
#define hit_cShapeFistColumn(s, row)   (hit_cShapeXadj(s)[(row)])
 
#define hit_cShapeLastColumn(s, row)   (hit_cShapeXadj(s)[(row)+1])
 
#define hit_cShapeNEdgesFromVertex(s, vertex)   (hit_cShapeLastColumn(s, vertex) - hit_cShapeFistColumn(s, vertex))
 
#define hit_cShapeEdgeTarget(s, edge)   (hit_cShapeAdjncy(s)[(edge)])
 
#define hit_cShapeVertexToGlobal(s, vertex)   (hit_nameListIndex2Name(hit_cShapeNameList(s,0),vertex))
 
#define hit_cShapeVertexToLocal(s, vertex)   (hit_nameListName2Index(hit_cShapeNameList(s,0),vertex))
 
#define hit_cShapeHasVertex(s, v)   (hit_cShapeVertexToLocal(s, v) != -1)
 
HitShape hit_cShapeSelect (HitShape s, int nvertices, int *vertices)
 
HitShape hit_cShapeSelectRows (HitShape shape, int n, int *names)
 
HitShape hit_cShapeExpand (HitShape shape, HitShape original, int amount)
 
HitShape hit_cShapeReorder (HitShape s, int *newNames)
 
#define hit_cShapeAddVertex(shapeP, x)   hit_cShapeAddEmptyRow_or_Vertex(shapeP, x, HIT_CSHAPE_GRAPH)
 
void hit_cShapeAddEmptyRow_or_Vertex (HitShape *shape, int x, int mode)
 
#define hit_cShapeAddEdge(shapep, x, y)   hit_cShapeAddElem_or_Edge(shapep, x, y, HIT_CSHAPE_GRAPH)
 
#define hit_cShapeAddEdge2(shape, x, y)   {hit_cShapeAddEdge(shape,x,y); hit_cShapeAddEdge(shape,y,x);}
 
void hit_cShapeCreateInvNames (HitShape *shape)
 
#define hit_cShapeRowIterator(var, shape)   for(var=0; var<hit_cShapeCard(shape, 0); var++)
 
#define hit_cShapeVertexIterator(var, shape)   hit_cShapeRowIterator(var,shape)
 
#define hit_cShapeColumnIterator(var, shape, row)   for(var=hit_cShapeFistColumn(shape,row); var<hit_cShapeLastColumn(shape,row); var++)
 
#define hit_cShapeEdgeIterator(var, shape, vertex)   hit_cShapeColumnIterator(var,shape,vertex)
 

Detailed Description

/* 1.3 CShape data structure ADT for sparse domains in CSR format.

A sparse CSR shape represents the index-domain of a graph, or a sparse matrix in CSR format (Compressed Sparse Row matrix). Standard CSR format can only represent a two dimensional space.

Definition at line 124 of file hit_shape.h.

Member Function Documentation

void hit_cShapeAddEmptyRow_or_Vertex ( HitShape shape,
int  x,
int  mode 
)

Adds a empty row in a matrix or a vertex in a graph.

Parameters
shapeThe CShape pointer of the graph.
xA row/vertex (in global coordinates).

Definition at line 349 of file hit_cshape.c.

Here is the caller graph for this function:

void hit_cShapeCreateInvNames ( HitShape shape)

Creates the inverse translation list of vertex names. Create the list for both dimensions. This list is used to speedup the translation operation from global to local names. This function will increase the size of the shape.

Parameters
shapeA pointer to HitCShape.

Definition at line 318 of file hit_cshape.c.

Here is the caller graph for this function:

HitShape hit_cShapeExpand ( HitShape  shape,
HitShape  original,
int  amount 
)

Expand a CSR Sparse Shape adding new vertices of the original graph.

Parameters
shapeThe shape to expand.
originalThe original shape.
amountThe number of times that the expand algorithm is invoked.
Returns
The new expanded shape.

Definition at line 208 of file hit_cshape.c.

Here is the caller graph for this function:

void hit_cShapeFree ( HitShape  shape)

Hit CSR Shape destructor.

Parameters
shapeA Hit CSR Shape.

Definition at line 99 of file hit_cshape.c.

Here is the caller graph for this function:

HitShape hit_cShapeReorder ( HitShape  s,
int *  newNames 
)

Vertex reorder. This function transform the local domain of a sparse shape according to a new order of global vertex names.

Parameters
sA CShape.
newNamesAn array with the new order of vertices using the global domain.
Returns
A new CShape reordered.
HitShape hit_cShapeSelect ( HitShape  s,
int  nvertices,
int *  vertices 
)

Sparse Shape selection. Makes a sparse shape with the selected vertices of the source shape.

Parameters
sThe source sparse shape.
nverticesThe number of selected vertices.
verticesAn array with the selected vertices in the global domain.
Returns
a New CShape.

Definition at line 109 of file hit_cshape.c.

Here is the caller graph for this function:

HitShape hit_cShapeSelectRows ( HitShape  shape,
int  n,
int *  names 
)

Sparse Shape Matrix selection. Makes a sparse shape with the selected rows of the source shape.

Parameters
sThe source sparse shape.
nThe number of selected rows.
namesSelected name list in global coordinates.
Returns
a New CShape.

Definition at line 542 of file hit_cshape.c.

Here is the caller graph for this function:

HitShape hit_csrShape ( int  nvertices,
int  nedges 
)

/* 1. Hit CSR Sparse Shape generating functions Sparse CSR graph shape constructor.

Parameters
nverticesnumber of vertices.
nedgesnumber of edges.
Returns
the new CSR Sparse Shape.

Definition at line 47 of file hit_cshape.c.

Here is the caller graph for this function:


The documentation for this struct was generated from the following files: