From 0508272bbe891037e5f9462a9f32001cec98ef31 Mon Sep 17 00:00:00 2001 From: Federico Lolli <federico.lolli@skywarder.eu> Date: Sun, 29 Oct 2023 11:52:12 +0100 Subject: [PATCH] [SFD] format --- src/shared/algorithms/SFD/SFDAscent.cpp | 9 ++++++--- src/shared/algorithms/SFD/SFDDescent.cpp | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/shared/algorithms/SFD/SFDAscent.cpp b/src/shared/algorithms/SFD/SFDAscent.cpp index 8842f7221..355faf8e2 100644 --- a/src/shared/algorithms/SFD/SFDAscent.cpp +++ b/src/shared/algorithms/SFD/SFDAscent.cpp @@ -29,13 +29,16 @@ namespace Boardcore { -SFDAscent::SFDAscent(const SFDAscentConfig& config) : svm(config.modelParameters) {} +SFDAscent::SFDAscent(const SFDAscentConfig& config) + : svm(config.modelParameters) +{ +} SFDAscent::FeaturesVec SFDAscent::getFeatures(const SFDVectorIn& input) { float delta, min, max, u, var, s2, m4, rfmean, rfvar; SFDVectorIn rfourier, x0; - SFDVectorIn data = SFDVectorIn::Zero(); + SFDVectorIn data = SFDVectorIn::Zero(); FeaturesVec features = FeaturesVec::Zero(); min = input.minCoeff(); @@ -51,7 +54,7 @@ SFDAscent::FeaturesVec SFDAscent::getFeatures(const SFDVectorIn& input) rfourier = FFT32::fft(data).real(); // TODO: fix complex -> float rfmean = rfourier.mean(); - rfvar = (rfourier - rfmean * SFDVectorIn::Ones()).squaredNorm() / LEN_CHUNK; + rfvar = (rfourier - rfmean * SFDVectorIn::Ones()).squaredNorm() / LEN_CHUNK; features(0) = delta; features(1) = var; diff --git a/src/shared/algorithms/SFD/SFDDescent.cpp b/src/shared/algorithms/SFD/SFDDescent.cpp index 447d38812..ed7fad969 100644 --- a/src/shared/algorithms/SFD/SFDDescent.cpp +++ b/src/shared/algorithms/SFD/SFDDescent.cpp @@ -27,7 +27,8 @@ namespace Boardcore { -SFDDescent::SFDDescent(const SFDDescentConfig& config) : svm(config.modelParameters) +SFDDescent::SFDDescent(const SFDDescentConfig& config) + : svm(config.modelParameters) { } @@ -35,7 +36,7 @@ SFDDescent::FeaturesVec SFDDescent::getFeatures(const SFDVectorIn& input) { float delta, min, max, u, s2, m3, m4, rms; SFDVectorIn rfourier, x0; - SFDVectorIn data = SFDVectorIn::Zero(); + SFDVectorIn data = SFDVectorIn::Zero(); FeaturesVec features = FeaturesVec::Zero(); min = input.minCoeff(); -- GitLab