28 #include <mrpt/config.h> 36 #elif defined(HAVE_MALLOC_MALLOC_H) 37 #include <malloc/malloc.h> 64 for (
int i = 0; i < d; i++) p1[i] += p2[i];
69 for (
int i = 0; i < d; i++)
p[i] *=
scale;
75 for (
int i = 0; i < d; i++) result += (p1[i] - p2[i]) * (p1[i] - p2[i]);
83 #define ENABLE_KMEANS_ASSERTS 84 #ifdef ENABLE_KMEANS_ASSERTS 86 const char* file,
int line,
const char* expression);
87 #define KM_ASSERT(expression) \ 88 (void)((expression) != 0 ? 0 : __KMeansAssertionFailure(__FILE__, __LINE__, #expression)) 90 #define KM_ASSERT(expression) 103 int u = rand() * RAND_MAX + rand();
104 return ((u %
n) +
n) %
n;
GLenum GLenum GLenum GLenum GLenum scale
Scalar * PointAllocate(int d)
void PointCopy(Scalar *p1, const Scalar *p2, int d)
void PointAdd(Scalar *p1, const Scalar *p2, int d)
void PointScale(Scalar *p, Scalar scale, int d)
int __KMeansAssertionFailure(const char *file, int line, const char *expression)
void PointFree(Scalar *p)
Scalar PointDistSq(const Scalar *p1, const Scalar *p2, int d)
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".