Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Functions | Variables
hit_shape.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
#include <hit_allocP.h>
#include <hit_sshape.h>
#include <hit_cshape.h>
#include <hit_bshape.h>
#include <unistd.h>
#include <hit_funcop.h>
#include <hit_error.h>
Include dependency graph for hit_shape.c:

Go to the source code of this file.

Functions

void hit_shapeFree (HitShape shape)
 
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)
 
HitShape hit_shapeExpand (HitShape shape, int dims, int offset)
 
HitShape hit_shapeDimExpand (HitShape shape, int dim, int position, int offset)
 
HitShape hit_shapeBorder (HitShape shape, int dim, int position, int offset)
 
int hit_nameListName2Index (HitNameList list, int name)
 
void hit_nameListFree (HitNameList list)
 
void hit_nameListCreate (HitNameList *list, int nelems)
 
void hit_nameListClone (HitNameList *dst, HitNameList *src)
 
void hit_nameListAdd (HitNameList *list, int x)
 
void hit_nameListCreateInvNames (HitNameList *list)
 
void dumpShape (HitShape sh)
 

Variables

HitShape HIT_SHAPE_NULL = HIT_SHAPE_NULL_STATIC
 
HitShape HIT_SIG_SHAPE_NULL = HIT_SIG_SHAPE_NULL_STATIC
 
HitShape HIT_CSR_SHAPE_NULL = HIT_CSR_SHAPE_NULL_STATIC
 
HitShape HIT_BITMAP_SHAPE_NULL = HIT_BITMAP_SHAPE_NULL_STATIC
 
HitShape HIT_SHAPE_WHOLE = HIT_SHAPE_WHOLE_STATIC
 
HitSigShape HIT_SIG_SHAPE_WHOLE = HIT_SIG_SHAPE_WHOLE_STATIC
 
HitNameList HIT_NAMELIST_NULL = HIT_NAMELIST_NULL_STATIC
 

Detailed Description

Definition of the HitShape types for multidimensional domain shapes. Constructors and functions to manipulate them.

Version
1.1
Author
Arturo Gonzalez-Escribano
Javier Fresno Bausela
Carlos de Blas Carton
Date
Mar 2011

Definition in file hit_shape.c.

Function Documentation

void dumpShape ( HitShape  sh)

Definition at line 391 of file hit_shape.c.

void hit_nameListAdd ( HitNameList *  list,
int  x 
)

Definition at line 337 of file hit_shape.c.

Here is the caller graph for this function:

void hit_nameListClone ( HitNameList *  dst,
HitNameList *  src 
)

Definition at line 318 of file hit_shape.c.

Here is the caller graph for this function:

void hit_nameListCreate ( HitNameList *  list,
int  nelems 
)

Definition at line 301 of file hit_shape.c.

Here is the caller graph for this function:

void hit_nameListCreateInvNames ( HitNameList *  list)

Definition at line 361 of file hit_shape.c.

Here is the caller graph for this function:

void hit_nameListFree ( HitNameList  list)

Definition at line 291 of file hit_shape.c.

Here is the caller graph for this function:

int hit_nameListName2Index ( HitNameList  list,
int  name 
)

Definition at line 262 of file hit_shape.c.

Here is the caller graph for this function:

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:

void hit_shapeFree ( HitShape  s)

/* 6. HIT SHAPE FREE FUNTION Free resources of a sparse shape.

Note
The subclass HitSigShape does not allocate dynamic resources. The use of this function may be skipped for HitSigShape variables.
Parameters
[in,out]sA domain shape.

Definition at line 84 of file hit_shape.c.

Here is the call graph for this function:

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_BITMAP_SHAPE_NULL = HIT_BITMAP_SHAPE_NULL_STATIC

Null value for bitmap sparse shapes.

Definition at line 71 of file hit_shape.c.

HitShape HIT_CSR_SHAPE_NULL = HIT_CSR_SHAPE_NULL_STATIC

Null value for sparse domain shapes.

Definition at line 70 of file hit_shape.c.

HitNameList HIT_NAMELIST_NULL = HIT_NAMELIST_NULL_STATIC

Definition at line 80 of file hit_shape.c.

HitShape HIT_SHAPE_NULL = HIT_SHAPE_NULL_STATIC

/* 2. Hit SHAPE NULL CONSTANT Null value for abstract shapes.

The number of dimensions of this value is -1.

Definition at line 60 of file hit_shape.c.

HitShape HIT_SHAPE_WHOLE = HIT_SHAPE_WHOLE_STATIC

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 = HIT_SIG_SHAPE_NULL_STATIC

/** 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 = HIT_SIG_SHAPE_WHOLE_STATIC

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.