Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
3a4616a6
Commit
3a4616a6
authored
May 25, 2017
by
Uwe Schulzweida
Browse files
kdtree: set KDATA to KD_DOUBLE.
parent
3cafa0ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kdtreelib/kdtree.h
View file @
3a4616a6
...
...
@@ -22,22 +22,36 @@
#include
<stdio.h>
#include
<string.h>
#define KD_FLOAT 1
#define KD_INT 2
#define KD_FLOAT 1
#define KD_INT 2
#define KD_DOUBLE 3
#define KD_LONG 4
#define KD_TYPE KD_FLOAT
#define KD_TYPE KD_DOUBLE
//#define KD_TYPE KD_INT
#if KD_TYPE == KD_INT
typedef
int
kdata_t
;
# define KDATA_SFAC
20
000.
# define KDATA_SCALE(x) ((int)
(0.5+
KDATA_SFAC*(x)))
# define KDATA_SFAC
44
000.
# define KDATA_SCALE(x) ((int)
lround(
KDATA_SFAC*(x)))
# define KDATA_INVSCALE(x) ((x)/KDATA_SFAC)
# define KDATA_ABS(x) abs(x)
#el
se
#el
if KD_TYPE == KD_FLOAT
typedef
float
kdata_t
;
# define KDATA_SCALE(x) (x)
# define KDATA_INVSCALE(x) (x)
# define KDATA_ABS(x) fabsf(x)
#elif KD_TYPE == KD_DOUBLE
typedef
double
kdata_t
;
# define KDATA_SCALE(x) (x)
# define KDATA_INVSCALE(x) (x)
# define KDATA_ABS(x) fabs(x)
#elif KD_TYPE == KD_LONG
typedef
long
kdata_t
;
# define KDATA_SFAC 3000000.
# define KDATA_SCALE(x) (lround(KDATA_SFAC*(x)))
# define KDATA_INVSCALE(x) ((x)/KDATA_SFAC)
# define KDATA_ABS(x) labs(x)
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment