DynamicDoubleArray.h 850 字节
Newer Older
T
tickduan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/**
 *  @file DynamicDoubleArray.h
 *  @author Sheng Di
 *  @date April, 2016
 *  @brief Header file for Dynamic Double Array.
 *  (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#ifndef _DynamicDoubleArray_H
#define _DynamicDoubleArray_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>

typedef struct DynamicDoubleArray
{	
	double* array;
	size_t size;
	double capacity;
} DynamicDoubleArray;

void new_DDA(DynamicDoubleArray **dda, size_t cap);
void convertDDAtoDoubles(DynamicDoubleArray *dba, double **data);
void free_DDA(DynamicDoubleArray *dda);
double getDDA_Data(DynamicDoubleArray *dda, size_t pos);
void addDDA_Data(DynamicDoubleArray *dda, double value);

#ifdef __cplusplus
}
#endif

#endif /* ----- #ifndef _DynamicDoubleArray_H  ----- */