48 #define HIT_CSHAPE_MATRIX 0
50 #define HIT_CSHAPE_GRAPH 1
59 #define HIT_CSR_SHAPE_INTERNAL_NULL_STATIC { {0,0}, NULL, NULL, {HIT_NAMELIST_NULL_STATIC,HIT_NAMELIST_NULL_STATIC} }
66 #define HIT_CSR_SHAPE_NULL_STATIC { HIT_CSR_SHAPE, {.csr = HIT_CSR_SHAPE_INTERNAL_NULL_STATIC} }
108 #define hit_cShapeCard(shape, dim) (hit_cShapeAccess(shape).cards[(dim)])
118 #define hit_cShapeNvertices(shape) (hit_cShapeCard(shape, 0))
126 #define hit_cShapeNZElems(shape) (hit_cShapeXadj((shape))[hit_cShapeNvertices(shape)])
136 #define hit_cShapeNedges(shape) hit_cShapeNZElems(shape)
145 #define hit_cShapeXadj(shape) (hit_cShapeAccess(shape).xadj)
154 #define hit_cShapeAdjncy(shape) (hit_cShapeAccess(shape).adjncy)
162 #define hit_cShapeNameList(shape,dim) (hit_cShapeAccess((shape)).names[(dim)])
182 #define hit_cShapeFistColumn(s, row) (hit_cShapeXadj(s)[(row)])
192 #define hit_cShapeLastColumn(s, row) (hit_cShapeXadj(s)[(row)+1])
202 #define hit_cShapeNEdgesFromVertex(s, vertex) (hit_cShapeLastColumn(s, vertex) - hit_cShapeFistColumn(s, vertex))
210 #define hit_cShapeNColsRow(s, row) hit_cShapeNEdgesFromVertex(s, row)
220 #define hit_cShapeEdgeTarget(s,edge) (hit_cShapeAdjncy(s)[(edge)])
233 #define hit_cShapeVertexToGlobal(s,vertex) (hit_nameListIndex2Name(hit_cShapeNameList(s,0),vertex))
243 #define hit_cShapeVertexToLocal(s,vertex) (hit_nameListName2Index(hit_cShapeNameList(s,0),vertex))
253 #define hit_cShapeCoordToGlobal(s,dim,elem) (hit_nameListIndex2Name(hit_cShapeNameList((s),(dim)),(elem)))
263 #define hit_cShapeCoordToLocal(s,dim,elem) (hit_nameListName2Index(hit_cShapeNameList((s),(dim)),(elem)))
276 #define hit_cShapeHasVertex(s,v) (hit_cShapeVertexToLocal(s, v) != -1)
330 #define hit_cShapeAddVertex(shapeP, x) hit_cShapeAddEmptyRow_or_Vertex(shapeP, x, HIT_CSHAPE_GRAPH)
348 #define hit_cShapeAddEdge(shapep, x, y) hit_cShapeAddElem_or_Edge(shapep, x, y, HIT_CSHAPE_GRAPH)
358 #define hit_cShapeAddEdge2(shape,x,y) {hit_cShapeAddEdge(shape,x,y); hit_cShapeAddEdge(shape,y,x);}
381 #define hit_cShapeRowIterator(var,shape) \
382 for(var=0; var<hit_cShapeCard(shape, 0); var++)
392 #define hit_cShapeVertexIterator(var,shape) hit_cShapeRowIterator(var,shape)
403 #define hit_cShapeColumnIterator(var,shape,row) \
404 for(var=hit_cShapeFistColumn(shape,row); var<hit_cShapeLastColumn(shape,row); var++)
416 #define hit_cShapeEdgeIterator(var,shape,vertex) hit_cShapeColumnIterator(var,shape,vertex)
435 #define hit_cShapeAddElem(shapep, x, y) hit_cShapeAddElem_or_Edge(shapep, x, y, HIT_CSHAPE_MATRIX)
HitShape hit_cShapeReorder(HitShape s, int *newNames)
HitShape hit_csrShapeMatrix(int n, int m, int nz)
void hit_cShapeCreateInvNames(HitShape *shape)
HitShape hit_csrShape(int nvertices, int nedges)
HitShape hit_cShapeExpand(HitShape shape, HitShape original, int amount)
HitShape hit_cShapeSelect(HitShape s, int nvertices, int *vertices)
HitShape HIT_CSR_SHAPE_NULL
HitShape hit_cShapeSelectRows(HitShape shape, int n, int *names)
void hit_cShapeFree(HitShape shape)
void hit_cShapeAddEmptyRow_or_Vertex(HitShape *shape, int x, int mode)
int hit_cShapeElemExists(HitShape shape, int x, int y)
void hit_cShapeAddElem_or_Edge(HitShape *shape, int x, int y, int mode)