block_fpr_base.hpp 708 B

1234567891011121314151617181920212223242526272829303132
  1. /* Copyright 2025 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See https://www.boost.org/libs/bloom for library home page.
  7. */
  8. #ifndef BOOST_BLOOM_DETAIL_BLOCK_FPR_BASE_HPP
  9. #define BOOST_BLOOM_DETAIL_BLOCK_FPR_BASE_HPP
  10. #include <cmath>
  11. #include <cstddef>
  12. namespace boost{
  13. namespace bloom{
  14. namespace detail{
  15. template<std::size_t K>
  16. struct block_fpr_base
  17. {
  18. static double fpr(std::size_t i,std::size_t w)
  19. {
  20. return std::pow(1.0-std::pow(1.0-1.0/w,(double)K*i),(double)K);
  21. }
  22. };
  23. } /* namespace detail */
  24. } /* namespace bloom */
  25. } /* namespace boost */
  26. #endif