[mlpack-git] master: Remove deprecated constructor. (db16a10)

gitdub at mlpack.org gitdub at mlpack.org
Mon Aug 29 17:22:54 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/1148f1652e139c9037eb3813550090313d089a30...a8a8a1381b529a01420de6e792a4a1e7bd58a626

>---------------------------------------------------------------

commit db16a10803e3107a2fd96ae0d196f8f8685cf076
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Mon Aug 29 18:22:54 2016 -0300

    Remove deprecated constructor.


>---------------------------------------------------------------

db16a10803e3107a2fd96ae0d196f8f8685cf076
 .../methods/neighbor_search/neighbor_search.hpp    | 33 ---------------------
 .../neighbor_search/neighbor_search_impl.hpp       | 34 ----------------------
 2 files changed, 67 deletions(-)

diff --git a/src/mlpack/methods/neighbor_search/neighbor_search.hpp b/src/mlpack/methods/neighbor_search/neighbor_search.hpp
index 6cfaff1..fb06a22 100644
--- a/src/mlpack/methods/neighbor_search/neighbor_search.hpp
+++ b/src/mlpack/methods/neighbor_search/neighbor_search.hpp
@@ -127,39 +127,6 @@ class NeighborSearch
                  const MetricType metric = MetricType());
 
   /**
-   * Initialize the NeighborSearch object with the given pre-constructed
-   * reference tree (this is the tree built on the points that will be
-   * searched).  Optionally, perform the computation in a different mode.
-   * Naive mode is not available as an option for this constructor.
-   * Additionally, an instantiated distance metric can be given, for cases where
-   * the distance metric holds data.
-   *
-   * This method is deprecated and will be removed in mlpack 3.0.0! Constructors
-   * taking a reference to the reference tree are prefered.
-   *
-   * This method won't take ownership of the given tree. There is no copying of
-   * the data matrices in this constructor (because  tree-building is not
-   * necessary).
-   *
-   * @note
-   * Mapping the points of the matrix back to their original indices is not done
-   * when this constructor is used, so if the tree type you are using maps
-   * points (like BinarySpaceTree), then you will have to perform the re-mapping
-   * manually.
-   * @endnote
-   *
-   * @param referenceTree Pre-built tree for reference points.
-   * @param mode Neighbor search mode.
-   * @param epsilon Relative approximate error (non-negative).
-   * @param metric Instantiated distance metric.
-   */
-  mlpack_deprecated NeighborSearch(
-      Tree* referenceTree,
-      const NeighborSearchMode mode = DUAL_TREE_MODE,
-      const double epsilon = 0,
-      const MetricType metric = MetricType());
-
-  /**
    * Initialize the NeighborSearch object with a copy of the given
    * pre-constructed reference tree (this is the tree built on the points that
    * will be searched).  Optionally, choose to use single-tree mode.  Naive mode
diff --git a/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp b/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp
index a5518e1..6c51d4c 100644
--- a/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp
+++ b/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp
@@ -143,40 +143,6 @@ template<typename SortPolicy,
          template<typename> class DualTreeTraversalType,
          template<typename> class SingleTreeTraversalType>
 NeighborSearch<SortPolicy, MetricType, MatType, TreeType, DualTreeTraversalType,
-SingleTreeTraversalType>::NeighborSearch(Tree* referenceTree,
-                                         const NeighborSearchMode mode,
-                                         const double epsilon,
-                                         const MetricType metric) :
-    referenceTree(referenceTree),
-    referenceSet(&referenceTree->Dataset()),
-    treeOwner(false),
-    setOwner(false),
-    searchMode(mode),
-    epsilon(epsilon),
-    metric(metric),
-    baseCases(0),
-    scores(0),
-    treeNeedsReset(false)
-{
-  // Update naive, singleMode and greedy flags according to searchMode.
-  UpdateSearchModeFlags();
-
-  if (mode == NAIVE_MODE)
-    throw std::invalid_argument("invalid constructor for naive mode");
-  if (epsilon < 0)
-    throw std::invalid_argument("epsilon must be non-negative");
-}
-
-// Construct the object.
-template<typename SortPolicy,
-         typename MetricType,
-         typename MatType,
-         template<typename TreeMetricType,
-                  typename TreeStatType,
-                  typename TreeMatType> class TreeType,
-         template<typename> class DualTreeTraversalType,
-         template<typename> class SingleTreeTraversalType>
-NeighborSearch<SortPolicy, MetricType, MatType, TreeType, DualTreeTraversalType,
 SingleTreeTraversalType>::NeighborSearch(const Tree& referenceTree,
                                          const NeighborSearchMode mode,
                                          const double epsilon,




More information about the mlpack-git mailing list