Ponca  eb7239a9c07e156fb1edc6faac7fe89e2b256bda
Point Cloud Analysis library
Loading...
Searching...
No Matches
mean.hpp
1/*
2 Copyright (C) 2014 Nicolas Mellado <nmellado0@gmail.com>
3 Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
4
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8*/
9
10template <class DataPoint, class _NFilter, typename T>
11void MeanPosition<DataPoint, _NFilter, T>::init()
12{
13 Base::init();
14 m_sumP = VectorType::Zero();
15}
16
17template <class DataPoint, class _NFilter, typename T>
18void MeanPosition<DataPoint, _NFilter, T>::addLocalNeighbor(Scalar w, const VectorType& localQ,
19 const DataPoint& attributes)
20{
21 Base::addLocalNeighbor(w, localQ, attributes);
22 m_sumP += w * localQ;
23}
24
25template <class DataPoint, class _NFilter, typename T>
26 requires MEAN_NORMAL_REQUIREMENTS
28{
29 Base::init();
30 m_sumN = VectorType::Zero();
31}
32
33template <class DataPoint, class _NFilter, typename T>
34 requires MEAN_NORMAL_REQUIREMENTS
35void MeanNormal<DataPoint, _NFilter, T>::addLocalNeighbor(Scalar w, const VectorType& localQ,
36 const DataPoint& attributes)
37{
38 Base::addLocalNeighbor(w, localQ, attributes);
39 m_sumN += w * attributes.normal();
40}
41
42template <class DataPoint, class _NFilter, int DiffType, typename T>
43 requires MEAN_POSITION_DER_REQUIREMENTS
45{
46 Base::init();
47 m_dSumP.setZero();
48}
49
50template <class DataPoint, class _NFilter, int DiffType, typename T>
51 requires MEAN_POSITION_DER_REQUIREMENTS
53 const DataPoint& attributes, ScalarArray& dw)
54{
55 Base::addLocalNeighbor(w, localQ, attributes, dw);
56 m_dSumP += localQ * dw;
57}
58
59template <class DataPoint, class _NFilter, int DiffType, typename T>
60 requires MEAN_NORMAL_DER_REQUIREMENTS
62{
63 Base::init();
64 m_dSumN.setZero();
65}
66
67template <class DataPoint, class _NFilter, int DiffType, typename T>
68 requires MEAN_NORMAL_DER_REQUIREMENTS
69void MeanNormalDer<DataPoint, _NFilter, DiffType, T>::addLocalNeighbor(Scalar w, const VectorType& localQ,
70 const DataPoint& attributes, ScalarArray& dw)
71{
72 Base::addLocalNeighbor(w, localQ, attributes, dw);
73 m_dSumN += attributes.normal() * dw;
74}
void init()
Set the evaluation position and reset the internal states.
Definition mean.h:62
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw)
Add a neighbor to perform the fit.
Definition mean.h:70
void init()
Set the evaluation position and reset the internal states.
Definition mean.h:28
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes)
Add a neighbor to perform the fit.
Definition mean.h:36
void init()
Set the evaluation position and reset the internal states.
Definition mean.h:45
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw)
Add a neighbor to perform the fit.
Definition mean.h:53