From c1c51f157d17b34a87779ed82a80ab22cc4e382f Mon Sep 17 00:00:00 2001
From: Jakhes <dean.schmitz@schmitzbauer.de>
Date: Fri, 16 Sep 2022 18:09:33 +0200
Subject: [PATCH] Fix problem in ApproxKNF

---
 src/methods/approx_kfn/approx_kfn.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/methods/approx_kfn/approx_kfn.cpp b/src/methods/approx_kfn/approx_kfn.cpp
index 44d37fd..fa19835 100644
--- a/src/methods/approx_kfn/approx_kfn.cpp
+++ b/src/methods/approx_kfn/approx_kfn.cpp
@@ -17,9 +17,10 @@ using namespace std;
 using namespace mlpack::neighbor;
 
 // Global Variable of the DrusillaSelect object so it can be accessed from all functions
-DrusillaSelect drusillaSelect;
+DrusillaSelect<mat> drusillaSelect = DrusillaSelect(0,0);
+
 // Global Variable of the QDAFN object so it can be accessed from all functions
-QDAFN qdafn;
+QDAFN<mat> qdafn = QDAFN(0,0);
 
 // TODO: 
 // input:   const size_t 	l,
@@ -61,7 +62,7 @@ void searchDrusilla(float *querySetMatArr, SP_integer querySetMatSize, SP_intege
     mat querySet = convertArrayToMat(querySetMatArr, querySetMatSize, querySetMatRowNum);
 
     // create the ReturnMat
-    mat neighborsReturnMat;
+    Mat< size_t> neighborsReturnMat;
 
     // create the ReturnMat
     mat distancesReturnMat;
@@ -138,7 +139,7 @@ void searchQDAFN(float *querySetMatArr, SP_integer querySetMatSize, SP_integer q
     mat querySet = convertArrayToMat(querySetMatArr, querySetMatSize, querySetMatRowNum);
 
     // create the ReturnMat
-    mat neighborsReturnMat;
+    Mat< size_t > neighborsReturnMat;
 
     // create the ReturnMat
     mat distancesReturnMat;
@@ -173,4 +174,4 @@ void trainQDAFN(float *referenceSetMatArr, SP_integer referenceSetMatSize, SP_in
     mat referenceSet = convertArrayToMat(referenceSetMatArr, referenceSetMatSize, referenceSetMatRowNum);
     
     qdafn.Train(referenceSet, l, m);
-}
\ No newline at end of file
+}
-- 
GitLab