Simpler Allen Key config. Fixes, cleanups from refactor (#15256)

This commit is contained in:
Scott Lahteine
2019-09-14 03:05:10 -05:00
committed by GitHub
parent ffb418b226
commit 465c6d9230
62 changed files with 389 additions and 685 deletions

View File

@@ -51,18 +51,19 @@ void inline incremental_LSF_reset(struct linear_fit_data *lsf) {
void inline incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) {
// weight each accumulator by factor w, including the "number" of samples
// (analogous to calling inc_LSF twice with same values to weight it by 2X)
lsf->xbar += w * x;
lsf->ybar += w * y;
lsf->zbar += w * z;
lsf->x2bar += w * x * x; // don't use sq(x) -- let compiler re-use w*x four times
lsf->y2bar += w * y * y;
lsf->z2bar += w * z * z;
lsf->xybar += w * x * y;
lsf->xzbar += w * x * z;
lsf->yzbar += w * y * z;
const float wx = w * x, wy = w * y, wz = w * z;
lsf->xbar += wx;
lsf->ybar += wy;
lsf->zbar += wz;
lsf->x2bar += wx * x;
lsf->y2bar += wy * y;
lsf->z2bar += wz * z;
lsf->xybar += wx * y;
lsf->xzbar += wx * z;
lsf->yzbar += wy * z;
lsf->N += w;
lsf->max_absx = _MAX(ABS(w * x), lsf->max_absx);
lsf->max_absy = _MAX(ABS(w * y), lsf->max_absy);
lsf->max_absx = _MAX(ABS(wx), lsf->max_absx);
lsf->max_absy = _MAX(ABS(wy), lsf->max_absy);
}
void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) {