File indexing completed on 2025-01-18 09:51:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef __BOOST_SORT_COMMON_INT_ARRAY_HPP
0016 #define __BOOST_SORT_COMMON_INT_ARRAY_HPP
0017
0018 #include <ciso646>
0019 #include <cstdint>
0020 #include <iostream>
0021
0022 namespace boost
0023 {
0024 namespace sort
0025 {
0026 namespace common
0027 {
0028
0029 template<uint32_t NN>
0030 struct int_array
0031 {
0032 uint64_t M[NN];
0033
0034 template<class generator>
0035 static int_array<NN> generate(generator & gen)
0036 {
0037 int_array<NN> result;
0038 for (uint32_t i = 0; i < NN; ++i)
0039 {
0040 result.M[i] = gen();
0041 };
0042 return result;
0043 };
0044
0045 uint64_t counter(void) const
0046 {
0047 uint64_t Acc = M[0];
0048 for (uint32_t i = 1; i < NN; Acc += M[i++])
0049 ;
0050 return Acc;
0051 };
0052 };
0053
0054 template<class IA>
0055 struct H_comp
0056 {
0057 bool operator ( )(const IA & A1, const IA & A2) const
0058 {
0059 return (A1.counter() < A2.counter());
0060 };
0061 };
0062
0063 template<class IA>
0064 struct L_comp
0065 {
0066 bool operator ( )(const IA & A1, const IA & A2) const
0067 {
0068 return (A1.M[0] < A2.M[0]);
0069 };
0070 };
0071
0072 };
0073 };
0074 };
0075
0076 #endif