-
Notifications
You must be signed in to change notification settings - Fork 0
/
ve-msk.cpp
36 lines (33 loc) · 945 Bytes
/
ve-msk.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "ve-msk.hpp"
#include <iostream>
using namespace std;
ostream& operator<<(ostream&os, Msk256 const& m256){
for(int i=0; i<256; ++i){
int s=i/64, r=63-i%64;
os<<(s>0 && r==63?" ":"")
<<((m256.m[s] & (uint64_t{1}<<r))? '1':'0'); }
return os;
}
ostream& operator<<(ostream&os, Msk512 const& m512){
#if 1
os<<"\na="<<std::hex;
for(int i=0;i<4;++i) os<<(i==0?'{':',')<<"0x"<<m512.a.m[i];
os<<"}\nb=";
for(int i=0;i<4;++i) os<<(i==0?'{':',')<<"0x"<<m512.b.m[i];
os<<'}'<<std::dec;
os<<"\na: "<<m512.a;
os<<"\nb: "<<m512.b;
for(int x=0; x<512; ++x){
if(x%64==0) os<<"\n "<<x/64<<":";
os<<(m512.get(x)? '1':'0');
}
#else
for(int x=0; x<256; ++x){
int s=x/64, r=x%64;
os<<((m512.a.m[s] & (uint64_t{1}<<r))? '1':'0')
<<((m512.b.m[s] & (uint64_t{1}<<r))? '1':'0');
}
#endif
return os;
}
/* vim: set sw=4 ts=4 et: */