00001 #ifndef NPS_S8F8_SVEC_H 00002 #define NPS_S8F8_SVEC_H 00003 00004 #include "../bio/ty.h" 00005 #include <stdint.h> 00006 /* 00007 Sparse vectors are immutable, and and sorted by index 00008 There is no repetition amongst the indices 00009 00010 The struct exists to contain the data. The functions that act on the data will be 00011 BLAS-like and take the constituents as arguments. 00012 00013 */ 00014 00015 typedef struct { 00016 /* char sorted; */ 00017 int64_t count; /* reference count */ 00018 int64_t sz; 00019 int64_t *ix; 00020 double * vals; 00021 } s8f8_svec_t; 00022 00023 s8f8_svec_t *s8f8_svec_alloc(int64_t sz, int64_t *ix, double *vals); 00024 00025 /* frees ix/vals as well */ 00026 void s8f8_svec_free(s8f8_svec_t *o); 00027 00028 /* clone */ 00029 s8f8_svec_t *s8f8_svec_clone_unsafe(s8f8_svec_t *o); 00030 00031 00032 00033 #endif