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

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
 

Detailed Description

Types and functions to manipulate CSR sparse domains.

Version
1.0
Author
Javier Fresno Bausela
Date
June 2012

Definition in file hit_cshape.h.

Macro Definition Documentation

#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

Parameters
shapeThe CShape.
xThe x coordinate.
yThe y coordinate.

Definition at line 435 of file hit_cshape.h.

#define hit_cShapeCard (   shape,
  dim 
)    (hit_cShapeAccess(shape).cards[(dim)])

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

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

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.

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

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.

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

Definition at line 263 of file hit_cshape.h.

#define hit_cShapeNameList (   shape,
  dim 
)    (hit_cShapeAccess((shape)).names[(dim)])

Returns the name list for the given dimension.

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

Definition at line 162 of file hit_cshape.h.

#define hit_cShapeNColsRow (   s,
  row 
)    hit_cShapeNEdgesFromVertex(s, row)

Number of columns in a row.

Parameters
sThe shape
rowThe row
Returns
Number of columns

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.

Parameters
shapeA HitCShape
Returns

Definition at line 126 of file hit_cshape.h.

Function Documentation

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

Parameters
shapeThe CShape.
xThe x coordinate or source vertex.
yThe y coordinate or destination vertex.
modeThe Matrix or Graph mode

Definition at line 432 of file hit_cshape.c.

Here is the call graph for this function:

int hit_cShapeElemExists ( HitShape  shape,
int  x,
int  y 
)

Checks if a element exists in a HitCShape

Parameters
shapeA HitCShape.
xThe row index.
yThe col index.
Returns
1 if the element exists, 0 otherwise.

Definition at line 416 of file hit_cshape.c.

HitShape hit_csrShapeMatrix ( int  n,
int  m,
int  nz 
)

Sparse CSR matrix shape constructor.

Parameters
nNumber of rows
mNumber of columns
nzNumber of nonzero elements.
Returns
the new CSR Sparse Shape.

Definition at line 72 of file hit_cshape.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

HitShape HIT_CSR_SHAPE_NULL

Null value for sparse domain shapes.

Definition at line 70 of file hit_shape.c.