hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
nearest-neighbor.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Florent Lamiraux
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_NEAREST_NEIGHBOR_HH
20 # define HPP_CORE_NEAREST_NEIGHBOR_HH
21 
22 # include <hpp/core/fwd.hh>
23 
24 namespace hpp {
25  namespace core {
28  {
29  public:
30  virtual void clear () = 0;
31  virtual void addNode (const NodePtr_t& node) = 0;
32 
42  virtual NodePtr_t search (const Configuration_t& configuration,
44  connectedComponent,
45  value_type& distance,bool reverse = false) = 0;
46 
47 
48  virtual NodePtr_t search (const NodePtr_t& node,
50  connectedComponent,
51  value_type& distance) = 0;
52 
55  virtual Nodes_t KnearestSearch (const Configuration_t& configuration,
57  connectedComponent,
58  const std::size_t K,
59  value_type& distance) = 0;
60 
63  virtual Nodes_t KnearestSearch (const NodePtr_t& node,
65  connectedComponent,
66  const std::size_t K,
67  value_type& distance) = 0;
68 
74  virtual Nodes_t KnearestSearch (const Configuration_t& configuration,
75  const RoadmapPtr_t& roadmap,
76  const std::size_t K,
77  value_type& distance) = 0;
78 
79  // merge two connected components in the whole tree
80  virtual void merge (ConnectedComponentPtr_t cc1,
81  ConnectedComponentPtr_t cc2) = 0;
82 
83  // Get distance function
84  virtual DistancePtr_t distance () const = 0;
85 
86  virtual ~NearestNeighbor () {};
87 
88  }; // class NearestNeighbor
89  } // namespace core
90 } // namespace hpp
91 
92 #endif // HPP_CORE_NEAREST_NEIGHBOR_HH
virtual ~NearestNeighbor()
Definition: nearest-neighbor.hh:86
virtual void merge(ConnectedComponentPtr_t cc1, ConnectedComponentPtr_t cc2)=0
Optimization of the nearest neighbor search.
Definition: nearest-neighbor.hh:27
virtual Nodes_t KnearestSearch(const Configuration_t &configuration, const ConnectedComponentPtr_t &connectedComponent, const std::size_t K, value_type &distance)=0
boost::shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition: fwd.hh:107
Definition: node.hh:34
virtual void addNode(const NodePtr_t &node)=0
std::list< NodePtr_t > Nodes_t
Definition: fwd.hh:164
pinocchio::value_type value_type
Definition: fwd.hh:157
virtual DistancePtr_t distance() const =0
virtual NodePtr_t search(const Configuration_t &configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &distance, bool reverse=false)=0
search Return the closest node of the given configuration
boost::shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:181
boost::shared_ptr< Distance > DistancePtr_t
Definition: fwd.hh:122
virtual void clear()=0
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:96