mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-10 06:59:54 +08:00
- Fixed svd function with min (#2790)
This commit is contained in:
@@ -141,6 +141,9 @@ static inline float pythag(float a, float b)
|
||||
}
|
||||
|
||||
|
||||
int min(int num1, int num2) {
|
||||
return (num1 > num2 ) ? num2 : num1;
|
||||
}
|
||||
/** SVD decomposition
|
||||
*
|
||||
* --------------------------------------------------------------------- *
|
||||
@@ -295,7 +298,7 @@ int pprz_svd_float(float **a, float *w, float **v, int m, int n)
|
||||
}
|
||||
|
||||
/* Accumulation of left-hand transformations. */
|
||||
for (i = n - 1; i >= 0; --i) {
|
||||
for (i = min(m,n) - 1; i >= 0; --i) {
|
||||
l = i + 1;
|
||||
G = w[i];
|
||||
if (i < (n - 1)) {
|
||||
|
||||
Reference in New Issue
Block a user