Skip to content

Refactor integral estimation and error handling - #2

Merged
alexandrehoffmann merged 3 commits into
mainfrom
perfs
Jul 24, 2026
Merged

alexandrehoffmann merged 3 commits into
mainfrom
perfs

Conversation

@alexandrehoffmann

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors parts of the adaptive quadrature implementation by reusing local variables for sub-interval integral estimates and adjusting the remapped infinite-interval integrand evaluation.

Changes:

  • Refactors adaptQuadrature() to reuse res / estimatedErr variables when splitting intervals.
  • Removes NaN-masking logic in remapAndIntegrate() when computing the remapped integrand value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/LNIT/AdaptiveQuadratures/AdaptiveQuadratureBase_impl.hpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

include/LNIT/AdaptiveQuadratures/AdaptiveQuadratureBase_impl.hpp:260

  • remapAndIntegrate evaluates the mapped integrand at t = ±1 (CC nodes include ±1). At those endpoints t/(1-t*t) and dxdt divide by zero, so f(...) is called with ±∞ and fx*dxdt can become non-finite. The current isnan(fx*dxdt) check does not catch Inf, and after switching to integrate(fref, -1, 1) the local eps is unused (can trigger unused-variable warnings under -Werror).

Consider skipping endpoints and using isfinite on the mapped value (covers both NaN and Inf), and remove eps/isnan.

			? LongScalar{}
			: fx*dxdt;	
	};
	
	return integrate(fref, -1, 1);

@alexandrehoffmann
alexandrehoffmann merged commit a50c81f into main Jul 24, 2026
6 checks passed
@alexandrehoffmann
alexandrehoffmann deleted the perfs branch July 24, 2026 14:00
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.

3 participants