[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [labplot] src/backend/nsl: added line simplification type enums and names
From:       Stefan Gerlach <stefan.gerlach () uni-konstanz ! de>
Date:       2016-08-31 21:04:23
Message-ID: E1bfCgJ-0004u8-EC () code ! kde ! org
[Download RAW message or body]

Git commit 53af46b2d3ef5a28be5bc6787274905e257fe96a by Stefan Gerlach.
Committed on 31/08/2016 at 21:04.
Pushed by sgerlach into branch 'master'.

added line simplification type enums and names

M  +4    -1    src/backend/nsl/nsl_geom_linesim.c
M  +5    -0    src/backend/nsl/nsl_geom_linesim.h

http://commits.kde.org/labplot/53af46b2d3ef5a28be5bc6787274905e257fe96a

diff --git a/src/backend/nsl/nsl_geom_linesim.c b/src/backend/nsl/nsl_geom_linesim.c
index 68cedc3..0d3c9ae 100644
--- a/src/backend/nsl/nsl_geom_linesim.c
+++ b/src/backend/nsl/nsl_geom_linesim.c
@@ -28,7 +28,6 @@
 
 /*
 	TODO:
-	* struct of algorithm and names
 	* extern nsl_compare
 	* non-parametric functions (calculate eps from data)
 	* more algorithm
@@ -42,6 +41,10 @@
 #include "nsl_geom.h"
 #include "nsl_geom_linesim.h"
 
+
+const char* nsl_geom_linesim_type_name[] = {"Douglas-Peucker", "n-th point", "radial \
distance", "perpendicular distance" ,  +	"Reumann-Witkam", "Opheim", "Lang"};
+
 double nsl_geom_linesim_positional_squared_error(const double xdata[], const double \
ydata[], const size_t n, const size_t index[]) {  double dist=0;
 	size_t i=0, j;	/* i: index of index[] */
diff --git a/src/backend/nsl/nsl_geom_linesim.h b/src/backend/nsl/nsl_geom_linesim.h
index 1b6ae54..cd9092c 100644
--- a/src/backend/nsl/nsl_geom_linesim.h
+++ b/src/backend/nsl/nsl_geom_linesim.h
@@ -31,6 +31,11 @@
 
 #include <stdlib.h>
 
+#define NSL_GEOM_LINESIM_TYPE_COUNT 7
+typedef enum {nsl_geom_linesim_type_douglas_peucker, nsl_geom_linesim_type_nthpoint, \
nsl_geom_linesim_type_raddist, nsl_geom_linesim_type_perpdist, \
+	nsl_geom_linesim_type_reumann_witkam, nsl_geom_linesim_type_opheim, \
nsl_geom_linesim_type_lang} nsl_geom_linesim_type; +extern const char* \
nsl_geom_linesim_type_name[]; +
 /* calculates positional error (sum of squared perpendicular distance)
 	of simplified set (given by index[])
 */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic