17 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h 18 #define L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h 68 void set(
int r,
int c,
T v);
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);
170 assert(
m.c_size == c_size &&
m.r_size == r_size);
172 for (
int i = 0;
i < r_size * c_size; ++
i) {
185 assert(
m.c_size == c_size &&
m.r_size == r_size);
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++)
Log< level::Info, true > LogVerbatim
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
T & operator()(int r, int c)
bool isMin(int r, int c) const
is the element (r,c) the min. entry in its row and column?
void reset(T v)
reset all elements
L1MuGMTMatrix(int r, int c, T v)
constructor
L1MuGMTMatrix & operator+=(const L1MuGMTMatrix &m)
matrix addition
int rowAny(int r) const
is any element in row r > 0 ? return index or -1
int colAny(int c) const
is any element in column c > 0 ? return index or -1
void print() const
print matrix
virtual ~L1MuGMTMatrix()=default
destructor