The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cRangeFactor.h
Go to the documentation of this file.
1 /**
2  * @file cRangeFactor
3  * file name: cRangeFactor.h
4  * @author Betti Oesterholz
5  * @date 09.06.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This header specifies a class for a range factor.
11  * Copyright (C) @c GPL3 2010 Betti Oesterholz
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License (GPL) as
15  * published by the Free Software Foundation, either version 3 of the
16  * License, or any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  *
26  *
27  * This header specifies a class for a range factor.
28  * A range factor specifies a range, wich contains the possible values for
29  * a factor.
30  * This kind of factor can be used, if the value for factor can not be
31  * evalued, but it can be narrowed down to a range.
32  *
33  */
34 /*
35 History:
36 09.06.2010 Oesterholz created
37 */
38 
39 #ifndef ___C_RANGE_FACTOR_H__
40 #define ___C_RANGE_FACTOR_H__
41 
42 #include "version.h"
43 
44 #include <vector>
45 #include <ostream>
46 
47 namespace fib{
48 
49 namespace algorithms{
50 
51 namespace nLinearInequation{
52 
53 
54 template <class tFactors>
56 public:
57 
58  /**
59  * The minimal possible number for the factor.
60  * (if not infinity @see bMinIsInf)
61  */
62  tFactors min;
63 
64  /**
65  * The minimal value for the factor is (negativ) infinity.
66  * @see min
67  */
68  bool bMinIsInf;
69 
70  /**
71  * The maxmal possible number for the factor.
72  * (if not infinity @see bMaxIsInf)
73  */
74  tFactors max;
75 
76  /**
77  * The maximal value for the factor is infinity.
78  * @see max
79  */
80  bool bMaxIsInf;
81 
82 
83  /**
84  * The standardconstructor for the range factor.
85  * The range for the created factor will be from negativ to positiv
86  * infinity.
87  */
88  cRangeFactor();
89 
90  /**
91  * A constructor for the range factor.
92  *
93  * @param inMin the minimal value for the range of the factor (@see min)
94  * @param inMax the maximal value for the range of the factor (@see max)
95  */
96  cRangeFactor( tFactors inMin, tFactors inMax );
97 
98  /**
99  * This method will evalue the size of the range, if not one boundery
100  * is infinifty.
101  * Beware: Check with @see isInf() if the range size is infinity,
102  * if you are not shure, befor using this method.
103  *
104  * @see diffIsNull()
105  * @see isInf()
106  * @see min
107  * @see max
108  * @return the difference betwean the minimal and maximal value in the
109  * range of the factor, respectively the size of the range;
110  */
111  tFactors diff() const;
112 
113  /**
114  * This method will return true if the size of the range is 0, if not
115  * one boundery is infinifty.
116  *
117  * @see diff()
118  * @see isInf()
119  * @see min
120  * @see max
121  * @return true if the difference betwean the minimal and maximal value
122  * is 0, respectively if the bounderies have not the same value,
123  * else false is returned
124  */
125  bool diffIsNull() const;
126 
127  /**
128  * @return true if one boundery is infinity (if @see bMinIsInf or
129  * @see bMaxIsInf is true), else false
130  */
131  bool isInf() const;
132 
133  /**
134  * Equal comparrisson operator for two range factors.
135  *
136  * @param rangeFactor the range factor to compare this rangefactor to
137  * @return true if the given range factor rangeFactor is equal to this
138  * range factor, else false
139  */
140  bool operator==( const cRangeFactor & rangeFactor ) const;
141 
142  /**
143  * This method sets the minimal boundery of the range factor to the
144  * given value. (It will also set @see bMinIsInf to false)
145  *
146  * @see min
147  * @see bMinIsInf
148  * @param inMin the value to set the minimal boundery to
149  */
150  void setMin( tFactors inMin );
151 
152  /**
153  * This method sets the maximal boundery of the range factor to the
154  * given value. (It will also set @see bMaxIsInf to false)
155  *
156  * @see max
157  * @see bMaxIsInf
158  * @param inMax the value to set the maximal boundery to
159  */
160  void setMax( tFactors inMax );
161 };
162 
163 
164 };//end namespace nLinearInequation
165 };//end namespace algorithms
166 };//end namespace fib
167 
168 //include template implementation
169 #include "../src/cRangeFactor.cpp"
170 
171 
172 #endif //___C_RANGE_FACTOR_H__