81 snprintf(what,
sizeof(what),
"layer (which is %u) >= _layers (which is %u)", layer,
_layers);
82 throw std::out_of_range(what);
88 snprintf(what,
sizeof(what),
"unit (which is %u) >= _units (which is %u)", unit,
_units);
89 throw std::out_of_range(what);
102 const unsigned int mask = UINT64_BITS - 1;
104 const unsigned int n2 = _units - (n /
UINT64_BITS);
105 const unsigned int n3 = (n1 == 0) ? n2+1 : n2;
107 unsigned int i = 0, j = 0, j_curr = 0, j_next = 0;
109 for (j = 0; j <
_units; ++j) {
116 j_curr = (n2+j) % _units;
117 j_next = (n3+j+_units-1) % _units;
118 _buffer[
i][j] = (tmp[
i][j_curr] << n1) | (tmp[i][j_next] >> (-n1 & mask));
130 const unsigned int mask = UINT64_BITS - 1;
133 const unsigned int n3 = (n1 == 0) ? n2+_units-1 : n2;
135 unsigned int i = 0, j = 0, j_curr = 0, j_next = 0;
137 for (j = 0; j <
_units; ++j) {
144 j_curr = (n2+j)% _units;
145 j_next = (n3+j+1) % _units;
146 _buffer[
i][j] = (tmp[
i][j_curr] >> n1) | (tmp[i][j_next] << (-n1 & mask));
172 unsigned int ly = (b_st1 << 2) | (b_st2 << 1) | (b_st3 << 0) | (b_st4 << 0);
178 out << std::bitset<N-128>(
_buffer[3][2]) << std::bitset<128-64>(
_buffer[3][1]) << std::bitset<64>(
_buffer[3][0]) << std::endl;
179 out << std::bitset<N-128>(
_buffer[2][2]) << std::bitset<128-64>(
_buffer[2][1]) << std::bitset<64>(
_buffer[2][0]) << std::endl;
180 out << std::bitset<N-128>(
_buffer[1][2]) << std::bitset<128-64>(
_buffer[1][1]) << std::bitset<64>(
_buffer[1][0]) << std::endl;
181 out << std::bitset<N-128>(
_buffer[0][2]) << std::bitset<128-64>(
_buffer[0][1]) << std::bitset<64>(
_buffer[0][0]);
unsigned int op_and(const PhiMemoryImage &other) const
void set_word(unsigned int layer, unsigned int unit, value_type value)
void set_bit(unsigned int layer, unsigned int bit)
static const unsigned int _units
value_type get_word(unsigned int layer, unsigned int unit) const
void check_input(unsigned int layer, unsigned int bit) const
void clear_bit(unsigned int layer, unsigned int bit)
void print(std::ostream &out) const
value_type _buffer[_layers][_units]
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::ostream & operator<<(std::ostream &o, const PhiMemoryImage &patt)
void rotr(unsigned int n)
void rotl(unsigned int n)
PhiMemoryImage & operator=(PhiMemoryImage other)
std::vector< std::vector< double > > tmp
bool test_bit(unsigned int layer, unsigned int bit) const
void swap(PhiMemoryImage &other)
static const unsigned int _layers