QPALM
A proximal augmented Lagrangian method for QPs.
lin_alg.h
Go to the documentation of this file.
1 
9 #ifndef LIN_ALG_H
10 # define LIN_ALG_H
11 
12 
13 # ifdef __cplusplus
14 extern "C" {
15 # endif // ifdef __cplusplus
16 
17 # include "types.h"
18 #include "solver_interface.h"
19 
32 c_float* vec_copy(const c_float *a,
33  size_t n);
34 
42 void prea_vec_copy(const c_float *a,
43  c_float *b,
44  size_t n);
45 
53 void prea_int_vec_copy(const c_int *a,
54  c_int *b,
55  size_t n);
56 
64 void vec_set_scalar(c_float *a,
65  c_float sc,
66  size_t n);
67 
75 void vec_set_scalar_int(c_int *a,
76  c_int sc,
77  size_t n);
78 
87  c_float sc,
88  size_t n);
89 
98 void vec_mult_scalar(const c_float *a,
99  c_float sc,
100  c_float *b,
101  size_t n);
102 
111 c_float vec_prod(const c_float *a,
112  const c_float *b,
113  size_t n);
114 
122 c_float vec_norm_two( const c_float *a,
123  size_t n);
124 
132 c_float vec_norm_inf(const c_float *a,
133  size_t n);
134 
144 void vec_add_scaled(const c_float *a,
145  const c_float *b,
146  c_float *c,
147  c_float sc,
148  size_t n);
149 
159 void vec_mult_add_scaled( c_float *a,
160  const c_float *b,
161  c_float sc1,
162  c_float sc2,
163  size_t n);
164 
174 void vec_ew_recipr(const c_float *a,
175  c_float *b,
176  size_t n);
177 
186 void vec_ew_max_vec(const c_float *a,
187  const c_float *b,
188  c_float *c,
189  size_t n);
190 
199 void vec_ew_min_vec(const c_float *a,
200  const c_float *b,
201  c_float *c,
202  size_t n);
203 
213 void vec_ew_mid_vec(const c_float *a,
214  const c_float *bmin,
215  const c_float *bmax,
216  c_float *c,
217  size_t n);
218 
227 void vec_ew_prod(const c_float *a,
228  const c_float *b,
229  c_float *c,
230  size_t n);
231 
240 void vec_ew_div(const c_float *a,
241  const c_float *b,
242  c_float *c,
243  size_t n);
244 
252 void vec_ew_sqrt(const c_float *a,
253  c_float *b,
254  size_t n);
255 
256 
261 /* MATRIX FUNCTIONS ----------------------------------------------------------*/
262 
263 /* Moved to solver_interface.c*/
264 
265 
266 # ifdef __cplusplus
267 }
268 # endif // ifdef __cplusplus
269 
270 #endif // ifndef LIN_ALG_H
void vec_ew_recipr(const c_float *a, c_float *b, size_t n)
Elementwise reciprocal .
Definition: lin_alg.c:165
c_float vec_norm_two(const c_float *a, size_t n)
2-norm of a vector, .
Definition: lin_alg.c:88
void vec_ew_div(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise division, .
Definition: lin_alg.c:101
Internal data structures used in QPALM.
void prea_vec_copy(const c_float *a, c_float *b, size_t n)
Copy vector a into preallocated vector b.
Definition: lin_alg.c:24
c_float * vec_copy(const c_float *a, size_t n)
Copy vector a into output.
Definition: lin_alg.c:11
void vec_ew_mid_vec(const c_float *a, const c_float *bmin, const c_float *bmax, c_float *c, size_t n)
Elementwise mid between vectors, .
Definition: lin_alg.c:189
void vec_set_scalar_int(c_int *a, c_int sc, size_t n)
Fill int vector with a scalar value.
Definition: lin_alg.c:48
void vec_ew_max_vec(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise maximum between vectors, .
Definition: lin_alg.c:173
c_float vec_norm_inf(const c_float *a, size_t n)
Infinity norm of a vector, .
Definition: lin_alg.c:126
void vec_mult_scalar(const c_float *a, c_float sc, c_float *b, size_t n)
Mulitply vector with a constant scale factor and store in a different vector.
Definition: lin_alg.c:64
void vec_self_mult_scalar(c_float *a, c_float sc, size_t n)
Mulitply vector with a constant scale factor.
Definition: lin_alg.c:56
void vec_ew_prod(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise product, .
Definition: lin_alg.c:92
void prea_int_vec_copy(const c_int *a, c_int *b, size_t n)
Copy integer vector a into preallocated vector b.
Definition: lin_alg.c:32
void vec_ew_min_vec(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise minimum between vectors, .
Definition: lin_alg.c:181
c_float vec_prod(const c_float *a, const c_float *b, size_t n)
Inner product between two vectors, .
Definition: lin_alg.c:72
void vec_mult_add_scaled(c_float *a, const c_float *b, c_float sc1, c_float sc2, size_t n)
Scaled addition of one vector to another vector, both being scaled, .
Definition: lin_alg.c:118
void vec_set_scalar(c_float *a, c_float sc, size_t n)
Fill float vector with a scalar value.
Definition: lin_alg.c:40
ladel_int c_int
type for integer numbers
Definition: global_opts.h:22
Interface and wrapper to matrix/factorization (ladel/cholmod) functions.
void vec_ew_sqrt(const c_float *a, c_float *b, size_t n)
Elementwise square root, .
Definition: lin_alg.c:197
void vec_add_scaled(const c_float *a, const c_float *b, c_float *c, c_float sc, size_t n)
Scaled addition of one vector to another vector, .
Definition: lin_alg.c:110
ladel_double c_float
type for floating point numbers
Definition: global_opts.h:21