forked from BauhausUniversity/EasyListener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPointND.h
40 lines (36 loc) · 873 Bytes
/
PointND.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
/*
* EasyListener for Teensy Audio Library
*
* (c) 2020 Clemens Wegener
* Bauhaus-Universität Weimar
* Department Interface Design
*
* This library uses machine learning to detect previously
* presented audio signals on the Teensy board.
*
* BSD license
*/
#ifndef PointND_H
#define PointND_H
#include <vector>
using namespace std;
class PointND {
public:
PointND(){};
PointND(int dimensions);
PointND(const vector<float>& newN);
PointND(const PointND&);
void push_back(float val);
PointND operator+(const PointND& p2);
PointND operator/(float f);
float getDim(unsigned nth_dimension) const;
void setDim(unsigned nth_dimension, float value);
int size() const{
return _pointN.size();
}
float getDistance(const PointND&);
void normalize();
private:
vector<float> _pointN;
};
#endif