Print matrix, if matrix is larger the 3-dimension then donot print
| 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() { |
nothing calls this directly
no outgoing calls
no test coverage detected