1 |
// -*- C++ -*- |
2 |
// AID-GENERATED |
3 |
// ========================================================================= |
4 |
// This class was generated by AID - Abstract Interface Definition |
5 |
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. |
6 |
// ========================================================================= |
7 |
#ifndef AIDA_IRANGESET_H |
8 |
#define AIDA_IRANGESET_H 1 |
9 |
|
10 |
// This file is part of the AIDA library |
11 |
// Copyright (C) 2002 by the AIDA team. All rights reserved. |
12 |
// This library is free software and under the terms of the |
13 |
// GNU Library General Public License described in the LGPL.txt |
14 |
|
15 |
#include <vector> |
16 |
|
17 |
namespace AIDA { |
18 |
|
19 |
/** |
20 |
* User level interface to RangeSet. |
21 |
* |
22 |
* |
23 |
* Proposed rules for ranges: |
24 |
* |
25 |
* - By default (no arguments) RangeSet object is created with |
26 |
* one valid range: (-infinity, +infinity). |
27 |
* |
28 |
* - size=0 means no valid ranges (isInRange(double point) will |
29 |
* return false for any point). It also can be used to check if |
30 |
* any range is set - RangeSet include valid interval only |
31 |
* if size!=0. |
32 |
* |
33 |
* - RangeSet can be smart, e.g merge overlapping valid ranges. |
34 |
* So size() does not always equal to the number of times |
35 |
* user call include method. |
36 |
* |
37 |
* |
38 |
* @author The AIDA team (http://aida.freehep.org/) |
39 |
* |
40 |
*/ |
41 |
|
42 |
class IRangeSet { |
43 |
|
44 |
public: |
45 |
/// Destructor. |
46 |
virtual ~IRangeSet() { /* nop */; } |
47 |
|
48 |
/** |
49 |
* Return array of lower Bounds for the current set of ranges |
50 |
* @return Array of lower bounds for all valid ranges |
51 |
*/ |
52 |
virtual const std::vector<double> & lowerBounds() = 0; |
53 |
|
54 |
/** |
55 |
* Return array of upper Bounds for the current set of ranges |
56 |
* @return Array of upper bounds for all valid ranges |
57 |
*/ |
58 |
virtual const std::vector<double> & upperBounds() = 0; |
59 |
|
60 |
/** |
61 |
* Add [xMin, xMax] interval to existing set of valid ranges |
62 |
* @param xMin - lower bound of a new valid range |
63 |
* @param xMax - upper bound of a new valid range |
64 |
*/ |
65 |
virtual void include(double xMin, double xMax) = 0; |
66 |
|
67 |
/** |
68 |
* Exclude [xMin, xMax] interval from the existing set of valid ranges |
69 |
* @param xMin - lower bound of range to be excluded |
70 |
* @param xMax - upper bound of range to be excluded |
71 |
*/ |
72 |
virtual void exclude(double xMin, double xMax) = 0; |
73 |
|
74 |
/** |
75 |
* Set full range (from MINUS_INF to PLUS_INF ). |
76 |
*/ |
77 |
virtual void includeAll() = 0; |
78 |
|
79 |
/** |
80 |
* Set empty range. |
81 |
*/ |
82 |
virtual void excludeAll() = 0; |
83 |
|
84 |
/* |
85 |
* @return Return true if the point is in range |
86 |
*/ |
87 |
virtual bool isInRange(double point) = 0; |
88 |
|
89 |
/** |
90 |
* Return current number of disjoint ranges (non-overlapping intervals). |
91 |
* Note: it is not always equal to the number of times user set the range |
92 |
* @return Number of disjoint ranges |
93 |
*/ |
94 |
virtual int size() = 0; |
95 |
|
96 |
/* |
97 |
* Define +infinity according to specific implementation |
98 |
* @return Numeric definition for +infinity |
99 |
*/ |
100 |
virtual double PLUS_INF() = 0; |
101 |
|
102 |
/* |
103 |
* Define -infinity according to specific implementation |
104 |
* @return Numeric definition for -infinity |
105 |
*/ |
106 |
virtual double MINUS_INF() = 0; |
107 |
}; // class |
108 |
} // namespace AIDA |
109 |
#endif /* ifndef AIDA_IRANGESET_H */ |