X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Forder-stats.c;h=e8e078f4b6f066913d1081aadab2c7692886d19a;hb=57dee47b02df38e9b735b2171c02c47f5164918a;hp=59edc92fc80fe28af97237893ae89f39d344e1a3;hpb=96994a54e60e9c95b8bba54c2281acf7059b1203;p=pspp diff --git a/src/math/order-stats.c b/src/math/order-stats.c index 59edc92fc8..e8e078f4b6 100644 --- a/src/math/order-stats.c +++ b/src/math/order-stats.c @@ -125,8 +125,11 @@ order_stats_accumulate_idx (struct order_stats **os, size_t nos, for (; (cx = casereader_read (reader)) != NULL; case_unref (cx)) { - const double weight = (wt_idx == -1) ? 1.0 : case_data_idx (cx, wt_idx)->f; - const double this_value = case_data_idx (cx, val_idx)->f; + const double weight = wt_idx == -1 ? 1.0 : case_num_idx (cx, wt_idx); + const double this_value = case_num_idx (cx, val_idx); + + if (weight == SYSMIS) + continue; /* The casereader MUST be sorted */ assert (this_value >= prev_value); @@ -169,4 +172,3 @@ order_stats_accumulate (struct order_stats **os, size_t nos, wv ? var_get_case_index (wv) : -1, var_get_case_index (var)); } -