NumericStatisticalComplexSummary.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,0),
31  m_maxVal(0,0),
32  m_mean(0,0),
33  m_sum(0,0),
34  m_count(0),
35  m_validCount(0),
36  m_stdDeviation(0,0),
37  m_kernel(0,0),
38  m_variance(0,0),
39  m_skewness(0,0),
40  m_kurtosis(0,0),
41  m_amplitude(0,0),
42  m_median(0,0),
43  m_varCoeff(0,0)
44 {
45 }
46 
48  : m_minVal(0,0),
49  m_maxVal(0,0),
50  m_mean(0,0),
51  m_sum(0,0),
52  m_count(0),
53  m_validCount(0),
54  m_stdDeviation(0,0),
55  m_kernel(0,0),
56  m_variance(0,0),
57  m_skewness(0,0),
58  m_kurtosis(0,0),
59  m_amplitude(0,0),
60  m_median(0,0),
61  m_varCoeff(0,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());
80 }
81 
83 {
84  clear();
85 }
86 
88 {
89  if(this != &rhs)
90  {
91  clear();
92 
93  m_minVal = rhs.m_minVal;
94  m_maxVal = rhs.m_maxVal;
95  m_mean = rhs.m_mean;
96  m_sum = rhs.m_sum;
97  m_count = rhs.m_count;
100  m_kernel = rhs.m_kernel;
101  m_variance = rhs.m_variance;
102  m_skewness = rhs.m_skewness;
103  m_kurtosis = rhs.m_kurtosis;
104  m_amplitude = rhs.m_amplitude;
105  m_median = rhs.m_median;
106  m_varCoeff = rhs.m_varCoeff;
107  m_mode.resize(rhs.m_mode.size());
108  std::copy(rhs.m_mode.begin(), rhs.m_mode.end(), m_mode.begin());
110  }
111 
112  return *this;
113 }
114 
116 {
117  m_minVal = std::complex<double> (0,0);
118  m_maxVal = std::complex<double> (0,0);
119  m_mean = std::complex<double> (0,0);
120  m_sum = std::complex<double> (0,0);
121  m_count = 0;
122  m_validCount = 0;
123  m_stdDeviation = std::complex<double> (0,0);
124  m_kernel = std::complex<double> (0,0);
125  m_variance = std::complex<double> (0,0);
126  m_skewness = std::complex<double> (0,0);
127  m_kurtosis = std::complex<double> (0,0);
128  m_amplitude = std::complex<double> (0,0);
129  m_median = std::complex<double> (0,0);
130  m_varCoeff = std::complex<double> (0,0);
131  m_mode.clear();
132  m_percentEachClass.clear();
133 }
NumericStatisticalComplexSummary & operator=(const NumericStatisticalComplexSummary &rhs)
Assignment operator.