-
Notifications
You must be signed in to change notification settings - Fork 0
/
lms.h
46 lines (35 loc) · 1.01 KB
/
lms.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Created by pwszebor on 03.06.17.
//
#pragma once
#include <QtQml/QJSValue>
#include <QVariant>
#include "algorithm.h"
#include <armadillo>
class Lms : public Algorithm {
typedef arma::Col<double> vectorCol;
typedef arma::Row<double> vectorRow;
typedef arma::Mat<double> matrix;
public:
static Lms &sharedInstance();
QVariant changeParameters(const QJSValue ¶meters) override;
void simulate(std::function<void(SIMULATION_STATUS)> changeStatus) override;
void stopSimulation() override;
std::vector<std::vector<double>> getData(const QString &plotType) override;
private:
arma::Col<double> parseVector(const QString &filePath);
void executeAlgorithm(std::function<void(SIMULATION_STATUS)> changeStatus);
private:
Lms();
virtual ~Lms();
Lms(const Lms &) = delete;
Lms(Lms &&) = delete;
std::atomic<bool> _stopExecution;
vectorCol _x;
vectorCol _d;
unsigned long long _L;
double _alpha;
vectorRow _e;
vectorRow _y;
matrix _ff;
};