17 for (i = 0; i < n; i++) {
27 for (i = 0; i < n; i++) {
35 for (i = 0; i < n; i++) {
43 for (i = 0; i < n; i++) {
51 for (i = 0; i < n; i++) {
59 for (i = 0; i < n; i++) {
67 for (i = 0; i < n; i++) {
77 for (; i <= n-4; i+=4) {
78 prod += (a[i]*b[i] + a[i+1]*b[i+1] + a[i+2]*b[i+2] + a[i+3]*b[i+3]);
95 for (i = 0; i < n; i++) {
104 for (i = 0; i < n; i++) {
113 for (i = 0; i < n; i++) {
114 c[i] = a[i] + sc * b[i];
121 for (i = 0; i < n; i++) {
122 a[i] = sc1*a[i] + sc2*b[i];
127 register size_t j = 0;
136 const size_t block_size = 4;
137 const size_t block_len = n >> 2;
138 const size_t remaining = n % block_size;
142 while (j < block_len * block_size) {
143 s0 =
c_absval(a[j]); max0 = s0 > max0 ? s0 : max0;
144 s1 =
c_absval(a[j+1]); max1 = s1 > max1 ? s1 : max1;
145 s2 =
c_absval(a[j+2]); max2 = s2 > max2 ? s2 : max2;
146 s3 =
c_absval(a[j+3]); max3 = s3 > max3 ? s3 : max3;
150 max0 = max0 > max1 ? max0 : max1;
151 max0 = max0 > max2 ? max0 : max2;
152 max0 = max0 > max3 ? max0 : max3;
153 j = block_size * block_len;
179 for (i = 0; i < n; i++) {
187 for (i = 0; i < n; i++) {
188 c[i] =
c_max(a[i], b[i]);
195 for (i = 0; i < n; i++) {
196 c[i] =
c_min(a[i], b[i]);
203 for (i = 0; i < n; i++) {
211 for (i = 0; i < n; i++) {
#define c_sqrt
square root
ladel_int c_int
type for integer numbers
ladel_double c_float
type for floating point numbers
#define c_max(a, b)
maximum of two values
#define c_absval(x)
absolute value
QPALM_EXPORT void * qpalm_malloc(size_t size)
#define c_min(a, b)
minimum of two values
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, .
c_float * vec_copy(const c_float *a, size_t n)
Copy vector a into output.
void vec_ew_min_vec(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise minimum between vectors, .
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.
void vec_set_scalar(c_float *a, c_float sc, size_t n)
Fill float vector with a scalar value.
void vec_ew_max_vec(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise maximum between vectors, .
void vec_ew_div(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise division, .
void vec_set_scalar_int(c_int *a, c_int sc, size_t n)
Fill int vector with a scalar value.
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, .
void vec_self_mult_scalar(c_float *a, c_float sc, size_t n)
Mulitply vector with a constant scale factor.
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, .
void vec_ew_prod(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise product, .
c_float vec_prod(const c_float *a, const c_float *b, size_t n)
Inner product between two vectors, .
c_float vec_norm_two(const c_float *a, size_t n)
2-norm of a vector, .
void prea_vec_copy(const c_float *a, c_float *b, size_t n)
Copy vector a into preallocated vector b.
c_float vec_norm_inf(const c_float *a, size_t n)
Infinity norm of a vector, .
void prea_int_vec_copy(const c_int *a, c_int *b, size_t n)
Copy integer vector a into preallocated vector b.
void vec_ew_recipr(const c_float *a, c_float *b, size_t n)
Elementwise reciprocal .
void vec_ew_sqrt(const c_float *a, c_float *b, size_t n)
Elementwise square root, .
Linear algebra with vectors.