33 #include "..\..\persistence1d\persistence1d.hpp" 47 char * filename =
"data.txt";
48 char * outfilename =
"res.txt";
49 bool enableMatlabIndexing =
true;
56 datafile.open(filename);
59 cout <<
"Cannot open data file for reading: " << filename << endl;
63 while(datafile >> currdata)
65 data.push_back(currdata);
77 cout <<
"ERROR" << endl;
81 float filterThreshold = 1.0;
91 outfile.open(outfilename);
95 for (
unsigned int i = 0; i < min.size() && i < max.size(); i++)
97 outfile << min[i] << endl;
98 outfile << max[i] << endl;
103 outfile << globalMinIndex << endl;
int GetGlobalMinimumIndex(const bool matlabIndexing=false) const
Returns the index of the global minimum.
bool GetExtremaIndices(std::vector< int > &min, std::vector< int > &max, const float threshold=0, const bool matlabIndexing=false) const
Use this method to get two vectors with all indices of PairedExterma.
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 VerifyResults()
Runs basic sanity checks on results of RunPersistence: