From f6c8e1b3eb79da0b03af8b6afbbdb4afad6710f2 Mon Sep 17 00:00:00 2001 From: Rishabh Garg <56191449+RishabhGarg108@users.noreply.github.com> Date: Sat, 10 Jul 2021 08:15:59 +0530 Subject: [PATCH] Add static keyword to function... Doesn't compile yet. --- .../decision_tree/best_binary_numeric_split.hpp | 14 +++++++++++--- .../best_binary_numeric_split_impl.hpp | 12 ++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp b/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp index 3f5cd27e65..6114b7e1b9 100644 --- a/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp +++ b/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp @@ -101,7 +101,15 @@ class BestBinaryNumericSplit */ template - static double SplitIfBetter( + static typename std::enable_if< + !HasBinaryScanInitialize::value && + !HasBinaryStep::value && + !HasBinaryGains(FitnessFunction::*)(void)>::value, + double>::type + SplitIfBetter( const double bestGain, const VecType& data, const ResponsesType& responses, @@ -134,13 +142,13 @@ class BestBinaryNumericSplit */ template - typename std::enable_if< + static typename std::enable_if< HasBinaryScanInitialize::value && HasBinaryStep::value && HasBinaryGains(FitnessFunction::*)()>::value, + std::tuple(FitnessFunction::*)(void)>::value, double>::type SplitIfBetter( const double bestGain, diff --git a/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp b/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp index 3d0ebdc078..76fb90df95 100644 --- a/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp +++ b/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp @@ -189,7 +189,15 @@ double BestBinaryNumericSplit::SplitIfBetter( template template -double BestBinaryNumericSplit::SplitIfBetter( +typename std::enable_if< + !HasBinaryScanInitialize::value && + !HasBinaryStep::value && + !HasBinaryGains(FitnessFunction::*)(void)>::value, + double>::type +BestBinaryNumericSplit::SplitIfBetter( const double bestGain, const VecType& data, const ResponsesType& responses, @@ -329,7 +337,7 @@ typename std::enable_if< HasBinaryStep::value && HasBinaryGains(FitnessFunction::*)()>::value, + std::tuple(FitnessFunction::*)(void)>::value, double>::type BestBinaryNumericSplit::SplitIfBetter( const double bestGain,