From 176149693e28d1f1e0279f931b1d25e95742b688 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 10 May 2017 10:50:12 +0200 Subject: [PATCH 1/1] MATRIX DATA: Allow non-symetric matrices if /FORMAT = FULL. --- src/language/data-io/matrix-data.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/language/data-io/matrix-data.c b/src/language/data-io/matrix-data.c index 02673f37d2..4370908aca 100644 --- a/src/language/data-io/matrix-data.c +++ b/src/language/data-io/matrix-data.c @@ -182,9 +182,12 @@ preprocess (struct casereader *casereader0, const struct dictionary *dict, void if (e == SYSMIS) continue; - + /* Fill in the lower triangle */ (matrices[n_splits-1])[col + mformat->n_continuous_vars * row] = e; - (matrices[n_splits-1]) [row + mformat->n_continuous_vars * col] = e; + + if (mformat->triangle != FULL) + /* Fill in the upper triangle */ + (matrices[n_splits-1]) [row + mformat->n_continuous_vars * col] = e; } row++; } @@ -269,7 +272,6 @@ preprocess (struct casereader *casereader0, const struct dictionary *dict, void if (prev_case) case_copy (outcase, 0, prev_case, 0, caseproto_get_n_widths (proto)); - const struct variable *var = dict_get_var (dict, idx + 1 + row); set_varname_column (outcase, mformat->varname, var_get_name (var)); -- 2.30.2