};
-/* Function to use for testing for missing values */
-static mv_is_missing_func *value_is_missing;
+/* Categories of missing values to exclude. */
+static enum mv_class exclude_values;
static struct rank_spec *rank_specs;
static size_t n_rank_specs;
reader = casefile_get_destructive_reader (cf) ;
criteria.crits[criteria.crit_cnt - 1] = sc->crits[i];
assert ( sc->crits[i].fv == var_get_case_index (src_vars[i]) );
- sorted_cf = sort_execute (reader, &criteria);
+ sorted_cf = sort_execute (reader, &criteria, NULL);
casefile_destroy (cf);
out = rank_sorted_casefile (sorted_cf, &criteria,
casereader_destroy (lookahead);
cc_1 = cc;
- if ( !value_is_missing (mv, this_value) )
+ if ( !mv_is_value_missing (mv, this_value, exclude_values) )
cc += c;
do
{
const struct variable *dst_var = rs[i].destvars[dest_var_index];
- if ( value_is_missing (mv, this_value) )
+ if ( mv_is_value_missing (mv, this_value, exclude_values) )
case_data_rw (&this_case, dst_var)->f = SYSMIS;
else
case_data_rw (&this_case, dst_var)->f =
}
while (n-- > 0 && casereader_read_xfer (cr, &this_case));
- if ( !value_is_missing (mv, this_value) )
+ if ( !mv_is_value_missing (mv, this_value, exclude_values) )
iter++;
}
double w = 0.0;
this_value = case_data_idx( &group_case, ultimate_crit->fv);
- if ( !value_is_missing(mv, this_value) )
+ if ( !mv_is_value_missing (mv, this_value, exclude_values) )
w = dict_get_case_weight (dict, &group_case, &warn);
while (casereader_read (lookahead, &this_case))
case_destroy (&group_case);
case_move (&group_case, &this_case);
}
- if ( !value_is_missing (mv, this_value) )
+ if ( !mv_is_value_missing (mv, this_value, exclude_values) )
w += c;
case_destroy (&this_case);
}
}
/* If /MISSING=INCLUDE is set, then user missing values are ignored */
- if (cmd.miss == RANK_INCLUDE )
- value_is_missing = mv_is_value_system_missing;
- else
- value_is_missing = mv_is_value_missing;
-
+ exclude_values = cmd.miss == RANK_INCLUDE ? MV_SYSTEM : MV_ANY;
/* Default to /RANK if no function subcommands are given */
if ( !( cmd.sbc_normal || cmd.sbc_ntiles || cmd.sbc_proportion ||
if (!parse_variables (lexer, dataset_dict (ds),
&group_vars, &n_group_vars,
- PV_NO_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH) )
+ PV_NO_DUPLICATE | PV_NO_SCRATCH) )
{
free (group_vars);
return 0;