#pragma once #include namespace graft_cv { const float EPS = 2.2204e-16f; void diff(std::vector in, std::vector& out); void vectorElementsProduct(std::vector a, std::vector b, std::vector& out); void findIndicesLessThan(std::vector in, float threshold, std::vector& indices); void selectElementsFromIndices(std::vector in, std::vector indices, std::vector& out); void selectElementsFromIndices(std::vector in, std::vector indices, std::vector& out); void signVector(std::vector in, std::vector& out); void scalarProduct(float scalar, std::vector in, std::vector& out); /* Inputs x0: input signal extrema: 1 if maxima are desired, -1 if minima are desired includeEndpoints - If true the endpoints will be included as possible extrema otherwise they will not be included Output peakInds: Indices of peaks in x0 */ void findPeaks(std::vector x0, std::vector& peakInds, bool includeEndpoints = true, float extrema = 1); void indexPeaks( std::vector&stem_width, std::vector&peak_indices, float mu, std::vector& peak_power); }