X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcovariance-matrix.c;h=4f14a7c60517f7b97379d0e963a8eff0c74fce1d;hb=99196bc8cab27560e9d96654607151e3ae566b78;hp=32ca9bca9f7a20f1d7bd6d899027af54b6639998;hpb=2165f59ab9eee5272b4037e45477811627cae078;p=pspp-builds.git diff --git a/src/math/covariance-matrix.c b/src/math/covariance-matrix.c index 32ca9bca..4f14a7c6 100644 --- a/src/math/covariance-matrix.c +++ b/src/math/covariance-matrix.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -399,14 +400,14 @@ match_nodes (const struct covariance_accumulator *c, } if (var_is_numeric (v1) && var_is_alpha (v2)) { - if (compare_values_short (val2, c->val2, v2)) + if (!compare_values_short (val2, c->val2, v2)) { return 0; } } if (var_is_alpha (v1) && var_is_numeric (v2)) { - if (compare_values_short (val1, c->val1, v1)) + if (!compare_values_short (val1, c->val1, v1)) { return 0; } @@ -415,7 +416,7 @@ match_nodes (const struct covariance_accumulator *c, { if (compare_values_short (val1, c->val1, v1)) { - if (compare_values_short (val2, c->val2, v2)) + if (!compare_values_short (val2, c->val2, v2)) { return 0; } @@ -588,7 +589,7 @@ covariance_accumulate_pairwise (struct covariance_matrix *cov, if (!var_is_value_missing (v_variables[i], val1, cov->missing_value)) { cat_value_update (v_variables[i], val1); - if (var_is_alpha (v_variables[i])) + if (var_is_numeric (v_variables[i])) cov->update_moments (cov, i, val1->f); for (j = i; j < cov->n_variables; j++) @@ -643,7 +644,7 @@ covariance_accumulate_listwise (struct covariance_matrix *cov, { val1 = case_data (ccase, v_variables[i]); cat_value_update (v_variables[i], val1); - if (var_is_alpha (v_variables[i])) + if (var_is_numeric (v_variables[i])) cov->update_moments (cov, i, val1->f); for (j = i; j < cov->n_variables; j++)