17 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h
18 #define L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h
68 void set(
int r,
int c,
T v);
83 bool isMax(
int r,
int c)
const;
86 bool isMin(
int r,
int c)
const;
104 std::unique_ptr<T[]>
p_;
118 : r_size(mat.r_size), c_size(mat.c_size), p_(new
T[r_size * c_size]) {
129 assert(r >= 0 && r < r_size && c >= 0 && c < c_size);
139 assert(r >= 0 && r < r_size && c >= 0 && c < c_size);
149 for (
int i = 0;
i < r_size * c_size; ++
i) {
159 assert(r >= 0 && r < r_size && c >= 0 && c < c_size);
172 for (
int i = 0;
i < r_size * c_size; ++
i) {
187 for (
int i = 0;
i < r_size * c_size; ++
i) {
199 for (
int i = 0;
i < r_size * c_size; ++
i) {
211 for (
int i = 0;
i < r_size * c_size; ++
i) {
225 for (
int i = 0;
i <
c;
i++) {
226 max = max && (this->
get(
r,
c) > this->
get(r,
i));
228 for (
int i = c + 1;
i < c_size;
i++) {
229 max = max && (this->
get(
r,
c) >= this->
get(r,
i));
232 for (
int j = 0;
j <
r;
j++) {
233 max = max && (this->
get(
r,
c) > this->
get(
j, c));
235 for (
int j = r + 1;
j < r_size;
j++) {
236 max = max && (this->
get(
r,
c) >= this->
get(
j, c));
248 for (
int i = 0;
i < c_size;
i++) {
249 min = min && (this->
get(
r,
c) <= this->
get(r,
i));
251 for (
int j = 0;
j < r_size;
j++) {
252 min = min && (this->
get(
r,
c) <= this->
get(
j, c));
264 for (
int i = 0;
i < r_size;
i++) {
265 if (this->
get(
i, c) > 0)
278 for (
int i = 0;
i < c_size;
i++) {
279 if (this->
get(r,
i) > 0)
291 for (
int r = 0;
r < r_size;
r++) {
293 for (
int c = 0;
c < c_size;
c++)
294 output <<
get(
r,
c) <<
"\t";
Log< level::Info, true > LogVerbatim
const edm::EventSetup & c
L1MuGMTMatrix & operator=(const L1MuGMTMatrix &m)
assignment operator
bool isMax(int r, int c) const
is the element (r,c) the max. entry in its row and column?
L1MuGMTMatrix & operator*=(const T &s)
scalar multiplication
void set(int r, int c, T v)
set matrix element
bool isMin(int r, int c) const
is the element (r,c) the min. entry in its row and column?
int rowAny(int r) const
is any element in row r > 0 ? return index or -1
T & operator()(int r, int c)
void reset(T v)
reset all elements
void print() const
print matrix
L1MuGMTMatrix(int r, int c, T v)
constructor
L1MuGMTMatrix & operator+=(const L1MuGMTMatrix &m)
matrix addition
virtual ~L1MuGMTMatrix()=default
destructor
int colAny(int c) const
is any element in column c > 0 ? return index or -1