19 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h
20 #define L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h
72 void set(
int r,
int c, T
v);
87 bool isMax(
int r,
int c)
const;
90 bool isMin(
int r,
int c)
const;
117 for (
int i = 0;
i <
r;
i++) {
149 for (
int i = 0;
i < r_size;
i++) {
164 assert( r >= 0 && r < r_size && c >= 0 && c < c_size );
177 assert( r >= 0 && r < r_size && c >= 0 && c < c_size );
190 for (
int r = 0;
r < r_size;
r++) {
191 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] = v;
203 assert( r >= 0 && r < r_size && c >= 0 && c < c_size );
219 for (
int r = 0;
r < r_size;
r++) {
220 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] = m.
p[
r][
c];
237 for (
int r = 0;
r < r_size;
r++) {
238 for (
int c = 0;
c < c_size;
c++) {
254 for (
int r = 0;
r < r_size;
r++) {
255 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] += s;
269 for (
int r = 0;
r < r_size;
r++) {
270 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] *= s;
286 for (
int i = 0;
i <
c;
i++) {
287 max = max && ( this->
p[
r][
c] > this->
p[
r][
i]);
289 for (
int i = c+1;
i < c_size;
i++) {
290 max = max && ( this->
p[
r][
c] >= this->p[
r][
i]);
293 for (
int j = 0;
j <
r;
j++) {
294 max = max && ( this->
p[
r][
c] > this->
p[
j][
c]);
296 for (
int j = r+1;
j < r_size;
j++) {
297 max = max && ( this->
p[
r][
c] >= this->p[
j][
c]);
312 for (
int i = 0;
i < c_size;
i++) {
313 min = min && ( this->
p[
r][
c] <= this->p[
r][
i]);
315 for (
int j = 0;
j < r_size;
j++) {
316 min = min && ( this->
p[
r][
c] <= this->p[
j][
c]);
331 for (
int i = 0;
i < r_size;
i++) {
332 if ( this->
p[
i][c] > 0 ) stat =
i;
347 for (
int i = 0;
i < c_size;
i++) {
348 if ( this->
p[r][
i] > 0 ) stat =
i;
362 for (
int r = 0;
r < r_size;
r++) {
364 for (
int c = 0;
c < c_size;
c++) output <<
p[
r][
c] <<
"\t";
L1MuGMTMatrix & operator=(const L1MuGMTMatrix &m)
assignment operator
virtual ~L1MuGMTMatrix()
destructor
void init(T v=0)
initialize matrix
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)
const T & max(const T &a, const T &b)
L1MuGMTMatrix(int r, int c)
constructor
void print() const
print matrix
L1MuGMTMatrix & operator+=(const L1MuGMTMatrix &m)
matrix addition
int colAny(int c) const
is any element in column c > 0 ? return index or -1