| 251 | } |
| 252 | |
| 253 | void PrintMat( // utility to print a matrix |
| 254 | const MAT& mat, // in |
| 255 | const char* msg) // in: message |
| 256 | { |
| 257 | char format[SLEN]; // will be something like %3.2f |
| 258 | GetPrintMatFormat(format, mat); |
| 259 | lprintf("%s %dx%d:\n", msg, mat.rows, mat.cols); |
| 260 | for (int row = 0; row < mat.rows; row++) |
| 261 | { |
| 262 | lprintf("%*d: ", NumDigits(mat.rows), row); |
| 263 | for (int col = 0; col < mat.cols; col++) |
| 264 | { |
| 265 | lprintf(format, mat(row, col)); |
| 266 | if (col < mat.cols-1) |
| 267 | lprintf(" "); |
| 268 | } |
| 269 | lprintf("\n"); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | // This redimensions a matrix and preserves as much of the old data as possible. |
| 274 | // If new matrix is bigger than or same size as the old matrix then all the data |
nothing calls this directly
no test coverage detected