Ponca  82fc77e8c6294111c6f00670e92ec58a24e2ecf2
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>
12{
13 Base::init();
14 m_sumP = VectorType::Zero();
15}
16
17template <class DataPoint, class _NFilter, typename T>
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
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
70 const DataPoint& attributes, ScalarArray& dw)
71{
72 Base::addLocalNeighbor(w, localQ, attributes, dw);
73 m_dSumN += attributes.normal() * dw;
74}
typename Base::ScalarArray ScalarArray
Alias to scalar derivatives array.
Definition mean.h:186
typename Base::VectorType VectorType
Alias to vector type.
Definition mean.h:185
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw)
Add a neighbor to perform the fit.
Definition mean.hpp:69
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition mean.h:185
void init()
Set the evaluation position and reset the internal states.
Definition mean.hpp:61
void init()
Set the evaluation position and reset the internal states.
Definition mean.hpp:27
typename Base::VectorType VectorType
Alias to vector type.
Definition mean.h:85
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition mean.h:85
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes)
Add a neighbor to perform the fit.
Definition mean.hpp:35
typename Base::VectorType VectorType
Alias to vector type.
Definition mean.h:124
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition mean.h:124
void init()
Set the evaluation position and reset the internal states.
Definition mean.hpp:44
typename Base::ScalarArray ScalarArray
Alias to scalar derivatives array.
Definition mean.h:125
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw)
Add a neighbor to perform the fit.
Definition mean.hpp:52
Compute the barycenter of the input points.
Definition mean.h:29
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition mean.h:30
typename Base::VectorType VectorType
Alias to vector type.
Definition mean.h:30