| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef VL_ARRAY_H |
| #define VL_ARRAY_H |
|
|
| #include "generic.h" |
|
|
| |
| #define VL_ARRAY_MAX_NUM_DIMENSIONS 16 |
|
|
| |
| typedef struct _VlArray |
| { |
| vl_type type ; |
| vl_bool isEnvelope ; |
| vl_bool isSparse ; |
| vl_size numDimensions ; |
| vl_size dimensions [VL_ARRAY_MAX_NUM_DIMENSIONS] ; |
| void * data ; |
| void * rowPointers ; |
| void * columnPointers ; |
| } VlArray ; |
|
|
|
|
| |
| |
|
|
| |
| |
| |
| |
|
|
| VL_INLINE vl_size |
| vl_array_get_num_dimensions (VlArray const * self) |
| { |
| return self->numDimensions ; |
| } |
|
|
| |
| |
| |
| |
|
|
| VL_INLINE vl_size const * |
| vl_array_get_dimensions (VlArray const * self) |
| { |
| return self->dimensions ; |
| } |
|
|
| |
| |
| |
| |
|
|
| VL_INLINE void * |
| vl_array_get_data (VlArray const * self) |
| { |
| return self->data; |
| } |
|
|
| |
| |
| |
| |
|
|
| VL_INLINE vl_type |
| vl_array_get_data_type (VlArray const * self) |
| { |
| return self->type ; |
| } |
|
|
| VL_EXPORT vl_size vl_array_get_num_elements (VlArray const * self) ; |
|
|
| |
|
|
| |
| |
|
|
| VL_EXPORT VlArray * vl_array_init (VlArray * self, vl_type type, vl_size numDimension, vl_size const * dimensions) ; |
| VL_EXPORT VlArray * vl_array_init_envelope (VlArray *self, void * data, vl_type type, vl_size numDimension, vl_size const * dimensions) ; |
| VL_EXPORT VlArray * vl_array_init_matrix (VlArray * self, vl_type type, vl_size numRows, vl_size numColumns) ; |
| VL_EXPORT VlArray * vl_array_init_matrix_envelope (VlArray * self, void * data, vl_type type, vl_size numRows, vl_size numColumns) ; |
|
|
| VL_EXPORT VlArray * vl_array_new (vl_type type, vl_size numDimension, vl_size const * dimensions) ; |
| VL_EXPORT VlArray * vl_array_new_envelope (void * data, vl_type type, vl_size numDimension, vl_size const * dimensions) ; |
| VL_EXPORT VlArray * vl_array_new_matrix (vl_type type, vl_size numRows, vl_size numColumns) ; |
| VL_EXPORT VlArray * vl_array_new_matrix_envelope (void * data, vl_type type, vl_size numRows, vl_size numColumns) ; |
|
|
| VL_EXPORT void vl_array_dealloc (VlArray * self) ; |
| VL_EXPORT void vl_array_delete (VlArray * self) ; |
| |
|
|
| |
| #endif |
|
|