Skip to content

[fitting] Add hrbf fitting - #348

Draft
nmellado wants to merge 3 commits into
masterfrom
add_hrbf
Draft

nmellado wants to merge 3 commits into
masterfrom
add_hrbf

Conversation

@nmellado

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.78%. Comparing base (7abd0fd) to head (f3a4af5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #348   +/-   ##
=======================================
  Coverage   94.77%   94.78%           
=======================================
  Files          97       97           
  Lines        3619     3621    +2     
  Branches      282      282           
=======================================
+ Hits         3430     3432    +2     
  Misses        188      188           
  Partials        1        1           
Files with missing lines Coverage Δ
Ponca/src/Fitting/Filters/weightKernel.h 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nmellado nmellado mentioned this pull request Sep 16, 2026
1 task
static constexpr bool isDDValid = true;
}; // class GaussianWeightKernel

/*!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the description "this is not a weight kernel", this class should probably be in another file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I hesitated a lot.
I wrote This is not a decreasing weight function, but it is actually a weight kernel in the end. But it is used to weight basis functions according to distance, not neighbors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it here as has the same semantics: function and its derivatives.

{

/*!
* \brief Corrected Normal Current Fit type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc is copy pasted from CNC

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, WIP. Keep this open.

return grad;
}

//

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed (copy-pasted from cnc)

* \tparam PointContainer An STL-like container storing the points
*/
template <typename IndexRange, typename PointContainer>
PONCA_MULTIARCH inline FIT_RESULT computeWithIds(const IndexRange& ids, const PointContainer& points)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that ponca supports C++20, I suggest instead something like:

auto view = ids | std::views::transform([&](size_t i) { return points[i]; });
compute(view.begin(), view.end());

Performance wise this should be about the same. Transforms and pipes inherit the iterator category.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I wrote the comment, I wonder if this could be the default for ComputeObject::compute...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, would be better :)

Comment on lines +309 to +312
using NeighborFilter = DistWeightFilter<DataPoint,ConstantWeightKernel<Scalar>>;

PONCA_FITTING_APIDOC_SETWFUNC
PONCA_MULTIARCH inline void setNeighborFilter(const NeighborFilter& ) { ; }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of trick is annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants