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

Magic numbers in Givens rotation regularization #194

Open
pelesh opened this issue Sep 28, 2024 · 0 comments
Open

Magic numbers in Givens rotation regularization #194

pelesh opened this issue Sep 28, 2024 · 0 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@pelesh
Copy link
Collaborator

pelesh commented Sep 28, 2024

Givens rotation in (F)GMRES solvers is implemented as

        real_type gam = std::sqrt(Hii * Hii + Hii1 * Hii1);

        if(std::abs(gam - ZERO) <= EPSILON) {
          gam = EPSMAC;
        }

        /* next Given's rotation */
        h_c_[i] = Hii / gam;

where EPSILON and EPSMAC are defined as

  constexpr double EPSILON = 1.0e-18;
  constexpr double EPSMAC  = 1.0e-16;

It would be good to document these numbers to better understand why these specific values have been chosen.

Also, these values will probably not be appropriate if real_type is not chosen to be double floating precision. Perhaps a better idea would be to define EPSILON and EPSMAC in terms of std::limits::epsilon().

@pelesh pelesh added bug Something isn't working question Further information is requested labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants