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
cPolynomRange.h
Go to the documentation of this file.
1 /**
2  * @file cPolynomRange
3  * file name: cPolynomRange.h
4  * @author Betti Oesterholz
5  * @date 07.06.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This header specifies functions for a one dimensional polynom functions.
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 functions for a one dimensional polynom functions.
28  *
29  */
30 /*
31 History:
32 07.06.2010 Oesterholz created
33 */
34 
35 
36 #ifndef ___N_D_1_C_POLYNOM_RANGE_H__
37 #define ___N_D_1_C_POLYNOM_RANGE_H__
38 
39 #include "version.h"
40 
41 #include "nD1.h"
42 #include "cRangeFactor.h"
43 #include "cDataPointRange.h"
44 #include "cLinearConstrainFix.h"
45 #include "cOneAryRangeFunction.h"
46 
47 #include "cUnderFunction.h"
48 #include "cFibVariable.h"
49 
50 #include <vector>
51 
52 using namespace fib::algorithms::nLinearInequation;
53 using namespace fib;
54 
55 namespace fib{
56 
57 namespace algorithms{
58 
59 namespace nD1{
60 
61 template <class tX, class tY>
62 class cPolynomRange: public cOneAryRangeFunction<tX, tY>{
63 
64 public:
65  /**
66  * The factors for the polynom.
67  * @see evalue()
68  */
69  vector< cRangeFactor<tY> > vecFactors;
70 
71 
72  /**
73  * Standartconstructor
74  */
75  cPolynomRange();
76 
77  /**
78  * This method prints the given this polynom to the given stream.
79  *
80  * @param outputStream the stream wher to print this polynom to
81  */
82  virtual void print( ostream & outputStream ) const;
83 
84  /**
85  * This methods creats the linear inequiations ( @see cLinearConstrainFix )
86  * for the given datapoints.
87  * The i'th linear inequiations will have the form:
88  * vecData[i].minY * yu_i <=
89  * x_0 + vecData.x * x_1 + vecData.x^2 * x_2 + ... +
90  * vecData[uiMaxPolynomOrder - 1] * x_{uiMaxPolynomOrder - 1}
91  * <= vecData[i].maxY * yu_i
92  *
93  * @param vecData the with the datapoints, for which to evalue the
94  * linear equiations should be evalued
95  * @param uiMaxPolynomOrder the maximal order of the polynom to generate
96  * the factor ranges for
97  * @return a vector with the linear equiations for the datapoints
98  */
99  virtual vector< cLinearConstrainFix<tY> > createLinearInequations(
100  const vector< cDataPointRange< tX, tY> > & vecData,
101  unsigned int uiMaxPolynomOrder );
102 
103  /**
104  * This functions evalues the ranges for the possible factors for a
105  * polynom which matches the given data vecData.
106  * The returned ranges don't have to include the factors for polynom
107  * which match the data, if ther isn't a possible polynome of the maximal
108  * range given for the data.
109  *
110  * @see evalue()
111  * @param vecData the data which the returend polynom should match
112  * @param uiMaxPolynomOrder the maximal order of the polynom to generate
113  * the factor ranges for
114  * @return ranges in which the factors of a polynom should lay, if
115  * possible (@see evalue()) in this cOneAryRangeFunction
116  */
117  virtual void evalue(
118  const vector< cDataPointRange< tX, tY> > & vecData,
119  unsigned int uiMaxPolynomOrder );
120 
121  /**
122  * @return the sum of the ranges of this function.
123  */
124  virtual tY getRangeSizeSum() const;
125 
126  /**
127  * @return if the sum of the ranges of this function is 0
128  */
129  virtual bool getRangeSizeSumIsNull() const;
130 
131 };//end class cPolynomRange
132 };//end namespace nD1
133 };//end namespace algorithms
134 };//end namespace fib
135 
136 //include template implementation
137 #include "../src/cPolynomRange.cpp"
138 
139 
140 #endif //___N_D_1_C_POLYNOM_RANGE_H__