+ struct string str = DS_EMPTY_INITIALIZER;
+ interaction_to_string (iact, &str);
+ struct pivot_category *group = pivot_category_create_group__ (
+ factors->root,
+ pivot_value_new_user_text_nocopy (ds_steal_cstr (&str)));
+
+ int df = categoricals_df (cov->categoricals, n);
+ for (int j = 0; j < df; j++)
+ pivot_category_create_leaf_rc (group, pivot_value_new_integer (j),
+ PIVOT_RC_INTEGER);
+
+ i += df;
+ }
+
+ struct pivot_dimension *matrix = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, "Matrix", "Matrix");
+ matrix->hide_all_labels = true;
+
+ return table;
+}
+
+
+/*
+ Append table T, which should have been returned by covariance_dump_enc_header
+ with an entry corresponding to case C for the covariance matrix COV
+ */
+void
+covariance_dump_enc (const struct covariance *cov, const struct ccase *c,
+ struct pivot_table *table)
+{
+ int row = pivot_category_create_leaf (
+ table->dimensions[1]->root,
+ pivot_value_new_integer (table->dimensions[1]->n_leaves));
+
+ for (int i = 0 ; i < cov->dim; ++i)
+ pivot_table_put2 (
+ table, i, row, pivot_value_new_number (get_val (cov, i, c)));
+}