#include "aubio_priv.h"
#include "cvec.h"
-cvec_t * new_cvec( uint_t length) {
+cvec_t * new_cvec(uint_t length) {
cvec_t * s;
if ((sint_t)length <= 0) {
return NULL;
return s->phas[position];
}
-smpl_t * cvec_norm_get_data (cvec_t *s) {
+smpl_t * cvec_norm_get_data (const cvec_t *s) {
return s->norm;
}
-smpl_t * cvec_phas_get_data (cvec_t *s) {
+smpl_t * cvec_phas_get_data (const cvec_t *s) {
return s->phas;
}
/* helper functions */
-void cvec_print(cvec_t *s) {
+void cvec_print(const cvec_t *s) {
uint_t j;
AUBIO_MSG("norm: ");
for (j=0; j< s->length; j++) {
AUBIO_MSG("\n");
}
-void cvec_copy(cvec_t *s, cvec_t *t) {
+void cvec_copy(const cvec_t *s, cvec_t *t) {
if (s->length != t->length) {
AUBIO_ERR("trying to copy %d elements to %d elements \n",
s->length, t->length);
\param s vector to read from
*/
-smpl_t * cvec_norm_get_data (cvec_t *s);
+smpl_t * cvec_norm_get_data (const cvec_t *s);
/** read phase data from a complex buffer
\param s vector to read from
*/
-smpl_t * cvec_phas_get_data (cvec_t *s);
+smpl_t * cvec_phas_get_data (const cvec_t *s);
/** print out cvec data
\param s vector to print out
*/
-void cvec_print(cvec_t *s);
+void cvec_print(const cvec_t *s);
/** make a copy of a vector
\param t vector to copy to
*/
-void cvec_copy(cvec_t *s, cvec_t *t);
+void cvec_copy(const cvec_t *s, cvec_t *t);
/** set all norm elements to a given value
s->data[channel][position] = data;
}
-smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position) {
+smpl_t fmat_get_sample(const fmat_t *s, uint_t channel, uint_t position) {
return s->data[channel][position];
}
-void fmat_get_channel(fmat_t *s, uint_t channel, fvec_t *output) {
+void fmat_get_channel(const fmat_t *s, uint_t channel, fvec_t *output) {
output->data = s->data[channel];
output->length = s->length;
return;
}
-smpl_t * fmat_get_channel_data(fmat_t *s, uint_t channel) {
+smpl_t * fmat_get_channel_data(const fmat_t *s, uint_t channel) {
return s->data[channel];
}
-smpl_t ** fmat_get_data(fmat_t *s) {
+smpl_t ** fmat_get_data(const fmat_t *s) {
return s->data;
}
/* helper functions */
-void fmat_print(fmat_t *s) {
+void fmat_print(const fmat_t *s) {
uint_t i,j;
for (i=0; i< s->height; i++) {
for (j=0; j< s->length; j++) {
}
}
-void fmat_weight(fmat_t *s, fmat_t *weight) {
+void fmat_weight(fmat_t *s, const fmat_t *weight) {
uint_t i,j;
uint_t length = MIN(s->length, weight->length);
for (i=0; i< s->height; i++) {
}
}
-void fmat_copy(fmat_t *s, fmat_t *t) {
+void fmat_copy(const fmat_t *s, fmat_t *t) {
uint_t i;
#if !HAVE_MEMCPY_HACKS
uint_t j;
#endif
}
-void fmat_vecmul(fmat_t *s, fvec_t *scale, fvec_t *output) {
+void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output) {
uint_t k;
#if 0
assert(s->height == output->length);
\param position sample position to read from
*/
-smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position);
+smpl_t fmat_get_sample(const fmat_t *s, uint_t channel, uint_t position);
/** write sample value in a buffer
\param output ::fvec_t to output to
*/
-void fmat_get_channel (fmat_t *s, uint_t channel, fvec_t *output);
+void fmat_get_channel (const fmat_t *s, uint_t channel, fvec_t *output);
/** get vector buffer from an fmat data
\param channel channel to read from
*/
-smpl_t * fmat_get_channel_data (fmat_t *s, uint_t channel);
+smpl_t * fmat_get_channel_data (const fmat_t *s, uint_t channel);
/** read data from a buffer
\param s vector to read from
*/
-smpl_t ** fmat_get_data(fmat_t *s);
+smpl_t ** fmat_get_data(const fmat_t *s);
/** print out fmat data
\param s vector to print out
*/
-void fmat_print(fmat_t *s);
+void fmat_print(const fmat_t *s);
/** set all elements to a given value
\param weight weighting coefficients
*/
-void fmat_weight(fmat_t *s, fmat_t *weight);
+void fmat_weight(fmat_t *s, const fmat_t *weight);
/** make a copy of a matrix
\param t vector to copy to
*/
-void fmat_copy(fmat_t *s, fmat_t *t);
+void fmat_copy(const fmat_t *s, fmat_t *t);
/* compute the product of a matrix by a vector
\param output vector to store restults in
*/
-void fmat_vecmul(fmat_t *s, fvec_t *scale, fvec_t *output);
+void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output);
#ifdef __cplusplus
}
#include "aubio_priv.h"
#include "fvec.h"
-fvec_t * new_fvec( uint_t length) {
+fvec_t * new_fvec(uint_t length) {
fvec_t * s;
if ((sint_t)length <= 0) {
return NULL;
s->data[position] = data;
}
-smpl_t fvec_get_sample(fvec_t *s, uint_t position) {
+smpl_t fvec_get_sample(const fvec_t *s, uint_t position) {
return s->data[position];
}
-smpl_t * fvec_get_data(fvec_t *s) {
+smpl_t * fvec_get_data(const fvec_t *s) {
return s->data;
}
/* helper functions */
-void fvec_print(fvec_t *s) {
+void fvec_print(const fvec_t *s) {
uint_t j;
for (j=0; j< s->length; j++) {
AUBIO_MSG(AUBIO_SMPL_FMT " ", s->data[j]);
}
}
-void fvec_weight(fvec_t *s, fvec_t *weight) {
+void fvec_weight(fvec_t *s, const fvec_t *weight) {
#ifndef HAVE_ACCELERATE
uint_t j;
uint_t length = MIN(s->length, weight->length);
#endif /* HAVE_ACCELERATE */
}
-void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out) {
+void fvec_weighted_copy(const fvec_t *in, const fvec_t *weight, fvec_t *out) {
#ifndef HAVE_ACCELERATE
uint_t j;
uint_t length = MIN(out->length, weight->length);
#endif /* HAVE_ACCELERATE */
}
-void fvec_copy(fvec_t *s, fvec_t *t) {
+void fvec_copy(const fvec_t *s, fvec_t *t) {
if (s->length != t->length) {
AUBIO_ERR("trying to copy %d elements to %d elements \n",
s->length, t->length);
\param position sample position to read from
*/
-smpl_t fvec_get_sample(fvec_t *s, uint_t position);
+smpl_t fvec_get_sample(const fvec_t *s, uint_t position);
/** write sample value in a buffer
\param s vector to read from
*/
-smpl_t * fvec_get_data(fvec_t *s);
+smpl_t * fvec_get_data(const fvec_t *s);
/** print out fvec data
\param s vector to print out
*/
-void fvec_print(fvec_t *s);
+void fvec_print(const fvec_t *s);
/** set all elements to a given value
\param weight weighting coefficients
*/
-void fvec_weight(fvec_t *s, fvec_t *weight);
+void fvec_weight(fvec_t *s, const fvec_t *weight);
/** make a copy of a vector
\param t vector to copy to
*/
-void fvec_copy(fvec_t *s, fvec_t *t);
+void fvec_copy(const fvec_t *s, fvec_t *t);
/** make a copy of a vector, applying weights to each element
\param out output vector
*/
-void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out);
+void fvec_weighted_copy(const fvec_t *in, const fvec_t *weight, fvec_t *out);
#ifdef __cplusplus
}
#include "aubio_priv.h"
#include "lvec.h"
-lvec_t * new_lvec( uint_t length) {
+lvec_t * new_lvec(uint_t length) {
lvec_t * s;
if ((sint_t)length <= 0) {
return NULL;
return s->data[position];
}
-lsmp_t * lvec_get_data(lvec_t *s) {
+lsmp_t * lvec_get_data(const lvec_t *s) {
return s->data;
}
/* helper functions */
-void lvec_print(lvec_t *s) {
+void lvec_print(const lvec_t *s) {
uint_t j;
for (j=0; j< s->length; j++) {
AUBIO_MSG(AUBIO_LSMP_FMT " ", s->data[j]);
\param s vector to read from
*/
-lsmp_t * lvec_get_data(lvec_t *s);
+lsmp_t * lvec_get_data(const lvec_t *s);
/** print out lvec data
\param s vector to print out
*/
-void lvec_print(lvec_t *s);
+void lvec_print(const lvec_t *s);
/** set all elements to a given value