Skip to content

Commit

Permalink
Per issue #2206, renamed weighted_mean_abs_diff() to wmean_abs_diff()…
Browse files Browse the repository at this point in the history
…. SL
  • Loading branch information
Seth Linden committed Sep 8, 2022
1 parent e326222 commit 3442897
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/basic/vx_util/num_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,6 @@ void NumArray::reorder(const NumArray &i_na) {
return;
}

// SETH, please review the logic of the functions below.
// Do they still work OK after switching to STL::vector?

////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -1263,22 +1261,22 @@ double NumArray::mean_abs_diff() const
////////////////////////////////////////////////////////////////////////


double NumArray::weighted_mean_abs_diff() const
double NumArray::wmean_abs_diff() const

{

double mad, weighted_mad;
double mad, wmad;

int n = n_elements();

mad = mean_abs_diff();

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

return(weighted_mad);
return(wmad);

}

Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_util/num_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class NumArray {
double mean_sqrt() const;
double mean_fisher() const;
double mean_abs_diff() const;
double weighted_mean_abs_diff() const;
double wmean_abs_diff() const;

double variance(int skip_index = bad_data_int) const;
double stdev(int skip_index = bad_data_int) const;
Expand Down

0 comments on commit 3442897

Please sign in to comment.