-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cluster.h
47 lines (29 loc) · 808 Bytes
/
Cluster.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
47
//
// Created by gevagorou on 19/04/16.
//
#ifndef THESIS_CLUSTER_H
#define THESIS_CLUSTER_H
#include <vector>
#include "Point.h"
#include <cmath>
#include <ostream>
class Cluster {
friend std::ostream &operator<<(std::ostream &ostr, const Cluster &cl);
private:
static long id_generator;
long cluster_id;
int num_of_points;
std::vector<double> sum_vector;
std::vector<Point> cluster_points;
std::vector<double> centroid;
public:
Cluster() = default;
Cluster(const Cluster &cl);
Cluster &merge(const Cluster &right);
Cluster(Point p);
void insertPoint(Point p);
long getCluster_id() const;
Cluster &operator=(const Cluster &right);
static double euclidean_distance(const Cluster &a, const Cluster &b);
};
#endif //THESIS_CLUSTER_H