Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Arrays


Detailed Description

Implementation of an array container.

An array is a matrix-like data structure with an arbitrary (but fixed) dimension and arbitrary (but fixed) size. Items are accessed by a tuple of indices in constant time. Some of the functions of this module use a variable number of arguments like

The defined dimension constructing and array with arrayNew() must match the number of indices you provide to arraySetElement() and arrayElement().

Data Structures

Functions


Function Documentation

Array arrayClone Array  a  ) 
 

copy an array into a new one.

Parameters:
a is the source for the cloning
Returns:
a new cloned array
Definition at line 107 of file array.c.

References vectorClone().

void arrayDelete Array  a  ) 
 

deletes an array.

Any future access to the array is illegal. Note that this function does not free the memory from the items contained in the array.

Parameters:
a the array to be deleted.
Definition at line 130 of file array.c.

References vectorDelete().

int arrayDimension Array  a,
int  dim
 

returns value for dimension dim.

Parameters:
a the array whose dimension has to be retrieved.
dim the dimension in which the size of the array has to be retrieved.
Returns:
the size of the array in the specified dimension.
Definition at line 230 of file array.c.

References vectorElement(), and vectorSize().

Pointer arrayElement Array  a,
  ...
 

retrieves an array element.

Parameters:
a the array from which an element has to be retrieved.
... the indices that define which element has to be retrieved.
Returns:
the element identified by the indices.
Definition at line 198 of file array.c.

References vectorElement(), and vectorSize().

Array arrayNew int  i,
  ...
 

creates and returns a new vector.

This function constructs a new array with an arbitrary number of dimensions.

Parameters:
i the first array dimension
... optional more dimensions
Returns:
a new Array
Definition at line 69 of file array.c.

References vectorAddElement(), and vectorNew().

void arraySetAllElements Array  a,
Pointer  new
 

sets all array element to a new value

Parameters:
a the array whose values should be set to a new value
new the new value to which all the elements of the array have to be set to.
Definition at line 183 of file array.c.

Pointer arraySetElement Array  a,
Pointer  new,
  ...
 

sets an array element to a new value.

Parameters:
a the array whose element should be set to a new value.
new the new value to which the element must be set to.
... the index of the new element in the array.
Returns:
the old value of the element
Definition at line 150 of file array.c.

References vectorElement(), and vectorSize().


BLAH 0.95 (20 Oct 2004)