VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /proc/self/root/usr/include/boost/sort/common/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/include/boost/sort/common/int_array.hpp
//----------------------------------------------------------------------------
/// @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 <cstdint>
#include <iostream>

namespace boost
{
namespace sort
{
namespace common
{

template<uint32_t NN>
struct int_array
{
    uint64_t M[NN];

    template<class generator>
    static int_array<NN> generate(generator & gen)
    {
        int_array<NN> 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<class IA>
struct H_comp
{
    bool operator ( )(const IA & A1, const IA & A2) const
    {
        return (A1.counter() < A2.counter());
    };
};

template<class IA>
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

VaKeR 2022