Hitmap 1.3
|
#include "hit_shape.h"
Go to the source code of this file.
Macros | |
#define | HIT_BSHAPE_MATRIX 0 |
#define | HIT_BSHAPE_GRAPH 1 |
#define | hit_bShapeCard(shape, dim) (hit_bShapeAccess(shape).cards[(dim)]) |
#define | hit_bShapeNameList(shape, dim) (hit_bShapeAccess((shape)).names[(dim)]) |
#define | hit_bShapeData(shape) (hit_bShapeAccess(shape).data) |
#define | hit_bShapeCoordToGlobal(s, dim, elem) (hit_nameListIndex2Name(hit_bShapeNameList((s),(dim)),(elem))) |
#define | hit_bShapeCoordToLocal(s, dim, elem) (hit_nameListName2Index(hit_bShapeNameList((s),(dim)),(elem))) |
#define | hit_bShapeColumnIteratorDense(var, shape, row) for(var=0;var<hit_bShapeCard(shape,1);var++) |
#define | hit_bShapeAddElem(shapep, x, y) hit_bShapeAddElem_or_Edge(shapep, x, y, HIT_BSHAPE_MATRIX) |
#define | hit_bitmapShapeVertexIterator(var, shape) for(var=0; var<hit_bitmapShapeNvertices(shape); var++) |
Functions | |
HitShape | hit_bitmapShapeMatrix (int n, int m) |
void | hit_bShapeAddEmptyRow_or_Vertex (HitShape *shape, int x, int mode) |
void | hit_bShapeAddElem_or_Edge (HitShape *shape, int x, int y, int mode) |
HitShape | hit_bShapeSelectRows (HitShape shape, int nNames, int *names) |
int | hit_bShapeNColsRow (HitShape shape, int row) |
Variables | |
HitShape | HIT_BITMAP_SHAPE_NULL |
Shapes for bitmap sparse domains.
Types and functions to manipulate sparse domains stored using a bitmap to locate the elements that are zero or non-zero.
Definition in file hit_bshape.h.
#define hit_bitmapShapeVertexIterator | ( | var, | |
shape | |||
) | for(var=0; var<hit_bitmapShapeNvertices(shape); var++) |
Vertex iterator in a bitmap shape
var | Variable to iterate |
shape | Bitmap shape |
Definition at line 639 of file hit_bshape.h.
#define HIT_BSHAPE_GRAPH 1 |
Constant for a Bitmap Sparse Graph.
Definition at line 53 of file hit_bshape.h.
#define HIT_BSHAPE_MATRIX 0 |
Constant for a Bitmap Sparse Matrix.
Definition at line 51 of file hit_bshape.h.
#define hit_bShapeAddElem | ( | shapep, | |
x, | |||
y | |||
) | hit_bShapeAddElem_or_Edge(shapep, x, y, HIT_BSHAPE_MATRIX) |
Adds an element to a matrix.
shape | The shape |
x | The row |
y | The element |
Definition at line 612 of file hit_bshape.h.
Get the cardinality (number of row or columns) of the Bitmap matrix.
shape | A HitBShape. |
dim | The dimension (0 for rows, 1 for columns). |
Definition at line 144 of file hit_bshape.h.
#define hit_bShapeColumnIteratorDense | ( | var, | |
shape, | |||
row | |||
) | for(var=0;var<hit_bShapeCard(shape,1);var++) |
Definition at line 481 of file hit_bshape.h.
#define hit_bShapeCoordToGlobal | ( | s, | |
dim, | |||
elem | |||
) | (hit_nameListIndex2Name(hit_bShapeNameList((s),(dim)),(elem))) |
Converts a local coordinate to global.
s | A HitBShape. |
dim | the dimension (0 or 1) |
elem | The element using local coordinates. |
Definition at line 191 of file hit_bshape.h.
#define hit_bShapeCoordToLocal | ( | s, | |
dim, | |||
elem | |||
) | (hit_nameListName2Index(hit_bShapeNameList((s),(dim)),(elem))) |
Converts a global coordinate to local.
s | A HitBShape. |
dim | the dimension (0 or 1) |
elem | The element using global coordinates. |
Definition at line 201 of file hit_bshape.h.
Definition at line 180 of file hit_bshape.h.
Returns the name list for the given dimension.
shape | A HitBShape |
dim | The dimension (0 for rows, 1 for columns). |
Definition at line 171 of file hit_bshape.h.
HitShape hit_bitmapShapeMatrix | ( | int | n, |
int | m | ||
) |
Sparse Bitmap matrix shape constructor.
n | Number of rows |
m | Number of columns |
Definition at line 69 of file hit_bshape.c.
void hit_bShapeAddElem_or_Edge | ( | HitShape * | shape, |
int | x, | ||
int | y, | ||
int | mode | ||
) |
Adds an element to a matrix or a edge to a graph.
shape | The shape |
x | The row/vertex |
y | The element/edge |
mode | The matrix/graph mode. |
Definition at line 413 of file hit_bshape.c.
void hit_bShapeAddEmptyRow_or_Vertex | ( | HitShape * | shape, |
int | x, | ||
int | mode | ||
) |
Adds an empty row in a bitmap sparse matrix or a vertex in a graph.
shape | The shape. |
x | The name of the row or vertex. |
mode | The mode matrix or graph. |
Definition at line 293 of file hit_bshape.c.
int hit_bShapeNColsRow | ( | HitShape | shape, |
int | row | ||
) |
Return the number of nonzero elements of a row.
shape | A bitmap shape. |
row | The index of the row. |
Definition at line 434 of file hit_bshape.c.
Returns a new bitmap shape with a selection of rows.
shape | The source shape. |
nNames | The number of rows. |
names | The list with the names of the rows. |
Definition at line 162 of file hit_bshape.c.
HitShape HIT_BITMAP_SHAPE_NULL |
Null value for bitmap sparse shapes.
Definition at line 71 of file hit_shape.c.