Skip to content

Commit

Permalink
Per issue #2206, fixed a bug in the wmean_abs_diff() function. SL
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Linden committed Sep 9, 2022
1 parent a451368 commit ea93131
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/basic/vx_util/num_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1265,16 +1265,16 @@ double NumArray::wmean_abs_diff() const

{

double mad, wmad;
double wmad;

int n = n_elements();
double wgt = 1.0/(2.0*n);
double mad = mean_abs_diff();

mad = mean_abs_diff();

if( is_bad_data(mad) )
if( is_bad_data(mad) )
wmad = bad_data_double;
else
wmad = (1/(2*n)) * mad;
else
wmad = wgt * mad;

return(wmad);

Expand Down

0 comments on commit ea93131

Please sign in to comment.