libigl v2.5.0
Loading...
Searching...
No Matches
knn.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2018 Gavin Barill <gavinpcb@gmail.com>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/
8
9#ifndef IGL_KNN_H
10#define IGL_KNN_H
11#include "igl_inline.h"
12#include <Eigen/Core>
13#include <vector>
14
15namespace igl
16{
35 template <
36 typename DerivedP,
37 typename IndexType,
38 typename DerivedCH,
39 typename DerivedCN,
40 typename DerivedW,
41 typename DerivedI>
43 const Eigen::MatrixBase<DerivedP>& P,
44 size_t k,
45 const std::vector<std::vector<IndexType> > & point_indices,
46 const Eigen::MatrixBase<DerivedCH>& CH,
47 const Eigen::MatrixBase<DerivedCN>& CN,
48 const Eigen::MatrixBase<DerivedW>& W,
49 Eigen::PlainObjectBase<DerivedI> & I);
54 template <
55 typename DerivedP,
56 typename DerivedV,
57 typename IndexType,
58 typename DerivedCH,
59 typename DerivedCN,
60 typename DerivedW,
61 typename DerivedI>
63 const Eigen::MatrixBase<DerivedP>& P,
64 const Eigen::MatrixBase<DerivedV>& V,
65 size_t k,
66 const std::vector<std::vector<IndexType> > & point_indices,
67 const Eigen::MatrixBase<DerivedCH>& CH,
68 const Eigen::MatrixBase<DerivedCN>& CN,
69 const Eigen::MatrixBase<DerivedW>& W,
70 Eigen::PlainObjectBase<DerivedI> & I);
71}
72#ifndef IGL_STATIC_LIBRARY
73# include "knn.cpp"
74#endif
75#endif
76
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
void knn(const Eigen::MatrixBase< DerivedP > &P, size_t k, const std::vector< std::vector< IndexType > > &point_indices, const Eigen::MatrixBase< DerivedCH > &CH, const Eigen::MatrixBase< DerivedCN > &CN, const Eigen::MatrixBase< DerivedW > &W, Eigen::PlainObjectBase< DerivedI > &I)
Given a 3D set of points P, an whole number k, and an octree find the indicies of the k nearest neigh...