Data Structures | Functions

ne_dyn_vec.h File Reference

Vector type data type and associated functions allocate, free and manipulate contents. More...

Go to the source code of this file.

Data Structures

struct  ne_dyn_vec_t
 Vector data type for simulation output. More...

Functions

ne_dyn_vec_tne_dyn_vec_alloc (int dataSize)
 Allocate memory for a new vector.
void ne_dyn_vec_free (ne_dyn_vec_t *vec)
 Free memory used by the vector.
void ne_dyn_vec_append_item (ne_dyn_vec_t *vec, double *data)
 Append an item of data (simulation) to the vector.
int ne_dyn_vec_extend_fn (int curSize)
 Calculate the new extended length of the vector.

Detailed Description

Vector type data type and associated functions allocate, free and manipulate contents.

Each element which is of a fixed size is held in a distibuted manner allowing for only pointers to be adjusted when the size changes.

Author:
T.E. Gorochowski

Definition in file ne_dyn_vec.h.


Function Documentation

ne_dyn_vec_t* ne_dyn_vec_alloc ( int  dataSize  ) 

Allocate memory for a new vector.

Initial size is 20. Should be freed using ne_dyn_vec_free.

Definition at line 27 of file ne_dyn_vec.c.

void ne_dyn_vec_append_item ( ne_dyn_vec_t vec,
double *  data 
)

Append an item of data (simulation) to the vector.

Definition at line 69 of file ne_dyn_vec.c.

int ne_dyn_vec_extend_fn ( int  curSize  ) 

Calculate the new extended length of the vector.

Definition at line 113 of file ne_dyn_vec.c.

void ne_dyn_vec_free ( ne_dyn_vec_t vec  ) 

Free memory used by the vector.

Definition at line 49 of file ne_dyn_vec.c.