1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 15:27:06 +01:00

Cleaning up output of CG repro

This commit is contained in:
Guido Cossu
2016-12-09 02:17:31 +00:00
parent 14a1406f54
commit 8fb0a13f39
4 changed files with 37 additions and 20 deletions

View File

@ -26,9 +26,6 @@ See the full license in the file "LICENSE" in the top level distribution
directory
*************************************************************************************/
/* END LEGAL */
#ifndef GRID_BITWISE_H
#define GRID_BITWISE_H
#include <iostream>
#include <Bitwise.h>
#include <bitset>
@ -39,10 +36,14 @@ namespace Grid {
void show_binaryrep(const unsigned char* a, size_t size) {
const unsigned char* beg = a;
const unsigned char* end = a + size;
while (beg != end) std::cout << std::bitset<CHAR_BIT>(*beg++) << ' ';
unsigned int ctr = 0;
while (beg != end) {
std::cout << std::bitset<CHAR_BIT>(*beg++) << ' ';
ctr++;
if (ctr % GRID_REAL_BYTES == 0) std::cout << '\n';
}
std::cout << '\n';
}
} // namespace
#endif