[GRASS-SVN] r36527 - grass/branches/releasebranch_6_4/imagery/i.pca
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 30 06:14:25 EDT 2009
Author: neteler
Date: 2009-03-30 06:14:25 -0400 (Mon, 30 Mar 2009)
New Revision: 36527
Modified:
grass/branches/releasebranch_6_4/imagery/i.pca/support.c
Log:
write out appropriately eigenvectors, eigenvalues and percent importance (fixes trac #430)
Modified: grass/branches/releasebranch_6_4/imagery/i.pca/support.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.pca/support.c 2009-03-30 10:14:16 UTC (rev 36526)
+++ grass/branches/releasebranch_6_4/imagery/i.pca/support.c 2009-03-30 10:14:25 UTC (rev 36527)
@@ -49,14 +49,18 @@
for (i = 0; i < bands; i++) {
char tmpeigen[256], tmpa[80];
- sprintf(tmpeigen, "PC%d %9.2f ( ", i+1, eigval[i]);
+ sprintf(tmpeigen, "PC%d %9.2f (", i+1, eigval[i]);
for (j = 0; j < bands; j++) {
- sprintf(tmpa, "%5.2f ", eigmat[i][j]);
+ sprintf(tmpa, "%7.4f", eigmat[i][j]);
G_strcat(tmpeigen, tmpa);
+ if (j < (bands - 1) ){
+ sprintf(tmpa, ",");
+ G_strcat(tmpeigen, tmpa);
+ }
}
- G_strcat(tmpeigen, ") ");
+ G_strcat(tmpeigen, ")");
- sprintf(tmpa, "[ %5.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