25 #include "..\..\persistence1d\persistence1d.hpp" 39 char * filename =
"data.txt";
40 char * outfilename =
"res.txt";
47 datafile.open(filename);
50 cout <<
"Cannot open data file for reading: " << filename << endl;
54 while(datafile >> currdata)
56 data.push_back(currdata);
68 cout <<
"ERROR" << endl;
72 float filterThreshold = 1.0;
79 outfile.open(outfilename);
83 for (
unsigned int i = 0; i < min.size() && i < max.size(); i++)
85 outfile << min[i] << endl;
86 outfile << max[i] << endl;
91 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: