/usr/include/boost/sort/common
Edit: /usr/include/boost/sort/common/int_array.hpp (1900B)
//----------------------------------------------------------------------------
/// @file int_array.hpp
/// @brief This file contains the struct int_array , which is an array of
/// uint64_t elements, being the template parameter NN the number of
/// elements in the array
///
/// @author Copyright (c) 2010-2015 Francisco José Tapia (fjtapia@gmail.com )\n
/// Distributed under the Boost Software License, Version 1.0.\n
/// ( See accompanyingfile LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt )
/// @version 0.1
///
/// @remarks
//-----------------------------------------------------------------------------
#ifndef __BOOST_SORT_COMMON_INT_ARRAY_HPP
#define __BOOST_SORT_COMMON_INT_ARRAY_HPP
#include
#include
namespace boost
{
namespace sort
{
namespace common
{
template
struct int_array
{
uint64_t M[NN];
template
static int_array generate(generator & gen)
{
int_array result;
for (uint32_t i = 0; i < NN; ++i)
{
result.M[i] = gen();
};
return result;
};
uint64_t counter(void) const
{
uint64_t Acc = M[0];
for (uint32_t i = 1; i < NN; Acc += M[i++])
;
return Acc;
};
};
template
struct H_comp
{
bool operator ( )(const IA & A1, const IA & A2) const
{
return (A1.counter() < A2.counter());
};
};
template
struct L_comp
{
bool operator ( )(const IA & A1, const IA & A2) const
{
return (A1.M[0] < A2.M[0]);
};
};
//***************************************************************************
};// End namespace benchmark
};// End namespace sort
};// End namespace boost
//***************************************************************************
#endif // end of int_array.hpp