36#ifndef __YTLIB_DOUBLE_ARRAY_H
37#define __YTLIB_DOUBLE_ARRAY_H
42#include "lang/ytObject.h"
44#define ytDoubleArray_ERROR_VALUE ((size_t) -1)
52typedef struct ytDoubleArray_t {
61#define ytDoubleArray_new() ytDoubleArray_newm(__FILE__,__LINE__)
62ytDoubleArray * ytDoubleArray_newm(
const char * file,
int line);
67void ytDoubleArray_deletev(
void *
this);
69void ytDoubleArray_deleteAllv(
void *
this);
74void ytDoubleArray_dump(
const ytDoubleArray *
this, FILE * fp);
75void ytDoubleArray_dumpv(
const ytObject *
this, FILE * fp);
90double ytDoubleArray_get(
const ytDoubleArray *
this,
size_t index);
96int ytDoubleArray_sprint(
const ytDoubleArray *
this,
char * buff,
size_t size,
char * delim);
102size_t ytDoubleArray_memorySizeI(
const ytObject *
this);
103ytByte * ytDoubleArray_serializeI(
const ytObject * obj, ytByte ** pptr);
104ytByte * ytDoubleArray_serialize(
const ytDoubleArray *
this, ytByte ** pptr);
105ytDoubleArray * ytDoubleArray_deserialize(ytByte **
const pptr);
106ytObject * ytDoubleArray_deserializeI(ytByte **
const ptr);
110void ytDoubleArray_MPI_BcastI(
ytObject ** pObject,
int root, MPI_Comm comm);
void ytDoubleArray_print(const ytDoubleArray *this, FILE *fp, char *delim)
Prints the elements in the array.
Definition: ytDoubleArray.c:480
void ytDoubleArray_arrayDelete(ytDoubleArray *this, size_t size)
Deletes the array of ytDoubleArray instances.
Definition: ytDoubleArray.c:197
ytDoubleArray * ytDoubleArray_setBuffSize(ytDoubleArray *this, size_t new_size)
Changes the size of buffer.
Definition: ytDoubleArray.c:239
size_t ytDoubleArray_arrayMemSize(const ytDoubleArray *this, size_t n)
Returns the total size of memory used by the array of the array.
Definition: ytDoubleArray.c:266
void ytDoubleArray_set(ytDoubleArray *this, size_t index, double value)
Sets a value at the specified position.
Definition: ytDoubleArray.c:323
double ytDoubleArray_remove(ytDoubleArray *this, size_t index)
Definition: ytDoubleArray.c:392
void ytDoubleArray_copy(ytDoubleArray *this, const ytDoubleArray *src)
Copies values in another array into this.
Definition: ytDoubleArray.c:404
ytDoubleArray * ytDoubleArray_new()
Creates a new ytDoubleArray instance.
Definition: ytDoubleArray.c:84
size_t ytDoubleArray_memSize(const ytDoubleArray *this)
Returns the size of memory where the specified instance occupies.
Definition: ytDoubleArray.c:258
ytDoubleArray * ytDoubleArray_arrayNew(size_t size)
Creates the array of ytDoubleArray instances.
Definition: ytDoubleArray.c:180
void ytDoubleArray_insert(ytDoubleArray *this, size_t index, double value)
Inserts a value at the specified position.
Definition: ytDoubleArray.c:369
void ytDoubleArray_setSize(ytDoubleArray *this, size_t size)
Changes the size of the array.
Definition: ytDoubleArray.c:357
double ytDoubleArray_pop(ytDoubleArray *this)
Returns the last element.
Definition: ytDoubleArray.c:440
void ytDoubleArray_add(ytDoubleArray *this, double value)
Adds a value.
Definition: ytDoubleArray.c:288
void ytDoubleArray_MPI_Bcast(ytDoubleArray **pObject, int root, MPI_Comm comm)
Broadcasts the array with MPI.
Definition: ytDoubleArray.c:648
void ytDoubleArray_clear(ytDoubleArray *this)
Removes all the elements in the array.
Definition: ytDoubleArray.c:280
size_t ytDoubleArray_buffSize(const ytDoubleArray *this)
Returns the current buffer size allocated.
Definition: ytDoubleArray.c:227
size_t ytDoubleArray_find(const ytDoubleArray *this, const double v)
Returns the index of the value identical to the given one.
Definition: ytDoubleArray.c:466
void ytDoubleArray_deleteAll(ytDoubleArray *this)
Releases the array and all the elements in the array.
Definition: ytDoubleArray.c:114
ytDoubleArray * ytDoubleArray_clone(const ytDoubleArray *this)
Returns the clone of this ytDoubleArray instance.
Definition: ytDoubleArray.c:138
void ytDoubleArray_copyArray(ytDoubleArray *this, size_t index, const double *array, size_t size)
Copies values in an array into this array.
Definition: ytDoubleArray.c:418
ytObject * ytDoubleArray_cloneI(const ytObject *this)
Returns the clone of this ytDoubleArray instance.
Definition: ytDoubleArray.c:153
void ytDoubleArray_sort(ytDoubleArray *this)
Sorts the elements in ascending order.
Definition: ytDoubleArray.c:457