]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blobdiff - incl/nn.h
Use std::array for indexing structure
[hubacji1/iamcar.git] / incl / nn.h
index 3b74d6e9b58f062de43b74af4df8ba235d559e71..4870667c884abeb7b65618ac678b74ff7d7116ce 100644 (file)
--- a/incl/nn.h
+++ b/incl/nn.h
@@ -18,6 +18,8 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #ifndef NEARESTNEIGHBOUR_H
 #define NEARESTNEIGHBOUR_H
 
+#include <array>
+#include "aux.h"
 #include "rrtbase.h"
 #include "rrtnode.h"
 
@@ -30,10 +32,6 @@ struct mcnn { // min-cost nearest neighbour
          omp_in.mc < omp_out.mc ? omp_in : omp_out) \
          initializer \
          (omp_priv(omp_orig))
-#define EDIST(a, b) ({ __typeof__ (a) _a = (a); \
-                __typeof__ (b) _b = (b); \
-                pow(pow((_b)->x() - (_a)->x(), 2) + \
-                                pow((_b)->y() - (_a)->y(), 2), 0.5); })
 
 RRTNode *nn1(
                 std::vector<RRTNode *> &nodes,
@@ -48,7 +46,7 @@ RRTNode *nn3(
                 RRTNode *node,
                 float (*cost)(RRTNode *, RRTNode *));
 RRTNode *nn4(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
+                std::array<std::vector<RRTNode *>, IYSIZE> &nodes,
                 RRTNode *node,
                 float (*cost)(RRTNode *, RRTNode *));
 RRTNode *nn5(
@@ -56,5 +54,9 @@ RRTNode *nn5(
                 RRTNode *node,
                 float (*cost)(RRTNode *, RRTNode *),
                 char tree);
+RRTNode *nn6(
+                std::vector<RRTNode *> (&nodes)[IYSIZE],
+                RRTNode *node,
+                float (*cost)(RRTNode *, RRTNode *));
 
 #endif