MBot Software Library  v1.0
An API documentation to mbot_firmware repository
All Classes Files Functions Variables Typedefs Enumerations Macros Modules
algebra_common.h
1 
7 #ifndef RC_ALGEBRA_COMMON_H
8 #define RC_ALGEBRA_COMMON_H
9 
10 #ifndef unlikely
11 #define unlikely(x) __builtin_expect (!!(x), 0)
12 #endif
13 
14 #ifndef likely
15 #define likely(x) __builtin_expect (!!(x), 1)
16 #endif
17 
18 /*
19  * Performs a vector dot product on the contents of a and b over n values.
20  *
21  * This is a dangerous function that could segfault if not used properly. Hence
22  * it is only for internal use in the RC library. the 'restrict' attributes tell
23  * the C compiler that the pointers are not aliased which helps the vectorization
24  * process for optimization with the NEON FPU or similar
25  */
26 double __vectorized_mult_accumulate(double * __restrict__ a, double * __restrict__ b, int n);
27 
28 /*
29  * Performs a vector dot product on the contents of a with itself
30  *
31  * This is a dangerous function that could segfault if not used properly. Hence
32  * it is only for internal use in the RC library. the 'restrict' attributes tell
33  * the C compiler that the pointers are not aliased which helps the vectorization
34  * process for optimization with the NEON FPU or similar
35  */
36 double __vectorized_square_accumulate(double * __restrict__ a, int n);
37 
38 #endif // RC_ALGEBRA_COMMON_H