| 202 | } |
| 203 | |
| 204 | void LogShape( // print mat to log file, this is mostly for debugging and testing |
| 205 | const MAT& mat, // in |
| 206 | const char* matname) // in |
| 207 | { |
| 208 | // print in shapefile format |
| 209 | logprintf("\n00000000 %s\n{ %d %d\n", Base(matname), mat.rows, mat.cols); |
| 210 | for (int row = 0; row < mat.rows; row++) |
| 211 | { |
| 212 | for (int col = 0; col < mat.cols; col++) |
| 213 | { |
| 214 | if (int(mat(row, col)) == mat(row, col)) |
| 215 | logprintf("%.0f", mat(row, col)); |
| 216 | else |
| 217 | logprintf("%.1f", mat(row, col)); |
| 218 | if (col < mat.cols-1) |
| 219 | logprintf(" "); |
| 220 | } |
| 221 | logprintf("\n"); |
| 222 | } |
| 223 | logprintf("}\n"); |
| 224 | } |
| 225 | |
| 226 | static void GetPrintMatFormat( |
| 227 | char* format, // out: will be something like %3.2f |
no test coverage detected