File: test_uintwide_t_n_binary_ops_base.h

package info (click to toggle)
gringo 5.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,128 kB
  • sloc: cpp: 210,867; ansic: 37,507; python: 11,271; yacc: 825; javascript: 627; sh: 368; xml: 364; makefile: 102
file content (56 lines) | stat: -rw-r--r-- 2,856 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
///////////////////////////////////////////////////////////////////////////////
//  Copyright Christopher Kormanyos 2019 - 2024.
//  Distributed under the Boost Software License,
//  Version 1.0. (See accompanying file LICENSE_1_0.txt
//  or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef TEST_UINTWIDE_T_N_BINARY_OPS_BASE_2019_12_19_H // NOLINT(llvm-header-guard)
  #define TEST_UINTWIDE_T_N_BINARY_OPS_BASE_2019_12_19_H

  #include <cstdint>
  #include <iomanip>
  #include <iostream>
  #include <random>

  #include <test/test_uintwide_t_n_base.h>

  class test_uintwide_t_n_binary_ops_base : public test_uintwide_t_n_base
  {
  public:
    explicit test_uintwide_t_n_binary_ops_base(const std::size_t count)
      : test_uintwide_t_n_base(count) { }

    test_uintwide_t_n_binary_ops_base() = delete;

    test_uintwide_t_n_binary_ops_base(const test_uintwide_t_n_binary_ops_base&)  = delete;
    test_uintwide_t_n_binary_ops_base(      test_uintwide_t_n_binary_ops_base&&) = delete;

    auto operator=(const test_uintwide_t_n_binary_ops_base&)  -> test_uintwide_t_n_binary_ops_base& = delete;
    auto operator=(      test_uintwide_t_n_binary_ops_base&&) -> test_uintwide_t_n_binary_ops_base& = delete;

    ~test_uintwide_t_n_binary_ops_base() override = default;

    virtual auto do_test(std::size_t rounds) -> bool = 0;

  protected:
    using random_generator_type = std::mersenne_twister_engine<std::uint32_t,
                                                               static_cast<std::size_t>(UINT32_C( 32)),
                                                               static_cast<std::size_t>(UINT32_C(624)),
                                                               static_cast<std::size_t>(UINT32_C(397)),
                                                               static_cast<std::size_t>(UINT32_C( 31)),
                                                               UINT32_C(0x9908B0DF),
                                                               static_cast<std::size_t>(UINT32_C( 11)),
                                                               UINT32_C(0xFFFFFFFF),
                                                               static_cast<std::size_t>(UINT32_C(  7)),
                                                               UINT32_C(0x9D2C5680),
                                                               static_cast<std::size_t>(UINT32_C( 15)),
                                                               UINT32_C(0xEFC60000),
                                                               static_cast<std::size_t>(UINT32_C( 18)),
                                                               UINT32_C(1812433253)>;

    static auto my_rnd() -> std::random_device&;
    static auto my_gen() -> random_generator_type&;
  };

#endif // TEST_UINTWIDE_T_N_BINARY_OPS_BASE_2019_12_19_H