Ponca  6f9f1b59d7c8c4654a710cfcef7342f4f5c79ba1
Point Cloud Analysis library
Loading...
Searching...
No Matches
dryFit.h
1/*
2 Copyright (C) 2021 Nicolas Mellado <nmellado0@gmail.com>
3
4 This Source Code Form is subject to the terms of the Mozilla Public
5 License, v. 2.0. If a copy of the MPL was not distributed with this
6 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7*/
8
9#pragma once
10#include "../../defines.h"
11#include "../concepts.h"
12
13#include <Eigen/Dense>
14
15#define DRY_FIT_REQUIREMENTS ProvidesBasketUnitBase<T>
16
17namespace Ponca
18{
19
24 template <class DataPoint, class _NFilter, typename T>
25 requires DRY_FIT_REQUIREMENTS
26 class DryFit : public T
27 {
28 PONCA_FITTING_DECLARE_DEFAULT_TYPES
29 public:
30 PONCA_EXPLICIT_CAST_OPERATORS(DryFit, dryfit)
31
32 PONCA_FITTING_APIDOC_ADDNEIGHBOR
33 PONCA_MULTIARCH inline void addLocalNeighbor(Scalar w, const VectorType& localQ, const DataPoint& attributes)
34 {
35 Base::addLocalNeighbor(w, localQ, attributes);
36 }
37
38 PONCA_FITTING_APIDOC_FINALIZE
39 PONCA_MULTIARCH [[nodiscard]] inline FIT_RESULT finalize() { return Base::finalize(); }
40
42 PONCA_MULTIARCH [[nodiscard]] inline Scalar potential() const { return Scalar(0); }
43
45 PONCA_MULTIARCH [[nodiscard]] inline Scalar potential(const VectorType& /*_q*/) const { return Scalar(0); }
46
48 PONCA_MULTIARCH [[nodiscard]] inline VectorType project(const VectorType& _q) const { return _q; }
49
51 PONCA_MULTIARCH [[nodiscard]] inline VectorType primitiveGradient() const { return VectorType::Zero(); }
52
54 PONCA_MULTIARCH [[nodiscard]] inline VectorType primitiveGradient(const VectorType&) const
55 {
56 return VectorType::Zero();
57 }
58
59 protected:
61 PONCA_MULTIARCH [[nodiscard]] inline Scalar potentialLocal(const VectorType& /*_lq*/) const
62 {
63 return Scalar(0);
64 }
66 PONCA_MULTIARCH [[nodiscard]] inline VectorType primitiveGradientLocal(const VectorType& /*_lq*/) const
67 {
68 return VectorType::Zero();
69 }
70 };
71
72} // namespace Ponca
Aggregator class used to declare specialized structures using CRTP.
Definition basket.h:260
Empty fitting object doing no computation.
Definition dryFit.h:27
typename Base::VectorType VectorType
Alias to vector type.
Definition dryFit.h:28
VectorType project(const VectorType &_q) const
Simulate point projection.
Definition dryFit.h:48
FIT_RESULT finalize()
Finalize the procedure.
Definition dryFit.h:39
Scalar potential() const
Simulate Scalar field computation.
Definition dryFit.h:42
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition dryFit.h:28
Scalar potential(const VectorType &) const
Simulate Scalar field computation.
Definition dryFit.h:45
VectorType primitiveGradient() const
Simulate gradient direction computation.
Definition dryFit.h:51
VectorType primitiveGradient(const VectorType &) const
Simulate gradient direction computation.
Definition dryFit.h:54
DryFit< DataPoint, _NFilter, T > & dryfit()
Explicit conversion to DryFit , to access methods potentially hidden by heritage.
Definition dryFit.h:30
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes)
Add a neighbor to perform the fit.
Definition dryFit.h:33
Scalar potentialLocal(const VectorType &) const
Simulate Scalar field computation.
Definition dryFit.h:61
VectorType primitiveGradientLocal(const VectorType &) const
Simulate gradient direction computation.
Definition dryFit.h:66
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
Definition enums.h:15