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

Go to the source code of this file.

Macros

Initializers, constructors

/* 3. Hit SHAPE GENERATING FUNCTIONS

#define hit_shape(nd,...)
 
#define hit_shapeIndex(nd,...)
 
#define hit_shapeStd(nd,...)
 
Iterators
#define hit_shapeIterator(var, shape, dim)
 
#define hit_shapeIteratorTileCoord(var, shape, dim)
 

Functions

void dumpShape (HitShape sh)
 
Binary shape operators
int hit_shapeCmp (HitShape sh1, HitShape sh2)
 
HitShape hit_shapeIntersect (HitShape sh1, HitShape sh2)
 
HitShape hit_shapeSubset (HitShape sh1, HitShape sh2)
 
HitShape hit_shapeTileToArray (HitShape sh1, HitShape sh2)
 

Variables

HitShape HIT_SIG_SHAPE_NULL
 
HitSigShape HIT_SIG_SHAPE_WHOLE
 
HitShape HIT_SHAPE_WHOLE
 

Retrieving/Setting shape information

#define hit_shapeDims(shape)
 
#define hit_sshapeDims(shape)
 
#define hit_shapeDimsSet(shape, value)
 
#define hit_shapeSig(shape, dim)
 
#define hit_shapeSigCard(shape, dim)
 

Boundaries and halos

#define HIT_SHAPE_BEGIN
 
#define HIT_SHAPE_END
 
HitShape hit_shapeBorder (HitShape shape, int dim, int position, int offset)
 
HitShape hit_shapeDimExpand (HitShape shape, int dim, int position, int offset)
 
HitShape hit_shapeExpand (HitShape shape, int dims, int offset)
 

Detailed Description

Functionalities to manipulate Signature based domains.

Manipulation of HitSigShape domains. Multidimensional shapes for dense or strided domains of indexes in a bounding box.

Deprecated:
Many functions in this file should be renamed to have the hit_sshape prefix. They are mantained for portability of legacy Hitmap code.
Version
1.1
Author
Arturo Gonzalez-Escribano
Javier Fresno Bausela
Carlos de Blas Carton
Date
Mar 2011

Definition in file hit_sshape.h.

Macro Definition Documentation

#define hit_shape (   nd,
  ... 
)

Constructor (1) of Signature domain shapes.

The number of dimensions is limited by the maximum number of dimensions established when compiling the library.

Deprecated:
The name will change to use the hit_sshape prefix.
See Also
HIT_MAXDIMS
Parameters
[in]ndint Number of dimensions.
[in]...HitSig_list A list of "nd" signature values.
Return values
HitShapeA new shape value.

Definition at line 175 of file hit_sshape.h.

#define HIT_SHAPE_BEGIN

Hit Shape Begin flag for the hit_shapeBorder function.

See Also
hit_shapeBorder()

Definition at line 515 of file hit_sshape.h.

#define HIT_SHAPE_END

Hit Shape End flag for the hit_shapeBorder function.

See Also
hit_shapeBorder()

Definition at line 522 of file hit_sshape.h.

#define hit_shapeDims (   shape)

Number of dimensions in a shape.

Deprecated:
The name will change to use the hit_sshape prefix. The correct method to use is now hit_sshapeDims().
Parameters
[in]shapeHitShape A domain shape.
Return values
intNumber of dimensions of the shape.

Definition at line 364 of file hit_sshape.h.

#define hit_shapeDimsSet (   shape,
  value 
)

Set the number of dimensions in a shape.

Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
[out]shapeHitShape A domain shape.
[in]valueThe new number of dimensions.

Definition at line 387 of file hit_sshape.h.

#define hit_shapeIndex (   nd,
  ... 
)

/** Constructor (2) of Signature domain shapes, for a particular multidimensional index.

This construtor builds a shape that contains only one multidimensional index.

The number of dimensions is limited by the maximum number of dimensions established when compiling the library.

Deprecated:

The name will change to use the hit_sshape prefix.

Not used in the Trasgo translation system or in any application example

See Also
HIT_MAXDIMS
Parameters
[in]ndint Number of dimensions.
[in]...int_list A list of "nd" integer indexes.
Return values
HitShapeA new shape value with one multidimensional index.

Definition at line 227 of file hit_sshape.h.

#define hit_shapeIterator (   var,
  shape,
  dim 
)

Loop across the array indexes of a dimension.

Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
[out]varint Variable index to be used as counter in the loop.
[in]shapeHitShape A domain shape.
[in]dimint Number of the dimension.

Definition at line 603 of file hit_sshape.h.

#define hit_shapeIteratorTileCoord (   var,
  shape,
  dim 
)

Loop across the tile indexes of a dimension.

This iterator starts at 0, advances with stride 1, and stops at the cardinality of the dimension signature minus 1.

Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
[out]varint Variable index to be used as counter in the loop.
[in]shapeHitShape A domain shape.
[in]dimint Number of the dimension.

Definition at line 619 of file hit_sshape.h.

#define hit_shapeSig (   shape,
  dim 
)

Access to one dimensional signature in a shape.

Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
[in]shapeHitShape A domain shape.
[in]dimint A dimension,
Return values
HitSigThe dimensional signature of that shape.

Definition at line 400 of file hit_sshape.h.

#define hit_shapeSigCard (   shape,
  dim 
)

Cardinality of a dimensional signature in a shape.

Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
[in]shapeHitShape A domain shape.
[in]dimint A dimension,
Return values
intThe cardinality of the dimensional signature of that shape.

Definition at line 412 of file hit_sshape.h.

#define hit_shapeStd (   nd,
  ... 
)

/** Constructor (3) of Signature domain shapes, with standard C array domains.

Standard array C domains have index ranges from 0 to N-1, with no stride. A size for each dimension is enough to describe them.

The number of dimensions is limited by the maximum number of dimensions established when compiling the library.

Deprecated:
The name will change to use the hit_sshape prefix.
See Also
HIT_MAXDIMS
Parameters
[in]ndint Number of dimensions.
[in]...int_list A list of "nd" positive integer size values.
Return values
HitShapeA new shape value.

Definition at line 295 of file hit_sshape.h.

#define hit_sshapeDims (   shape)

Number of dimensions in a shape.

Parameters
[in]shapeHitShape A domain shape.
Return values
intNumber of dimensions of the shape.

Definition at line 376 of file hit_sshape.h.

Function Documentation

void dumpShape ( HitShape  sh)

Definition at line 391 of file hit_shape.c.

HitShape hit_shapeBorder ( HitShape  shape,
int  dim,
int  position,
int  offset 
)

Boundary selection.

Return another shape with the shape of the boundary (or border) elements in a given dimension, or a similar boundary shape but displaced by a given offset in that dimension. This function is useful to compute halos, and other boundary related shapes.

Warning
Only for HitSigShape. It returns HIT_SHAPE_NULL with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
shapeA HitShape.
dimThe dimension.
positionFlag to select the border:
  • HIT_SHAPE_BEGIN For the starting border in the dimension.
  • HIT_SHAPE_END For the ending border in the dimension.
offsetA positive offset moves the border outside the shape. A negative offser moves the border inside the shape.
Returns
A shape representing the selected border.

Definition at line 241 of file hit_shape.c.

Here is the caller graph for this function:

int hit_shapeCmp ( HitShape  sh1,
HitShape  sh2 
)

Compare two shape values.

Warning
Only for HitSigShape. It returns 0 with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
sh1Domain shape.
sh2Domain shape.
Returns
Logical value. True if the two shapes are equal.

Definition at line 109 of file hit_shape.c.

Here is the caller graph for this function:

HitShape hit_shapeDimExpand ( HitShape  shape,
int  dim,
int  position,
int  offset 
)

Expand a boundary.

Return a shape with a given boundary of one selected dimension expanded by an offset. This function is useful to compute halos, and other boundary related shapes.

Warning
Only for HitSigShape. It returns HIT_SHAPE_NULL with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
shapeA HitShape.
dimThe dimension to expand.
positionFlag to select the border:
  • HIT_SHAPE_BEGIN For the starting border in the dimension.
  • HIT_SHAPE_END For the ending border in the dimension.
offsetA positive offset moves the border outside the shape. A negative offser moves the border inside the shape.
Returns
The expanded shape.

Definition at line 226 of file hit_shape.c.

Here is the caller graph for this function:

HitShape hit_shapeExpand ( HitShape  shape,
int  dims,
int  offset 
)

Expand boundaries.

Return a shape with the boundaries of several dimensions expanded by a given offset. This function is useful to compute halos, and other boundary related shapes.

Warning
Only for HitSigShape. It returns HIT_SHAPE_NULL with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
shapeA HitShape.
dimsThe number of dimension to expand.
offsetA positive offset moves the border outside the shape. A negative offser moves the border inside the shape.
Returns
The expanded shape.

Definition at line 210 of file hit_shape.c.

Here is the caller graph for this function:

HitShape hit_shapeIntersect ( HitShape  sh1,
HitShape  sh2 
)

Intersection of two shapes.

Warning
Only for HitSigShape. It returns HIT_SHAPE_NULL with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
sh1Domain shape.
sh2Domain shape.
Returns
A new domain shape with the indexes combinations which are valid in both shapes at the same time.

Definition at line 123 of file hit_shape.c.

Here is the call graph for this function:

Here is the caller graph for this function:

HitShape hit_shapeSubset ( HitShape  sh1,
HitShape  sh2 
)

Subset or subselection of a shape in tile coordinates.

Returns a new domain shape with the indexes of the first shape that exist in the second shape when renumbering the first shape in standard C notation (starting at 0, stride 1).

Warning
Only for HitSigShape. It returns HIT_SHAPE_NULL with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
sh1Domain shape.
sh2Subselection shape.
Returns
A shape with the selected indexes.

Definition at line 157 of file hit_shape.c.

Here is the caller graph for this function:

HitShape hit_shapeTileToArray ( HitShape  sh1,
HitShape  sh2 
)

Transform tile coordinates to array coordinates.

Returns a new domain shape with the indexes of the second shape transformed to array coordinates in the reference system of the first shape.

Warning
Only for HitSigShape. It returns HIT_SHAPE_NULL with sparse shapes.
Deprecated:
The name will change to use the hit_sshape prefix.
Parameters
sh1Domain shape.
sh2Subshape in tile coordinates
Returns
A shape with the transformed indexes.

Definition at line 181 of file hit_shape.c.

Variable Documentation

HitShape HIT_SHAPE_WHOLE

Special value: Whole domain.

Special value to indicate in tile selections that the whole collection of indexes of another shape should be selected.

Deprecated:
Use HIT_SIG_SHAPE_WHOLE for signature domains.

The number of dimensions of this value is 0.

See Also
hit_tileSelect()

Definition at line 75 of file hit_shape.c.

HitShape HIT_SIG_SHAPE_NULL

/** Null value for signature shapes.

The number of dimensions of this value is -1.

Definition at line 62 of file hit_shape.c.

HitSigShape HIT_SIG_SHAPE_WHOLE

Special value: Whole domain.

Special value to indicate in tile selections that the whole collection of indexes of another shape should be selected.

The number of dimensions of this value is 0.

See Also
hit_tileSelect()

Definition at line 77 of file hit_shape.c.