ref: 6ede3abe1c4ed8d853547d116fb732380661a536
parent: 4f2c28cb07149d6a9fc080ecdcb1a04f66d6011f
author: Paul Brossier <piem@piem.org>
date: Tue Dec 17 20:29:16 EST 2013
src/lvec.h: clean up lvec api
--- a/src/lvec.c
+++ b/src/lvec.c
@@ -39,7 +39,7 @@
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 @@
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 @@
#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.);
}
--- a/src/lvec.h
+++ b/src/lvec.h
@@ -57,36 +57,26 @@
*/
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.
-
\param s vector to read from
\param position sample position to read from
*/
-lsmp_t lvec_read_sample(lvec_t *s, uint_t position);
+lsmp_t lvec_get_sample(lvec_t *s, uint_t position);
+
/** write sample value in a buffer
- 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.
-
\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 @@
\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