25 #include <mrpt/config.h>
33 #elif defined(HAVE_MALLOC_MALLOC_H)
34 # include <malloc/malloc.h>
61 for (
int i = 0; i < d; i++)
66 for (
int i = 0; i < d; i++)
72 for (
int i = 0; i < d; i++)
73 result += (p1[i] - p2[i]) * (p1[i] - p2[i]);
81 #define ENABLE_KMEANS_ASSERTS
82 #ifdef ENABLE_KMEANS_ASSERTS
84 #define KM_ASSERT(expression) \
85 (void)((expression) != 0? 0 : __KMeansAssertionFailure(__FILE__, __LINE__, #expression))
87 #define KM_ASSERT(expression)
97 int u = rand() * RAND_MAX + rand();
98 return ((u %
n) +
n) %
n;
Scalar * PointAllocate(int d)
int __KMeansAssertionFailure(const char *file, int line, const char *expression)
Scalar PointDistSq(const Scalar *p1, const Scalar *p2, int d)
void PointFree(Scalar *p)
void PointCopy(Scalar *p1, const Scalar *p2, int d)
void PointScale(Scalar *p, Scalar scale, int d)
void PointAdd(Scalar *p1, const Scalar *p2, int d)
GLenum GLenum GLenum GLenum GLenum scale
void BASE_IMPEXP memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) MRPT_NO_THROWS
An OS and compiler independent version of "memcpy".