Files
libpasada/google-tests/test_helpers.h

34 lines
902 B
C++

//
// Created by david on 11.03.2026.
//
#ifndef PASADASUPERPROJECT_TEST_HELPERS_H
#define PASADASUPERPROJECT_TEST_HELPERS_H
#include "npy.hpp"
#include "ssf_filter.h"
#include <string>
#include <vector>
template <typename T> static std::vector<double> apply_filter(T& filter, std::vector<double>& x) {
std::vector<double> y;
y.resize(x.size());
for (int i = 0; i < x.size(); i++) {
y[i] = filter.filter(x[i]);
}
return y;
}
void npy_save(std::string path, std::vector<double>& x);
void npy_save(std::string path, std::vector<bool>& x);
std::vector<double> fetch_y_axis(npy::npy_data<double>& acc);
/** Returns the ssf_threshold as the filter output for debugging. */
class DebugSsfStepDetectorThreshold : public SsfStepDetector {
public:
DebugSsfStepDetectorThreshold(size_t len_refr);
double filter(double val);
};
#endif //PASADASUPERPROJECT_TEST_HELPERS_H