MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / print

Method print

XM/include/Utils/memory.h:243–259  ·  view source on GitHub ↗

Print matrix, if matrix is larger the 3-dimension then donot print

Source from the content-addressed store, hash-verified

241
242 // Print matrix, if matrix is larger the 3-dimension then donot print
243 void print() {
244 if(num_dims == 1){
245 for (size_s j = 0; j < dimensions[0]; j++) {
246 std::printf("%0.2f ", vals[j]);
247 }
248 std::printf("\n");
249 }else if(num_dims == 2){
250 for (size_s i = 0; i < dimensions[0]; i++) {
251 for (size_s j = 0; j < dimensions[1]; j++) {
252 std::printf("%0.2f ", vals[j * dimensions[0] + i]);
253 }
254 std::printf("\n");
255 }
256 }else{
257 std::cout << "Matrix dimension larger than 2" << std::endl;
258 }
259 }
260
261 // Free allocated memory
262 ~HostDnTen() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected