]> 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 af1d755d900f0bda1b88f9a9c512d4fe06d931e9..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,6 +46,15 @@ RRTNode *nn3(
                 RRTNode *node,
                 float (*cost)(RRTNode *, RRTNode *));
 RRTNode *nn4(
+                std::array<std::vector<RRTNode *>, IYSIZE> &nodes,
+                RRTNode *node,
+                float (*cost)(RRTNode *, RRTNode *));
+RRTNode *nn5(
+                std::vector<RRTNode *> (&nodes)[IYSIZE],
+                RRTNode *node,
+                float (*cost)(RRTNode *, RRTNode *),
+                char tree);
+RRTNode *nn6(
                 std::vector<RRTNode *> (&nodes)[IYSIZE],
                 RRTNode *node,
                 float (*cost)(RRTNode *, RRTNode *));