All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NumericStatisticalSummary.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2011 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/statistics/NumericStatisticalSummary.cpp
22 
23  \brief A struct that can be used to keep the summary of statistics.
24 */
25 
26 // TerraLib
28 
30  : m_minVal(0),
31  m_maxVal(0),
32  m_mean(0),
33  m_sum(0),
34  m_count(0),
35  m_validCount(0),
36  m_stdDeviation(0),
37  m_kernel(0),
38  m_variance(0),
39  m_skewness(0),
40  m_kurtosis(0),
41  m_amplitude(0),
42  m_median(0),
43  m_varCoeff(0)
44 {
45 }
46 
48  : m_minVal(0),
49  m_maxVal(0),
50  m_mean(0),
51  m_sum(0),
52  m_count(0),
53  m_validCount(0),
54  m_stdDeviation(0),
55  m_kernel(0),
56  m_variance(0),
57  m_skewness(0),
58  m_kurtosis(0),
59  m_amplitude(0),
60  m_median(0),
61  m_varCoeff(0)
62 {
63  m_minVal = rhs.m_minVal;
64  m_maxVal = rhs.m_maxVal;
65  m_mean = rhs.m_mean;
66  m_sum = rhs.m_sum;
67  m_count = rhs.m_count;
70  m_kernel = rhs.m_kernel;
71  m_variance = rhs.m_variance;
72  m_skewness = rhs.m_skewness;
73  m_kurtosis = rhs.m_kurtosis;
75  m_median = rhs.m_median;
76  m_varCoeff = rhs.m_varCoeff;
77  std::copy(rhs.m_mode.begin(), rhs.m_mode.end(), m_mode.begin());
78 }
79 
81 {
82  clear();
83 }
84 
86 {
87  if(this != &rhs)
88  {
89  clear();
90 
91  m_minVal = rhs.m_minVal;
92  m_maxVal = rhs.m_maxVal;
93  m_mean = rhs.m_mean;
94  m_sum = rhs.m_sum;
95  m_count = rhs.m_count;
96  m_validCount = rhs.m_validCount;
97  m_stdDeviation = rhs.m_stdDeviation;
98  m_kernel = rhs.m_kernel;
99  m_variance = rhs.m_variance;
100  m_skewness = rhs.m_skewness;
101  m_kurtosis = rhs.m_kurtosis;
102  m_amplitude = rhs.m_amplitude;
103  m_median = rhs.m_median;
104  m_varCoeff = rhs.m_varCoeff;
105  std::copy(rhs.m_mode.begin(), rhs.m_mode.end(), m_mode.begin());
106  }
107 
108  return *this;
109 }
110 
112 {
113  m_minVal = 0;
114  m_maxVal = 0;
115  m_mean = 0;
116  m_sum = 0;
117  m_count = 0;
118  m_validCount = 0;
119  m_stdDeviation = 0;
120  m_kernel = 0;
121  m_variance = 0;
122  m_skewness = 0;
123  m_kurtosis = 0;
124  m_amplitude = 0;
125  m_median = 0;
126  m_varCoeff = 0;
127  m_mode.clear();
128 }
129 
NumericStatisticalSummary & operator=(const NumericStatisticalSummary &rhs)
Assignment operator.
A structure to hold the set of statistics from a set of numerical values.