Commit 08930a3f authored by mzed's avatar mzed
Browse files

minor code cleanups

parent e7a56819
......@@ -67,9 +67,9 @@ std::vector<std::vector<T> > fastDTW<T>::downsample(const std::vector<std::vecto
}
}
//TODO: implement downsampling by resolution
return shrunkenSeries;
return shrunkenSeries;size()
}
//explicit instantiation
template class fastDTW<double>;
template class fastDTW<float>;
\ No newline at end of file
template class fastDTW<float>;
......@@ -96,8 +96,8 @@ std::vector<T> modelSet<T>::run(const std::vector<T> &inputVector) {
template<typename T>
std::vector<T> json2vector(Json::Value json) {
std::vector<T> returnVec;
for (unsigned int i = 0; i < json.size(); ++i) {
returnVec.push_back(json[i].asDouble());
for (auto jsonValue : json) {
returnVec.push_back(jsonValue.asDouble());
}
return returnVec;
}
......
......@@ -9,6 +9,7 @@
#define rapidStream_h
#include <stdint.h>
#include <atomic>
#include "../dependencies/bayesfilter/src/BayesianFilter.h"
template<typename T>
......@@ -104,7 +105,7 @@ public:
private:
uint32_t windowSize;
uint32_t windowIndex;
std::atomic_uint32_t windowIndex;
T *circularWindow;
T calcCurrentVel(int i);
......
......@@ -30,6 +30,7 @@ bool seriesClassificationTemplate<T>::train(const std::vector<trainingSeriesTemp
allTrainingSeries = seriesSet;
minLength = maxLength = int(allTrainingSeries[0].input.size());
for (int i = 0; i < allTrainingSeries.size(); ++i) {
//for (auto trainingSeries : allTrainingSeries)
//Global
int newLength = int(allTrainingSeries[i].input.size());
if (newLength < minLength) {
......@@ -198,4 +199,4 @@ template class seriesClassificationTemplate<float>;
//std::vector<T> seriesClassification::getCosts(const std::vector<trainingExample> &trainingSet) {
// run(trainingSet);
// return allCosts;
//}
\ No newline at end of file
//}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment