Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve low discrepancy sequences #2654

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mbaudin47
Copy link
Collaborator

@mbaudin47 mbaudin47 commented May 12, 2024

@mbaudin47 mbaudin47 force-pushed the ldsunittests branch 3 times, most recently from 40ac801 to f1067d7 Compare May 12, 2024 20:02
@mbaudin47 mbaudin47 marked this pull request as ready for review May 12, 2024 20:10
@mbaudin47 mbaudin47 changed the title Improve unit test of Halton sequence Improve low discrepancy sequences May 12, 2024
ChangeLog Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.48%. Comparing base (b5fd833) to head (fae5686).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2654   +/-   ##
=======================================
  Coverage   78.47%   78.48%           
=======================================
  Files         840      840           
  Lines       96641    96641           
=======================================
+ Hits        75836    75844    +8     
+ Misses      20805    20797    -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ChangeLog Outdated Show resolved Hide resolved
Copy link
Member

@regislebrun regislebrun left a comment

Choose a reason for hiding this comment

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

Very nice work! Thanks for digging into this not-so-easy piece of code. I would be reassured if you checked the values for larger sequences.

@@ -381,9 +381,9 @@ Unsigned64BitsInteger LowDiscrepancySequenceImplementation::GetNextPrimeNumber(c
#ifdef OPENTURNS_HAVE_PRIMESIEVE
primesieve::iterator it;
#if PRIMESIEVE_VERSION_MAJOR >= 11
it.jump_to(n - 1);
it.jump_to(n);
Copy link
Member

Choose a reason for hiding this comment

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

Line 380, the test if (n == 0) return 2; should be replaced by if (n <= 2) return 2;

expected3D[5] = Point({2.0 / 9.0, 8.0 / 9.0, 5.0 / 9.0});
expected3D[6] = Point({5.0 / 9.0, 2.0 / 9.0, 8.0 / 9.0});
expected3D[7] = Point({8.0 / 9.0, 5.0 / 9.0, 2.0 / 9.0});
FaureSequence sequence3D(3);
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked the values for larger samples, even if these values don't have to be checked in the test? This is just the beginning of the sequence and surprises can pop up for larger values...

@mbaudin47
Copy link
Collaborator Author

  • @regislebrun states that the dimension 2 works perfectly, which is the contrary of what @mbaudin47 . Burkardt (C++ and Matlab) and Dimitry Shvorob (Mathworks.com, 15373, "Generate a Faure sequence").
  • TODO : extend the sample size in the unit tests up to size TODO

@jschueller jschueller modified the milestone: 1.23 Jun 3, 2024
@jschueller
Copy link
Member

good to go after the first Regis comment is addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Faure sequence is wrong
4 participants