Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef VL_ARRAY_H
00015 #define VL_ARRAY_H
00016
00017 #include "generic.h"
00018
00020 #define VL_ARRAY_MAX_NUM_DIMENSIONS 16
00021
00023 typedef struct _VlArray
00024 {
00025 vl_type type ;
00026 vl_bool isEnvelope ;
00027 vl_bool isSparse ;
00028 vl_size numDimensions ;
00029 vl_size dimensions [VL_ARRAY_MAX_NUM_DIMENSIONS] ;
00030 void * data ;
00031 void * rowPointers ;
00032 void * columnPointers ;
00033 } VlArray ;
00034
00035
00044 VL_INLINE vl_size
00045 vl_array_get_num_dimensions (VlArray const * self)
00046 {
00047 return self->numDimensions ;
00048 }
00049
00055 VL_INLINE vl_size const *
00056 vl_array_get_dimensions (VlArray const * self)
00057 {
00058 return self->dimensions ;
00059 }
00060
00066 VL_INLINE void *
00067 vl_array_get_data (VlArray const * self)
00068 {
00069 return self->data;
00070 }
00071
00077 VL_INLINE vl_type
00078 vl_array_get_data_type (VlArray const * self)
00079 {
00080 return self->type ;
00081 }
00082
00083 VL_EXPORT vl_size vl_array_get_num_elements (VlArray const * self) ;
00084
00090 VL_EXPORT VlArray * vl_array_init (VlArray * self, vl_type type, vl_size numDimension, vl_size const * dimensions) ;
00091 VL_EXPORT VlArray * vl_array_init_envelope (VlArray *self, void * data, vl_type type, vl_size numDimension, vl_size const * dimensions) ;
00092 VL_EXPORT VlArray * vl_array_init_matrix (VlArray * self, vl_type type, vl_size numRows, vl_size numColumns) ;
00093 VL_EXPORT VlArray * vl_array_init_matrix_envelope (VlArray * self, void * data, vl_type type, vl_size numRows, vl_size numColumns) ;
00094
00095 VL_EXPORT VlArray * vl_array_new (vl_type type, vl_size numDimension, vl_size const * dimensions) ;
00096 VL_EXPORT VlArray * vl_array_new_envelope (void * data, vl_type type, vl_size numDimension, vl_size const * dimensions) ;
00097 VL_EXPORT VlArray * vl_array_new_matrix (vl_type type, vl_size numRows, vl_size numColumns) ;
00098 VL_EXPORT VlArray * vl_array_new_matrix_envelope (void * data, vl_type type, vl_size numRows, vl_size numColumns) ;
00099
00100 VL_EXPORT void vl_array_dealloc (VlArray * self) ;
00101 VL_EXPORT void vl_array_delete (VlArray * self) ;
00104
00105 #endif