123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- #ifndef LIN_ALG_H
- # define LIN_ALG_H
- # ifdef __cplusplus
- extern "C" {
- # endif
- # include "types.h"
- # ifndef EMBEDDED
- c_float* vec_copy(c_float *a,
- c_int n);
- # endif
- void prea_vec_copy(const c_float *a,
- c_float *b,
- c_int n);
- void prea_int_vec_copy(const c_int *a,
- c_int *b,
- c_int n);
- void vec_set_scalar(c_float *a,
- c_float sc,
- c_int n);
- void int_vec_set_scalar(c_int *a,
- c_int sc,
- c_int n);
- void vec_add_scalar(c_float *a,
- c_float sc,
- c_int n);
- void vec_mult_scalar(c_float *a,
- c_float sc,
- c_int n);
- void vec_add_scaled(c_float *c,
- const c_float *a,
- const c_float *b,
- c_int n,
- c_float sc);
- c_float vec_norm_inf(const c_float *v,
- c_int l);
- c_float vec_scaled_norm_inf(const c_float *S,
- const c_float *v,
- c_int l);
- c_float vec_norm_inf_diff(const c_float *a,
- const c_float *b,
- c_int l);
- c_float vec_mean(const c_float *a,
- c_int n);
- # if EMBEDDED != 1
- void vec_ew_recipr(const c_float *a,
- c_float *b,
- c_int n);
- # endif
- c_float vec_prod(const c_float *a,
- const c_float *b,
- c_int n);
- void vec_ew_prod(const c_float *a,
- const c_float *b,
- c_float *c,
- c_int n);
- # if EMBEDDED != 1
- void vec_ew_sqrt(c_float *a,
- c_int n);
- void vec_ew_max(c_float *a,
- c_int n,
- c_float max_val);
- void vec_ew_min(c_float *a,
- c_int n,
- c_float min_val);
- void vec_ew_max_vec(const c_float *a,
- const c_float *b,
- c_float *c,
- c_int n);
- void vec_ew_min_vec(const c_float *a,
- const c_float *b,
- c_float *c,
- c_int n);
- # endif
- void mat_mult_scalar(csc *A,
- c_float sc);
- void mat_premult_diag(csc *A,
- const c_float *d);
- void mat_postmult_diag(csc *A,
- const c_float *d);
- void mat_vec(const csc *A,
- const c_float *x,
- c_float *y,
- c_int plus_eq);
- void mat_tpose_vec(const csc *A,
- const c_float *x,
- c_float *y,
- c_int plus_eq,
- c_int skip_diag);
- # if EMBEDDED != 1
- void mat_inf_norm_cols(const csc *M,
- c_float *E);
- void mat_inf_norm_rows(const csc *M,
- c_float *E);
- void mat_inf_norm_cols_sym_triu(const csc *M,
- c_float *E);
- # endif
- c_float quad_form(const csc *P,
- const c_float *x);
- # ifdef __cplusplus
- }
- # endif
- #endif
|