Definition in file TeGroupingAlgorithms.h.
#include "TeDefines.h"
#include "TeSlice.h"
#include "TeUtils.h"
#include "TeDataTypes.h"
#include <math.h>
#include <time.h>
#include <algorithm>
Go to the source code of this file.
Functions | |
| template<class iterator> | |
| void | TeElemCountingBySlice (iterator begin, iterator end, vector< TeSlice > &result) |
| Counts the number of elements, from a general container, per slice of a vector of slices. | |
| template<class iterator> | |
| void | TeGroupByEqualStep (iterator begin, iterator end, int nstep, vector< TeSlice > &result, int precision=0, bool countElements=true) |
| Groups a set of elements defined by a range of iterators in nstep groups, using Equal Step algorithm. | |
| TL_DLL void | TeGroupByEqualStep (double min, double max, int nstep, vector< TeSlice > &result, int precision=0) |
| Defines the classes (slices) of a equal step grouping. | |
| template<class iterator> | |
| void | TeGroupByQuantil (iterator begin, iterator end, int nstep, vector< TeSlice > &result, int precision=0, bool countElements=true) |
| Groups a set of elements defined by a range of iterators in nstep groups, using Quantil algorithm. | |
| template<class iterator> | |
| void | TeGroupByStdDev (iterator begin, iterator end, double ndev, vector< TeSlice > &result, string &rmean, int precision=0, bool countElements=true) |
| Groups a set of elements defined by a range of iterators in ndev groups, using Standanrd deviation algorithm. | |
| TL_DLL void | TeGroupByUniqueValue (vector< string > &vec, TeAttrDataType tipo, vector< TeSlice > &result, int precision) |
| Groups a set of elements in a vector of string using Unique Value algorithm. | |
| template<typename It> | |
| void | TeMaximumValue (It begin, It end, vector< double > &maxValue, double dummy=-9999.99, bool usesDummy=false) |
| Finds the element with maximum value among the elements contained in a range of iterators. | |
| template<typename It> | |
| void | TeMinimumValue (It begin, It end, vector< double > &minValue, double dummy=-9999.99, bool usesDummy=false) |
| Finds the element with minimum value among the elements contained in a range of iterators. | |
| TL_DLL void TeGroupByEqualStep | ( | double | min, | |
| double | max, | |||
| int | nstep, | |||
| vector< TeSlice > & | result, | |||
| int | precision = 0 | |||
| ) |
Definition at line 96 of file TeGroupingAlgorithms.cpp.
References TeSlice::count_, TeSlice::from_, Te2String(), TeAdjustToPrecision(), and TeSlice::to_.
00097 { 00098 double slice = (max - min)/double(nstep); 00099 int ns; 00100 for (ns=0;ns<nstep;ns++) 00101 { 00102 TeSlice ps; 00103 ps.count_ = 0; 00104 ps.from_ = Te2String(min+double(ns)*slice, precision); 00105 ps.to_ = Te2String(min+double(ns+1)*slice, precision); 00106 result.push_back(ps); 00107 } 00108 min = TeAdjustToPrecision(min, precision, true); 00109 result[0].from_ = Te2String(min, precision); 00110 max = TeAdjustToPrecision(max, precision); 00111 result[result.size()-1].to_ = Te2String(max, precision); 00112 }
| void TeMaximumValue | ( | It | begin, | |
| It | end, | |||
| vector< double > & | maxValue, | |||
| double | dummy = -9999.99, |
|||
| bool | usesDummy = false | |||
| ) | [inline] |
Definition at line 64 of file TeGroupingAlgorithms.h.
References TeMAXFLOAT.
Referenced by TeKMeans().
00065 { 00066 for (int i=0; i<maxValue.size(); i++) 00067 maxValue[i] = -TeMAXFLOAT; 00068 00069 It it = begin; 00070 double val; 00071 while ( it != end) 00072 { 00073 if (!(usesDummy && dummy == val)) 00074 for (int i=0; i<maxValue.size(); i++) 00075 { 00076 val= (*it)[i]; 00077 if (val > maxValue[i]) 00078 maxValue[i] = val; 00079 } 00080 it++; 00081 } 00082 }
| void TeMinimumValue | ( | It | begin, | |
| It | end, | |||
| vector< double > & | minValue, | |||
| double | dummy = -9999.99, |
|||
| bool | usesDummy = false | |||
| ) | [inline] |
Definition at line 42 of file TeGroupingAlgorithms.h.
References TeMAXFLOAT.
Referenced by TeKMeans().
00043 { 00044 for (int i=0; i<minValue.size(); i++) 00045 minValue[i] = TeMAXFLOAT; 00046 00047 It it = begin; 00048 double val; 00049 while ( it != end) 00050 { 00051 if (!(usesDummy && dummy == val)) 00052 for (int i=0; i<minValue.size(); i++) 00053 { 00054 val= (*it)[i]; 00055 if (val < minValue[i]) 00056 minValue[i] = val; 00057 } 00058 it++; 00059 } 00060 }
1.5.3