siscone is hosted by Hepforge, IPPP Durham

The SISCone Jet Algorithm

Version 3.0.6



SISCone 3.0.6
reference.h
1// -*- C++ -*-
3// File: reference.h //
4// Description: header file for checkxor management (Creference class) //
5// This file is part of the SISCone project. //
6// For more details, see http://projects.hepforge.org/siscone //
7// //
8// Copyright (c) 2006 Gavin Salam and Gregory Soyez //
9// //
10// This program is free software; you can redistribute it and/or modify //
11// it under the terms of the GNU General Public License as published by //
12// the Free Software Foundation; either version 2 of the License, or //
13// (at your option) any later version. //
14// //
15// This program is distributed in the hope that it will be useful, //
16// but WITHOUT ANY WARRANTY; without even the implied warranty of //
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
18// GNU General Public License for more details. //
19// //
20// You should have received a copy of the GNU General Public License //
21// along with this program; if not, write to the Free Software //
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
23// //
24// $Revision:: $//
25// $Date:: $//
27
28#ifndef __REFERENCE_H__
29#define __REFERENCE_H__
30
31namespace siscone{
32
44 public:
46 Creference();
47
49 void randomize();
50
52 bool is_empty();
53
55 bool not_empty();
56
59
62
65
68
70 inline unsigned int operator[] (int i) {return ref[i];}
71
72 unsigned int ref[3];
73};
74
76Creference operator + (Creference &r1, Creference &r2);
77
79bool operator == (const Creference &r1, const Creference &r2);
80
82bool operator != (const Creference &r1, const Creference &r2);
83
85bool operator < (const Creference &r1, const Creference &r2);
86
87
88//=============== inline material ================
89
90// equality test for two references
91//----------------------------------
92inline bool operator == (const Creference &r1, const Creference &r2){
93 return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]);
94}
95
96// difference test for two references
97//----------------------------------
98inline bool operator != (const Creference &r1, const Creference &r2){
99 return (r1.ref[0]!=r2.ref[0]) || (r1.ref[1]!=r2.ref[1]) || (r1.ref[2]!=r2.ref[2]);
100}
101
102// difference test for two references
103//----------------------------------
104inline bool operator < (const Creference &r1, const Creference &r2){
105 return (r1.ref[0]<r2.ref[0]) || ((r1.ref[0]==r2.ref[0]) &&
106 ((r1.ref[1]<r2.ref[1]) || ((r1.ref[1]==r2.ref[1]) && (r1.ref[2]<r2.ref[2]))
107 ));
108}
109
110}
111#endif
references used for checksums.
Definition: reference.h:43
Creference operator+(const Creference &r)
addition of reference
Definition: reference.cpp:96
bool is_empty()
test emptyness
Definition: reference.cpp:75
Creference & operator=(const Creference &r)
assignment of reference
Definition: reference.cpp:87
unsigned int operator[](int i)
accessing the reference
Definition: reference.h:70
Creference()
default constructor
Definition: reference.cpp:46
void randomize()
create a random reference
Definition: reference.cpp:54
Creference & operator+=(const Creference &r)
incrementation of reference
Definition: reference.cpp:103
bool not_empty()
test non-emptyness
Definition: reference.cpp:81
Creference & operator-=(const Creference &r)
decrementation of reference
Definition: reference.cpp:112
unsigned int ref[3]
actual data for the reference
Definition: reference.h:72

The SISCone project has been developed by Gavin Salam and Gregory Soyez
Documentation generated on Tue Jun 20 2023 18:08:37 for SISCone by  Doxygen 1.9.4