//Functions of points, sets.
#ifndef MY_FUNCTION
#define MY_FUNCTION

#include "head.h"
#include "tools.h"

datapoint operator -(datapoint a,datapoint b);
datapoint operator +(datapoint a,datapoint b);
datapoint operator *(datapoint a,double b);
datapoint operator /(datapoint a,double b);

double norm(const datapoint &x);

double dist(const datapoint &x, const datapoint &y);
double dist(const datapoint &x,const dataset &C);

datapoint NN(const datapoint &x, const dataset &C);

double cost(const dataset &X, const dataset &C, int z);

double cost(const dataset &X, const datapoint &c, int z);

double rcost(dataset X, const dataset &C, double m, int z);

void Union(parti &_A, parti _B);

void Union(dataset &A, dataset B);

#endif