src/lvec.h: clean up lvec api
authorPaul Brossier <piem@piem.org>
Wed, 18 Dec 2013 06:29:16 +0000 (01:29 -0500)
committerPaul Brossier <piem@piem.org>
Wed, 18 Dec 2013 06:29:16 +0000 (01:29 -0500)
src/lvec.c
src/lvec.h

index 69d0f03..a97fd8b 100644 (file)
@@ -39,7 +39,7 @@ void del_lvec(lvec_t *s) {
 void lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position) {
   s->data[position] = data;
 }
-lsmp_t lvec_read_sample(lvec_t *s, uint_t position) {
+lsmp_t lvec_get_sample(lvec_t *s, uint_t position) {
   return s->data[position];
 }
 
@@ -57,7 +57,7 @@ void lvec_print(lvec_t *s) {
   AUBIO_MSG("\n");
 }
 
-void lvec_set(lvec_t *s, smpl_t val) {
+void lvec_set_all (lvec_t *s, smpl_t val) {
   uint_t j;
   for (j=0; j< s->length; j++) {
     s->data[j] = val;
@@ -68,11 +68,11 @@ void lvec_zeros(lvec_t *s) {
 #if HAVE_MEMCPY_HACKS
   memset(s->data, 0, s->length * sizeof(lsmp_t));
 #else
-  lvec_set(s, 0.);
+  lvec_set_all (s, 0.);
 #endif
 }
 
 void lvec_ones(lvec_t *s) {
-  lvec_set(s, 1.);
+  lvec_set_all (s, 1.);
 }
 
index 80d4aa6..c5750f1 100644 (file)
@@ -57,36 +57,26 @@ lvec_t * new_lvec(uint_t length);
 
 */
 void del_lvec(lvec_t *s);
-/** read sample value in a buffer
 
-  Note that this function is not used in the aubio library, since the same
-  result can be obtained using vec->data[position]. Its purpose is to
-  access these values from wrappers, as created by swig.
+/** read sample value in a buffer
 
   \param s vector to read from
   \param position sample position to read from 
 
 */
-lsmp_t lvec_read_sample(lvec_t *s, uint_t position);
-/** write sample value in a buffer
+lsmp_t lvec_get_sample(lvec_t *s, uint_t position);
 
-  Note that this function is not used in the aubio library, since the same
-  result can be obtained by assigning vec->data[position]. Its purpose
-  is to access these values from wrappers, as created by swig.
+/** write sample value in a buffer
 
   \param s vector to write to 
   \param data value to write in s->data[position]
   \param position sample position to write to 
 
 */
-void  lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position);
+void  lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position);
 
 /** read data from a buffer
 
-  Note that this function is not used in the aubio library, since the same
-  result can be obtained with vec->data. Its purpose is to access these values
-  from wrappers, as created by swig.
-
   \param s vector to read from
 
 */
@@ -105,7 +95,7 @@ void lvec_print(lvec_t *s);
   \param val value to set elements to
 
 */
-void lvec_set(lvec_t *s, smpl_t val);
+void lvec_set_all(lvec_t *s, smpl_t val);
 
 /** set all elements to zero