Changeset 26647
- Timestamp:
- Jan 20, 2010, 5:18:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psLib/src/math/psMatrix.c
r26551 r26647 1065 1065 if (isfinite(thresh) && thresh > 0.0) { 1066 1066 // Trim the singular values 1067 thresh *= gsl_vector_get(S, 0); 1068 psTrace("psLib.math", 8, "Singular value 0: %lf", gsl_vector_get(S, 0)); 1069 for (int i = 1; i < numCols; i++) { 1067 double total = 0.0; // Total of singular values 1068 for (int i = 0; i < numCols; i++) { 1069 total += gsl_vector_get(S, i); 1070 } 1071 thresh *= total; 1072 for (int i = 0; i < numCols; i++) { 1070 1073 double value = gsl_vector_get(S, i); // Singular value 1071 1074 if (value < thresh) { 1072 psTrace("psLib.math", 5, "Trimming singular value %d: %l f", i, value);1075 psTrace("psLib.math", 5, "Trimming singular value %d: %lg", i, value); 1073 1076 gsl_vector_set(S, i, 0.0); 1077 #if 0 1074 1078 for (int j = 0; j < numCols; j++) { 1075 1079 // Being thorough; probably unnecessary … … 1077 1081 gsl_matrix_set(A, j, i, 0.0); 1078 1082 } 1083 #endif 1079 1084 } else { 1080 psTrace("psLib.math", 5, "Singular value %d: %l f", i, value);1085 psTrace("psLib.math", 5, "Singular value %d: %lg", i, value); 1081 1086 } 1082 1087 }
Note:
See TracChangeset
for help on using the changeset viewer.
