17 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h
18 #define L1TriggerGlobalMuonTrigger_L1MuGMTMatrix_h
70 void set(
int r,
int c,
T v);
85 bool isMax(
int r,
int c)
const;
88 bool isMin(
int r,
int c)
const;
115 for (
int i = 0;
i <
r;
i++) {
147 for (
int i = 0;
i < r_size;
i++) {
162 assert( r >= 0 && r < r_size && c >= 0 && c < c_size );
175 assert( r >= 0 && r < r_size && c >= 0 && c < c_size );
188 for (
int r = 0;
r < r_size;
r++) {
189 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] = v;
201 assert( r >= 0 && r < r_size && c >= 0 && c < c_size );
217 for (
int r = 0;
r < r_size;
r++) {
218 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] = m.
p[
r][
c];
235 for (
int r = 0;
r < r_size;
r++) {
236 for (
int c = 0;
c < c_size;
c++) {
252 for (
int r = 0;
r < r_size;
r++) {
253 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] += s;
267 for (
int r = 0;
r < r_size;
r++) {
268 for (
int c = 0;
c < c_size;
c++)
p[
r][
c] *= s;
284 for (
int i = 0;
i <
c;
i++) {
285 max = max && ( this->
p[
r][
c] > this->
p[
r][
i]);
287 for (
int i = c+1;
i < c_size;
i++) {
288 max = max && ( this->
p[
r][
c] >= this->p[
r][
i]);
291 for (
int j = 0;
j <
r;
j++) {
292 max = max && ( this->
p[
r][
c] > this->
p[
j][
c]);
294 for (
int j = r+1;
j < r_size;
j++) {
295 max = max && ( this->
p[
r][
c] >= this->p[
j][
c]);
310 for (
int i = 0;
i < c_size;
i++) {
311 min = min && ( this->
p[
r][
c] <= this->p[
r][
i]);
313 for (
int j = 0;
j < r_size;
j++) {
314 min = min && ( this->
p[
r][
c] <= this->p[
j][
c]);
329 for (
int i = 0;
i < r_size;
i++) {
330 if ( this->
p[
i][c] > 0 ) stat =
i;
345 for (
int i = 0;
i < c_size;
i++) {
346 if ( this->
p[r][
i] > 0 ) stat =
i;
360 for (
int r = 0;
r < r_size;
r++) {
362 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)
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