提交 3645f0c3 编写于 作者: A Alastair Quadros

abs -> std::abs

warning: using integer absolute value function 'abs' when argument is of
floating point type [-Wabsolute-value]
上级 04b4a565
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
#include <stdarg.h> #include <stdarg.h>
#include <cmath>
#include "flann/general.h" #include "flann/general.h"
#include "flann/algorithms/nn_index.h" #include "flann/algorithms/nn_index.h"
...@@ -663,7 +664,7 @@ private: ...@@ -663,7 +664,7 @@ private:
ElementType max_span = 0; ElementType max_span = 0;
size_t div_feat = 0; size_t div_feat = 0;
for (size_t i=0;i<veclen_;++i) { for (size_t i=0;i<veclen_;++i) {
ElementType span = abs(point[i]-leaf_point[i]); ElementType span = std::abs(point[i]-leaf_point[i]);
if (span > max_span) { if (span > max_span) {
max_span = span; max_span = span;
div_feat = i; div_feat = i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册