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
cClusterFunExp.h
Go to the documentation of this file.
1 /**
2  * @class cClusterFunExp
3  * file name: cClusterFunExp.h
4  * @author Betti Oesterholz
5  * @date 17.03.2011
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This file contains the implementation for evaluing a cluster value for
11  * two data points.
12  * Copyright (C) @c LGPL3 2011 Betti Oesterholz
13  *
14  * This program is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU Lesser General Public License (LGPL) as
16  * published by the Free Software Foundation, either version 3 of the
17  * License, or any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public License
25  * along with this program. If not, see <http://www.gnu.org/licenses/>.
26  *
27  *
28  * This file contains the implementation for evaluing a cluster value for
29  * two data points.
30  *
31  * An data point dataPoint can be in the cluster to an other data point
32  * dataClusterCenter, if:
33  * dataClusterCenter.second > dataPoint.second * dBaseFactor ^
34  * distFunction( dataClusterCenter.first, dataPoint.first )
35  * If ther are more data points C_i for which the formulare is fulfilled,
36  * the data point will be mapped to the data point wher
37  * C_i.second - dataPoint.second * dBaseFactor ^ distFunction( C_i.first, dataPoint.first )
38  * is the maximal. (@see pDistFunction and @see dBaseFactor)
39  */
40 /*
41 History:
42 17.03.2011 Oesterholz created
43 */
44 
45 #ifndef ___C_CLUSTER_FUN_EXP__
46 #define ___C_CLUSTER_FUN_EXP__
47 
48 #include "version.h"
49 
50 
51 namespace fib{
52 
53 namespace algorithms{
54 
55 namespace nCluster{
56 
57 template< class tDataPoint >
58 class cClusterFunExp: public iClusterFunction< tDataPoint >{
59 
60  /**
61  * The functor to evalue the distance of two data points.
62  */
64 
65  /**
66  * The base factor for evaluing, if an data point is subsumed.
67  */
68  const double dBaseFactor;
69 
70 public:
71 
72  /**
73  * constructor
74  *
75  * @param inDistFunction a reference vor the functor to evalue the distance
76  * of two data points; (@see pDistFunction)
77  * Beware: As long as this object is used inDistFunction shouldn't be
78  * deleted.
79  * @param dInBaseFactor the base factor for evaluing, if an data point
80  * is subsumed (@see dBaseFactor)
81  */
83  const double dInBaseFactor ):
84  pDistFunction( &inDistFunction ), dBaseFactor( dInBaseFactor ){
85 
86  //nothing to do
87  }
88 
89  /**
90  * destructor
91  */
92  virtual ~cClusterFunExp(){
93  //nothing to do
94  }
95 
96 
97  /**
98  * This operator should evalue a cluster value for two data points.
99  * The value should indicate, how good it is to cluster the data
100  * point dataPoint to the dataClusterCenter.
101  *
102  * An data point dataPoint can be in the cluster to an other data point
103  * dataClusterCenter, if:
104  * dataClusterCenter.second > dataPoint.second * dBaseFactor ^
105  * distFunction( dataClusterCenter.first, dataPoint.first )
106  * If ther are more data points C_i for which the formulare is fulfilled,
107  * the data point will be mapped to the data point wher
108  * C_i.second - dataPoint.second * dBaseFactor ^ distFunction( C_i.first, dataPoint.first )
109  * is the maximal. (@see pDistFunction and @see dBaseFactor)
110  *
111  * @param dataClusterCenter the data point, to wich to evalue the
112  * value that dataPoint is clustered to it
113  * @param dataPoint the data point to cluster/subsume by dataClusterCenter
114  * @return the cluster value for dataClusterCenter and dataPoint
115  */
116  virtual double operator() ( const pair< tDataPoint, unsigned long > & dataClusterCenter,
117  const pair< tDataPoint, unsigned long > & dataPoint ) const{
118 
119  return dataClusterCenter.second - dataPoint.second * pow( dBaseFactor,
120  (*pDistFunction)( dataClusterCenter.first, dataPoint.first ) );
121  }
122 
123 
124 };//class cClusterFunExp
125 
126 
127 };//end namespace nCluster
128 };//end namespace algorithms
129 };//end namespace fib
130 
131 
132 #endif //___C_CLUSTER_FUN_EXP__
133 
134 
135 
136