MATRIX DATA: Allow non-symetric matrices if /FORMAT = FULL.
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 10 May 2017 08:50:12 +0000 (10:50 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 10 May 2017 08:50:12 +0000 (10:50 +0200)
src/language/data-io/matrix-data.c

index 02673f37d20639c107717e26e7118c1e3e76b020..4370908acaa58fd8b15c97a68987707f9855cb2e 100644 (file)
@@ -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));