[GRASS-SVN] r36154 - grass/branches/develbranch_6/imagery/i.pca

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 1 04:58:42 EST 2009


Author: hamish
Date: 2009-03-01 04:58:42 -0500 (Sun, 01 Mar 2009)
New Revision: 36154

Modified:
   grass/branches/develbranch_6/imagery/i.pca/support.c
Log:
output actual eigenvalues; they aren't PCs

Modified: grass/branches/develbranch_6/imagery/i.pca/support.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.pca/support.c	2009-03-01 09:19:34 UTC (rev 36153)
+++ grass/branches/develbranch_6/imagery/i.pca/support.c	2009-03-01 09:58:42 UTC (rev 36154)
@@ -38,10 +38,10 @@
     double eigval_total = 0.0;
 
     G_short_history(outname, "raster", &hist);
-    sprintf(hist.edhist[0], "Eigen (vectors) and values:");
+    sprintf(hist.edhist[0], "Eigen values, (vectors), and [percent importance]:");
 
     if(first_map)
-	G_message(_("Eigen (vectors) and values:"));
+	G_message(_("Eigen values, (vectors), and [percent importance]:"));
 
     for (i = 0; i < bands; i++)
 	eigval_total += eigval[i];
@@ -49,14 +49,14 @@
     for (i = 0; i < bands; i++) {
 	char tmpeigen[256], tmpa[80];
 
-	sprintf(tmpeigen, "PC%d ( ", i+1);
+	sprintf(tmpeigen, "Eigenvalue %d: %.2f ( ", i+1, eigval[i]);
 	for (j = 0; j < bands; j++) {
 	    sprintf(tmpa, "%.2f ", eigmat[i][j]);
 	    G_strcat(tmpeigen, tmpa);
 	}
 	G_strcat(tmpeigen, ") ");
 	
-	sprintf(tmpa, "%.2f", eigval[i] * 100/eigval_total);
+	sprintf(tmpa, "[%.2f%%]", eigval[i] * 100/eigval_total);
 	G_strcat(tmpeigen, tmpa);
 
 	sprintf(hist.edhist[i + 1], tmpeigen);



More information about the grass-commit mailing list