MATRIX DATA: Fully implement.
[pspp] / src / language / stats / factor.c
index f37930aca5b292f4483333e01e9deed60ea4835f..9fa0a8ad258c3198a5db9e903daf2249d4a29054 100644 (file)
@@ -45,7 +45,6 @@
 #include "math/correlation.h"
 #include "math/covariance.h"
 #include "math/moments.h"
-#include "output/chart-item.h"
 #include "output/charts/scree.h"
 #include "output/pivot-table.h"
 
@@ -1315,7 +1314,7 @@ cmd_factor (struct lexer *lexer, struct dataset *ds)
              else if (lex_match_id (lexer, "ITERATE"))
                {
                  if (lex_force_match (lexer, T_LPAREN)
-                       && lex_force_int (lexer))
+                      && lex_force_int_range (lexer, "ITERATE", 0, INT_MAX))
                    {
                      n_iterations = lex_integer (lexer);
                      lex_get (lexer);
@@ -1537,10 +1536,8 @@ cmd_factor (struct lexer *lexer, struct dataset *ds)
           id->ai_cov = NULL;
           gsl_matrix_free (id->ai_cor);
           id->ai_cor = NULL;
-         gsl_matrix_free (id->mm.corr);
-         id->mm.corr = NULL;
-         gsl_matrix_free (id->mm.cov);
-         id->mm.cov = NULL;
+
+          matrix_material_uninit (&id->mm);
        }
 
       idata_free (id);
@@ -1750,12 +1747,12 @@ show_explained_variance (const struct cmd_factor * factor,
 
   struct pivot_table *table = pivot_table_create (
     N_("Total Variance Explained"));
-  table->omit_empty = true;
 
-  /* xgettext:no-c-format */
   pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Statistics"),
                           N_("Total"), PIVOT_RC_OTHER,
+                          /* xgettext:no-c-format */
                           N_("% of Variance"), PIVOT_RC_PERCENT,
+                         /* xgettext:no-c-format */
                           N_("Cumulative %"), PIVOT_RC_PERCENT);
 
   struct pivot_dimension *phase = pivot_dimension_create (