From 2c13f4a5a2853df2d3af0be7b5833b447143e704 Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Wed, 7 Sep 2022 14:34:50 -0600 Subject: [PATCH] Per issue #2206, added new function weighted_mean_absolute_diff(). SL --- src/basic/vx_util/num_array.cc | 80 ++++++++++++++++++++++------------ src/basic/vx_util/num_array.h | 1 + 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/src/basic/vx_util/num_array.cc b/src/basic/vx_util/num_array.cc index d4f3a86a35..8cec3bef2d 100644 --- a/src/basic/vx_util/num_array.cc +++ b/src/basic/vx_util/num_array.cc @@ -1233,24 +1233,29 @@ double NumArray::stdev(int skip_index) const //////////////////////////////////////////////////////////////////////// -// -// Utility Functions -// - -//////////////////////////////////////////////////////////////////////// - -ConcatString write_css(const NumArray &na) +double NumArray::mean_abs_diff() const { - ConcatString css; + int i, j, count; + double sum, mad; - for ( int i=0; i