egsl.h
Go to the documentation of this file.
1 #ifndef H_EASY_GSL
2 #define H_EASY_GSL
3 
4 #include <gsl/gsl_vector.h>
5 #include <gsl/gsl_matrix.h>
6 
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 struct egsl_val {
13  gsl_matrix * gslm;
14  int cid : 16;
15  int index : 16;
16 };
17 
18 typedef struct egsl_val val;
19 
20 /* Core functions */
21 
22 /* Push a new context. */
23 void egsl_push();
24 void egsl_push_named(const char*name);
25 /* Pops a context */
26 void egsl_pop();
27 void egsl_pop_named(const char*name);
28 void egsl_free(void);
29 
30 double* egsl_atmp(val v, size_t i, size_t j);
31 val egsl_alloc(size_t rows, size_t columns);
32 val egsl_alloc_in_context(int cid, size_t rows, size_t cols);
33 gsl_matrix * egsl_gslm(val v);
36 
38 val egsl_scale(double, val);
45 val egsl_sum(val v1,val v2);
46 val egsl_compose_col(val v1, val v2);
47 val egsl_compose_row(val v1, val v2);
48 void egsl_add_to(val v1, val v2);
49 void egsl_add_to_col(val v1, size_t j, val v2);
50 
51 double egsl_norm(val);
52 
53 void egsl_symm_eig(val v, double* eigenvalues, val* eigenvectors);
54 
55 double egsl_atv(val, size_t i);
56 double egsl_atm(val, size_t i, size_t j);
57 
58 /* File: egsl_conversions.c
59  Conversions */
60 
61 val egsl_vFa(size_t rows, const double*);
62 val egsl_vFda(size_t rows, size_t columns, const double*);
63 
65 void egsl_v2a(val, double*);
67 void egsl_v2da(val, double*);
69 void egsl_v2vec(val, gsl_vector*);
70 
71 val egsl_vFgslv(const gsl_vector*);
72 val egsl_vFgslm(const gsl_matrix*);
73 
74 gsl_matrix* egsl_v2gslm(val);
75 
76 /*/ File: egsl_misc.c
77  Miscellaneous useful matrixes. */
78 val egsl_zeros(size_t rows, size_t columns);
79 val egsl_ones(size_t rows, size_t columns);
80 val egsl_vers(double theta);
81 val egsl_rot(double theta);
82 
83 
84 /* Misc */
85 void egsl_print(const char*str, val);
87 void egsl_print_spectrum(const char*s, val v);
88 void egsl_print_stats(void);
89 
90 
91 
93 void egsl_expect_size(val v, size_t rows, size_t cols);
94 void egsl_error(void);
95 
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
val egsl_compose_col(val v1, val v2)
Definition: egsl_ops.c:14
double egsl_atm(val, size_t i, size_t j)
Definition: egsl.c:298
val egsl_sub(val, val)
Definition: egsl_ops.c:10
void egsl_push_named(const char *name)
Definition: egsl.c:91
val egsl_alloc_in_context(int cid, size_t rows, size_t cols)
Definition: egsl.c:192
double * egsl_atmp(val v, size_t i, size_t j)
Definition: egsl.c:276
gsl_matrix * egsl_v2gslm(val)
Definition: egsl.h:12
void egsl_add_to(val v1, val v2)
Definition: egsl_ops.c:48
gsl_matrix * gslm
Definition: egsl.h:13
void egsl_add_to_col(val v1, size_t j, val v2)
Definition: egsl_ops.c:54
void egsl_print(const char *str, val)
Definition: egsl.c:251
val egsl_inverse(val)
Definition: egsl_ops.c:115
val egsl_mult(val, val)
Definition: egsl_ops.c:98
val egsl_sum(val, val)
Definition: egsl_ops.c:84
void egsl_expect_size(val v, size_t rows, size_t cols)
Definition: egsl.c:238
val egsl_zeros(size_t rows, size_t columns)
Definition: egsl_misc.c:12
gsl_matrix * egsl_gslm(val v)
Definition: egsl.c:83
void egsl_v2da(val, double *)
double egsl_atv(val, size_t i)
Definition: egsl.c:294
val egsl_vFgslm(const gsl_matrix *)
val egsl_transpose(val)
Definition: egsl_ops.c:107
void egsl_pop_named(const char *name)
Definition: egsl.c:117
int index
Definition: egsl.h:15
void egsl_print_spectrum(const char *s, val v)
Definition: egsl_misc.c:31
void egsl_print_stats(void)
Definition: egsl.c:147
val egsl_scale(double, val)
Definition: egsl_ops.c:77
val egsl_vFa(size_t rows, const double *)
void egsl_push()
Definition: egsl.c:88
void egsl_pop()
Definition: egsl.c:89
val egsl_ones(size_t rows, size_t columns)
Definition: egsl_misc.c:19
int cid
Definition: egsl.h:14
val egsl_vers(double theta)
Definition: egsl_misc.c:26
val egsl_alloc(size_t rows, size_t columns)
Definition: egsl.c:159
double egsl_norm(val)
Definition: egsl.c:282
void egsl_error(void)
Definition: egsl.c:40
void egsl_free(void)
Definition: egsl.c:302
void egsl_v2vec(val, gsl_vector *)
void egsl_symm_eig(val v, double *eigenvalues, val *eigenvectors)
Definition: egsl_ops.c:133
val egsl_vFgslv(const gsl_vector *)
val egsl_rot(double theta)
Definition: egsl_misc.c:4
val egsl_sum3(val, val, val)
Definition: egsl_ops.c:94
void egsl_v2a(val, double *)
val egsl_promote(val v)
Definition: egsl.c:223
val egsl_vFda(size_t rows, size_t columns, const double *)
val egsl_compose_row(val v1, val v2)
Definition: egsl_ops.c:31


csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23