Skip to content

Commit 651bd13

Browse files
authored
Merge pull request #2 from Jaybro/eigen_adaptor
eigen_adaptor.hpp is now part of the library.
2 parents 472180a + 64170c9 commit 651bd13

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

examples/eigen/eigen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#include <Eigen/Dense>
2+
#include <pico_tree/eigen_adaptor.hpp>
23
#include <pico_tree/kd_tree.hpp>
34
#include <point.hpp>
45
#include <scoped_timer.hpp>
56

6-
#include "eigen_adaptor.hpp"
7-
87
using Index = int;
98
using Scalar = double;
109

examples/eigen/eigen_adaptor.hpp renamed to src/pico_tree/eigen_adaptor.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma once
22

3-
#include <Eigen/Dense>
4-
53
namespace pico_tree {
64

75
namespace internal {
@@ -26,9 +24,8 @@ class EigenAdaptorBase<Index_, EigenMatrix, false> {
2624
}
2725

2826
//! Returns dimension \p dim of point \p point.
29-
template <typename Derived>
30-
inline Scalar operator()(
31-
Eigen::MatrixBase<Derived> const& point, Index const dim) const {
27+
template <typename Point>
28+
inline Scalar operator()(Point const& point, Index const dim) const {
3229
return point(dim);
3330
}
3431

@@ -59,9 +56,8 @@ class EigenAdaptorBase<Index_, EigenMatrix, true> {
5956
}
6057

6158
//! Returns dimension \p dim of point \p point.
62-
template <typename Derived>
63-
inline Scalar operator()(
64-
Eigen::MatrixBase<Derived> const& point, Index const dim) const {
59+
template <typename Point>
60+
inline Scalar operator()(Point const& point, Index const dim) const {
6561
return point(dim);
6662
}
6763

0 commit comments

Comments
 (0)