SummaryFunctions.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 SummaryFunctions.cpp
22 
23  \brief Statistical summary functions.
24  */
25 
26 //Terralib
27 #include "../../dataaccess/query_h.h"
28 #include "../../dataaccess/dataset/DataSet.h"
29 #include "../../dataaccess/dataset/DataSetType.h"
30 #include "../../dataaccess/datasource/DataSource.h"
31 #include "../../dataaccess/datasource/DataSourceCapabilities.h"
32 #include "../../dataaccess/datasource/DataSourceTransactor.h"
33 #include "../../dataaccess/utils/Utils.h"
34 #include "../../dataaccess/query_h.h"
35 #include "../../datatype/Property.h"
36 #include "../../maptools/AbstractLayer.h"
37 #include "../../maptools/DataSetLayer.h"
38 #include "Config.h"
39 #include "Exception.h"
40 #include "SummaryFunctions.h"
41 #include "Utils.h"
42 
43 // BOOST
44 #include <boost/lexical_cast.hpp>
45 
46 //STL
47 #include <algorithm>
48 #include <map>
49 #include <numeric>
50 #include <vector>
51 #include <memory>
52 
53 namespace te
54 {
55  namespace stat
56  {
57  bool DoubleComplexCompare(std::complex< double > x, std::complex< double > y)
58  {
59  return (x.real() < y.real()) ||
60  (x.real() == y.real() && x.imag() < y.imag());
61  }
62  }
63 }
64 
65 void te::stat::GetStringStatisticalSummary(std::vector<std::string>& values, te::stat::StringStatisticalSummary& ss, const std::string& nullValue)
66 {
67  if (values.empty())
68  return;
69 
70  std::vector<std::string> validValues;
71  for (size_t i=0; i<values.size(); ++i)
72  {
73  if (values[i] != nullValue)
74  validValues.push_back(values[i]);
75  }
76  GetStringStatisticalSummary(validValues, ss);
77  ss.m_count = static_cast<int>(values.size());
78  ss.m_validCount = static_cast<int>(validValues.size());
79 }
80 
82 {
83  if (values.empty())
84  return;
85 
86  std::sort(values.begin(), values.end());
87 
88  ss.m_minVal = *values.begin();
89  ss.m_maxVal = values[values.size() - 1];
90 
91  ss.m_count = static_cast<int>(values.size());
92 
93  for(std::size_t i = 0; i < values.size(); ++i)
94  {
95  if(!values[i].empty())
96  {
97  ++ss.m_validCount;
98  }
99  }
100 }
101 
102 void te::stat::GetNumericStatisticalSummary(std::vector<double>& values, te::stat::NumericStatisticalSummary& ss, double nullValue)
103 {
104  if (values.empty())
105  return;
106 
107  std::vector<double> validValues;
108  for (size_t i=0; i<values.size(); ++i)
109  {
110  if (values[i] != nullValue)
111  validValues.push_back(values[i]);
112  }
113  GetNumericStatisticalSummary(validValues, ss);
114  ss.m_count = static_cast<int>(values.size());
115  ss.m_validCount = static_cast<int>(validValues.size());
116 }
117 
119 {
120  if (values.empty())
121  return;
122 
123  std::sort(values.begin(), values.end());
124 
125  ss.m_minVal = *values.begin();
126  ss.m_maxVal = values[values.size() - 1];
127  ss.m_count = static_cast<int>(values.size());
128  ss.m_validCount = static_cast<int>(values.size());
129 
130  for(std::size_t i = 0; i < values.size(); ++i)
131  {
132  ss.m_sum += values[i];
133  }
134 
135  ss.m_mean = ss.m_sum/ss.m_count;
136 
137  for (int i = 0; i < ss.m_count; ++i)
138  {
139  double v = values[i];
140  ss.m_variance += pow((v - ss.m_mean), 2);
141  ss.m_skewness += pow((v - ss.m_mean), 3);
142  ss.m_kurtosis += pow((v - ss.m_mean), 4);
143  }
144 
145  if (ss.m_count > 3) {
146  ss.m_skewness /= pow(ss.m_variance, 1.5);
147  ss.m_skewness *= (ss.m_count * sqrt(ss.m_count - 1)) / (ss.m_count - 2);
148 
149  ss.m_kurtosis /= pow(ss.m_variance, 2);
150  ss.m_kurtosis *= (ss.m_count * (ss.m_count + 1) * (ss.m_count - 1)) / ((ss.m_count - 2) * (ss.m_count - 3));
151 
152  ss.m_variance /= ss.m_count - 1;
153  ss.m_stdDeviation = sqrt(ss.m_variance);
154  } else if (ss.m_count > 2) {
155  ss.m_skewness /= pow(ss.m_variance, 1.5);
156  ss.m_skewness *= (ss.m_count * sqrt(ss.m_count - 1)) / (ss.m_count - 2);
157 
158  ss.m_variance /= ss.m_count - 1;
159  ss.m_stdDeviation = sqrt(ss.m_variance);
160 
161  ss.m_kurtosis = 0.0;
162  } else if (ss.m_count > 1) {
163  ss.m_variance /= ss.m_count - 1;
164  ss.m_stdDeviation = sqrt(ss.m_variance);
165 
166  ss.m_skewness = 0.0;
167  ss.m_kurtosis = 0.0;
168  } else {
169  ss.m_variance = 0.0;
170  ss.m_stdDeviation = 0.0;
171  ss.m_skewness = 0.0;
172  ss.m_kurtosis = 0.0;
173  }
174 
175  ss.m_varCoeff = (100* ss.m_stdDeviation) / ss.m_mean;
176  ss.m_amplitude = ss.m_maxVal - ss.m_minVal;
177 
178  if((ss.m_count % 2) == 0)
179  ss.m_median = (values[(ss.m_count/2)] + values[(ss.m_count/2-1)])/2;
180  else
181  ss.m_median = values[(ss.m_count-1)/2];
182 }
183 
185 {
186  if (values.empty())
187  return;
188 
189  std::map<double, int>::iterator it = values.begin();
190  std::map<double, int>::reverse_iterator it_last = values.rbegin();
191 
192  // Minimum and Maximum values
193  ss.m_minVal = it->first;
194  ss.m_maxVal = it_last->first;
195 
196  // Count, Valid count, Sum
197  while(it != values.end())
198  {
199  ss.m_count += it->second;
200  ss.m_validCount = it->second;
201  ss.m_sum += it->first * it->second;
202 
203  ++it;
204  }
205 
206  // Mean
207  ss.m_mean = ss.m_sum/ss.m_count;
208 
209  // Median, Mode
210  double median_pos;
211  bool modZero;
212 
213  if((ss.m_count % 2) == 0)
214  {
215  modZero = true;
216  median_pos = (ss.m_count)/2;
217  }
218  else
219  {
220  modZero = false;
221  median_pos = (ss.m_count-1)/2;
222  }
223 
224  double pre_median = 0;
225  int current_count = 0;
226  bool alreadySet = false;
227 
228  std::vector<double> mode;
229  double occurrence = 0;
230 
231  for (it = values.begin(); it != values.end(); ++it)
232  {
233  //Median
234  current_count += it->second;
235  if(current_count >= median_pos && !alreadySet)
236  {
237  if(modZero)
238  ss.m_median = (it->first + pre_median)/2;
239  else
240  ss.m_median = it->first;
241 
242  alreadySet = true;
243  }
244  pre_median = it->first;
245 
246  //Mode
247  if(it->second > 1)
248  {
249  if(occurrence < it->second)
250  {
251  occurrence = it->second;
252  mode.clear();
253  mode.push_back(it->first);
254  }
255  else if(occurrence == it->second)
256  {
257  mode.push_back(it->first);
258  }
259  }
260  }
261 
262  ss.m_mode = mode;
263 
264  // Variance, Skewness, Kurtosis, Std Deviation
265  for (it = values.begin(); it != values.end(); ++it)
266  {
267  for(int i = 0; i < it->second; ++i)
268  {
269  ss.m_variance += pow((it->first - ss.m_mean), 2);
270  ss.m_skewness += pow((it->first - ss.m_mean), 3);
271  ss.m_kurtosis += pow((it->first - ss.m_mean), 4);
272  }
273  }
274 
275  if (ss.m_count > 3) {
276  ss.m_skewness /= pow(ss.m_variance, 1.5);
277  ss.m_skewness *= (ss.m_count * sqrt(ss.m_count - 1)) / (ss.m_count - 2);
278 
279  ss.m_kurtosis /= pow(ss.m_variance, 2);
280  ss.m_kurtosis *= (ss.m_count * (ss.m_count + 1) * (ss.m_count - 1)) / ((ss.m_count - 2) * (ss.m_count - 3));
281 
282  ss.m_variance /= ss.m_count - 1;
283  ss.m_stdDeviation = sqrt(ss.m_variance);
284  } else if (ss.m_count > 2) {
285  ss.m_skewness /= pow(ss.m_variance, 1.5);
286  ss.m_skewness *= (ss.m_count * sqrt(ss.m_count - 1)) / (ss.m_count - 2);
287 
288  ss.m_variance /= ss.m_count - 1;
289  ss.m_stdDeviation = sqrt(ss.m_variance);
290 
291  ss.m_kurtosis = 0.0;
292  } else if (ss.m_count > 1) {
293  ss.m_variance /= ss.m_count - 1;
294  ss.m_stdDeviation = sqrt(ss.m_variance);
295 
296  ss.m_skewness = 0.0;
297  ss.m_kurtosis = 0.0;
298  } else {
299  ss.m_variance = 0.0;
300  ss.m_stdDeviation = 0.0;
301  ss.m_skewness = 0.0;
302  ss.m_kurtosis = 0.0;
303  }
304 
305  // Coefficient variation, Amplitude
306  ss.m_varCoeff = (100* ss.m_stdDeviation) / ss.m_mean;
307  ss.m_amplitude = ss.m_maxVal - ss.m_minVal;
308 }
309 
311 {
312  if (values.empty())
313  return;
314 
315  std::sort(values.begin(), values.end(), DoubleComplexCompare );
316 
317  ss.m_minVal = *values.begin();
318  ss.m_maxVal = values[values.size() - 1];
319  ss.m_count = static_cast<int>(values.size());
320  ss.m_validCount = static_cast<int>(values.size());
321 
322  for(std::size_t i = 0; i < values.size(); ++i)
323  {
324  ss.m_sum += values[i];
325  }
326 
327  ss.m_mean = ss.m_sum/(double)ss.m_count;
328 
329  for(int i = 0; i < ss.m_count; ++i)
330  {
331  std::complex<double> v= values[i];
332  ss.m_variance += pow((v-ss.m_mean),2);
333  ss.m_skewness += pow((v-ss.m_mean),3);
334  ss.m_kurtosis += pow((v-ss.m_mean),4);
335  }
336 
337  ss.m_variance /= ss.m_count;
338  ss.m_stdDeviation = pow(ss.m_variance, 0.5);
339  ss.m_skewness /= ss.m_count;
340  ss.m_skewness /= pow(ss.m_stdDeviation, 3);
341  ss.m_kurtosis /= ss.m_count;
342  ss.m_kurtosis /= pow(ss.m_stdDeviation, 4);
343 
344  ss.m_varCoeff = (100.0 * ss.m_stdDeviation) / ss.m_mean;
345  ss.m_amplitude = ss.m_maxVal - ss.m_minVal;
346 
347  if((ss.m_count % 2) == 0)
348  ss.m_median = (values[(ss.m_count/2)] + values[(ss.m_count/2-1)])/2.0;
349  else
350  ss.m_median = values[(ss.m_count-1)/2];
351 }
352 
354  std::map<double, int>& values, double& /*resolutionX*/,
355  double& /*resolutionY*/, double& /*area*/,
357 {
358  if (values.empty())
359  return;
360 
361  std::map<double, double> percentMap;
362 
363  std::map<double, int>::iterator it = values.begin();
364 
365  int count = 0;
366  while(it != values.end())
367  {
368  count+= it->second;
369  ++it;
370  }
371 
372  for(it = values.begin(); it != values.end(); ++it)
373  {
374  double percentInter = (double)it->second / (double)count;
375  percentMap.insert(std::pair<double, double>(it->first, percentInter));
376  }
377 
378  ss.m_percentEachClass = percentMap;
379 }
380 
381 void te::stat::Mode(const std::vector<double>& values,
383 {
384  std::vector<double> mode;
385  if (values.empty())
386  return;
387 
388  bool found;
389  std::map<double, int> mapMode;
390 
391  for(std::size_t i = 0; i < values.size(); ++i)
392  {
393  found = false;
394 
395  if(!mapMode.empty())
396  {
397  std::map<double, int>::iterator itMode = mapMode.begin();
398 
399  while(itMode != mapMode.end())
400  {
401  if(itMode->first == values[i])
402  {
403  ++itMode->second;
404  found = true;
405  }
406 
407  ++itMode;
408  }
409  if(found == false)
410  {
411  mapMode.insert( std::map<double, int>::value_type( values[i] , 1 ) );
412  }
413  }
414  else
415  mapMode.insert( std::map<double, int>::value_type( values[i] , 1 ) );
416  }
417 
418  std::map<double, int>::iterator itMode = mapMode.begin();
419  int repeat = 0;
420 
421  while(itMode != mapMode.end())
422  {
423  if(itMode->second > 1)
424  {
425  if(repeat < itMode->second)
426  {
427  repeat = itMode->second;
428  mode.clear();
429  mode.push_back(itMode->first);
430  }
431  else if(repeat == itMode->second)
432  {
433  mode.push_back(itMode->first);
434  }
435  }
436 
437  ++itMode;
438  }
439 
440  ss.m_mode = mode;
441 }
442 
443 void te::stat::Mode(const std::vector<std::string>& values,
445 {
446  if (values.empty())
447  return;
448 
449  bool found;
450  std::string mode;
451  std::map<std::string, int> mapMode;
452 
453  for(std::size_t i = 0; i < values.size(); ++i)
454  {
455  found = false;
456 
457  if(!mapMode.empty())
458  {
459  std::map<std::string, int>::iterator itMode = mapMode.begin();
460 
461  while(itMode != mapMode.end())
462  {
463  if(itMode->first == values[i])
464  {
465  ++itMode->second;
466  found = true;
467  }
468 
469  ++itMode;
470  }
471  if(found == false)
472  {
473  mapMode.insert( std::map<std::string, int>::value_type( values[i] , 1 ) );
474  }
475  }
476  else
477  mapMode.insert( std::map<std::string, int>::value_type( values[i] , 1 ) );
478  }
479 
480  std::map<std::string, int>::iterator itMode = mapMode.begin();
481  int repeat = 0;
482 
483  while(itMode != mapMode.end())
484  {
485  if(repeat < itMode->second)
486  {
487  repeat = itMode->second;
488  mode = itMode->first;
489  }
490 
491  ++itMode;
492  }
493 
494  ss.m_mode = mode;
495 }
496 
497 void te::stat::GetStringStatisticalSummaryQuery(const std::string& inDataset,
498  te::da::DataSource* inDatasource,
499  const std::string& propName,
501 {
502  assert(inDatasource);
503 
504  if (!inDatasource->dataSetExists(inDataset))
505  return;
506 
507  const te::da::DataSourceCapabilities dsCapabilities = inDatasource->getCapabilities();
508 
509  if(!dsCapabilities.supportsPreparedQueryAPI())
510  {
511  std::unique_ptr<te::da::DataSet> ds = inDatasource->getDataSet(inDataset);
512 
513  std::vector<std::string> stringVector = te::stat::GetStringData(ds.get(), propName);
514 
515  te::stat::GetStringStatisticalSummary(stringVector, ss);
516  }
517  else
518  {
519  te::da::Fields* fields = new te::da::Fields;
520 
521  te::da::PropertyName* p_name = new te::da::PropertyName(propName);
522 
523  te::da::Expression* e_min = new te::da::Min(p_name);
524  te::da::Field* f_min = new te::da::Field(*e_min, p_name->getName() + "_MIN_VALUE");
525 
526  te::da::Expression* e_max = new te::da::Max(p_name);
527  te::da::Field* f_max = new te::da::Field(*e_max, p_name->getName() + "_MAX_VALUE");
528 
529  te::da::Expression* e_count = new te::da::Count(p_name);
530  te::da::Field* f_count = new te::da::Field(*e_count, p_name->getName() + "_COUNT");
531 
532  te::da::Expression* e_validcount = new te::da::Count(p_name);
533  te::da::Field* f_validcount = new te::da::Field(*e_validcount, p_name->getName() + "_VALID_COUNT");
534 
535  fields->push_back(f_min);
536  fields->push_back(f_max);
537  fields->push_back(f_count);
538  fields->push_back(f_validcount);
539 
540  te::da::FromItem* fromItem = new te::da::DataSetName(inDataset);
541  te::da::From* from = new te::da::From;
542  from->push_back(fromItem);
543 
544  te::da::Select select(fields, from);
545 
546  std::unique_ptr<te::da::DataSet> dsQuery = inDatasource->query(select);
547 
548  if (!dsQuery.get())
549  return;
550 
551  dsQuery->moveFirst();
552 
553  ss.m_minVal = dsQuery->getAsString(1);
554  ss.m_maxVal = dsQuery->getAsString(2);
555  ss.m_count = dsQuery->getInt16(3);
556  ss.m_validCount = dsQuery->getInt16(4);
557 
558  // how to get the mode?
559  }
560 }
561 
562 void te::stat::GetNumericStatisticalSummaryQuery(const std::string& inDataset,
563  te::da::DataSource* inDatasource,
564  const std::string& propName,
566 {
567  assert(inDatasource);
568 
569  if (!inDatasource->dataSetExists(inDataset))
570  return;
571 
572  const te::da::DataSourceCapabilities dsCapabilities = inDatasource->getCapabilities();
573 
574  if(!dsCapabilities.supportsPreparedQueryAPI())
575  {
576  std::unique_ptr<te::da::DataSet> ds = inDatasource->getDataSet(inDataset);
577 
578  std::vector<double> numericVector = te::stat::GetNumericData(ds.get(), propName);
579 
580  te::stat::GetNumericStatisticalSummary(numericVector, ss);
581  }
582  else
583  {
584  te::da::PropertyName* p_name = new te::da::PropertyName(propName);
585 
586  te::da::Expression* e_min = new te::da::Min(p_name);
587  te::da::Field* f_min = new te::da::Field(*e_min, "MIN");
588 
589  te::da::Expression* e_max = new te::da::Max(p_name);
590  te::da::Field* f_max = new te::da::Field(*e_max, "MAX");
591 
592  te::da::Expression* e_count = new te::da::Count(p_name);
593  te::da::Field* f_count = new te::da::Field(*e_count, "COUNT");
594 
595  te::da::Expression* e_sum = new te::da::Sum(p_name);
596  te::da::Field* f_sum = new te::da::Field(*e_sum, "SUM");
597 
598  te::da::Expression* e_mean = new te::da::Avg(p_name);
599  te::da::Field* f_mean = new te::da::Field(*e_mean, "MEAN");
600 
601  te::da::Expression* e_stddev = new te::da::StdDev(p_name);
602  te::da::Field* f_stddev = new te::da::Field(*e_stddev, "STD_DEV");
603 
604  te::da::Expression* e_variance = new te::da::Variance(p_name);
605  te::da::Field* f_variance = new te::da::Field(*e_variance, "VARIANCE");
606 
607  te::da::Expression* e_amplitude = new te::da::Sub(*e_max, *e_min);
608  te::da::Field* f_amplitude = new te::da::Field(*e_amplitude, "AMPLITUDE");
609 
610  te::da::Fields* fields = new te::da::Fields;
611 
612  fields->push_back(f_min);
613  fields->push_back(f_max);
614  fields->push_back(f_count);
615  fields->push_back(f_sum);
616  fields->push_back(f_mean);
617  fields->push_back(f_stddev);
618  fields->push_back(f_variance);
619  fields->push_back(f_amplitude);
620 
621  te::da::FromItem* fromItem = new te::da::DataSetName(inDataset);
622  te::da::From* from = new te::da::From;
623  from->push_back(fromItem);
624 
625  te::da::Select select(fields, from);
626 
627  std::unique_ptr<te::da::DataSet> dsQuery = inDatasource->query(select);
628 
629  if (!dsQuery.get())
630  return;
631 
632  dsQuery->moveFirst();
633 
634  ss.m_minVal = boost::lexical_cast<double>(dsQuery->getAsString(0));
635  ss.m_maxVal = boost::lexical_cast<double>(dsQuery->getAsString(1));
636  ss.m_count = boost::lexical_cast<int>(dsQuery->getAsString(2));
637  ss.m_sum = boost::lexical_cast<double>(dsQuery->getAsString(3));
638  ss.m_mean = boost::lexical_cast<double>(dsQuery->getAsString(4));
639  ss.m_stdDeviation = boost::lexical_cast<double>(dsQuery->getAsString(5));
640  ss.m_variance = boost::lexical_cast<double>(dsQuery->getAsString(6));
641  ss.m_amplitude = boost::lexical_cast<double>(dsQuery->getAsString(7));
642  }
643 }
const std::string & getName() const
It returns the property name.
TESTATEXPORT void GetPercentOfEachClassByArea(std::map< double, int > &values, double &resolutionX, double &resolutionY, double &area, te::stat::NumericStatisticalSummary &ss)
TESTATEXPORT void GetNumericStatisticalSummaryQuery(const std::string &inDataset, te::da::DataSource *inDatasource, const std::string &propName, te::stat::NumericStatisticalSummary &ss)
Configuration flags for the Terrralib Statistic module.
A structure to hold the set of statistics from a set of numerical values.
An abstract class that models a source of data in a query.
Definition: FromItem.h:50
The Field class can be used to model an expression that takes part of the output items of a SELECT...
A class that models the name of a dataset used in a From clause.
Definition: DataSetName.h:43
TESTATEXPORT void GetStringStatisticalSummaryQuery(const std::string &inDataset, te::da::DataSource *inDatasource, const std::string &propName, te::stat::StringStatisticalSummary &ss)
A class that models the name of any property of an object.
TEMNTEXPORT te::gm::Point Max(te::gm::Point &p1, te::gm::Point &p2)
Count statistical function.
Definition: Count.h:46
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Avg statistical function.
Definition: Avg.h:46
std::map< double, double > m_percentEachClass
This is an abstract class that models a query expression.
StdDev statistical function.
Definition: StdDev.h:46
TESTATEXPORT std::vector< double > GetNumericData(te::da::DataSet *dataSet, const std::string propName)
Returns the values of a numeric type property in a vector of values.
virtual std::unique_ptr< DataSet > query(const Select &q, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It executes a query that may return some data using a generic query. This method always returns a dis...
A set of functions to calculate the statistic summary from a set of values.
An exception class for the statistical module.
virtual const DataSourceCapabilities & getCapabilities() const =0
It returns the known capabilities of the data source.
TESAEXPORT double Sum(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate sum of a specific attribute from a gpm.
TESTATEXPORT std::vector< std::string > GetStringData(te::da::DataSet *dataSet, const std::string propName)
Returns the values of a string type property in a vector of values.
URI C++ Library.
Definition: Attributes.h:37
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
Definition: Fields.h:37
TESTATEXPORT void GetNumericStatisticalSummary(std::vector< double > &values, te::stat::NumericStatisticalSummary &ss, double nullValue)
Utility functions for the data access module.
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
Definition: From.h:37
virtual bool dataSetExists(const std::string &name)
It checks if a dataset with the given name exists in the data source.
TESTATEXPORT void GetStringStatisticalSummary(std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss, const std::string &nullValue)
The subtraction operator.
virtual std::unique_ptr< DataSet > getDataSet(const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It gets the dataset identified by the given name. This method always returns a disconnected dataset...
A structure to hold the set of statistics from a set of categorical (sample) values.
Variance statistical function.
Definition: Variance.h:46
TESTATEXPORT void GetNumericComplexStatisticalSummary(std::vector< std::complex< double > > &values, te::stat::NumericStatisticalComplexSummary &ss)
TEMNTEXPORT te::gm::Point Min(te::gm::Point &p1, te::gm::Point &p2)
TESTATEXPORT void Mode(const std::vector< double > &values, te::stat::NumericStatisticalSummary &ss)
bool DoubleComplexCompare(std::complex< double > x, std::complex< double > y)