|
#define | YTLIB_INT_ARRAY_DEFAULT_EXPAND_SIZE 16 |
| Expandable int Array.
|
|
ytIntArray * | ytIntArray_new () |
| Creates a new ytIntArray instance.
|
|
void | ytIntArray_deleteAll (ytIntArray *this) |
| Releases the array and all the elements in the array.
|
|
ytIntArray * | ytIntArray_clone (const ytIntArray *this) |
| Returns the clone of this ytIntArray instance.
|
|
ytObject * | ytIntArray_cloneI (const ytObject *this) |
| Returns the clone of this ytIntArray instance.
|
|
ytIntArray * | ytIntArray_arrayNew (size_t size) |
| Creates the array of ytIntArray instances.
|
|
void | ytIntArray_arrayDelete (ytIntArray *this, size_t size) |
| Deletes the array of ytIntArray instances.
|
|
size_t | ytIntArray_buffSize (const ytIntArray *this) |
| Returns the current buffer size allocated.
|
|
ytIntArray * | ytIntArray_setBuffSize (ytIntArray *this, size_t new_size) |
| Changes the size of buffer.
|
|
size_t | ytIntArray_memSize (const ytIntArray *this) |
| Returns the size of memory where the specified instance occupies.
|
|
size_t | ytIntArray_arrayMemSize (const ytIntArray *this, size_t n) |
| Returns the total size of memory used by the array of the array.
|
|
void | ytIntArray_clear (ytIntArray *this) |
| Removes all the elements in the array.
|
|
void | ytIntArray_add (ytIntArray *this, int value) |
| Adds a value.
|
|
void | ytIntArray_set (ytIntArray *this, size_t index, int value) |
| Sets a value at the specified position.
|
|
void | ytIntArray_setSize (ytIntArray *this, size_t size) |
| Changes the size of the array.
|
|
void | ytIntArray_insert (ytIntArray *this, size_t index, int value) |
| Inserts a value at the specified position.
|
|
int | ytIntArray_remove (ytIntArray *this, size_t index) |
|
void | ytIntArray_copy (ytIntArray *this, const ytIntArray *src) |
| Copies values in another array into this.
|
|
void | ytIntArray_copyArray (ytIntArray *this, size_t index, const int *array, size_t size) |
| Copies values in an array into this array.
|
|
int | ytIntArray_pop (ytIntArray *this) |
| Returns the last element.
|
|
void | ytIntArray_sort (ytIntArray *this) |
| Sorts the elements in ascending order.
|
|
size_t | ytIntArray_find (const ytIntArray *this, const int v) |
| Returns the index of the value identical to the given one.
|
|
void | ytIntArray_print (const ytIntArray *this, FILE *fp, char *delim) |
| Prints the elements in the array.
|
|
void | ytIntArray_MPI_Bcast (ytIntArray **pObject, int root, MPI_Comm comm) |
| Broadcasts the array with MPI.
|
|
void ytIntArray_MPI_Bcast |
( |
ytIntArray ** |
pObject, |
|
|
int |
root, |
|
|
MPI_Comm |
comm |
|
) |
| |
Broadcasts the array with MPI.
This is available only for the MPI-enabled ytLib.
This allocates working memory whose size is the same as the total memory required for storing all the elements in the array.
This calls MPI_Ibcast() three times internally.
- Parameters
-
pObject | pointer to the array instance. in receiving ranks, the new instance is generated and set to the original pointer (*pObject ). |
void ytIntArray_setSize |
( |
ytIntArray * |
this, |
|
|
size_t |
size |
|
) |
| |
Changes the size of the array.
If the specified size is larger than the current size, new elements are not initialized.
If the specified size is less than the current size, this does not free the allocated memory. Instead, this simply changes the current size without changing any elements in the array.
- Parameters
-
this | |
size | =================================================== |