Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RcdMathLib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zkasmi
RcdMathLib
Commits
d5e23b45
Commit
d5e23b45
authored
5 years ago
by
zkasmi
Browse files
Options
Downloads
Patches
Plain Diff
Backups files removed.
parent
b3c23545
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
linear_algebra/utilities/include/shell_sort.h.bak
+0
-60
0 additions, 60 deletions
linear_algebra/utilities/include/shell_sort.h.bak
linear_algebra/utilities/include/utils.h.bak
+0
-176
0 additions, 176 deletions
linear_algebra/utilities/include/utils.h.bak
with
0 additions
and
236 deletions
linear_algebra/utilities/include/shell_sort.h.bak
deleted
100644 → 0
+
0
−
60
View file @
b3c23545
/*
* Copyright (C) 2020 Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup utils
* @{
*
* @file
* @brief Implement the Shell sort algorithm.
* @details The Shell sort algorithm is more convenient for devices with limited storage
* capacity.
*
* @author Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
*
* @}
*/
#ifndef SHELL_SORT_H_
#define SHELL_SORT_H_
#include <stdint.h>
#include "vector.h"
/**
* @brief Sort a data set of integers by using the Shell sort algorithm.
*
* @param[in] array[] pointer to the data set.
* @param[in] length size of the data set.
*
*/
void int_shell_sort(int* array, int length);
/**
* @brief Sort a data set of type utils_t by using the Shell sort algorithm.
*
* @param[in] arr[] pointer to the data set.
* @param[in] length size of the data set.
*
*/
void shell_sort(vector_t* arr, uint8_t length);
/**
* @brief Sort a data set of type utils_t by using the Shell sort algorithm.
*
* @param[in] arr[] pointer to the data set.
* @param[in] length size of the data set.
*
*/
void double_shell_sort(vector_t* arr, uint8_t length);
#endif /* SHELL_SORT_H_ */
This diff is collapsed.
Click to expand it.
linear_algebra/utilities/include/utils.h.bak
deleted
100644 → 0
+
0
−
176
View file @
b3c23545
/*
* Copyright (C) 2020 Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup utils
* @{
*
* @file
* @brief Utilities for linear algebra.
* @details Utility-functions are needed by linear algebra-module as well as
* other modules such as the position algorithm-module.
*
* @author Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
*
* @}
*/
#ifndef UTILS_H_
#define UTILS_H_
#include <inttypes.h>
/** @brief Define the data type */
#define utils_t double
#ifndef utils_t
#define utils_t double
#endif
/** @brief Define the pi-constant */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
/**
* @brief Convert the angle from degrees to radians.
*
* @param[in] deg_angle angle in degrees.
*
* @return angle in radians.
*
*/
double utils_to_radian(double deg_angle);
/**
* @brief Compute the sine of a variable in degrees.
* Calculate the sine of the variable deg_angle, which is expressed
* in degrees.
*
* @param[in] deg_angle angle in degrees.
*
* @return sine value.
*
*/
double utils_sind(double deg_angle);
/**
* @brief Interchange the values of two variables of type uint8_t.
*
* @param[in] *a pointer to first variable.
* @param[in] *b pointer to second variable.
*
*/
void utils_swap(uint8_t *a, uint8_t *b);
/**
* @brief Returns the greater of two real numbers.
*
* @param[in] a the first value to compare.
* @param[in] b the second value to compare.
*
* @return the greater of a and b.
*
*/
double utils_max(double a, double b);
/**
* @brief Returns the smaller of two real numbers.
*
*
* @param[in] a the first value to compare.
* @param[in] b the second value to compare.
*
* @return the smaller of a and b.
*
*/
double utils_min(double a, double b);
/**
* @brief Returns the greater of two numbers from type uint8_t.
*
* @param[in] a the first value to compare.
* @param[in] b the second value to compare.
*
* @return the greater of a and b.
*
*/
uint8_t utils_u8_max(uint8_t a, uint8_t b);
/**
* @brief Returns the smaller of two numbers from type uint8_t.
*
* @param[in] a the first value to compare.
* @param[in] b the second value to compare.
*
* @return the smaller of a and b.
*
*/
uint8_t utils_u8_min(uint8_t a, uint8_t b);
// Enables to use variable format string as well as argument lists
// Fixing error: format not a string literal.
/**
* @brief 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.
*
* @param[in] *format_str format string.
* @param[in] ... argument list.
*
*/
void utils_printf(char *format_str, ...);
/**
* @brief Compute the mean value of a data set.
*
* @param[in] arr_size size of the data set.
* @param[in] in_arr[] pointer to the data set.
*
* @return the mean value of the data set.
*
*/
double utils_mean(uint8_t arr_size, double in_arr[]);
/**
* @brief Compute the moving average of a data set.
*
* @param[in] arr_size size of the data set.
* @param[in] in_arr[] pointer to the data set.
* @param[in] window_size window size.
* @param[out] out_arr pointer to the values of the moving average.
*
*/
void utils_moving_average(uint8_t arr_size, double in_arr[], uint8_t window_size, double out_arr[]);
/**
* @brief Compute the median of a finite array of numbers.
*
* @param[in] arr[] pointer to the data set.
* @param[in] length size of the data set.
*
* @return the median value of the data set.
*
*/
double utils_get_median(double arr[], uint8_t length);
/**
* @brief Compute the square root without under/overflow.
*
* @param[in] x first value.
* @param[in] y second value.
*
* @return save square root.
*
*/
double utils_get_save_square_root(double x, double y);
#endif /* UTILS_H_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment