invalid_matrix_types.cpp
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2015, Simon Lynen, Google Inc.
4 You can contact the author at <slynen at google dot com>
5 
6 All rights reserved.
7 
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
10  * Redistributions of source code must retain the above copyright
11  notice, this list of conditions and the following disclaimer.
12  * Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15  * Neither the name of the <organization> nor the
16  names of its contributors may be used to endorse or promote products
17  derived from this software without specific prior written permission.
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 DISCLAIMED. IN NO EVENT SHALL ETH-ASL BE LIABLE FOR ANY
23 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 */
31 
32 #include "nabo/nabo.h"
33 
34 /*
35  * These tests ensure that the instantiation of Nabo Trees with non-matching
36  * matrix types is not allowed.
37  */
38 template <typename MatrixType>
40 {
41  MatrixType M = MatrixType::Random(3, 100);
42  MatrixType q = MatrixType::Random(3, 5);
43 
44 #ifdef NABO_TYPE_CREATE
46 #endif // NABO_TYPE_CREATE
47 
48 #ifdef NABO_TYPE_BRUTE_FORCE
50 #endif // NABO_TYPE_BRUTE_FORCE
51 
52 #ifdef NABO_TYPE_LINEAR_HEAP
54 #endif // NABO_TYPE_TREE_HEAP
55 
56 #ifdef NABO_TYPE_TREE_HEAP
58 #endif // NABO_TYPE_TREE_HEAP
59  delete nns;
60  return 0;
61 }
62 int main(int /*argc*/, char** /*argv*/)
63 {
64  // Ensure that the test as such compiles.
65 #ifdef NABO_EIGEN_DYNAMIC_TYPE
66  int value = testFunction<Eigen::MatrixXf>();
67 #endif // NABO_EIGEN_DYNAMIC_TYPE
68 
69 #ifdef NABO_EIGEN_SEMI_DYNAMIC_TYPE
70  int value = testFunction<Eigen::Matrix<float, 5, Eigen::Dynamic> >();
71 #endif // NABO_EIGEN_SEMI_DYNAMIC_TYPE
72  return value;
73 }
nabo.h
public interface
Nabo::NearestNeighbourSearch::createKDTreeTreeHeap
static NearestNeighbourSearch * createKDTreeTreeHeap(const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters())
Create a nearest-neighbour search, using a kd-tree with tree heap, good for large k (~from 30)
Definition: nabo/nabo.cpp:174
Nabo::NearestNeighbourSearch::createKDTreeLinearHeap
static NearestNeighbourSearch * createKDTreeLinearHeap(const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters())
Create a nearest-neighbour search, using a kd-tree with linear heap, good for small k (~up to 30)
Definition: nabo/nabo.cpp:166
testFunction
int testFunction()
Definition: invalid_matrix_types.cpp:39
Nabo::NearestNeighbourSearch
Nearest neighbour search interface, templatized on scalar type.
Definition: nabo.h:258
Nabo::NearestNeighbourSearch::create
static NearestNeighbourSearch * create(const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const SearchType preferedType=KDTREE_LINEAR_HEAP, const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters())
Create a nearest-neighbour search.
Definition: nabo/nabo.cpp:135
test.nns
nns
Definition: test.py:7
Nabo::NearestNeighbourSearch::createBruteForce
static NearestNeighbourSearch * createBruteForce(const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0)
Create a nearest-neighbour search, using brute-force search, useful for comparison only.
Definition: nabo/nabo.cpp:158
test.q
q
Definition: test.py:8
main
int main(int, char **)
Definition: invalid_matrix_types.cpp:62


mrpt_local_obstacles
Author(s): Jose-Luis Blanco-Claraco
autogenerated on Mon Aug 14 2023 02:09:03