MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / PrintMat

Function PrintMat

jni/stasm/misc.cpp:253–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void 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

Callers

nothing calls this directly

Calls 3

GetPrintMatFormatFunction · 0.85
lprintfFunction · 0.85
NumDigitsFunction · 0.85

Tested by

no test coverage detected