23 #include "..\..\persistence1d\persistence1d.hpp" 32 data.push_back(2.0);
data.push_back(5.0);
data.push_back(7.0);
33 data.push_back(-12.0);
data.push_back(-13.0);
data.push_back(-7.0);
34 data.push_back(10.0);
data.push_back(18.0);
data.push_back(6.0);
35 data.push_back(8.0);
data.push_back(7.0);
data.push_back(4.0);
42 vector< TPairedExtrema > Extrema;
46 for(vector< TPairedExtrema >::iterator it = Extrema.begin(); it != Extrema.end(); it++)
48 cout <<
"Persistence: " << (*it).Persistence
49 <<
" minimum index: " << (*it).MinIndex
50 <<
" maximum index: " << (*it).MaxIndex
int GetGlobalMinimumIndex(const bool matlabIndexing=false) const
Returns the index of the global minimum.
bool RunPersistence(const std::vector< float > &InputData)
Call this function with a vector of one dimensional data to find extrema features in the data.
Finds extrema and their persistence in one-dimensional data.
bool GetPairedExtrema(std::vector< TPairedExtrema > &pairs, const float threshold=0, const bool matlabIndexing=false) const
Use this method to get the results of RunPersistence.
float GetGlobalMinimumValue() const
Returns the value of the global minimum.