|
RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
|
Utilities for linear algebra. More...
Go to the source code of this file.
Macros | |
| #define | M_PI 3.14159265358979323846 |
| Define the pi-constant. | |
Functions | |
| double | utils_to_radian (double deg_angle) |
| Convert the angle from degrees to radians. More... | |
| double | utils_sind (double deg_angle) |
| Compute the sine of a variable in degrees. More... | |
| void | utils_swap (uint8_t *a, uint8_t *b) |
| Interchange the values of two variables of type uint8_t. More... | |
| double | utils_max (double a, double b) |
| Returns the greater of two real numbers. More... | |
| double | utils_min (double a, double b) |
| Returns the smaller of two real numbers. More... | |
| uint8_t | utils_u8_max (uint8_t a, uint8_t b) |
| Returns the greater of two numbers from type uint8_t. More... | |
| uint8_t | utils_u8_min (uint8_t a, uint8_t b) |
| Returns the smaller of two numbers from type uint8_t. More... | |
| void | utils_printf (char *format_str,...) |
| Print by using variable format string as well as argument lists. More... | |
| double | utils_mean (uint8_t arr_size, vector_t in_arr[]) |
| Compute the mean value of a data set. More... | |
| void | utils_moving_average (uint8_t arr_size, vector_t in_arr[], uint8_t window_size, vector_t out_arr[]) |
| Compute the moving average of a data set. More... | |
| double | utils_get_median (vector_t arr[], uint8_t length) |
| Compute the median of a finite array of numbers. More... | |
| double | utils_get_save_square_root (double x, double y) |
| Compute the square root without under/overflow. More... | |
Utilities for linear algebra.
Utility-functions are needed by linear algebra-module as well as other modules such as the position algorithm-module.
Definition in file utils.h.
| double utils_get_median | ( | vector_t | arr[], |
| uint8_t | length | ||
| ) |
Compute the median of a finite array of numbers.
| [in] | arr[] | pointer to the data set. |
| [in] | length | size of the data set. |
Definition at line 152 of file utils.c.
References shell_sort().
Referenced by utils_test().
| double utils_get_save_square_root | ( | double | x, |
| double | y | ||
| ) |
Compute the square root without under/overflow.
| [in] | x | first value. |
| [in] | y | second value. |
Compute the square root without under/overflow.
Definition at line 168 of file utils.c.
Referenced by qr_householder_decomp().
| double utils_max | ( | double | a, |
| double | b | ||
| ) |
Returns the greater of two real numbers.
| [in] | a | the first value to compare. |
| [in] | b | the second value to compare. |
Definition at line 55 of file utils.c.
Referenced by loc_gauss_newton(), modified_gauss_newton(), and utils_test().
| double utils_mean | ( | uint8_t | arr_size, |
| vector_t | in_arr[] | ||
| ) |
Compute the mean value of a data set.
| [in] | arr_size | size of the data set. |
| [in] | in_arr[] | pointer to the data set. |
Definition at line 105 of file utils.c.
Referenced by utils_test().
| double utils_min | ( | double | a, |
| double | b | ||
| ) |
Returns the smaller of two real numbers.
| [in] | a | the first value to compare. |
| [in] | b | the second value to compare. |
Definition at line 65 of file utils.c.
Referenced by utils_test().
| void utils_moving_average | ( | uint8_t | arr_size, |
| vector_t | in_arr[], | ||
| uint8_t | window_size, | ||
| vector_t | out_arr[] | ||
| ) |
Compute the moving average of a data set.
| [in] | arr_size | size of the data set. |
| [in] | in_arr[] | pointer to the data set. |
| [in] | window_size | window size. |
| [out] | out_arr | pointer to the values of the moving average. |
Definition at line 121 of file utils.c.
Referenced by utils_test().
| void utils_printf | ( | char * | format_str, |
| ... | |||
| ) |
Print by using variable format string as well as argument lists.
This function enables to print data by using a variable format string as well as argument list. Furthermore, it avoids the error: "format not a string literal", if printf is used.
| [in] | *format_str | format string. |
| [in] | ... | argument list. |
Definition at line 96 of file utils.c.
Referenced by matrix_flex_part_print(), matrix_flex_print(), and vector_flex_print().
| double utils_sind | ( | double | deg_angle | ) |
Compute the sine of a variable in degrees.
Calculate the sine of the variable deg_angle, which is expressed in degrees.
| [in] | deg_angle | angle in degrees. |
Definition at line 39 of file utils.c.
References M_PI.
Referenced by utils_test().
| void utils_swap | ( | uint8_t * | a, |
| uint8_t * | b | ||
| ) |
Interchange the values of two variables of type uint8_t.
| [in] | *a | pointer to first variable. |
| [in] | *b | pointer to second variable. |
Definition at line 46 of file utils.c.
Referenced by utils_test().
| double utils_to_radian | ( | double | deg_angle | ) |
Convert the angle from degrees to radians.
| [in] | deg_angle | angle in degrees. |
Definition at line 31 of file utils.c.
References M_PI.
Referenced by magnetic_based_test(), and utils_test().
| uint8_t utils_u8_max | ( | uint8_t | a, |
| uint8_t | b | ||
| ) |