StatisticsFunctions.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/sa/core/StatisticsFunctions.h
22 
23  \brief Functions used in statistics operations.
24 
25  \reference Methods adapted from TerraLib4.
26 */
27 
28 #ifndef __TERRALIB_SA_INTERNAL_STATISTICSFUNCTIONS_H
29 #define __TERRALIB_SA_INTERNAL_STATISTICSFUNCTIONS_H
30 
31 // TerraLib
32 #include "../Config.h"
33 #include "KernelFunctions.h"
34 
35 // STL
36 #include <string>
37 
38 namespace te
39 {
40  namespace sa
41  {
42  // Forward declaration
43  class GeneralizedProximityMatrix;
44 
45  /*!
46  \brief Function used to calculate sum of a specific attribute from a gpm
47 
48  \param gpm Pointer to the gpm
49  \param attrIdx Attribute index used to calculate the sum.
50 
51  \return Return the sum value.
52  */
53  TESAEXPORT double Sum(te::sa::GeneralizedProximityMatrix* gpm, int attrIdx);
54 
55  /*!
56  \brief Function used to calculate sum of the intensity value from a kernel map
57 
58  \param kMap Referente to a kernel map.
59 
60  \return Return the sum value.
61  */
62  TESAEXPORT double Sum(te::sa::KernelMap& kMap);
63 
64  /*!
65  \brief Function used to calculate mean (first moment) of a specific attribute from a gpm
66 
67  \param gpm Pointer to the gpm
68  \param attrIdx Attribute index used to calculate the mean.
69 
70  \return Return the mean value.
71  */
73 
74  /*!
75  \brief Function used to calculate mean (first moment) from a vector with double values
76 
77  \param vec Vector with double values
78 
79  \return Return the mean value.
80  */
81  TESAEXPORT double FirstMoment(std::vector<double> vec);
82 
83  /*!
84  \brief Function used to calculate variance (second moment) of a specific attribute from a gpm
85 
86  \param gpm Pointer to the gpm
87  \param attrIdx Attribute index used to calculate the variance.
88 
89  \return Return the variance value.
90  */
91  TESAEXPORT double SecondMoment(te::sa::GeneralizedProximityMatrix* gpm, int attrIdx, double mean);
92 
93  } // end namespace sa
94 } // end namespace te
95 
96 #endif // __TERRALIB_SA_INTERNAL_STATISTICSFUNCTIONS_H
97 
This class defines a Generalized Proximity Matrix.
std::map< int, std::pair< te::gm::Geometry *, double > > KernelMap
This file contains a functions used by the kernel operation.
TESAEXPORT double SecondMoment(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx, double mean)
Function used to calculate variance (second moment) of a specific attribute from a gpm...
TESAEXPORT double Sum(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate sum of a specific attribute from a gpm.
URI C++ Library.
TESAEXPORT double FirstMoment(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate mean (first moment) of a specific attribute from a gpm.
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133