Hitmap 1.3
|
#include "hit_shape.h"
Go to the source code of this file.
Macros | |
#define | HIT_CSHAPE_MATRIX 0 |
#define | HIT_CSHAPE_GRAPH 1 |
#define | hit_cShapeCard(shape, dim) (hit_cShapeAccess(shape).cards[(dim)]) |
#define | hit_cShapeNZElems(shape) (hit_cShapeXadj((shape))[hit_cShapeNvertices(shape)]) |
#define | hit_cShapeNameList(shape, dim) (hit_cShapeAccess((shape)).names[(dim)]) |
#define | hit_cShapeNColsRow(s, row) hit_cShapeNEdgesFromVertex(s, row) |
#define | hit_cShapeCoordToGlobal(s, dim, elem) (hit_nameListIndex2Name(hit_cShapeNameList((s),(dim)),(elem))) |
#define | hit_cShapeCoordToLocal(s, dim, elem) (hit_nameListName2Index(hit_cShapeNameList((s),(dim)),(elem))) |
#define | hit_cShapeAddElem(shapep, x, y) hit_cShapeAddElem_or_Edge(shapep, x, y, HIT_CSHAPE_MATRIX) |
Functions | |
HitShape | hit_csrShapeMatrix (int n, int m, int nz) |
int | hit_cShapeElemExists (HitShape shape, int x, int y) |
void | hit_cShapeAddElem_or_Edge (HitShape *shape, int x, int y, int mode) |
Variables | |
HitShape | HIT_CSR_SHAPE_NULL |
Types and functions to manipulate CSR sparse domains.
Definition in file hit_cshape.h.
#define HIT_CSHAPE_GRAPH 1 |
Constant for a CSR Sparse Graph.
Definition at line 50 of file hit_cshape.h.
#define HIT_CSHAPE_MATRIX 0 |
Constant for a CSR Sparse Matrix.
Definition at line 48 of file hit_cshape.h.
#define hit_cShapeAddElem | ( | shapep, | |
x, | |||
y | |||
) | hit_cShapeAddElem_or_Edge(shapep, x, y, HIT_CSHAPE_MATRIX) |
Adds a new element to a matrix or and edge to a graph
shape | The CShape. |
x | The x coordinate. |
y | The y coordinate. |
Definition at line 435 of file hit_cshape.h.
Get the cardinality (number of row or columns) of the CSR matrix.
shape | A HitCShape. |
dim | The dimension (0 for rows, 1 for columns). |
Definition at line 108 of file hit_cshape.h.
#define hit_cShapeCoordToGlobal | ( | s, | |
dim, | |||
elem | |||
) | (hit_nameListIndex2Name(hit_cShapeNameList((s),(dim)),(elem))) |
Converts a local coordinate to global.
s | A HitCShape. |
dim | the dimension (0 or 1) |
elem | The element using local coordinates. |
Definition at line 253 of file hit_cshape.h.
#define hit_cShapeCoordToLocal | ( | s, | |
dim, | |||
elem | |||
) | (hit_nameListName2Index(hit_cShapeNameList((s),(dim)),(elem))) |
Converts a global coordinate to local.
s | A HitCShape. |
dim | the dimension (0 or 1) |
elem | The element using global coordinates. |
Definition at line 263 of file hit_cshape.h.
Returns the name list for the given dimension.
shape | A HitCShape |
dim | The dimension (0 for rows, 1 for columns). |
Definition at line 162 of file hit_cshape.h.
#define hit_cShapeNColsRow | ( | s, | |
row | |||
) | hit_cShapeNEdgesFromVertex(s, row) |
Number of columns in a row.
s | The shape |
row | The row |
Definition at line 210 of file hit_cshape.h.
#define hit_cShapeNZElems | ( | shape | ) | (hit_cShapeXadj((shape))[hit_cShapeNvertices(shape)]) |
Get the number of non zero elements.
shape | A HitCShape |
Definition at line 126 of file hit_cshape.h.
void hit_cShapeAddElem_or_Edge | ( | HitShape * | shape, |
int | x, | ||
int | y, | ||
int | mode | ||
) |
Adds a new element to a matrix or and edge to a graph
shape | The CShape. |
x | The x coordinate or source vertex. |
y | The y coordinate or destination vertex. |
mode | The Matrix or Graph mode |
Definition at line 432 of file hit_cshape.c.
int hit_cShapeElemExists | ( | HitShape | shape, |
int | x, | ||
int | y | ||
) |
Checks if a element exists in a HitCShape
shape | A HitCShape. |
x | The row index. |
y | The col index. |
Definition at line 416 of file hit_cshape.c.
HitShape hit_csrShapeMatrix | ( | int | n, |
int | m, | ||
int | nz | ||
) |
Sparse CSR matrix shape constructor.
n | Number of rows |
m | Number of columns |
nz | Number of nonzero elements. |
Definition at line 72 of file hit_cshape.c.
HitShape HIT_CSR_SHAPE_NULL |
Null value for sparse domain shapes.
Definition at line 70 of file hit_shape.c.