Robotat Linalg main file to import matf32, linsolve and quadprog libraries.
Adapted from CControl (https://github.com/DanielMartensson/CControl) with the following changes:
- Removed all but linear algebra and (some) optimization routines.
- Changed all variable length arrays for fixed size to increase portability (as VLAs are compiler dependent extensions since C11 and generally a bad idea in embedded).
- Merged all function implementations into a single source file, this introduces some clutter but allows a more manageable memory footprint by defining static, auxiliary, fixed-size float arrays (originally some function calls like inv needed a huge, impractical stack size when using both variable-length and fixed-length arrays created inside the routines).
- Defined a matrix data structure to add code readability, decrease redundancy in constantly passing matrix dimensions as parameters and add compatibility with ARM's CMSIS DSP libraries (this will allow us to define wrappers for ARM's HW accelerated routines). This also adds a layer of safety when doing linear algebra operations. It's even recommended to use single row or column matrices instead of arrays to gain these dimension checks even though it has a speed penalty (check next point).
- Added a size mismatch check similar to ARM's CMSIS DSP matrix libraries (this can be disabled to reduce overhead by undefining the MATH_MATRIX_CHECK macro)
- Organized the matf32 routines in the following files: matf32_check, matf32_def, matf32_math and math_util, while linsolve and quadprog have a single file. Included routines for matrix operations and factorizations, matrix check functions, linear solver methods and methods for convex quadratic programs with equality and inequality restricctions.
- Combined matf32_check, matf32_def, matf32_math and math_util into a single matf32 pair of files, to facilitate use and organization. Also, moved matrix factorizations from linsolve to matf32, for subject coherence and to be able to use them in other applications without creating dependence from matf32 to linsolve.
- Validated the previously developed routines in matf32, linsolve and quadprog. Made significant changes in the algorithms of the following: matf32_lu and linsolve lu (added partial pivoting for stability), matf32_cholesky (fixed issues), ones (fixed issues), quadprog_sqp (fixed issues and adapted to solve problems with both equality and inequality restriccions). Also renamed quadprog_qp as quadprog_qp_linsolve and modified it to allow to choose which linsolve method to be used.
Added the following routines to their respective libraries: matf32_pinv, matf32_cond, matf32_check_symposdef, matf32_one_sided_jacobi, matf32_jacobi_svd, linsolve_qr, linsolve_cholesky, linsolve_svd, quadprog_qp_ldlt, quadprog_qp_nullspace. 10.Added the robotat_control and robotat_robotics libraries.
- Date
- Created on: 5 oct. 2019 By: Daniel Martensson (original author)
Modified on: 1 aug. 2021 By: Miguel Zea (mezea.nosp@m.@uvg.nosp@m..edu..nosp@m.gt)
Modified on: 20 may. 2022 By: Daniel Pineda (bar18.nosp@m.714@.nosp@m.uvg.e.nosp@m.du.g.nosp@m.t)
Modified on: 26 nov. 2025 By: Andrea Pineda (bar20.nosp@m.575@.nosp@m.uvg.e.nosp@m.du.g.nosp@m.t)