Changeset 1172 for cpp/frams/model/similarity/EMD/emd.c
- Timestamp:
- 04/22/22 17:42:13 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/EMD/emd.c
r1130 r1172 147 147 } 148 148 149 if (itr == MAX_ITERATIONS) 150 fprintf(stderr, "emd: Maximum number of iterations has been reached (%d)\n", 151 MAX_ITERATIONS); 152 } 149 if (itr == MAX_ITERATIONS) //print a warning message 150 { 151 #define EMD_LIMIT_WARNING_MESSAGES 10 //if thousands of such messages are printed, we group them to avoid spamming stderr. Undefine (comment out) to disable. 152 #ifdef EMD_LIMIT_WARNING_MESSAGES 153 static int warncounter = 0; 154 static int warnnextlimit = 1; 155 warncounter++; 156 if (warncounter == warnnextlimit) 157 { 158 fprintf(stderr, "[repeated %dx in total, next warning at %dx] ", warncounter, warnnextlimit * EMD_LIMIT_WARNING_MESSAGES); 159 #endif 160 fprintf(stderr, "emd: Maximum number of iterations (%d) has been reached\n", MAX_ITERATIONS); 161 #ifdef EMD_LIMIT_WARNING_MESSAGES 162 warnnextlimit *= EMD_LIMIT_WARNING_MESSAGES; 163 } 164 #endif 165 } 166 } 153 167 154 168 /* COMPUTE THE TOTAL FLOW */
Note: See TracChangeset
for help on using the changeset viewer.