Constant vectors | |
typedef void * | Vec |
typedef double * | vec |
typedef int * | ivec |
typedef byte * | bvec |
typedef cplx * | cvec |
vec const | vec_null |
ivec const | ivec_null |
bvec const | bvec_null |
cvec const | cvec_null |
Basic vector allocation, initialization and deletion | |
vec | vec_new_alloc (idx_t length, idx_t length_max) |
ivec | ivec_new_alloc (idx_t length, idx_t length_max) |
bvec | bvec_new_alloc (idx_t length, idx_t length_max) |
cvec | cvec_new_alloc (idx_t length, idx_t length_max) |
#define | Vec_new_alloc(type_t, N, length_max) ((type_t *) __Vec_new_alloc(sizeof(type_t), N, length_max )) |
Vec | __Vec_new (size_t elem_size, idx_t N) |
vec | vec_new (idx_t length) |
ivec | ivec_new (idx_t length) |
bvec | bvec_new (idx_t length) |
cvec | cvec_new (idx_t length) |
#define | Vec_new(type_t, N) ((type_t *) __Vec_new( sizeof(type_t), N )) |
void | vec_delete (vec v) |
void | ivec_delete (ivec v) |
void | bvec_delete (bvec v) |
void | cvec_delete (cvec v) |
#define | Vec_delete(v) free( Vec_header(v).ptr ) |
Length and max length vector operations | |
idx_t | vec_length (vec v) |
idx_t | ivec_length (ivec v) |
idx_t | bvec_length (bvec v) |
idx_t | cvec_length (cvec v) |
#define | Vec_length(v) ( Vec_header(v).length ) |
idx_t | vec_length_max (vec v) |
idx_t | ivec_length_max (ivec v) |
idx_t | bvec_length_max (bvec v) |
idx_t | cvec_length_max (cvec v) |
#define | Vec_length_max(v) ( Vec_header(v).length_max ) |
vec | _vec_set_length_max (vec v, idx_t N) |
ivec | _ivec_set_length_max (ivec v, idx_t N) |
bvec | _bvec_set_length_max (bvec v, idx_t N) |
cvec | _cvec_set_length_max (cvec v, idx_t N) |
#define | Vec_set_length_max(v, N) |
#define | vec_set_length_max(v, N) do { v=_vec_set_length_max( v, N ); } while (0) |
#define | ivec_set_length_max(v, N) do { v=_ivec_set_length_max( v, N ); } while (0) |
#define | bvec_set_length_max(v, N) do { v=_bvec_set_length_max( v, N ); } while (0) |
#define | cvec_set_length_max(v, N) do { v=_cvec_set_length_max( v, N ); } while (0) |
vec | _vec_set_length (vec v, idx_t N) |
ivec | _ivec_set_length (ivec v, idx_t N) |
bvec | _bvec_set_length (bvec v, idx_t N) |
cvec | _cvec_set_length (cvec v, idx_t N) |
#define | Vec_set_length(v, N) |
#define | vec_set_length(v, N) do { v=_vec_set_length( v, N ); } while (0) |
#define | ivec_set_length(v, N) do { v=_ivec_set_length( v, N ); } while (0) |
#define | bvec_set_length(v, N) do { v=_bvec_set_length( v, N ); } while (0) |
#define | cvec_set_length(v, N) do { v=_cvec_set_length( v, N ); } while (0) |
Basic vector initialization/modification | |
vec | vec_init (vec v, double *buf, idx_t N) |
ivec | ivec_init (ivec v, int *buf, idx_t N) |
bvec | bvec_init (bvec v, byte *buf, idx_t N) |
cvec | cvec_init (cvec v, cplx *buf, idx_t N) |
#define | Vec_init(v, buf, N) memcpy( v, buf, Vec_element_size(v) * (N) ); |
vec | vec_set (vec v, double val) |
ivec | ivec_set (ivec v, int val) |
bvec | bvec_set (bvec v, byte val) |
cvec | cvec_set (cvec v, cplx val) |
#define | Vec_set(v, val) |
vec | vec_new_set (double val, idx_t N) |
ivec | ivec_new_set (int val, idx_t N) |
bvec | bvec_new_set (byte val, idx_t N) |
cvec | cvec_new_set (cplx val, idx_t N) |
void | vec_void (vec) |
void | ivec_void (ivec) |
void | bvec_void (bvec) |
void | cvec_void (cvec) |
#define | Vec_void(v) |
vec | vec_new_void () |
ivec | ivec_new_void () |
bvec | bvec_new_void () |
cvec | cvec_new_void () |
#define | Vec_new_void(type_t) Vec_new( type_t, 0 ) |
void | vec_zeros (vec) |
void | ivec_zeros (ivec) |
void | bvec_zeros (bvec) |
void | cvec_zeros (cvec) |
vec | vec_new_zeros (idx_t N) |
ivec | ivec_new_zeros (idx_t N) |
bvec | bvec_new_zeros (idx_t N) |
cvec | cvec_new_zeros (idx_t N) |
void | vec_ones (vec) |
void | ivec_ones (ivec) |
void | bvec_ones (bvec) |
void | cvec_ones (cvec) |
vec | vec_new_ones (idx_t N) |
ivec | ivec_new_ones (idx_t N) |
bvec | bvec_new_ones (idx_t N) |
cvec | cvec_new_ones (idx_t N) |
vec | vec_set_between (vec v, idx_t i1, idx_t i2, double val) |
ivec | ivec_set_between (ivec v, idx_t i1, idx_t i2, int val) |
bvec | bvec_set_between (bvec v, idx_t i1, idx_t i2, byte val) |
cvec | cvec_set_between (cvec v, idx_t i1, idx_t i2, cplx val) |
#define | Vec_set_between(v, i1, i2, val) |
void | vec_set_subvector (vec v, vec s, idx_t idx) |
void | ivec_set_subvector (ivec v, ivec s, idx_t idx) |
void | bvec_set_subvector (bvec v, bvec s, idx_t idx) |
void | cvec_set_subvector (cvec v, cvec s, idx_t idx) |
#define | Vec_set_subvector(v, s, index) |
vec | vec_get_subvector (vec v, idx_t i1, idx_t i2) |
ivec | ivec_get_subvector (ivec v, idx_t i1, idx_t i2) |
bvec | bvec_get_subvector (bvec v, idx_t i1, idx_t i2) |
cvec | cvec_get_subvector (cvec v, idx_t i1, idx_t i2) |
Comparisons functions | |
int | vec_eq (vec v1, vec v2) |
int | ivec_eq (ivec v1, ivec v2) |
int | bvec_eq (bvec v1, bvec v2) |
int | cvec_eq (cvec v1, cvec v2) |
#define | Vec_eq(v1, v2) |
int | vec_geq (vec v1, vec v2) |
int | ivec_geq (ivec v1, ivec v2) |
int | bvec_geq (bvec v1, bvec v2) |
Copy and Conversions Functions | |
Vec | __Vec_copy (Vec v1, Vec v2) |
void | vec_copy (vec dest, vec orig) |
void | ivec_copy (ivec dest, ivec orig) |
void | bvec_copy (bvec dest, bvec orig) |
void | cvec_copy (cvec dest, cvec orig) |
#define | Vec_copy(v1, v2) __Vec_copy((Vec) v1, (Vec) v2) |
Vec | Vec_clone (Vec v) |
vec | vec_clone (vec v) |
ivec | ivec_clone (ivec v) |
bvec | bvec_clone (bvec v) |
cvec | cvec_clone (cvec v) |
void | vec_copy_from_ivec (vec dest, ivec orig) |
void | vec_copy_from_bvec (vec dest, bvec orig) |
void | vec_copy_from_cvec (vec dest, cvec orig) |
void | ivec_copy_from_vec (ivec dest, vec orig) |
void | ivec_copy_from_bvec (ivec dest, bvec orig) |
void | ivec_copy_from_cvec (ivec dest, cvec orig) |
void | bvec_copy_from_vec (bvec dest, vec orig) |
void | bvec_copy_from_ivec (bvec dest, ivec orig) |
void | bvec_copy_from_cvec (bvec dest, cvec orig) |
void | cvec_copy_from_vec (cvec dest, vec orig) |
void | cvec_copy_from_ivec (cvec dest, ivec orig) |
void | cvec_copy_from_bvec (cvec dest, bvec orig) |
bvec | vec_to_bvec (vec v) |
ivec | vec_to_ivec (vec v) |
cvec | vec_to_cvec (vec v) |
vec | ivec_to_vec (ivec v) |
bvec | ivec_to_bvec (ivec v) |
cvec | ivec_to_cvec (ivec v) |
ivec | bvec_to_ivec (bvec v) |
vec | bvec_to_vec (bvec v) |
cvec | bvec_to_cvec (bvec v) |
void | vec_copy_mem (double *buf, vec v) |
void | ivec_copy_mem (int *buf, ivec v) |
void | bvec_copy_mem (byte *buf, bvec v) |
void | cvec_copy_mem (cplx *buf, cvec v) |
void | bvec_pack (byte *buf, bvec v) |
void | bvec_unpack (bvec v, byte *buf) |
Ordered set and stack operations | |
vec | vec_del (vec v, idx_t pos) |
ivec | ivec_del (ivec v, idx_t pos) |
bvec | bvec_del (bvec v, idx_t pos) |
cvec | cvec_del (cvec v, idx_t pos) |
#define | Vec_del(v, pos) |
vec | _vec_ins (vec v, idx_t pos, double elt) |
ivec | _ivec_ins (ivec v, idx_t pos, int elt) |
bvec | _bvec_ins (bvec v, idx_t pos, byte elt) |
cvec | _cvec_ins (cvec v, idx_t pos, cplx elt) |
#define | Vec_ins(v, pos, elt) |
#define | vec_ins(v, pos, elt) do { v=_vec_ins( v, pos, elt ); } while (0) |
#define | ivec_ins(v, pos, elt) do { v=_ivec_ins( v, pos, elt ); } while (0) |
#define | bvec_ins(v, pos, elt) do { v=_bvec_ins( v, pos, elt ); } while (0) |
#define | cvec_ins(v, pos, elt) do { v=_cvec_ins( v, pos, elt ); } while (0) |
vec | _vec_push (vec v, double elt) |
ivec | _ivec_push (ivec v, int elt) |
bvec | _bvec_push (bvec v, byte elt) |
cvec | _cvec_push (cvec v, cplx elt) |
#define | Vec_push(v, elt) Vec_ins( v, Vec_length(v), elt ) |
#define | vec_push(v, elt) do { v=_vec_push( v, elt ); } while (0) |
#define | ivec_push(v, elt) do { v=_ivec_push( v, elt ); } while (0) |
#define | bvec_push(v, elt) do { v=_bvec_push( v, elt ); } while (0) |
#define | cvec_push(v, elt) do { v=_cvec_push( v, elt ); } while (0) |
vec | vec_pop (vec v) |
ivec | ivec_pop (ivec v) |
bvec | bvec_pop (bvec v) |
cvec | cvec_pop (cvec v) |
#define | Vec_pop(v) Vec_del( v, Vec_length(v)-1 ) |
double | vec_head (vec v) |
int | ivec_head (ivec v) |
byte | bvec_head (bvec v) |
cplx | cvec_head (const cvec v) |
#define | Vec_head(v) ((v)[Vec_length(v)-1]) |
Safe vector access | |
double * | __vec (vec v, idx_t i) |
int * | __ivec (ivec v, idx_t i) |
byte * | __bvec (bvec v, idx_t i) |
cplx * | __cvec (cvec v, idx_t i) |
#define | _vec(v, i) (*__vec(v, i)) |
#define | _ivec(v, i) (*__ivec(v, i)) |
#define | _bvec(v, i) (*__bvec(v, i)) |
#define | _cvec(v, i) (*__cvec(v, i)) |
Mean, median, min, max, sum and elementary statistic indicators | |
double | vec_mean (vec v) |
double | ivec_mean (ivec v) |
double | vec_mean_robust (vec v) |
double | vec_median (vec v) |
int | ivec_median (ivec v) |
double | vec_sum (vec v) |
int | ivec_sum (ivec v) |
cplx | cvec_sum (cvec v) |
double | vec_sum_robust (vec v) |
vec | vec_cum_sum (vec v) |
ivec | ivec_cum_sum (ivec v) |
cvec | cvec_cum_sum (cvec v) |
double | vec_sum_between (vec v, idx_t i1, idx_t i2) |
int | ivec_sum_between (ivec v, idx_t i1, idx_t i2) |
cplx | cvec_sum_between (cvec v, idx_t i1, idx_t i2) |
double | vec_sum_sqr (vec v) |
double | vec_min (vec v) |
int | ivec_min (ivec v) |
double | vec_max (vec v) |
int | ivec_max (ivec v) |
idx_t | vec_min_index (vec v) |
idx_t | ivec_min_index (ivec v) |
idx_t | vec_max_index (vec v) |
idx_t | ivec_max_index (ivec v) |
vec | vec_k_min (vec v, int k) |
ivec | ivec_k_min (ivec v, int k) |
vec | vec_k_max (vec v, int k) |
ivec | ivec_k_max (ivec v, int k) |
vec | vec_k_min_between (vec v, int k, idx_t a, idx_t b) |
ivec | ivec_k_min_between (ivec v, int k, idx_t a, idx_t b) |
vec | vec_k_max_between (vec v, int k, idx_t a, idx_t b) |
ivec | ivec_k_max_between (ivec v, int k, idx_t a, idx_t b) |
ivec | vec_k_min_index (vec v, int k) |
ivec | ivec_k_min_index (ivec v, int k) |
ivec | vec_k_max_index (vec v, int k) |
ivec | ivec_k_max_index (ivec v, int k) |
ivec | vec_k_min_index_between (vec v, int k, idx_t a, idx_t b) |
ivec | ivec_k_min_index_between (ivec v, int k, idx_t a, idx_t b) |
ivec | vec_k_max_index_between (vec v, int k, idx_t a, idx_t b) |
ivec | ivec_k_max_index_between (ivec v, int k, idx_t a, idx_t b) |
double | vec_variance (vec v) |
double | vec_variance_robust (vec v) |
double | vec_cov (vec v1, vec v2) |
double | vec_norm (vec v, double nr) |
double | ivec_norm (ivec v, int nr) |
void | vec_normalize (vec v, double nr) |
vec | vec_new_normalize (vec v, double nr) |
Basic arithmetic operations | |
void | vec_neg (vec v) |
void | ivec_neg (ivec v) |
void | cvec_neg (cvec v) |
void | cvec_conj (cvec v) |
void | cvec_abssqr (cvec v) |
void | vec_sqr (vec v) |
void | ivec_sqr (ivec v) |
void | vec_sqrt (vec v) |
void | vec_log (vec v) |
void | vec_log10 (vec v) |
void | vec_exp (vec v) |
void | vec_pow (vec v, double a) |
vec | vec_new_pow (vec v, double a) |
void | vec_abs (vec v) |
void | ivec_abs (ivec v) |
vec | vec_new_abs (vec v) |
ivec | ivec_new_abs (ivec v) |
vec | cvec_new_abs (cvec v) |
Arithmetic operations with a scalar value | |
void | vec_incr (vec v, double a) |
void | ivec_incr (ivec v, int a) |
void | cvec_incr (cvec v, cplx a) |
void | cvec_incr_real (cvec v, double a) |
void | vec_decr (vec v, double a) |
void | ivec_decr (ivec v, int a) |
void | cvec_decr (cvec v, cplx a) |
void | cvec_decr_real (cvec v, double a) |
void | vec_mul_by (vec v, double a) |
void | ivec_mul_by (ivec v, int a) |
void | cvec_mul_by (cvec v, cplx a) |
void | cvec_mul_by_real (cvec v, double a) |
void | vec_div_by (vec v, double a) |
void | ivec_div_by (ivec v, int a) |
void | cvec_div_by (cvec v, cplx a) |
void | cvec_div_by_real (cvec v, double a) |
Component per component operations | |
void | vec_add (vec v1, vec v2) |
void | ivec_add (ivec v1, ivec v2) |
void | cvec_add (cvec v1, cvec v2) |
vec | vec_new_add (vec v1, vec v2) |
ivec | ivec_new_add (ivec v1, ivec v2) |
void | vec_sub (vec v1, vec v2) |
void | ivec_sub (ivec v1, ivec v2) |
void | cvec_sub (cvec v1, cvec v2) |
vec | vec_new_sub (vec v1, vec v2) |
ivec | ivec_new_sub (ivec v1, ivec v2) |
void | vec_mul (vec v1, vec v2) |
void | ivec_mul (ivec v1, ivec v2) |
void | cvec_mul (cvec v1, cvec v2) |
vec | vec_new_mul (vec v1, vec v2) |
ivec | ivec_new_mul (ivec v1, ivec v2) |
void | vec_div (vec v1, vec v2) |
void | ivec_div (ivec v1, ivec v2) |
void | cvec_div (cvec v1, cvec v2) |
vec | vec_new_div (vec v1, vec v2) |
ivec | ivec_new_div (ivec v1, ivec v2) |
double | vec_inner_product (vec v1, vec v2) |
int | ivec_inner_product (ivec v1, ivec v2) |
double | vecivec_inner_product (vec v1, ivec v2) |
int | bvecivec_inner_product (bvec v1, ivec v2) |
double | vec_inner_product_robust (vec v1, vec v2) |
void | cvec_conj_mul (cvec v1, cvec v2) |
Component per component arbitrar function | |
void | vec_apply_function (vec v, it_function_t function, it_args_t args) |
vec | vec_new_apply_function (vec v, it_function_t function, it_args_t args) |
ivec | ivec_apply_function (ivec v, it_ifunction_t function, it_args_t args) |
ivec | ivec_new_apply_function (ivec v, it_ifunction_t function, it_args_t args) |
#define | ivec_eval(v, f, a) ivec_apply_function(v, f, a) |
#define | ivec_new_eval(v, f, a) ivec_new_apply_function(v, f, a) |
Set, sorting and finding functions | |
void | vec_reverse (vec v) |
void | ivec_reverse (ivec v) |
void | bvec_reverse (bvec v) |
void | cvec_reverse (cvec v) |
vec | vec_new_reverse (vec v) |
ivec | ivec_new_reverse (ivec v) |
bvec | bvec_new_reverse (bvec v) |
cvec | cvec_new_reverse (cvec v) |
idx_t | vec_count (vec v, double a) |
idx_t | ivec_count (ivec v, int a) |
idx_t | bvec_count (bvec v, byte a) |
idx_t | cvec_count (cvec v, cplx a) |
idx_t | vec_find_first (vec v, double a) |
idx_t | ivec_find_first (ivec v, int a) |
idx_t | bvec_find_first (bvec v, byte a) |
idx_t | cvec_find_first (cvec v, cplx a) |
ivec | vec_find (vec v, double a) |
ivec | ivec_find (ivec v, int a) |
ivec | bvec_find (bvec v, byte a) |
ivec | cvec_find (cvec v, cplx a) |
idx_t | vec_find_sorted (vec v, double a) |
idx_t | ivec_find_sorted (ivec v, int a) |
idx_t | bvec_find_sorted (bvec v, byte a) |
ivec | vec_replace (vec v, double a, double b) |
ivec | ivec_replace (ivec v, int a, int b) |
ivec | bvec_replace (bvec v, byte a, byte b) |
ivec | cvec_replace (cvec v, cplx a, cplx b) |
vec | vec_new_concat (vec v1, vec v2) |
ivec | ivec_new_concat (ivec v1, ivec v2) |
bvec | bvec_new_concat (bvec v1, bvec v2) |
cvec | cvec_new_concat (cvec v1, cvec v2) |
vec | vec_new_unique (vec v) |
ivec | ivec_new_unique (ivec v) |
bvec | bvec_new_unique (bvec v) |
vec | vec_new_union (vec v1, vec v2) |
ivec | ivec_new_union (ivec v1, ivec v2) |
bvec | bvec_new_union (bvec v1, bvec v2) |
vec | vec_new_intersection (vec v1, vec v2) |
ivec | ivec_new_intersection (ivec v1, ivec v2) |
bvec | bvec_new_intersection (bvec v1, bvec v2) |
vec | vec_index_by (vec v, ivec idx) |
ivec | ivec_index_by (ivec v, ivec idx) |
bvec | bvec_index_by (bvec v, ivec idx) |
cvec | cvec_index_by (cvec v, ivec idx) |
void | Vec_sort (Vec v, int(*elem_leq)(const void *, const void *)) |
void | vec_sort (vec v) |
void | ivec_sort (ivec v) |
void | bvec_sort (bvec v) |
ivec | Vec_sort_index (Vec v, int(*elem_leq_idx)(const void *, const void *)) |
ivec | vec_sort_index (vec v) |
ivec | ivec_sort_index (ivec v) |
ivec | bvec_sort_index (bvec v) |
Special vectors | |
void | vec_range (vec) |
void | ivec_range (ivec) |
void | bvec_range (bvec) |
void | cvec_range (cvec) |
vec | vec_new_range (idx_t n) |
ivec | ivec_new_range (idx_t n) |
bvec | bvec_new_range (idx_t n) |
cvec | cvec_new_range (idx_t n) |
void | vec_1N (vec) |
void | ivec_1N (ivec) |
void | bvec_1N (bvec) |
void | cvec_1N (cvec) |
vec | vec_new_1N (idx_t n) |
ivec | ivec_new_1N (idx_t n) |
bvec | bvec_new_1N (idx_t n) |
cvec | cvec_new_1N (idx_t n) |
void | vec_arithm (vec, double start, double incr) |
void | ivec_arithm (ivec, int start, int incr) |
void | bvec_arithm (bvec, byte start, byte incr) |
void | cvec_arithm (cvec, cplx start, cplx incr) |
vec | vec_new_arithm (double start, double incr, idx_t N) |
ivec | ivec_new_arithm (int start, int incr, idx_t N) |
bvec | bvec_new_arithm (byte start, byte incr, idx_t N) |
cvec | cvec_new_arithm (cplx start, cplx incr, idx_t N) |
void | vec_geom (vec, double start, double r) |
void | ivec_geom (ivec, int start, int r) |
void | bvec_geom (bvec, byte start, byte r) |
void | cvec_geom (cvec, cplx start, cplx r) |
vec | vec_new_geom (double start, double r, idx_t N) |
ivec | ivec_new_geom (int start, int r, idx_t N) |
bvec | bvec_new_geom (byte start, byte r, idx_t N) |
cvec | cvec_new_geom (cplx start, cplx r, idx_t N) |
cvec | cvec_new_unit_roots (idx_t N) |
Random vectors | |
void | vec_rand (vec v) |
vec | vec_new_rand (idx_t N) |
void | vec_randn (vec v) |
vec | vec_new_randn (idx_t N) |
ivec | ivec_new_perm (size_t N) |
Convolution | |
vec | vec_conv (vec v1, vec v2) |
ivec | ivec_conv (ivec v1, ivec v2) |
Vector <-> sparse vectors conversion | |
void | vec_to_spvec (vec v, ivec *svi_out, vec *sv_out) |
void | ivec_to_spivec (ivec v, ivec *svi_out, ivec *sv_out) |
vec | spvec_to_vec (ivec svi, vec sv, int n) |
ivec | spivec_to_ivec (ivec svi, ivec sv, int n) |
double | spvec_inner_product (ivec svi1, vec sv1, ivec svi2, vec sv2) |
int | spivec_inner_product (ivec svi1, ivec sv1, ivec svi2, ivec sv2) |
Initialization of a vector or of some of its components | |
static int | double_leq (const void *d1, const void *d2) |
static int | double_leq_index (const void *d1, const void *d2) |
static int | int_leq (const void *d1, const void *d2) |
static int | int_leq_index (const void *d1, const void *d2) |
static int | byte_leq (const void *d1, const void *d2) |
static int | byte_leq_index (const void *d1, const void *d2) |
Defines | |
#define | VEC_END_PARAM(v, param) do { if( param == end ) param = Vec_length( v ) - 1; } while(0) |
#define | vec_eval(v, f, a) vec_apply_function(v, f, a) |
#define | vec_new_eval(v, f, a) vec_new_apply_function(v, f, a) |
#define _bvec | ( | v, | |||
i | ) | (*__bvec(v, i)) |
#define _cvec | ( | v, | |||
i | ) | (*__cvec(v, i)) |
#define _ivec | ( | v, | |||
i | ) | (*__ivec(v, i)) |
#define _vec | ( | v, | |||
i | ) | (*__vec(v, i)) |
#define bvec_ins | ( | v, | |||
pos, | |||||
elt | ) | do { v=_bvec_ins( v, pos, elt ); } while (0) |
insert an element in a given vector at the specified position
Definition at line 553 of file vec.h.
Referenced by _bvec_push().
#define bvec_push | ( | v, | |||
elt | ) | do { v=_bvec_push( v, elt ); } while (0) |
Add an element at the end of the vector
Definition at line 569 of file vec.h.
Referenced by bvec_new_intersection(), bvec_new_union(), bvec_new_unique(), it_read_bvec(), main(), and vlc_encode_concat().
#define bvec_set_length | ( | v, | |||
N | ) | do { v=_bvec_set_length( v, N ); } while (0) |
Modify the length of a vector
Definition at line 241 of file vec.h.
Referenced by it_read_bvec().
#define bvec_set_length_max | ( | v, | |||
N | ) | do { v=_bvec_set_length_max( v, N ); } while (0) |
Modify the maximum length of a vector
#define cvec_ins | ( | v, | |||
pos, | |||||
elt | ) | do { v=_cvec_ins( v, pos, elt ); } while (0) |
insert an element in a given vector at the specified position
Definition at line 554 of file vec.h.
Referenced by _cvec_push().
#define cvec_push | ( | v, | |||
elt | ) | do { v=_cvec_push( v, elt ); } while (0) |
Add an element at the end of the vector
Definition at line 570 of file vec.h.
Referenced by fft_init(), and it_read_cvec().
#define cvec_set_length | ( | v, | |||
N | ) | do { v=_cvec_set_length( v, N ); } while (0) |
Modify the length of a vector
Definition at line 242 of file vec.h.
Referenced by cvec_fft_autocorr(), cvec_fft_conv(), cvec_fft_corr(), it_fdft(), it_fzt(), and it_read_cvec().
#define cvec_set_length_max | ( | v, | |||
N | ) | do { v=_cvec_set_length_max( v, N ); } while (0) |
Modify the maximum length of a vector
#define ivec_eval | ( | v, | |||
f, | |||||
a | ) | ivec_apply_function(v, f, a) |
#define ivec_ins | ( | v, | |||
pos, | |||||
elt | ) | do { v=_ivec_ins( v, pos, elt ); } while (0) |
insert an element in a given vector at the specified position
Definition at line 552 of file vec.h.
Referenced by _ivec_push().
#define ivec_new_eval | ( | v, | |||
f, | |||||
a | ) | ivec_new_apply_function(v, f, a) |
#define ivec_push | ( | v, | |||
elt | ) | do { v=_ivec_push( v, elt ); } while (0) |
Add an element at the end of the vector
Definition at line 568 of file vec.h.
Referenced by it_read_ivec(), ivec_k_max_between(), ivec_k_max_index_between(), ivec_k_min_between(), ivec_k_min_index_between(), ivec_new_intersection(), ivec_new_union(), ivec_new_unique(), main(), vec_k_max_index_between(), vec_k_min_index_between(), vlc_decode_concat(), vlc_energy_order(), and vlc_read().
#define ivec_set_length | ( | v, | |||
N | ) | do { v=_ivec_set_length( v, N ); } while (0) |
Modify the length of a vector
Definition at line 240 of file vec.h.
Referenced by it_read_ivec().
#define ivec_set_length_max | ( | v, | |||
N | ) | do { v=_ivec_set_length_max( v, N ); } while (0) |
Modify the maximum length of a vector
Copy the content of a vector into another vector
Definition at line 433 of file vec.h.
Referenced by __Mat_copy(), __Mat_new_deinterleave_block(), __Mat_new_interleave_block(), bmat_copy_row(), bvec_clone(), bvec_copy(), cmat_copy_row(), cvec_clone(), cvec_copy(), imat_copy_row(), ivec_clone(), ivec_copy(), mat_copy_row(), vec_clone(), Vec_clone(), and vec_copy().
#define Vec_del | ( | v, | |||
pos | ) |
Value:
do { \ idx_t l = Vec_length(v)-1; \ idx_t i; \ assert(v); \ assert((pos) <= l); \ for( i = (pos) + 1 ; i <= l ; i++ ) \ (v)[ i - 1 ] = (v)[ i ]; \ Vec_length(v)--; \ } while( 0 )
Definition at line 510 of file vec.h.
Referenced by bvec_del(), cvec_del(), ivec_del(), and vec_del().
#define Vec_delete | ( | v | ) | free( Vec_header(v).ptr ) |
Free a vector
Definition at line 154 of file vec.h.
Referenced by __it_separable2D_itransform(), __it_separable2D_transform(), __Mat_delete(), __Vec_deinterleave_block(), __Vec_interleave_block(), __Vec_new_realloc(), bvec_delete(), cvec_delete(), ivec_delete(), parser_delete(), pvec_delete(), and vec_delete().
#define VEC_END_PARAM | ( | v, | |||
param | ) | do { if( param == end ) param = Vec_length( v ) - 1; } while(0) |
Definition at line 179 of file vec.h.
Referenced by __bvec(), __cvec(), __ivec(), __vec(), bvec_get_subvector(), bvec_set_subvector(), cvec_get_subvector(), cvec_set_subvector(), cvec_sum_between(), ivec_get_subvector(), ivec_set_subvector(), ivec_sum_between(), vec_get_subvector(), vec_set_subvector(), and vec_sum_between().
#define Vec_eq | ( | v1, | |||
v2 | ) |
Value:
( Vec_length( v1 ) == Vec_length( v2 ) && \ !memcmp( v1, v2, Vec_element_size( v1 ) * Vec_length( v1 ) ) )
Definition at line 401 of file vec.h.
Referenced by Mat_eq().
#define Vec_head | ( | v | ) | ((v)[Vec_length(v)-1]) |
Return the last element of vector
Definition at line 588 of file vec.h.
Referenced by _parser_add_string(), bvec_head(), cvec_head(), ivec_head(), and vec_head().
#define Vec_init | ( | v, | |||
buf, | |||||
N | ) | memcpy( v, buf, Vec_element_size(v) * (N) ); |
Initialize the vector from a buffer of the same type
Definition at line 254 of file vec.h.
Referenced by bvec_init(), cvec_init(), ivec_init(), and vec_init().
#define vec_ins | ( | v, | |||
pos, | |||||
elt | ) | do { v=_vec_ins( v, pos, elt ); } while (0) |
insert an element in a given vector at the specified position
Definition at line 551 of file vec.h.
Referenced by _vec_push(), it_rand_memoryless(), and source_memoryless().
#define Vec_ins | ( | v, | |||
pos, | |||||
elt | ) |
Value:
do { \ idx_t l = Vec_length(v); \ idx_t i; \ assert(v); \ assert((pos) <= l); \ if( l+1 > Vec_length_max(v) ) \ Vec_set_length_max( v, DYN_ALLOC_RULE( l ));\ for( i = l ; i >(pos) ; i-- ) \ (v)[i] = (v)[ i-1 ]; \ (v)[(pos)] = (elt); \ Vec_length(v)++; \ } while( 0 )
Definition at line 532 of file vec.h.
Referenced by _bvec_ins(), _cvec_ins(), _ivec_ins(), and _vec_ins().
#define Vec_length | ( | v | ) | ( Vec_header(v).length ) |
Return the length of the vector
Definition at line 169 of file vec.h.
Referenced by __Vec_copy(), __Vec_new_realloc(), _parser_add_string(), bvec_length(), cvec_length(), it_vfprintf(), ivec_cum_sum(), ivec_length(), ivec_max(), ivec_min(), main(), Mat_set_col(), parser_delete(), parser_print(), parser_var_line(), Vec_clone(), vec_count(), vec_cum_sum(), vec_exp(), vec_find(), vec_find_first(), vec_length(), vec_log(), vec_log10(), vec_max(), vec_mean(), vec_mean_robust(), vec_min(), Vec_new_deinterleave_block(), Vec_new_interleave_block(), vec_new_pow(), vec_pow(), vec_replace(), Vec_sort(), Vec_sort_index(), vec_sqrt(), vec_sum(), vec_sum_robust(), vec_sum_sqr(), vec_variance(), vec_variance_robust(), vlc_huffman(), and vlc_quasi_lexicographic().
#define Vec_length_max | ( | v | ) | ( Vec_header(v).length_max ) |
Return the maximum length of the vector (number of allocated elements)
Definition at line 183 of file vec.h.
Referenced by bvec_length_max(), cvec_length_max(), ivec_length_max(), vec_length_max(), and Vec_sort_index().
#define Vec_new | ( | type_t, | |||
N | ) | ((type_t *) __Vec_new( sizeof(type_t), N )) |
Allocate a vector
Definition at line 142 of file vec.h.
Referenced by __it_dequantize_mat(), __it_quantize_mat(), bvec_new(), cvec_new(), ivec_new(), parser_init(), pvec_new(), vec_new(), and Vec_sort_index().
#define Vec_new_alloc | ( | type_t, | |||
N, | |||||
length_max | ) | ((type_t *) __Vec_new_alloc(sizeof(type_t), N, length_max )) |
Vector allocation with explicit allocation of the maximum number of elements
Definition at line 130 of file vec.h.
Referenced by __Mat_new_alloc(), bvec_new_alloc(), cvec_new_alloc(), ivec_new_alloc(), and vec_new_alloc().
#define vec_new_eval | ( | v, | |||
f, | |||||
a | ) | vec_new_apply_function(v, f, a) |
#define Vec_new_void | ( | type_t | ) | Vec_new( type_t, 0 ) |
#define Vec_pop | ( | v | ) | Vec_del( v, Vec_length(v)-1 ) |
Retrieve the last element at the end of the vector (this removes it)
Definition at line 577 of file vec.h.
Referenced by bvec_pop(), cvec_pop(), ivec_pop(), and vec_pop().
#define vec_push | ( | v, | |||
elt | ) | do { v=_vec_push( v, elt ); } while (0) |
Add an element at the end of the vector
Definition at line 567 of file vec.h.
Referenced by it_read_fvec(), it_read_vec(), main(), vec_k_max_between(), vec_k_min_between(), vec_new_intersection(), vec_new_union(), and vec_new_unique().
#define Vec_push | ( | v, | |||
elt | ) | Vec_ins( v, Vec_length(v), elt ) |
Add an element at the end of the vector
Definition at line 560 of file vec.h.
Referenced by _parser_add_params(), and _parser_add_string().
#define Vec_set | ( | v, | |||
val | ) |
Value:
do { \ idx_t i; \ assert( v ); \ for( i = 0 ; i < Vec_length( v ) ; i++ ) \ v[ i ] = val; } while( 0 )
Definition at line 266 of file vec.h.
Referenced by bvec_set(), bvec_zeros(), cvec_set(), cvec_zeros(), ivec_set(), ivec_zeros(), vec_set(), and vec_zeros().
#define Vec_set_between | ( | v, | |||
i1, | |||||
i2, | |||||
val | ) |
Value:
do { \ idx_t ve = i2; \ idx_t i; \ VEC_END_PARAM( v,ve ); \ assert( v ); \ for( i = i1 ; i <= ve ; i++ ) \ v[ i ] = val; } while( 0 )
Definition at line 352 of file vec.h.
Referenced by bvec_set_between(), cvec_set_between(), ivec_set_between(), and vec_set_between().
#define vec_set_length | ( | v, | |||
N | ) | do { v=_vec_set_length( v, N ); } while (0) |
Modify the length of a vector
Definition at line 239 of file vec.h.
Referenced by it_read_fvec(), it_read_vec(), poly_add(), poly_normalize(), and poly_sub().
#define Vec_set_length | ( | v, | |||
N | ) |
Value:
do { \ if( N > Vec_length_max( v ) ) { \ Vec_set_length_max( v, N ); \ Vec_length( v ) = (N); \ } else { \ Vec_length( v ) = (N); } \ } while(0)
Definition at line 226 of file vec.h.
Referenced by _bvec_set_length(), _cvec_set_length(), _ivec_set_length(), and _vec_set_length().
#define vec_set_length_max | ( | v, | |||
N | ) | do { v=_vec_set_length_max( v, N ); } while (0) |
Modify the maximum length of a vector
#define Vec_set_length_max | ( | v, | |||
N | ) |
Value:
do { \ int L = Vec_length(v); \ size_t elem_size = Vec_element_size(v); \ \ assert( N >= Vec_length(v) ); \ if( N > Vec_length(v) ) { \ Vec new_Vec = __Vec_new_realloc(v, elem_size, L, N); \ (v) = (v) + ((byte *) new_Vec - (byte *) (v)) / elem_size; \ } \ } while(0)
Definition at line 197 of file vec.h.
Referenced by _bvec_set_length_max(), _cvec_set_length_max(), _ivec_set_length_max(), _vec_set_length_max(), and main().
#define Vec_set_subvector | ( | v, | |||
s, | |||||
index | ) |
Value:
do { \ idx_t i; \ assert(v); \ assert(s); \ assert(index + Vec_length(s) <= Vec_length(v)); \ for(i = 0; i < Vec_length(s); i++) \ (v)[(index) + i] = (s)[i]; } while(0)
Definition at line 370 of file vec.h.
Referenced by bvec_set_subvector(), cvec_set_subvector(), ivec_set_subvector(), and vec_set_subvector().
#define Vec_void | ( | v | ) |
Value:
do { \ assert( v ); \ Vec_length( v ) = 0; \ } while(0)
Definition at line 290 of file vec.h.
Referenced by bvec_void(), cvec_void(), ivec_void(), and vec_void().
Safe access to vector's elements
Definition at line 1046 of file vec.c.
References bvec_length(), and VEC_END_PARAM.
Safe access to vector's elements
Definition at line 1055 of file vec.c.
References cvec_length(), and VEC_END_PARAM.
Safe access to vector's elements
Definition at line 1037 of file vec.c.
References ivec_length(), and VEC_END_PARAM.
Safe access to vector's elements
Definition at line 1028 of file vec.c.
References VEC_END_PARAM, and vec_length().
Copy the content of a vector into another vector
Definition at line 478 of file vec.c.
References Vec_element_size, and Vec_length.
Allocate a vector
Definition at line 155 of file vec.c.
References __Vec_new_alloc().
Referenced by Vec_clone(), Vec_new_deinterleave_block(), and Vec_new_interleave_block().
Add an element at the end of the vector
Definition at line 959 of file vec.c.
References bvec_ins, and bvec_length().
Modify the length of a vector
Definition at line 303 of file vec.c.
References Vec_set_length.
Modify the maximum length of a vector
Definition at line 275 of file vec.c.
References Vec_set_length_max.
Add an element at the end of the vector
Definition at line 966 of file vec.c.
References cvec_ins, and cvec_length().
Modify the length of a vector
Definition at line 310 of file vec.c.
References Vec_set_length.
Modify the maximum length of a vector
Definition at line 282 of file vec.c.
References Vec_set_length_max.
Add an element at the end of the vector
Definition at line 952 of file vec.c.
References ivec_ins, and ivec_length().
Modify the length of a vector
Definition at line 296 of file vec.c.
References Vec_set_length.
Modify the maximum length of a vector
Definition at line 268 of file vec.c.
References Vec_set_length_max.
Add an element at the end of the vector
Definition at line 945 of file vec.c.
References vec_ins, and vec_length().
Modify the length of a vector
Definition at line 289 of file vec.c.
References Vec_set_length.
Modify the maximum length of a vector
Definition at line 261 of file vec.c.
References Vec_set_length_max.
void bvec_1N | ( | bvec | ) |
Set the vector elements to 1,2, ... n
Definition at line 3846 of file vec.c.
References bvec_length().
Set the vector to an arithmetic sequence
Definition at line 3887 of file vec.c.
References bvec_length().
Clone a vector (allocate memory and copy data)
Definition at line 534 of file vec.c.
References bvec_length(), bvec_new(), and Vec_copy.
Copy the content of a vector into another vector
Definition at line 501 of file vec.c.
References Vec_copy.
Copy with conversion (lengths must match)
Definition at line 628 of file vec.c.
References bvec_length(), creal, and cvec_length().
Copy with conversion (lengths must match)
Definition at line 618 of file vec.c.
References bvec_length(), and ivec_length().
Copy with conversion (lengths must match)
Definition at line 608 of file vec.c.
References bvec_length(), and vec_length().
Copy the vector into a buffer (which must be a valid allocated pointer)
Definition at line 700 of file vec.c.
References bvec_length().
Count the number of elements equal to a given value a
Definition at line 3141 of file vec.c.
References bvec_length().
Referenced by bvec_find(), and bvec_replace().
void bvec_delete | ( | bvec | v | ) |
Free a vector
Definition at line 197 of file vec.c.
References Vec_delete.
Referenced by __bvec_deinterleave_block(), __bvec_interleave_block(), bvec_file_read_bits(), bvec_file_write_bits(), it_read_bmat(), main(), and vlc_huffman().
Return true iff all the vectors v1 and v2 are equal component per component
Definition at line 1102 of file vec.c.
References bvec_length().
Referenced by bmat_eq().
Return the set of positions where a given value occurs
Definition at line 2950 of file vec.c.
References bvec_count(), bvec_length(), and ivec_new().
Return the first position where the value a occurs, NULL_INDEX if the research is not successful
Definition at line 2897 of file vec.c.
References bvec_length(), and NULL_INDEX.
Return the set of positions where a given value occurs assuming a sorted set
Definition at line 3033 of file vec.c.
References bvec_length(), and left.
Set the vector to an geometric sequence
Definition at line 3928 of file vec.c.
References bvec_length().
allocate a new vector formed by a subset of a given vector
Definition at line 451 of file vec.c.
References bvec_init(), bvec_new(), and VEC_END_PARAM.
Return the vector composed of the elements of v indexed by idx
Definition at line 3510 of file vec.c.
References bvec_new(), and ivec_length().
Initialize the vector from a buffer of the same type
Definition at line 333 of file vec.c.
References Vec_init.
Referenced by bmat_get_submatrix(), and bvec_get_subvector().
Return the length of the vector
Definition at line 225 of file vec.c.
References Vec_length.
Referenced by __bvec(), _bvec_push(), bmat_copy_col(), bmat_copy_row(), bmat_diag(), bmat_new_diag(), bmat_set_col(), bmat_set_diag(), bvec_1N(), bvec_arithm(), bvec_ber(), bvec_clone(), bvec_copy_from_cvec(), bvec_copy_from_ivec(), bvec_copy_from_vec(), bvec_copy_mem(), bvec_count(), bvec_distance_hamming(), bvec_eq(), bvec_file_read_bits(), bvec_file_write_bits(), bvec_find(), bvec_find_first(), bvec_find_sorted(), bvec_fread(), bvec_fwrite(), bvec_geom(), bvec_geq(), bvec_new_concat(), bvec_new_deinterleave_block(), bvec_new_interleave_block(), bvec_new_intersection(), bvec_new_reverse(), bvec_new_union(), bvec_new_unique(), bvec_pack(), bvec_range(), bvec_replace(), bvec_reverse(), bvec_to_bmat(), bvec_to_cvec(), bvec_to_ivec(), bvec_to_vec(), bvec_unpack(), bvecivec_inner_product(), channel_bsc(), convolutional_code_encode(), cvec_copy_from_bvec(), imat_bvec_mul(), it_vfprintf(), ivec_copy_from_bvec(), main(), modulate_bpsk(), vec_copy_from_bvec(), vlc_decode_concat(), and vlc_decode_concat_N().
Return the maximum length of the vector (number of allocated elements)
Definition at line 249 of file vec.c.
References Vec_length_max.
Allocate a vector
Definition at line 173 of file vec.c.
References Vec_new.
Referenced by bmat_get_col(), bmat_get_diag(), bmat_get_row(), bmat_to_bvec(), bvec_clone(), bvec_file_read_bits(), bvec_get_subvector(), bvec_index_by(), bvec_new_1N(), bvec_new_arithm(), bvec_new_concat(), bvec_new_deinterleave_block(), bvec_new_fread(), bvec_new_geom(), bvec_new_interleave_block(), bvec_new_intersection(), bvec_new_range(), bvec_new_reverse(), bvec_new_set(), bvec_new_union(), bvec_new_unique(), bvec_new_void(), channel_bsc(), convolutional_code_encode(), it_read_bmat(), it_viterbi_decode(), ivec_to_bvec(), main(), source_binary(), and vec_to_bvec().
Vector allocation with explicit allocation of the maximum number of elements
Definition at line 112 of file vec.c.
References Vec_new_alloc.
Referenced by bvec_new_string(), parser_get_bvec(), parser_get_bvec_verbose(), and vlc_encode_concat().
Concatenate two vectors
Definition at line 3213 of file vec.c.
References bvec_length(), and bvec_new().
Same but a geometric sequence of geometric factor r
Definition at line 4174 of file vec.c.
References bvec_new(), and it_assert.
Intersection of two sets represented by the two input vectors
Definition at line 3459 of file vec.c.
References bvec_length(), bvec_new(), bvec_push, ivec_delete(), ivec_length(), and ivec_new_zeros().
New vectors of ones
Definition at line 3777 of file vec.c.
References bvec_new_set().
Referenced by main().
Constant vector
Definition at line 3990 of file vec.c.
References bvec_new(), and bvec_set().
Referenced by bvec_new_ones(), and bvec_new_zeros().
Union of two sets represented by the two input vectors
Definition at line 3373 of file vec.c.
References bvec_length(), bvec_new(), bvec_push, ivec_delete(), ivec_length(), and ivec_new_zeros().
Vector created from the input vector by taking one occurences of each possible value of the input vector
Definition at line 3291 of file vec.c.
References bvec_length(), bvec_new(), bvec_push, ivec_delete(), ivec_length(), and ivec_new_zeros().
bvec bvec_new_void | ( | ) |
Create a vectors of zeros
Definition at line 3730 of file vec.c.
References bvec_new_set().
Referenced by bvec_file_write_bits(), and vlc_huffman().
void bvec_ones | ( | bvec | ) |
Pack/unpack all bits of a binary vector together
Definition at line 721 of file vec.c.
References bvec_length().
void bvec_range | ( | bvec | ) |
Set the vector elements to 0,1, ... n-1
Definition at line 3807 of file vec.c.
References bvec_length().
Replace a given value by another for all vector components
Definition at line 3094 of file vec.c.
References bvec_count(), bvec_length(), and ivec_new().
void bvec_reverse | ( | bvec | v | ) |
Set all the elements of the vector to a given value
Definition at line 359 of file vec.c.
References Vec_set.
Referenced by bvec_new_set(), and bvec_ones().
Set the elements of a subvector to a given value val
Definition at line 387 of file vec.c.
References Vec_set_between.
Referenced by vlc_huffman().
Modify a given element subset of a vector to another vector
Definition at line 415 of file vec.c.
References VEC_END_PARAM, and Vec_set_subvector.
void bvec_sort | ( | bvec | v | ) |
Sort the vector by increasing values
Definition at line 3652 of file vec.c.
References byte_leq(), and Vec_sort().
Return a vector of index corresponding to increasing values of the input vector
Definition at line 3658 of file vec.c.
References byte_leq_index(), and Vec_sort_index().
Vector type conversion
Definition at line 828 of file vec.c.
References bvec_length(), cimag, creal, and cvec_new().
Vector type conversion
Definition at line 803 of file vec.c.
References bvec_length(), and ivec_new().
Vector type conversion
Definition at line 816 of file vec.c.
References bvec_length(), and vec_new().
Pack/unpack all bits of a binary vector together
Definition at line 741 of file vec.c.
References bvec_length().
void bvec_void | ( | bvec | ) |
void bvec_zeros | ( | bvec | ) |
Inner product of two vectors
Definition at line 1642 of file vec.c.
References bvec_length(), and ivec_length().
static int byte_leq | ( | const void * | d1, | |
const void * | d2 | |||
) | [static] |
static int byte_leq_index | ( | const void * | d1, | |
const void * | d2 | |||
) | [static] |
void cvec_1N | ( | cvec | ) |
Set the vector elements to 1,2, ... n
Definition at line 3855 of file vec.c.
References cvec_length(), _cplx_::i, and _cplx_::r.
void cvec_abssqr | ( | cvec | v | ) |
elementwise |v_i|^2
Definition at line 1683 of file vec.c.
References cimag, creal, and cvec_length().
Referenced by cvec_fft_autocorr().
Set the vector to an arithmetic sequence
Definition at line 3897 of file vec.c.
References cadd(), and cvec_length().
Clone a vector (allocate memory and copy data)
Definition at line 541 of file vec.c.
References cvec_length(), cvec_new(), and Vec_copy.
Referenced by cvec_fft_autocorr(), cvec_fft_conv(), cvec_fft_corr(), it_dft(), it_fft(), it_idft(), and it_ifft().
void cvec_conj | ( | cvec | v | ) |
Hermitian product of two complex vectors
Definition at line 1504 of file vec.c.
References cconj(), cmul(), and cvec_length().
Referenced by cvec_fft_corr().
Copy the content of a vector into another vector
Definition at line 507 of file vec.c.
References Vec_copy.
Copy with conversion (lengths must match)
Definition at line 663 of file vec.c.
References bvec_length(), cvec_length(), _cplx_::i, and _cplx_::r.
Copy with conversion (lengths must match)
Definition at line 651 of file vec.c.
References cvec_length(), _cplx_::i, ivec_length(), and _cplx_::r.
Copy with conversion (lengths must match)
Definition at line 639 of file vec.c.
References cvec_length(), _cplx_::i, _cplx_::r, and vec_length().
Copy the vector into a buffer (which must be a valid allocated pointer)
Definition at line 711 of file vec.c.
References cvec_length().
Count the number of elements equal to a given value a
Definition at line 3165 of file vec.c.
References ceq(), and cvec_length().
Referenced by cvec_find(), and cvec_replace().
cumulative vector sum
v | the input vector v |
Definition at line 2021 of file vec.c.
References cadd(), cvec_length(), and cvec_new().
substract a specified value to the vector components
Definition at line 1341 of file vec.c.
References csub(), and cvec_length().
void cvec_decr_real | ( | cvec | v, | |
double | a | |||
) |
substract a specified real value to the complex components
Definition at line 1291 of file vec.c.
References creal, and cvec_length().
void cvec_delete | ( | cvec | v | ) |
Free a vector
Definition at line 203 of file vec.c.
References Vec_delete.
Referenced by _fft(), _ifft(), cmat_inv(), cvec_fft_conv(), cvec_fft_corr(), it_dft_real(), it_fdft(), it_fzt(), it_idft_real(), it_read_cmat(), main(), and mat_real_schur().
Component per component division
Definition at line 1493 of file vec.c.
References cdiv(), and cvec_length().
divide the components per a
Definition at line 1359 of file vec.c.
References ceq(), cinv(), cmul(), cplx_0, and cvec_length().
Referenced by cmat_inv().
void cvec_div_by_real | ( | cvec | v, | |
double | a | |||
) |
Definition at line 1311 of file vec.c.
References cvec_length(), _cplx_::i, and _cplx_::r.
Referenced by cvec_fft_autocorr(), cvec_fft_conv(), cvec_fft_corr(), it_ifft(), and it_sidft().
Return true iff all the vectors v1 and v2 are equal component per component
Definition at line 1119 of file vec.c.
References ceq(), and cvec_length().
Referenced by cmat_eq().
Return the set of positions where a given value occurs
Definition at line 2965 of file vec.c.
References ceq(), cvec_count(), cvec_length(), and ivec_new().
Return the first position where the value a occurs, NULL_INDEX if the research is not successful
Definition at line 2908 of file vec.c.
References ceq(), cvec_length(), and NULL_INDEX.
Set the vector to an geometric sequence
Definition at line 3938 of file vec.c.
References cmul(), and cvec_length().
allocate a new vector formed by a subset of a given vector
Definition at line 462 of file vec.c.
References cvec_init(), cvec_new(), and VEC_END_PARAM.
add a to the components
Definition at line 1332 of file vec.c.
References cadd(), and cvec_length().
void cvec_incr_real | ( | cvec | v, | |
double | a | |||
) |
Return the vector composed of the elements of v indexed by idx
Definition at line 3522 of file vec.c.
References cvec_new(), and ivec_length().
Initialize the vector from a buffer of the same type
Definition at line 339 of file vec.c.
References Vec_init.
Referenced by cvec_get_subvector().
Return the length of the vector
Definition at line 231 of file vec.c.
References Vec_length.
Referenced by __cvec(), _cvec_push(), bvec_copy_from_cvec(), cmat_cols_sum(), cmat_copy_col(), cmat_copy_row(), cmat_cvec_mul(), cmat_diag(), cmat_new_diag(), cmat_rows_sum(), cmat_set_col(), cmat_set_diag(), cvec_1N(), cvec_abssqr(), cvec_add(), cvec_arithm(), cvec_clone(), cvec_conj(), cvec_conj_mul(), cvec_copy_from_bvec(), cvec_copy_from_ivec(), cvec_copy_from_vec(), cvec_copy_mem(), cvec_count(), cvec_cum_sum(), cvec_decr(), cvec_decr_real(), cvec_distance_hamming(), cvec_div(), cvec_div_by(), cvec_div_by_real(), cvec_eq(), cvec_eq_tol(), cvec_fft_autocorr(), cvec_fft_conv(), cvec_fft_corr(), cvec_find(), cvec_find_first(), cvec_fread(), cvec_fwrite(), cvec_geom(), cvec_incr(), cvec_incr_real(), cvec_mul(), cvec_mul_by(), cvec_mul_by_real(), cvec_neg(), cvec_new_abs(), cvec_new_concat(), cvec_new_reverse(), cvec_range(), cvec_replace(), cvec_reverse(), cvec_sub(), cvec_sum(), cvec_to_cmat(), it_dft(), it_fdft(), it_fft(), it_fzt(), it_idft(), it_idft_real(), it_ifft(), it_sdft(), it_sidft(), it_vfprintf(), ivec_copy_from_cvec(), and vec_copy_from_cvec().
Return the maximum length of the vector (number of allocated elements)
Definition at line 255 of file vec.c.
References Vec_length_max.
Component per component multiplication
The result is stored in the vector which is the first parameter
Definition at line 1482 of file vec.c.
References cmul(), and cvec_length().
Referenced by cvec_fft_conv(), it_fdft(), and it_fzt().
multiply the components per a specified value
Definition at line 1350 of file vec.c.
References cmul(), and cvec_length().
void cvec_mul_by_real | ( | cvec | v, | |
double | a | |||
) |
void cvec_neg | ( | cvec | v | ) |
Allocate a vector
Definition at line 179 of file vec.c.
References Vec_new.
Referenced by _fft(), _ifft(), bvec_to_cvec(), cmat_cols_sum(), cmat_get_col(), cmat_get_diag(), cmat_get_row(), cmat_inv(), cmat_rows_sum(), cmat_to_cvec(), cvec_clone(), cvec_cum_sum(), cvec_get_subvector(), cvec_index_by(), cvec_new_1N(), cvec_new_arithm(), cvec_new_concat(), cvec_new_fread(), cvec_new_geom(), cvec_new_range(), cvec_new_reverse(), cvec_new_set(), cvec_new_unit_roots(), cvec_new_void(), it_dft(), it_fdft(), it_fzt(), it_idft(), it_read_cmat(), it_sdft(), it_sidft(), ivec_to_cvec(), main(), and vec_to_cvec().
The sequence 1, 2.. N
Definition at line 4040 of file vec.c.
References cimag, creal, and cvec_new().
New vector generated with the absolute values of the input vector
Definition at line 1786 of file vec.c.
References cnorm(), cvec_length(), and vec_new().
Vector allocation with explicit allocation of the maximum number of elements
Definition at line 118 of file vec.c.
References Vec_new_alloc.
Referenced by cvec_new_string(), parser_get_cvec(), and parser_get_cvec_verbose().
Concatenate two vectors
Definition at line 3229 of file vec.c.
References cvec_length(), and cvec_new().
Same but a geometric sequence of geometric factor r
Definition at line 4186 of file vec.c.
References cmul(), and cvec_new().
Reverse the vector
Definition at line 2854 of file vec.c.
References cimag, creal, cvec_length(), and cvec_new().
Constant vector
Definition at line 3997 of file vec.c.
References cvec_new(), and cvec_set().
Referenced by cvec_new_ones(), and cvec_new_zeros().
generate $e^{2i Pi k / N} = cos(2 k Pi / N) + i sin(2 k Pi / N)$
Definition at line 4200 of file vec.c.
References cimag, creal, cvec_new(), and M_PI.
Referenced by fft_init().
cvec cvec_new_void | ( | ) |
Create a vectors of zeros
Definition at line 3735 of file vec.c.
References cplx_0, and cvec_new_set().
Referenced by cmat_cvec_mul(), cmat_vec_mul(), it_fdft(), it_fzt(), and mat_h2rs().
void cvec_ones | ( | cvec | ) |
Set all the vector elements to 1
Definition at line 3759 of file vec.c.
References cplx_1, and cvec_set().
void cvec_range | ( | cvec | ) |
Set the vector elements to 0,1, ... n-1
Definition at line 3816 of file vec.c.
References cvec_length(), _cplx_::i, and _cplx_::r.
Replace a given value by another for all vector components
Definition at line 3111 of file vec.c.
References ceq(), cvec_count(), cvec_length(), and ivec_new().
void cvec_reverse | ( | cvec | v | ) |
Reverse the vector
Definition at line 2786 of file vec.c.
References cimag, creal, and cvec_length().
Set all the elements of the vector to a given value
Definition at line 366 of file vec.c.
References Vec_set.
Referenced by cvec_new_set(), and cvec_ones().
Set the elements of a subvector to a given value val
Definition at line 394 of file vec.c.
References Vec_set_between.
Modify a given element subset of a vector to another vector
Definition at line 422 of file vec.c.
References VEC_END_PARAM, and Vec_set_subvector.
vector sum
Definition at line 1974 of file vec.c.
References cadd(), cplx_0, and cvec_length().
Referenced by cmat_row_sum().
sum of a subset of the vector specified by an index interval
Definition at line 2077 of file vec.c.
References cadd(), cplx_0, and VEC_END_PARAM.
void cvec_void | ( | cvec | ) |
void cvec_zeros | ( | cvec | ) |
static int double_leq | ( | const void * | d1, | |
const void * | d2 | |||
) | [static] |
static int double_leq_index | ( | const void * | d1, | |
const void * | d2 | |||
) | [static] |
static int int_leq | ( | const void * | d1, | |
const void * | d2 | |||
) | [static] |
static int int_leq_index | ( | const void * | d1, | |
const void * | d2 | |||
) | [static] |
void ivec_1N | ( | ivec | ) |
Set the vector elements to 1,2, ... n
Definition at line 3837 of file vec.c.
References ivec_length().
void ivec_abs | ( | ivec | v | ) |
Apply absolute value
Definition at line 1760 of file vec.c.
References ivec_length().
Referenced by ivec_new_abs().
addition
Definition at line 1416 of file vec.c.
References ivec_length().
Referenced by ivec_new_add().
ivec ivec_apply_function | ( | ivec | v, | |
it_ifunction_t | function, | |||
it_args_t | args | |||
) |
Apply a function to all vector elements
Definition at line 2714 of file vec.c.
References ivec_length().
Referenced by imat_apply_function(), and imat_new_apply_function().
void ivec_arithm | ( | ivec | , | |
int | start, | |||
int | incr | |||
) |
Set the vector to an arithmetic sequence
Definition at line 3877 of file vec.c.
References ivec_length().
Clone a vector (allocate memory and copy data)
Definition at line 527 of file vec.c.
References ivec_length(), ivec_new(), and Vec_copy.
Referenced by ivec_median(), ivec_new_add(), ivec_new_div(), ivec_new_mul(), ivec_new_sub(), ivec_new_unique(), and vlc_clone().
Convolution of two vectors
Definition at line 4232 of file vec.c.
References ivec_length(), and ivec_new_zeros().
Copy the content of a vector into another vector
Definition at line 495 of file vec.c.
References Vec_copy.
Copy with conversion (lengths must match)
Definition at line 588 of file vec.c.
References bvec_length(), and ivec_length().
Copy with conversion (lengths must match)
Definition at line 598 of file vec.c.
References creal, cvec_length(), and ivec_length().
Copy with conversion (lengths must match)
Definition at line 578 of file vec.c.
References ivec_length(), and vec_length().
void ivec_copy_mem | ( | int * | buf, | |
ivec | v | |||
) |
Copy the vector into a buffer (which must be a valid allocated pointer)
Definition at line 689 of file vec.c.
References ivec_length().
Count the number of elements equal to a given value a
Definition at line 3153 of file vec.c.
References ivec_length().
Referenced by ivec_find(), and ivec_replace().
cumulative vector sum
v | the input vector v |
Definition at line 2001 of file vec.c.
References INT_MAX, INT_MIN, it_warning(), ivec_length(), ivec_new(), and Vec_length.
void ivec_decr | ( | ivec | v, | |
int | a | |||
) |
substract a specified value to the vector components
Definition at line 1253 of file vec.c.
References ivec_length().
Referenced by imat_row_decr(), and test_quantizer().
Delete an element from the vector
Definition at line 895 of file vec.c.
References Vec_del.
Referenced by main(), vlc_energy_order(), and vlc_hu_tucker().
void ivec_delete | ( | ivec | v | ) |
Free a vector
Definition at line 191 of file vec.c.
References Vec_delete.
Referenced by __ivec_deinterleave_block(), __ivec_interleave_block(), bvec_new_intersection(), bvec_new_union(), bvec_new_unique(), fpICA(), it_ica(), it_read_imat(), it_viterbi_decode(), ivec_k_max_between(), ivec_k_max_index_between(), ivec_k_min_between(), ivec_k_min_index_between(), ivec_median(), ivec_new_intersection(), ivec_new_union(), ivec_new_unique(), main(), mat_det(), mat_solve_mat(), mat_solve_vec(), PCAmat(), test_quantizer(), trellis_coded_quantizer_dequantize(), trellis_coded_quantizer_quantize(), vec_k_max_index_between(), vec_k_min_index_between(), vlc_delete(), vlc_energy_order(), vlc_hu_tucker(), and vlc_quasi_lexicographic().
Component per component division
Definition at line 1449 of file vec.c.
References ivec_length().
Referenced by ivec_new_div().
void ivec_div_by | ( | ivec | v, | |
int | a | |||
) |
divide the components per a
Definition at line 1271 of file vec.c.
References ivec_length().
Referenced by imat_row_div_by().
Return true iff all the vectors v1 and v2 are equal component per component
Definition at line 1085 of file vec.c.
References ivec_length().
Referenced by imat_eq().
Return the set of positions where a given value occurs
Definition at line 2935 of file vec.c.
References ivec_count(), ivec_length(), and ivec_new().
Return the first position where the value a occurs, NULL_INDEX if the research is not successful
Definition at line 2886 of file vec.c.
References ivec_length(), and NULL_INDEX.
Return the set of positions where a given value occurs assuming a sorted set
Definition at line 3008 of file vec.c.
References ivec_length(), and left.
void ivec_geom | ( | ivec | , | |
int | start, | |||
int | r | |||
) |
Set the vector to an geometric sequence
Definition at line 3918 of file vec.c.
References ivec_length().
allocate a new vector formed by a subset of a given vector
Definition at line 440 of file vec.c.
References ivec_init(), ivec_new(), and VEC_END_PARAM.
int ivec_head | ( | ivec | v | ) |
void ivec_incr | ( | ivec | v, | |
int | a | |||
) |
add a to the components
Definition at line 1244 of file vec.c.
References ivec_length().
Referenced by imat_row_incr().
Return the vector composed of the elements of v indexed by idx
Definition at line 3498 of file vec.c.
References ivec_length(), and ivec_new().
Referenced by vlc_quasi_lexicographic().
Initialize the vector from a buffer of the same type
Definition at line 327 of file vec.c.
References Vec_init.
Referenced by imat_get_submatrix(), ivec_get_subvector(), and ivec_sread().
Search the k greatest elements
Definition at line 2329 of file vec.c.
References ivec_k_max_between(), and ivec_length().
Referenced by main().
Search the k greatest elements between two positions
Definition at line 2288 of file vec.c.
References ivec_delete(), ivec_k_max_between(), ivec_length(), ivec_new(), ivec_new_alloc(), ivec_new_void(), and ivec_push.
Referenced by ivec_k_max(), and ivec_k_max_between().
Search the indexes where the k greatest elements occur
Definition at line 2525 of file vec.c.
References ivec_k_max_index_between(), and ivec_length().
Search the indexes where the k greatest elements between two positions occur
Definition at line 2483 of file vec.c.
References ivec_delete(), ivec_k_max_index_between(), ivec_length(), ivec_new(), ivec_new_alloc(), ivec_new_void(), and ivec_push.
Referenced by ivec_k_max_index(), ivec_k_max_index_between(), and main().
Search the k smallest elements
Definition at line 2281 of file vec.c.
References ivec_k_min_between(), and ivec_length().
Search the k smallest elements between two positions
Definition at line 2239 of file vec.c.
References ivec_delete(), ivec_k_min_between(), ivec_length(), ivec_new(), ivec_new_alloc(), ivec_new_void(), and ivec_push.
Referenced by ivec_k_min(), and ivec_k_min_between().
Search the indexes where the k smallest elements occur
Definition at line 2476 of file vec.c.
References ivec_k_min_index_between(), and ivec_length().
Search the indexes where the k smallest elements between two positions occur
Definition at line 2434 of file vec.c.
References ivec_delete(), ivec_k_min_index_between(), ivec_length(), ivec_new(), ivec_new_alloc(), ivec_new_void(), and ivec_push.
Referenced by ivec_k_min_index(), and ivec_k_min_index_between().
Return the length of the vector
Definition at line 219 of file vec.c.
References Vec_length.
Referenced by __ivec(), _ivec_push(), bcjr_side(), bvec_copy_from_ivec(), bvec_index_by(), bvec_new_intersection(), bvec_new_union(), bvec_new_unique(), bvecivec_inner_product(), convolutional_code_encode_symbolic(), cvec_copy_from_ivec(), cvec_index_by(), histogram(), histogram_cond(), histogram_normalized(), imat_cols_sum(), imat_copy_col(), imat_copy_row(), imat_diag(), imat_ivec_mul(), imat_new_diag(), imat_rows_sum(), imat_set_col(), imat_set_diag(), it_vfprintf(), it_viterbi_decode_symbolic(), ivec_1N(), ivec_abs(), ivec_add(), ivec_apply_function(), ivec_arithm(), ivec_clone(), ivec_conv(), ivec_copy_from_bvec(), ivec_copy_from_cvec(), ivec_copy_from_vec(), ivec_copy_mem(), ivec_count(), ivec_cum_sum(), ivec_decr(), ivec_distance_hamming(), ivec_distance_levenshtein(), ivec_distance_mse(), ivec_distance_norm1(), ivec_distance_sqr(), ivec_div(), ivec_div_by(), ivec_eq(), ivec_find(), ivec_find_first(), ivec_find_sorted(), ivec_fread(), ivec_fwrite(), ivec_geom(), ivec_geq(), ivec_imat_mul(), ivec_incr(), ivec_index_by(), ivec_inner_product(), ivec_k_max(), ivec_k_max_between(), ivec_k_max_index(), ivec_k_max_index_between(), ivec_k_min(), ivec_k_min_between(), ivec_k_min_index(), ivec_k_min_index_between(), ivec_max_index(), ivec_mean(), ivec_median(), ivec_min_index(), ivec_mul(), ivec_mul_by(), ivec_neg(), ivec_new_abs(), ivec_new_apply_function(), ivec_new_concat(), ivec_new_deinterleave_block(), ivec_new_interleave_block(), ivec_new_intersection(), ivec_new_reverse(), ivec_new_union(), ivec_new_unique(), ivec_norm(), ivec_range(), ivec_replace(), ivec_reverse(), ivec_ser(), ivec_sqr(), ivec_sub(), ivec_sum(), ivec_to_bvec(), ivec_to_cvec(), ivec_to_imat(), ivec_to_spivec(), ivec_to_vec(), main(), mat_ivec_mul(), mat_lu(), mat_solve_mat(), mat_solve_vec(), scalar_quantizer_dequantize(), selcol(), spivec_distance_norm1(), spivec_distance_sqr(), spivec_inner_product(), spivec_to_ivec(), spvec_distance_norm1(), spvec_distance_sqr(), spvec_inner_product(), spvec_to_vec(), trellis_coded_quantizer_dequantize(), vec_copy_from_ivec(), vec_index_by(), vec_k_max_index_between(), vec_k_min_index_between(), vecivec_inner_product(), viterbi_side(), vlc_encode_concat(), vlc_energy_order(), vlc_nb_bits_required(), and vlc_read().
Return the maximum length of the vector (number of allocated elements)
Definition at line 243 of file vec.c.
References Vec_length_max.
Referenced by main().
int ivec_max | ( | ivec | v | ) |
Maxinum of a vector
Definition at line 1881 of file vec.c.
References INT_MIN, and Vec_length.
Referenced by test_quantizer().
Position where the vector maximum occurs
Definition at line 1906 of file vec.c.
References INT_MIN, ivec_length(), and NULL_INDEX.
double ivec_mean | ( | ivec | v | ) |
mean of the input vector
Definition at line 1920 of file vec.c.
References ivec_length(), and ivec_sum().
int ivec_median | ( | ivec | v | ) |
median value of the input vector
Definition at line 2544 of file vec.c.
References it_warning(), ivec_clone(), ivec_delete(), ivec_length(), and ivec_sort().
Referenced by main().
int ivec_min | ( | ivec | v | ) |
Mininum of a vector
Definition at line 1869 of file vec.c.
References INT_MAX, and Vec_length.
Referenced by test_quantizer().
Position where the vector minimum occurs
Definition at line 1892 of file vec.c.
References INT_MAX, ivec_length(), and NULL_INDEX.
Component per component multiplication
The result is stored in the vector which is the first parameter
Definition at line 1438 of file vec.c.
References ivec_length().
Referenced by ivec_new_mul().
void ivec_mul_by | ( | ivec | v, | |
int | a | |||
) |
multiply the components per a specified value
Definition at line 1262 of file vec.c.
References ivec_length().
Referenced by imat_row_mul_by().
void ivec_neg | ( | ivec | v | ) |
Allocate a vector
Definition at line 167 of file vec.c.
References Vec_new.
Referenced by bvec_find(), bvec_replace(), bvec_to_ivec(), convolutional_code_encode_symbolic(), cvec_find(), cvec_replace(), fft_init(), getSamples(), imat_cols_sum(), imat_get_col(), imat_get_diag(), imat_get_row(), imat_rows_sum(), imat_to_ivec(), it_read_imat(), ivec_clone(), ivec_cum_sum(), ivec_find(), ivec_get_subvector(), ivec_index_by(), ivec_k_max_between(), ivec_k_max_index_between(), ivec_k_min_between(), ivec_k_min_index_between(), ivec_new_1N(), ivec_new_abs(), ivec_new_apply_function(), ivec_new_arithm(), ivec_new_concat(), ivec_new_deinterleave_block(), ivec_new_fread(), ivec_new_geom(), ivec_new_interleave_block(), ivec_new_range(), ivec_new_reverse(), ivec_new_set(), ivec_new_unique(), ivec_new_void(), ivec_replace(), ivec_to_spivec(), logviterbi(), main(), mat_solve_mat(), mat_solve_vec(), scalar_quantizer_quantize(), source_memoryless(), source_uniform_int(), trellis_coded_quantizer_dequantize(), trellis_coded_quantizer_quantize(), vec_find(), vec_k_max_index_between(), vec_k_min_index_between(), vec_replace(), vec_to_ivec(), vec_to_spvec(), viterbi(), viterbi_side(), vlc_decode_concat_N(), vlc_hu_tucker(), vlc_new(), and vlc_quasi_lexicographic().
New vector generated with the absolute values of the input vector
Definition at line 1778 of file vec.c.
References ivec_abs(), ivec_length(), and ivec_new().
addition stored in a new vector
Definition at line 1547 of file vec.c.
References ivec_add(), and ivec_clone().
Vector allocation with explicit allocation of the maximum number of elements
Definition at line 106 of file vec.c.
References Vec_new_alloc.
Referenced by ivec_k_max_between(), ivec_k_max_index_between(), ivec_k_min_between(), ivec_k_min_index_between(), ivec_new_intersection(), ivec_new_string(), ivec_new_union(), parser_get_ivec(), parser_get_ivec_verbose(), vec_k_max_index_between(), vec_k_min_index_between(), vlc_decode_concat(), vlc_energy_order(), and vlc_read().
ivec ivec_new_apply_function | ( | ivec | v, | |
it_ifunction_t | function, | |||
it_args_t | args | |||
) |
Apply a function to all vector elements
Definition at line 2726 of file vec.c.
References ivec_length(), and ivec_new().
New arithmetic sequence
Definition at line 4110 of file vec.c.
References ivec_new().
Referenced by ivec_new_perm(), and vlc_hu_tucker().
Concatenate two vectors
Definition at line 3197 of file vec.c.
References ivec_length(), and ivec_new().
Component per component division
Definition at line 1571 of file vec.c.
References ivec_clone(), and ivec_div().
Same but a geometric sequence of geometric factor r
Definition at line 4161 of file vec.c.
References it_assert, and ivec_new().
Referenced by main().
Intersection of two sets represented by the two input vectors
Definition at line 3428 of file vec.c.
References ivec_delete(), ivec_length(), ivec_new_alloc(), ivec_new_unique(), and ivec_push.
Referenced by main().
Component per component multiplication
Definition at line 1563 of file vec.c.
References ivec_clone(), and ivec_mul().
New vectors of ones
Definition at line 3771 of file vec.c.
References ivec_new_set().
Referenced by main(), and vlc_hu_tucker().
ivec ivec_new_perm | ( | size_t | N | ) |
Generate a new vector representing a random permutation
Definition at line 4296 of file vec.c.
References it_assert, it_rand(), and ivec_new_arithm().
Constant vector
Definition at line 3983 of file vec.c.
References ivec_new(), and ivec_set().
Referenced by ivec_new_ones(), and ivec_new_zeros().
Union of two sets represented by the two input vectors
Definition at line 3342 of file vec.c.
References ivec_delete(), ivec_length(), ivec_new_alloc(), ivec_new_unique(), and ivec_push.
Referenced by main().
Vector created from the input vector by taking one occurences of each possible value of the input vector
Definition at line 3269 of file vec.c.
References ivec_clone(), ivec_delete(), ivec_length(), ivec_new(), ivec_push, and ivec_sort().
Referenced by ivec_new_intersection(), ivec_new_union(), and main().
ivec ivec_new_void | ( | ) |
Create a vector of length 0
Definition at line 3958 of file vec.c.
References ivec_new().
Referenced by ivec_k_max_between(), ivec_k_max_index_between(), ivec_k_min_between(), ivec_k_min_index_between(), vec_k_max_index_between(), and vec_k_min_index_between().
Create a vectors of zeros
Definition at line 3725 of file vec.c.
References ivec_new_set().
Referenced by bvec_new_intersection(), bvec_new_union(), bvec_new_unique(), histogram(), imat_bvec_mul(), imat_ivec_mul(), ivec_conv(), ivec_imat_mul(), mat_det(), PCAmat(), spivec_to_ivec(), and vlc_new().
double ivec_norm | ( | ivec | v, | |
int | nr | |||
) |
void ivec_ones | ( | ivec | ) |
void ivec_range | ( | ivec | ) |
Set the vector elements to 0,1, ... n-1
Definition at line 3798 of file vec.c.
References ivec_length().
Replace a given value by another for all vector components
Definition at line 3077 of file vec.c.
References ivec_count(), ivec_length(), and ivec_new().
void ivec_reverse | ( | ivec | v | ) |
Reverse the vector
Definition at line 2756 of file vec.c.
References ivec_length().
Referenced by main().
Set all the elements of the vector to a given value
Definition at line 352 of file vec.c.
References Vec_set.
Referenced by ivec_new_set(), ivec_ones(), main(), vlc_decode_concat_N(), vlc_hu_tucker(), and vlc_new().
Set the elements of a subvector to a given value val
Definition at line 380 of file vec.c.
References Vec_set_between.
Referenced by vlc_quasi_lexicographic().
Modify a given element subset of a vector to another vector
Definition at line 408 of file vec.c.
References VEC_END_PARAM, and Vec_set_subvector.
void ivec_sort | ( | ivec | v | ) |
Sort the vector by increasing values
Definition at line 3623 of file vec.c.
References int_leq(), and Vec_sort().
Referenced by ivec_median(), ivec_new_unique(), and main().
Return a vector of index corresponding to increasing values of the input vector
Definition at line 3629 of file vec.c.
References int_leq_index(), and Vec_sort_index().
void ivec_sqr | ( | ivec | v | ) |
square the vector component per component
Definition at line 1705 of file vec.c.
References ivec_length().
Substraction
Definition at line 1427 of file vec.c.
References ivec_length().
Referenced by ivec_new_sub().
int ivec_sum | ( | ivec | v | ) |
vector sum
Definition at line 1958 of file vec.c.
References INT_MAX, INT_MIN, it_warning(), and ivec_length().
Referenced by fpICA(), imat_row_sum(), it_ica(), ivec_mean(), PCAmat(), and selcol().
sum of a subset of the vector specified by an index interval
Definition at line 2060 of file vec.c.
References INT_MAX, INT_MIN, it_warning(), and VEC_END_PARAM.
Vector type conversion
Definition at line 775 of file vec.c.
References bvec_new(), and ivec_length().
Vector type conversion
Definition at line 787 of file vec.c.
References cimag, creal, cvec_new(), and ivec_length().
convert a vector into a sparse vector
Definition at line 4349 of file vec.c.
References ivec_length(), and ivec_new().
Vector type conversion
Definition at line 762 of file vec.c.
References ivec_length(), and vec_new().
void ivec_void | ( | ivec | ) |
void ivec_zeros | ( | ivec | ) |
Inner product between two sparse vectors
Definition at line 4452 of file vec.c.
References ivec_length().
convert a sparse vector into a vector
Definition at line 4395 of file vec.c.
References ivec_length(), and ivec_new_zeros().
Inner product between two sparse vectors
Definition at line 4419 of file vec.c.
References ivec_length().
convert a sparse vector into a vector
Definition at line 4372 of file vec.c.
References ivec_length(), vec_length(), and vec_new_zeros().
void vec_1N | ( | vec | ) |
Set the vector elements to 1,2, ... n
Definition at line 3828 of file vec.c.
References vec_length().
Referenced by main().
void vec_abs | ( | vec | v | ) |
Apply absolute value
Definition at line 1750 of file vec.c.
References vec_length().
Referenced by fpICA(), and vec_new_abs().
addition
Definition at line 1372 of file vec.c.
References vec_length().
Referenced by channel_awgn(), fpICA(), mat_gs(), and vec_new_add().
void vec_apply_function | ( | vec | v, | |
it_function_t | function, | |||
it_args_t | args | |||
) |
Apply a function to all vector elements
Definition at line 2689 of file vec.c.
References vec_length().
Referenced by mat_apply_function(), mat_new_apply_function(), viterbi(), and viterbi_side().
void vec_arithm | ( | vec | , | |
double | start, | |||
double | incr | |||
) |
Set the vector to an arithmetic sequence
Definition at line 3867 of file vec.c.
References vec_length().
Clone a vector (allocate memory and copy data)
Definition at line 520 of file vec.c.
References Vec_copy, vec_length(), and vec_new().
Referenced by __wavelet_itransform(), fpICA(), lpoly_ediv(), main(), PCAmat(), poly_gcd(), scalar_quantizer_set_codebook(), vec_cov(), vec_median(), vec_new_add(), vec_new_div(), vec_new_mul(), vec_new_sub(), and vec_new_unique().
Clone a vector (allocate memory and copy data)
Definition at line 513 of file vec.c.
References __Vec_new(), Vec_copy, Vec_element_size, and Vec_length.
Convolution of two vectors
Definition at line 4218 of file vec.c.
References vec_length(), and vec_new_zeros().
Referenced by poly_mul().
Copy the content of a vector into another vector
Definition at line 489 of file vec.c.
References Vec_copy.
Referenced by __it_wavelet2D_copy(), __wavelet_transform(), bcjr(), bcjr_side(), fpICA(), logviterbi(), main(), viterbi(), and viterbi_side().
Copy with conversion (lengths must match)
Definition at line 558 of file vec.c.
References bvec_length(), and vec_length().
Copy with conversion (lengths must match)
Definition at line 568 of file vec.c.
References creal, cvec_length(), and vec_length().
Copy with conversion (lengths must match)
Definition at line 548 of file vec.c.
References ivec_length(), and vec_length().
void vec_copy_mem | ( | double * | buf, | |
vec | v | |||
) |
Copy the vector into a buffer (which must be a valid allocated pointer)
Definition at line 678 of file vec.c.
References vec_length().
Count the number of elements equal to a given value a
Definition at line 3129 of file vec.c.
References Vec_length.
Referenced by vec_find(), and vec_replace().
Covariance between two vectors
Definition at line 2627 of file vec.c.
References vec_clone(), vec_delete(), vec_length(), vec_mean(), vec_mul(), vec_new_set(), vec_sub(), and vec_sum().
Referenced by mat_cov().
cumulative vector sum
v | the input vector v |
Definition at line 1985 of file vec.c.
References Vec_length, vec_length(), and vec_new().
Referenced by it_rand_memoryless(), main(), and source_memoryless().
void vec_decr | ( | vec | v, | |
double | a | |||
) |
substract a specified value to the vector components
Definition at line 1214 of file vec.c.
References vec_length().
Referenced by mat_row_decr().
void vec_delete | ( | vec | v | ) |
Free a vector
Definition at line 185 of file vec.c.
References Vec_delete.
Referenced by __vec_deinterleave_block(), __vec_interleave_block(), __wavelet2D_destructor(), __wavelet2D_set_size(), __wavelet_destructor(), __wavelet_set_size(), bcjr(), bcjr_side(), convolutional_code_destructor(), entropy_markov(), fpICA(), it_function(), it_ica(), it_instanciate(), it_rand_memoryless(), it_read_fmat(), it_read_mat(), logviterbi(), lpoly_ediv(), main(), mat_cols_normalize(), mat_cond(), mat_cov(), mat_eig_sym(), mat_gs(), mat_h2rs(), mat_hessenberg(), mat_ls(), mat_norm2(), mat_pow_one_by_two(), mat_rank(), mat_svd(), PCAmat(), poly_div(), poly_gcd(), poly_mod(), remmean(), scalar_quantizer_destructor(), selcol(), source_estim_GG_from_histo(), source_memoryless(), test_quantizer(), vec_cov(), vec_k_max_between(), vec_k_min_between(), vec_median(), vec_new_intersection(), vec_new_union(), vec_new_unique(), viterbi(), viterbi_side(), vlc_energy_order(), vlc_hu_tucker(), vlc_huffman(), vlc_nodes_delta_energy(), vlc_nodes_entropy(), vlc_nodes_expectation(), vlc_nodes_proba0(), vlc_nodes_variance(), vlc_print_all(), vlc_quasi_lexicographic(), and whitenv().
Component per component division
Definition at line 1405 of file vec.c.
References vec_length().
Referenced by fpICA(), vec_new_div(), and vlc_energy_order().
void vec_div_by | ( | vec | v, | |
double | a | |||
) |
divide the components per a
Definition at line 1232 of file vec.c.
References vec_length().
Referenced by fpICA(), and mat_row_div_by().
Return true iff all the vectors v1 and v2 are equal component per component
Definition at line 1068 of file vec.c.
References vec_length().
Referenced by mat_eq().
void vec_exp | ( | vec | v | ) |
apply exponential
Definition at line 1741 of file vec.c.
References Vec_length.
Referenced by fpICA().
Return the set of positions where a given value occurs
Definition at line 2920 of file vec.c.
References ivec_new(), vec_count(), and Vec_length.
Return the first position where the value a occurs, NULL_INDEX if the research is not successful
Definition at line 2875 of file vec.c.
References NULL_INDEX, and Vec_length.
Return the set of positions where a given value occurs assuming a sorted set
Definition at line 2983 of file vec.c.
References left, and vec_length().
void vec_geom | ( | vec | , | |
double | start, | |||
double | r | |||
) |
Set the vector to an geometric sequence
Definition at line 3908 of file vec.c.
References vec_length().
allocate a new vector formed by a subset of a given vector
Definition at line 429 of file vec.c.
References VEC_END_PARAM, vec_init(), and vec_new().
Referenced by it_wavelet_split(), and scalar_quantizer_get_codebook_range().
double vec_head | ( | vec | v | ) |
void vec_incr | ( | vec | v, | |
double | a | |||
) |
add a to the components
Definition at line 1205 of file vec.c.
References vec_length().
Referenced by mat_row_incr().
Return the vector composed of the elements of v indexed by idx
Definition at line 3486 of file vec.c.
References ivec_length(), and vec_new().
Referenced by vlc_energy_order(), and vlc_quasi_lexicographic().
Initialize the vector from a buffer of the same type
Definition at line 321 of file vec.c.
References Vec_init.
Referenced by mat_get_submatrix(), vec_get_subvector(), and vec_sread().
Inner product of two vectors
Definition at line 1580 of file vec.c.
References vec_length().
Referenced by fpICA(), main(), and source_expectation().
Robustly computed inner product of two vectors
Definition at line 1593 of file vec.c.
References vec_length().
Search the k greatest elements
Definition at line 2232 of file vec.c.
References vec_k_max_between(), and vec_length().
Search the k greatest elements between two positions
Definition at line 2191 of file vec.c.
References vec_delete(), vec_k_max_between(), vec_length(), vec_new(), vec_new_alloc(), vec_new_void(), and vec_push.
Referenced by vec_k_max(), and vec_k_max_between().
Search the indexes where the k greatest elements occur
Definition at line 2427 of file vec.c.
References vec_k_max_index_between(), and vec_length().
Search the indexes where the k greatest elements between two positions occur
Definition at line 2385 of file vec.c.
References ivec_delete(), ivec_length(), ivec_new(), ivec_new_alloc(), ivec_new_void(), ivec_push, and vec_k_max_index_between().
Referenced by vec_k_max_index(), and vec_k_max_index_between().
Search the k smallest elements
Definition at line 2184 of file vec.c.
References vec_k_min_between(), and vec_length().
Search the k smallest elements between two positions
Definition at line 2142 of file vec.c.
References vec_delete(), vec_k_min_between(), vec_length(), vec_new(), vec_new_alloc(), vec_new_void(), and vec_push.
Referenced by vec_k_min(), and vec_k_min_between().
Search the indexes where the k smallest elements occur
Definition at line 2378 of file vec.c.
References vec_k_min_index_between(), and vec_length().
Search the indexes where the k smallest elements between two positions occur
Definition at line 2336 of file vec.c.
References ivec_delete(), ivec_length(), ivec_new(), ivec_new_alloc(), ivec_new_void(), ivec_push, and vec_k_min_index_between().
Referenced by vec_k_min_index(), and vec_k_min_index_between().
Length and max length vector operations
Definition at line 213 of file vec.c.
References Vec_length.
Referenced by __vec(), __wavelet_itransform(), __wavelet_pack(), __wavelet_transform(), __wavelet_unpack(), _vec_push(), arithmetic_coder_encode_symbol(), arithmetic_decoder_decode_symbol(), bspk_metrics(), bvec_copy_from_vec(), channel_awgn(), cmat_vec_mul(), cvec_copy_from_vec(), entropy(), fpICA(), fvec_fread(), fvec_fwrite(), imat_vec_mul(), it_instanciate(), it_rand_memoryless(), it_vfprintf(), it_wavelet_merge(), it_wavelet_split(), ivec_copy_from_vec(), main(), mat_cols_sum(), mat_copy_col(), mat_copy_row(), mat_diag(), mat_h2rs(), mat_new_diag(), mat_rank(), mat_rows_sum(), mat_set_col(), mat_set_diag(), mat_solve_vec(), mat_vec_mul(), PCAmat(), poly_add(), poly_is_null(), poly_normalize(), poly_shift(), poly_sub(), scalar_quantizer_quantize(), scalar_quantizer_set_codebook(), scalar_quantizer_set_index_range(), source_expectation(), source_memoryless(), source_pdf_GG(), source_variance(), spvec_distance_norm1(), spvec_distance_sqr(), spvec_to_vec(), trellis_coded_quantizer_quantize(), vec_1N(), vec_abs(), vec_add(), vec_apply_function(), vec_arithm(), vec_clone(), vec_conv(), vec_copy_from_bvec(), vec_copy_from_cvec(), vec_copy_from_ivec(), vec_copy_mem(), vec_cov(), vec_cum_sum(), vec_decr(), vec_distance_hamming(), vec_distance_kullback_leibler(), vec_distance_mse(), vec_distance_norm(), vec_div(), vec_div_by(), vec_eq(), vec_find_sorted(), vec_fread(), vec_fwrite(), vec_geom(), vec_geq(), vec_incr(), vec_inner_product(), vec_inner_product_robust(), vec_is_negative(), vec_k_max(), vec_k_max_between(), vec_k_max_index(), vec_k_min(), vec_k_min_between(), vec_k_min_index(), vec_mat_mul(), vec_max_index(), vec_median(), vec_min_index(), vec_mul(), vec_mul_by(), vec_neg(), vec_new_abs(), vec_new_apply_function(), vec_new_concat(), vec_new_deinterleave_block(), vec_new_interleave_block(), vec_new_intersection(), vec_new_normalize(), vec_new_pow(), vec_new_reverse(), vec_new_union(), vec_new_unique(), vec_norm(), vec_normalize(), vec_rand(), vec_randn(), vec_range(), vec_reverse(), vec_ser(), vec_sqr(), vec_sub(), vec_tanh(), vec_to_bvec(), vec_to_cvec(), vec_to_ivec(), vec_to_mat(), vec_to_spvec(), vecivec_inner_product(), vlc_hu_tucker(), and vlc_nodes_entropy().
Return the maximum length of the vector (number of allocated elements)
Definition at line 237 of file vec.c.
References Vec_length_max.
Referenced by main().
void vec_log | ( | vec | v | ) |
logarithm of a vector component per component
Definition at line 1723 of file vec.c.
References Vec_length.
void vec_log10 | ( | vec | v | ) |
logarithm of a vector component per component
Definition at line 1732 of file vec.c.
References Vec_length.
double vec_max | ( | vec | v | ) |
Maxinum of a vector
Definition at line 2101 of file vec.c.
References Vec_length.
Referenced by main().
Position where the vector maximum occurs
Definition at line 2127 of file vec.c.
References NULL_INDEX, and vec_length().
Referenced by vlc_energy_order().
double vec_mean | ( | vec | v | ) |
double vec_mean_robust | ( | vec | v | ) |
mean of the input vector
Definition at line 2537 of file vec.c.
References Vec_length, and vec_sum_robust().
Referenced by vec_variance_robust().
double vec_median | ( | vec | v | ) |
median value of the input vector
Definition at line 2567 of file vec.c.
References it_warning(), vec_clone(), vec_delete(), vec_length(), and vec_sort().
double vec_min | ( | vec | v | ) |
Position where the vector minimum occurs
Definition at line 2113 of file vec.c.
References NULL_INDEX, and vec_length().
Component per component multiplication
The result is stored in the vector which is the first parameter
Definition at line 1394 of file vec.c.
References vec_length().
Referenced by fpICA(), vec_cov(), and vec_new_mul().
void vec_mul_by | ( | vec | v, | |
double | a | |||
) |
multiply the components per a specified value
Definition at line 1223 of file vec.c.
References vec_length().
Referenced by fpICA(), mat_gs(), and mat_row_mul_by().
void vec_neg | ( | vec | v | ) |
Allocate a vector
Definition at line 161 of file vec.c.
References Vec_new.
Referenced by __wavelet2D_set_size(), __wavelet_set_size(), __wavelet_transform(), _lpoly_ediv(), bvec_to_vec(), cvec_new_abs(), fpICA(), fvec_new_fread(), it_function(), it_idft_real(), it_instanciate(), it_read_fmat(), it_read_mat(), it_wavelet_merge(), ivec_to_vec(), logviterbi(), main(), mat_cols_sum(), mat_get_col(), mat_get_diag(), mat_get_row(), mat_gs(), mat_qr(), mat_rows_sum(), mat_solve_vec(), mat_to_vec(), modulate_bpsk(), remmean(), scalar_quantizer_dequantize(), source_gaussian(), source_pdf(), source_uniform(), trellis_coded_quantizer_dequantize(), uniform_quantizer_get_codebook_range(), vec_clone(), vec_cum_sum(), vec_get_subvector(), vec_index_by(), vec_k_max_between(), vec_k_min_between(), vec_new_1N(), vec_new_abs(), vec_new_apply_function(), vec_new_arithm(), vec_new_concat(), vec_new_deinterleave_block(), vec_new_fread(), vec_new_geom(), vec_new_interleave_block(), vec_new_normalize(), vec_new_pow(), vec_new_rand(), vec_new_randn(), vec_new_range(), vec_new_reverse(), vec_new_set(), vec_new_unique(), vec_new_void(), vec_tanh(), vec_to_spvec(), viterbi(), viterbi_side(), vlc_hu_tucker(), vlc_nodes_proba0(), and vlc_quasi_lexicographic().
The sequence 1, 2.. N
Definition at line 4007 of file vec.c.
References vec_new().
Referenced by main(), and vlc_hu_tucker().
New vector generated with the absolute values of the input vector
Definition at line 1770 of file vec.c.
References vec_abs(), vec_length(), and vec_new().
addition stored in a new vector
Definition at line 1515 of file vec.c.
References vec_add(), and vec_clone().
Vector allocation with explicit allocation of the maximum number of elements
Definition at line 100 of file vec.c.
References Vec_new_alloc.
Referenced by fvec_new_string(), parser_get_vec(), parser_get_vec_verbose(), vec_k_max_between(), vec_k_min_between(), vec_new_intersection(), vec_new_string(), and vec_new_union().
vec vec_new_apply_function | ( | vec | v, | |
it_function_t | function, | |||
it_args_t | args | |||
) |
Apply a function to all vector elements
Definition at line 2700 of file vec.c.
References vec_length(), and vec_new().
New arithmetic sequence
Definition at line 4098 of file vec.c.
References vec_new().
Referenced by lloyd_max(), and main().
Concatenate two vectors
Definition at line 3181 of file vec.c.
References vec_length(), and vec_new().
Component per component division
Definition at line 1539 of file vec.c.
References vec_clone(), and vec_div().
Intersection of two sets represented by the two input vectors
Definition at line 3397 of file vec.c.
References vec_delete(), vec_length(), vec_new_alloc(), vec_new_unique(), and vec_push.
Component per component multiplication
Definition at line 1531 of file vec.c.
References vec_clone(), and vec_mul().
Return a normalized version of the input vector
Definition at line 1843 of file vec.c.
References vec_length(), vec_new(), vec_new_set(), and vec_sum().
new vector: exponential values of the input vector
Definition at line 1830 of file vec.c.
References Vec_length, vec_length(), and vec_new().
Referenced by fpICA().
Generate a random vector, uniformally drawn in [0,1[
Definition at line 4263 of file vec.c.
References vec_new(), and vec_rand().
Generate a random vector with normal law
Definition at line 4271 of file vec.c.
References vec_new(), and vec_randn().
Constant vector
Definition at line 3976 of file vec.c.
References vec_new(), and vec_set().
Referenced by fpICA(), it_instanciate(), vec_cov(), vec_new_normalize(), vec_new_ones(), and vec_new_zeros().
Union of two sets represented by the two input vectors
Definition at line 3311 of file vec.c.
References vec_delete(), vec_length(), vec_new_alloc(), vec_new_unique(), and vec_push.
Vector created from the input vector by taking one occurences of each possible value of the input vector
Definition at line 3247 of file vec.c.
References vec_clone(), vec_delete(), vec_length(), vec_new(), vec_push, and vec_sort().
Referenced by vec_new_intersection(), and vec_new_union().
vec vec_new_void | ( | ) |
Create a vector of length 0
Definition at line 3952 of file vec.c.
References vec_new().
Referenced by vec_k_max_between(), and vec_k_min_between().
Create a vectors of zeros
Definition at line 3720 of file vec.c.
References vec_new_set().
Referenced by histogram_normalized(), imat_vec_mul(), it_instanciate(), main(), mat_eig_sym(), mat_h2rs(), mat_hessenberg(), mat_ivec_mul(), mat_svd(), mat_vec_mul(), source_pdf_GG(), spvec_to_vec(), vec_conv(), vec_mat_mul(), vlc_hu_tucker(), vlc_huffman(), vlc_nodes_delta_energy(), vlc_nodes_entropy(), vlc_nodes_expectation(), vlc_nodes_pdf(), vlc_nodes_variance(), and vlc_quasi_lexicographic().
double vec_norm | ( | vec | v, | |
double | nr | |||
) |
void vec_normalize | ( | vec | v, | |
double | nr | |||
) |
Normalize the vector for a specified norm, so that $sum(||v||_nr)=1$
Definition at line 1807 of file vec.c.
References vec_length(), and vec_sum().
Referenced by bcjr(), bcjr_side(), markov_marg_pdf(), mat_rows_normalize(), and source_pdf_GG().
void vec_ones | ( | vec | ) |
void vec_pow | ( | vec | v, | |
double | a | |||
) |
void vec_rand | ( | vec | v | ) |
Draw the component of a vector to uniformally random variable in [0,1[
Definition at line 4246 of file vec.c.
References it_rand(), and vec_length().
Referenced by vec_new_rand().
void vec_randn | ( | vec | v | ) |
Generate a random vector, uniformally drawn in [0,1[
Definition at line 4254 of file vec.c.
References it_randn(), and vec_length().
Referenced by fpICA(), and vec_new_randn().
void vec_range | ( | vec | ) |
Set the vector elements to 0,1, ... n-1
Definition at line 3789 of file vec.c.
References vec_length().
Replace a given value by another for all vector components
Definition at line 3060 of file vec.c.
References ivec_new(), vec_count(), and Vec_length.
void vec_reverse | ( | vec | v | ) |
Reverse the vector
Definition at line 2741 of file vec.c.
References vec_length().
Referenced by PCAmat().
Set all the elements of the vector to a given value
Definition at line 345 of file vec.c.
References Vec_set.
Referenced by bcjr_side(), fpICA(), logviterbi(), main(), vec_new_set(), vec_ones(), viterbi(), viterbi_side(), and vlc_hu_tucker().
Set the elements of a subvector to a given value val
Definition at line 373 of file vec.c.
References Vec_set_between.
Modify a given element subset of a vector to another vector
Definition at line 401 of file vec.c.
References VEC_END_PARAM, and Vec_set_subvector.
Referenced by it_wavelet_merge().
void vec_sort | ( | vec | v | ) |
Sort the vector by increasing values
Definition at line 3595 of file vec.c.
References double_leq(), and Vec_sort().
Referenced by main(), PCAmat(), scalar_quantizer_set_codebook(), vec_median(), and vec_new_unique().
void Vec_sort | ( | Vec | v, | |
int(*)(const void *, const void *) | elem_leq | |||
) |
Sort the vector by increasing values
Definition at line 3537 of file vec.c.
References Vec_element_size, and Vec_length.
Referenced by bvec_sort(), ivec_sort(), and vec_sort().
Return a vector of index corresponding to increasing values of the input vector
Definition at line 3601 of file vec.c.
References double_leq_index(), and Vec_sort_index().
Referenced by main(), and vlc_quasi_lexicographic().
Return a vector of index corresponding to increasing values of the input vector
Definition at line 3543 of file vec.c.
References idx, Vec_element_size, Vec_length, Vec_length_max, and Vec_new.
Referenced by bvec_sort_index(), ivec_sort_index(), and vec_sort_index().
void vec_sqr | ( | vec | v | ) |
square the vector component per component
Definition at line 1696 of file vec.c.
References vec_length().
void vec_sqrt | ( | vec | v | ) |
root square of a vector component per component
Definition at line 1714 of file vec.c.
References Vec_length.
Referenced by mat_pow_one_by_two().
Substraction
Definition at line 1383 of file vec.c.
References vec_length().
Referenced by fpICA(), vec_cov(), and vec_new_sub().
double vec_sum | ( | vec | v | ) |
vector sum
Definition at line 1928 of file vec.c.
References Vec_length.
Referenced by fpICA(), is_valid_pdf(), main(), mat_row_sum(), PCAmat(), vec_cov(), vec_mean(), vec_new_normalize(), and vec_normalize().
sum of a subset of the vector specified by an index interval
Definition at line 2048 of file vec.c.
References VEC_END_PARAM.
double vec_sum_robust | ( | vec | v | ) |
vector sum
Definition at line 1939 of file vec.c.
References Vec_length.
Referenced by vec_mean_robust().
double vec_sum_sqr | ( | vec | v | ) |
The sum of the square components of a vector, i.e. the vector energy
Definition at line 2037 of file vec.c.
References Vec_length.
Vector type conversion
Definition at line 856 of file vec.c.
References bvec_new(), and vec_length().
Vector type conversion
Definition at line 868 of file vec.c.
References cimag, creal, cvec_new(), and vec_length().
Referenced by it_dft_real(), and main().
Vector type conversion
Definition at line 843 of file vec.c.
References ivec_new(), and vec_length().
convert a vector into a sparse vector
Definition at line 4325 of file vec.c.
References ivec_new(), vec_length(), and vec_new().
double vec_variance | ( | vec | v | ) |
Unbiaised variance of the vector (obtained by dividing by N-1)
Definition at line 2590 of file vec.c.
References Vec_length.
Referenced by main(), and test_quantizer().
double vec_variance_robust | ( | vec | v | ) |
Unbiaised variance of the vector (obtained by dividing by N-1)
Definition at line 2607 of file vec.c.
References Vec_length, and vec_mean_robust().
void vec_void | ( | vec | ) |
void vec_zeros | ( | vec | ) |
Inner product of two vectors
Definition at line 1628 of file vec.c.
References ivec_length(), and vec_length().
void vector of length 0, i.e. with no element
Definition at line 64 of file vec.c.
Referenced by _lpoly_ediv(), markov_marg_pdf(), and mat_distance_mse().
|
|