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[] =3D {"Douglas-Peucker", "n-th poi= nt", "radial distance", "perpendicular distance" , = + "Reumann-Witkam", "Opheim", "Lang"}; + double nsl_geom_linesim_positional_squared_error(const double xdata[], con= st double ydata[], const size_t n, const size_t index[]) { double dist=3D0; size_t i=3D0, 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 = +#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_g= eom_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[]) */