|
@@ -0,0 +1,22 @@
|
|
|
+#include "pointset.h"
|
|
|
+#include "utils.h"
|
|
|
+
|
|
|
+extern "C" {
|
|
|
+ #include "discr_calc/dem_discr.h"
|
|
|
+}
|
|
|
+
|
|
|
+pointset::pointset(int dim, int npoints) : dim(dim), npoints(npoints) {
|
|
|
+ data = (double**)malloc2d(npoints, dim, sizeof(double));
|
|
|
+ for(int y = 0; y < npoints; y++)
|
|
|
+ for(int x = 0; x < dim; x++)
|
|
|
+ data[y][x] = 0.5;
|
|
|
+}
|
|
|
+
|
|
|
+pointset::~pointset() {
|
|
|
+ free2d((void**)data, npoints);
|
|
|
+}
|
|
|
+
|
|
|
+double pointset::discrepancy() {
|
|
|
+ double lower;
|
|
|
+ return oydiscr(data, dim, npoints, &lower);
|
|
|
+}
|