]> 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 54e84d7fd9b8df53080a84ef4b03c12727873c2f..4870667c884abeb7b65618ac678b74ff7d7116ce 100644 (file)
--- a/incl/nn.h
+++ b/incl/nn.h
@@ -18,9 +18,21 @@ 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"
 
+struct mcnn { // min-cost nearest neighbour
+        float mc;
+        RRTNode *nn;
+};
+#pragma omp declare reduction \
+        (minn: struct mcnn: omp_out = \
+         omp_in.mc < omp_out.mc ? omp_in : omp_out) \
+         initializer \
+         (omp_priv(omp_orig))
+
 RRTNode *nn1(
                 std::vector<RRTNode *> &nodes,
                 RRTNode *node,
@@ -33,5 +45,18 @@ RRTNode *nn3(
                 std::vector<RRTNode *> (&nodes)[IYSIZE],
                 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 *));
 
 #endif