SISCone
2.0.6
Main Page
Classes
Files
File List
File Members
siscone
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:: 123 $//
25
// $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) $//
27
28
#ifndef __REFERENCE_H__
29
#define __REFERENCE_H__
30
31
namespace
siscone{
32
43
class
Creference
{
44
public
:
46
Creference
();
47
49
void
randomize
();
50
52
bool
is_empty
();
53
55
bool
not_empty
();
56
58
Creference
&
operator =
(
const
Creference
&r);
59
61
Creference
operator +
(
const
Creference
&r);
62
64
Creference
&
operator +=
(
const
Creference
&r);
65
67
Creference
&
operator -=
(
const
Creference
&r);
68
70
inline
unsigned
int
operator[]
(
int
i) {
return
ref
[i];}
71
72
unsigned
int
ref
[3];
73
};
74
76
Creference
operator + (
Creference
&r1,
Creference
&r2);
77
79
bool
operator == (
const
Creference
&r1,
const
Creference
&r2);
80
82
bool
operator != (
const
Creference
&r1,
const
Creference
&r2);
83
85
bool
operator < (
const
Creference
&r1,
const
Creference
&r2);
86
87
88
//=============== inline material ================
89
90
// equality test for two references
91
//----------------------------------
92
inline
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
//----------------------------------
98
inline
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
//----------------------------------
104
inline
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
The
SISCone
project has been developed by
Gavin Salam
and
Gregory Soyez
Documentation generated on Mon May 6 2013 11:30:35 for SISCone by
Doxygen
1.8.3.1