+
+/*
+ Returns true iff the variable corresponding to the Ith element of the covariance matrix
+ has a missing value for case C
+*/
+static bool
+is_missing (const struct covariance *cov, int i, const struct ccase *c)
+{
+ const struct variable *var = i < cov->n_vars ?
+ cov->vars[i] :
+ categoricals_get_variable_by_subscript (cov->categoricals, i - cov->n_vars);
+
+ const union value *val = case_data (c, var);
+
+ return var_is_value_missing (var, val, cov->exclude);
+}
+
+
+static double
+get_val (const struct covariance *cov, int i, const struct ccase *c)
+{
+ if ( i < cov->n_vars)
+ {
+ const struct variable *var = cov->vars[i];
+
+ const union value *val = case_data (c, var);
+
+ return val->f;
+ }
+
+ return categoricals_get_binary_by_subscript (cov->categoricals, i - cov->n_vars, c);
+}
+