Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Macros | Functions | Variables
hit_bshape.h File Reference
#include "hit_shape.h"
Include dependency graph for hit_bshape.h:
This graph shows which files directly or indirectly include this file:

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
 

Detailed Description

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.

Version
1.0
Author
Javier Fresno Bausela
Date
Nov 2011

Definition in file hit_bshape.h.

Macro Definition Documentation

#define hit_bitmapShapeVertexIterator (   var,
  shape 
)    for(var=0; var<hit_bitmapShapeNvertices(shape); var++)

Vertex iterator in a bitmap shape

Parameters
varVariable to iterate
shapeBitmap 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.

Parameters
shapeThe shape
xThe row
yThe element

Definition at line 612 of file hit_bshape.h.

#define hit_bShapeCard (   shape,
  dim 
)    (hit_bShapeAccess(shape).cards[(dim)])

Get the cardinality (number of row or columns) of the Bitmap matrix.

Parameters
shapeA HitBShape.
dimThe dimension (0 for rows, 1 for columns).
Returns
The cardinality

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.

Parameters
sA HitBShape.
dimthe dimension (0 or 1)
elemThe element using local coordinates.
Returns
The global coordinate.

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.

Parameters
sA HitBShape.
dimthe dimension (0 or 1)
elemThe element using global coordinates.
Returns
The local coordinate.

Definition at line 201 of file hit_bshape.h.

#define hit_bShapeData (   shape)    (hit_bShapeAccess(shape).data)

Definition at line 180 of file hit_bshape.h.

#define hit_bShapeNameList (   shape,
  dim 
)    (hit_bShapeAccess((shape)).names[(dim)])

Returns the name list for the given dimension.

Parameters
shapeA HitBShape
dimThe dimension (0 for rows, 1 for columns).
Returns
The name list

Definition at line 171 of file hit_bshape.h.

Function Documentation

HitShape hit_bitmapShapeMatrix ( int  n,
int  m 
)

Sparse Bitmap matrix shape constructor.

Parameters
nNumber of rows
mNumber of columns
Returns
the new bitmap sparse Shape.

Definition at line 69 of file hit_bshape.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
shapeThe shape
xThe row/vertex
yThe element/edge
modeThe matrix/graph mode.

Definition at line 413 of file hit_bshape.c.

Here is the call graph for this function:

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.

Parameters
shapeThe shape.
xThe name of the row or vertex.
modeThe mode matrix or graph.

Definition at line 293 of file hit_bshape.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int hit_bShapeNColsRow ( HitShape  shape,
int  row 
)

Return the number of nonzero elements of a row.

Parameters
shapeA bitmap shape.
rowThe index of the row.
Returns
The number of non-zero elements.

Definition at line 434 of file hit_bshape.c.

Here is the caller graph for this function:

HitShape hit_bShapeSelectRows ( HitShape  shape,
int  nNames,
int *  names 
)

Returns a new bitmap shape with a selection of rows.

Parameters
shapeThe source shape.
nNamesThe number of rows.
namesThe list with the names of the rows.
Returns
A new bitmap shape.

Definition at line 162 of file hit_bshape.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

HitShape HIT_BITMAP_SHAPE_NULL

Null value for bitmap sparse shapes.

Definition at line 71 of file hit_shape.c.