Go to the source code of this file.
Data Structures | |
struct | DoubleArray |
Defines | |
#define | DOUBLEARRAY_VERSION "1.1.0" |
#define | DOUBLEARRAY_DATE "23-Jun-2003" |
Typedefs | |
typedef DoubleArray * | DoubleArrayPtr |
A pointer to structure DoubleArray is assigned the name DoubleArrayPtr . | |
Functions | |
DoubleArrayPtr | DoubleArray_create (const int numberOfElements) |
Creates a DoubleArray structure. | |
DoubleArrayPtr | DoubleArray_createWithIdentifier (const int numberOfElements, const int identifier) |
Creates a DoubleArray structure with an identifier. | |
void | DoubleArray_destroy (DoubleArrayPtr dAPtr) |
Destroys a structure DoubleArray. | |
void | DoubleArray_display (void *dAPtr, FILE *outputStream) |
Displays a structure DoubleArray. | |
void | DoubleArray_displayIntegers (const DoubleArrayPtr dAPtr, FILE *outputStream) |
Displays a structure DoubleArray. | |
DoubleArrayPtr | DoubleArray_copy (const DoubleArrayPtr dAPtr) |
Copies a structure DoubleArray. | |
int | DoubleArray_getIdentifier (const DoubleArrayPtr dAPtr) |
Returns the identifier of a structure DoubleArray. | |
int | DoubleArray_getNumberOfElements (const DoubleArrayPtr dAPtr) |
Returns the number of elements of a structure DoubleArray. | |
void | DoubleArray_setValue (const DoubleArrayPtr dAPtr, const int index, const double value) |
The element with index index of structure DoubleArray is assigned the value value . | |
double | DoubleArray_getValue (const DoubleArrayPtr dAPtr, const int index) |
The value of the element with index index of structure DoubleArray is returned. | |
DoubleArrayPtr | DoubleArray_calculateMeanAndSd (const DoubleArrayPtr dAPtr) |
The mean and standard deviation of the values contained in one DoubleArray is calculated. | |
int | DoubleArray_lessThan (void *dAPtr1, void *dAPtr2) |
Evaluates if the first value of dAPtr1 is less than that of dAPtr2 . |
This structure provides a fault-tolerant way to store several double values. The individual values are accessed via their index starting from zero. Therefore, the index of the element with the highest index number is one less than numberOfElements
. The memory allocation of the structure is managed via the DoubleArray_create and DoubleArray_destroy functions.
The structure is created with DoubleArray_create, destroyed with DoubleArray_destroy and displayed with DoubleArray_display. The structure could also be displayed with function DoubleArray_displayIntegers; the individual values of the elements are than treated as integers. It could be copied with the function DoubleArray_copy. The number of elements of a structure could be found out via DoubleArray_getNumberOfElements. Elements could be assigned values with DoubleArray_setValue and the value of an element could be obtained with DoubleArray_getValue.
If an element is accessed via DoubleArray_setValue or DoubleArray_getValue and the index is higher than numberOfElements
- 1 (maximum index of this structure) the define IndexOutOfBoundsError is called and the program aborts.
Description of the members:
value
- the double values of the structure
numberOfElements
- number of elements in the structure
05/20/2003 - Uli Fechner - added function DoubleArray_calculateMeanAndSd
05/22/2003 - Uli Fechner - added the member identifier
und the functions DoubleArray_createWithIdentifier and DoubleArray_getIdentifier; adjusted the function DoubleArray_copy accordingly
05/23/2003 - Uli Fechner - SPECIAL MODIFICATION for the RankIt program: added function DoubleArray_lessThan
06/16/2003 - v1.0.1 - Uli Fechner - SPECIAL MODIFICATION for the RankIt program: several adjustments in function DoubleArray_calculateMeanAndSd
06/23/2003 - v1.1.0 - Uli Fechner - bugfix in function DoubleArray_calculateMeanAndSd \code
Definition in file doubleArray.c.
|
Definition at line 3 of file doubleArray.c. Referenced by displayVersionInformation(). |
|
Definition at line 2 of file doubleArray.c. Referenced by displayVersionInformation(). |
|
A pointer to structure DoubleArray is assigned the name
Definition at line 53 of file doubleArray.c. Referenced by DoubleArray_calculateMeanAndSd(), DoubleArray_copy(), DoubleArray_create(), DoubleArray_createWithIdentifier(), getFileProperties(), and readDataFromStream(). |
|
The mean and standard deviation of the values contained in one DoubleArray is calculated. The return value of this function is a DoubleArrayPtr. The corresponding DoubleArray contains two values:
Definition at line 361 of file doubleArray.c. References BOOLEAN_FALSE, BOOLEAN_TRUE, DoubleArray_create(), DoubleArray_getNumberOfElements(), DoubleArray_getValue(), DoubleArray_setValue(), and DoubleArrayPtr. |
|
Copies a structure DoubleArray.
A copy of the structure DoubleArray referred to by
Definition at line 191 of file doubleArray.c. References AbortProgram, DoubleArray_getIdentifier(), DoubleArray_getNumberOfElements(), DoubleArray_getValue(), DoubleArray_setValue(), DoubleArrayPtr, DoubleArray::identifier, MemoryError, DoubleArray::numberOfElements, and DoubleArray::value. |
|
Creates a DoubleArray structure. A DoubleArray structure is created. The number of elements of the structure is given as an argument and is not dynamic during the lifetime of a structure DoubleArray.
Definition at line 95 of file doubleArray.c. References DoubleArrayPtr, MemoryError, DoubleArray::numberOfElements, and DoubleArray::value. Referenced by DoubleArray_calculateMeanAndSd(), and getFileProperties(). |
|
Creates a DoubleArray structure with an identifier. A DoubleArray structure is created. The number of elements of the structure is given as an argument and is not dynamic during the lifetime of a structure DoubleArray. The second argument is an integer that serves as a unique identifier of this DoubleArray. This function for the creation of a DoubleArray is useful, if the DoubleArray is part of an array of DoubleArrays.
Definition at line 131 of file doubleArray.c. References DoubleArrayPtr, DoubleArray::identifier, MemoryError, DoubleArray::numberOfElements, and DoubleArray::value. |
|
Destroys a structure DoubleArray.
The structure DoubleArray the pointer
Definition at line 163 of file doubleArray.c. References AbortProgram, and DoubleArray::value. |
|
Displays a structure DoubleArray.
The structure DoubleArray the pointer
Definition at line 234 of file doubleArray.c. References AbortProgram, DoubleArray_getNumberOfElements(), and DoubleArray_getValue(). |
|
Displays a structure DoubleArray.
The structure DoubleArray the pointer
Definition at line 260 of file doubleArray.c. References AbortProgram, DoubleArray_getNumberOfElements(), and DoubleArray_getValue(). |
|
Returns the identifier of a structure DoubleArray.
Definition at line 284 of file doubleArray.c. References DoubleArray::identifier. Referenced by DoubleArray_copy(). |
|
Returns the number of elements of a structure DoubleArray.
The number of elements of the structure DoubleArray the pointer
Definition at line 298 of file doubleArray.c. References DoubleArray::numberOfElements. Referenced by DoubleArray_calculateMeanAndSd(), DoubleArray_copy(), DoubleArray_display(), DoubleArray_displayIntegers(), DoubleArray_getValue(), and DoubleArray_setValue(). |
|
The value of the element with index
The value of the element with index
Definition at line 336 of file doubleArray.c. References DoubleArray_getNumberOfElements(), IndexOutOfBoundsError, and DoubleArray::value. Referenced by DoubleArray_calculateMeanAndSd(), DoubleArray_copy(), DoubleArray_display(), DoubleArray_displayIntegers(), DoubleArray_lessThan(), and readDataFromStream(). |
|
Evaluates if the
The function returns BOOLEAN_TRUE if the
Definition at line 422 of file doubleArray.c. References BOOLEAN_FALSE, BOOLEAN_TRUE, and DoubleArray_getValue(). |
|
The element with index
The value
Definition at line 316 of file doubleArray.c. References DoubleArray_getNumberOfElements(), IndexOutOfBoundsError, and DoubleArray::value. Referenced by DoubleArray_calculateMeanAndSd(), DoubleArray_copy(), and getFileProperties(). |