From 416fb0f896fa92e44acb7da74c6065d609358064 Mon Sep 17 00:00:00 2001 From: hvasbath Date: Thu, 18 Jan 2024 14:49:57 +0100 Subject: [PATCH] covariance_ext: fix adaptive subsampling increment when scene is small --- kite/ext/covariance.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kite/ext/covariance.c b/kite/ext/covariance.c index cf1b4c0..e7192b5 100644 --- a/kite/ext/covariance.c +++ b/kite/ext/covariance.c @@ -27,6 +27,13 @@ uint32_t finished_combinations = 0; typedef npy_float32 float32_t; typedef npy_float64 float64_t; +#ifndef max + #define max(a,b) \ + ({ __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a > _b ? _a : _b; }) +#endif + typedef enum { SUCCESS = 0, SAUBSAMPLING_SPARSE_ERROR @@ -127,7 +134,7 @@ static state_covariance calc_covariance_matrix( for (il1=0; il1