Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • Project Juggler Project Juggler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 33
    • Issues 33
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • EIC
  • Project JugglerProject Juggler
  • Merge requests
  • !495

algorithms::detail::CachedBitGenerator: make min/max methods static

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Dmitry Kalinkin requested to merge pr/CachedBitGenerator_static_methods into main Nov 12, 2022
  • Overview 0
  • Commits 1
  • Pipelines 2
  • Changes 1

Fixes a following compilation error:

In file included from external/algorithms/truth/src/MC2SmearedParticle.cpp:4:
In file included from external/algorithms/truth/include/algorithms/truth/MC2SmearedParticle.h:5:
In file included from external/algorithms/core/include/algorithms/random.h:6:
libcxx-11.1.0-dev/include/c++/v1/random:3645:51: error: call to non-static member function without an object argument
    const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
                                           ~~~~~~~^~~
libcxx-11.1.0-dev/include/c++/v1/random:3777:18: note: in instantiation of function template specialization 'std::__1::generate_canonical<double, 53, algorithms::detail::CachedBitGenerator>' requested here
        * _VSTD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
                 ^
libcxx-11.1.0-dev/include/c++/v1/random:3741:17: note: in instantiation of function template specialization 'std::__1::uniform_real_distribution<double>::operator()<algorithms::detail::CachedBitGenerator>' requested here
        {return (*this)(__g, __p_);}
                ^
libcxx-11.1.0-dev/include/c++/v1/random:4336:19: note: in instantiation of function template specialization 'std::__1::uniform_real_distribution<double>::operator()<algorithms::detail::CachedBitGenerator>' requested here
            __u = _Uni(__g);
                  ^
libcxx-11.1.0-dev/include/c++/v1/random:4275:17: note: in instantiation of function template specialization 'std::__1::normal_distribution<double>::operator()<algorithms::detail::CachedBitGenerator>' requested here
        {return (*this)(__g, __p_);}
                ^
external/algorithms/core/include/algorithms/random.h:52:12: note: in instantiation of function template specialization 'std::__1::normal_distribution<double>::operator()<algorithms::detail::CachedBitGenerator>' requested here
    return d(m_gen);
           ^
external/algorithms/truth/src/MC2SmearedParticle.cpp:33:40: note: in instantiation of function template specialization 'algorithms::Generator::gaussian<double>' requested here
    const auto momentum = pgen * m_rng.gaussian<double>(0., m_smearing.value());
                                       ^
In file included from external/algorithms/truth/src/MC2SmearedParticle.cpp:4:
In file included from external/algorithms/truth/include/algorithms/truth/MC2SmearedParticle.h:5:
In file included from external/algorithms/core/include/algorithms/random.h:6:
libcxx-11.1.0-dev/include/c++/v1/random:3648:57: error: call to non-static member function without an object argument
    const _RealType _Rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1);
                                                 ~~~~~~~^~~
libcxx-11.1.0-dev/include/c++/v1/random:3650:36: error: call to non-static member function without an object argument
    _RealType _Sp = __g() - _URNG::min();
                            ~~~~~~~^~~
3 errors generated.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: pr/CachedBitGenerator_static_methods