All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
NumericStatisticalSummary.cpp
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/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  m_mode.resize(rhs.m_mode.size());
78  std::copy(rhs.m_mode.begin(), rhs.m_mode.end(), m_mode.begin());
79 }
80 
82 {
83  clear();
84 }
85 
87 {
88  if(this != &rhs)
89  {
90  clear();
91 
92  m_minVal = rhs.m_minVal;
93  m_maxVal = rhs.m_maxVal;
94  m_mean = rhs.m_mean;
95  m_sum = rhs.m_sum;
96  m_count = rhs.m_count;
97  m_validCount = rhs.m_validCount;
98  m_stdDeviation = rhs.m_stdDeviation;
99  m_kernel = rhs.m_kernel;
100  m_variance = rhs.m_variance;
101  m_skewness = rhs.m_skewness;
102  m_kurtosis = rhs.m_kurtosis;
103  m_amplitude = rhs.m_amplitude;
104  m_median = rhs.m_median;
105  m_varCoeff = rhs.m_varCoeff;
106  m_mode.resize(rhs.m_mode.size());
107  std::copy(rhs.m_mode.begin(), rhs.m_mode.end(), m_mode.begin());
108  }
109 
110  return *this;
111 }
112 
114 {
115  m_minVal = 0;
116  m_maxVal = 0;
117  m_mean = 0;
118  m_sum = 0;
119  m_count = 0;
120  m_validCount = 0;
121  m_stdDeviation = 0;
122  m_kernel = 0;
123  m_variance = 0;
124  m_skewness = 0;
125  m_kurtosis = 0;
126  m_amplitude = 0;
127  m_median = 0;
128  m_varCoeff = 0;
129  m_mode.clear();
130 }
131 
NumericStatisticalSummary & operator=(const NumericStatisticalSummary &rhs)
Assignment operator.
A structure to hold the set of statistics from a set of numerical values.