update boost
This commit is contained in:
@@ -14,13 +14,16 @@
|
||||
#ifndef __TOOLS_DEQUE_CNC_HPP
|
||||
#define __TOOLS_DEQUE_CNC_HPP
|
||||
|
||||
#include <sort/tools/spinlock.hpp>
|
||||
#include <ciso646>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <boost/sort/common/spinlock.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace sort
|
||||
{
|
||||
namespace tools
|
||||
namespace common
|
||||
{
|
||||
|
||||
//###########################################################################
|
||||
@@ -61,7 +64,7 @@ protected:
|
||||
// VARIABLES
|
||||
//------------------------------------------------------------------------
|
||||
deque_t dq;
|
||||
mutable spinlock spl;
|
||||
mutable spinlock_t spl;
|
||||
|
||||
public:
|
||||
//
|
||||
@@ -94,7 +97,7 @@ public:
|
||||
//----------------------------------------------------------------------
|
||||
void clear(void)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.clear();
|
||||
};
|
||||
//
|
||||
@@ -107,7 +110,7 @@ public:
|
||||
void swap(deque_cnc & A) noexcept
|
||||
{
|
||||
if (this == &A) return;
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.swap(A.dq);
|
||||
};
|
||||
//
|
||||
@@ -123,7 +126,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
size_type size(void) const noexcept
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
return dq.size();
|
||||
};
|
||||
//
|
||||
@@ -134,7 +137,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
size_type max_size(void) const noexcept
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
return (dq.max_size());
|
||||
};
|
||||
//
|
||||
@@ -150,7 +153,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
void shrink_to_fit()
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.shrink_to_fit();
|
||||
};
|
||||
//
|
||||
@@ -161,7 +164,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
bool empty(void) const noexcept
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
return (dq.empty());
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -172,7 +175,7 @@ public:
|
||||
//---------------------------------------------------------------------------
|
||||
void push_back(const value_type & D)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.push_back(D);
|
||||
};
|
||||
|
||||
@@ -184,7 +187,7 @@ public:
|
||||
template<class ... Args>
|
||||
void emplace_back(Args && ... args)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.emplace_back(std::forward <Args>(args) ...);
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
@@ -197,7 +200,7 @@ public:
|
||||
template<class Allocator2>
|
||||
deque_cnc & push_back(const std::deque<value_type, Allocator2> & D)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
for (size_type i = 0; i < D.size(); ++i)
|
||||
dq.push_back(D[i]);
|
||||
return *this;
|
||||
@@ -211,7 +214,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
deque_cnc & push_back(std::deque<value_type, Allocator> && D)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
for (size_type i = 0; i < D.size(); ++i)
|
||||
dq.emplace_back(std::move(D[i]));
|
||||
return *this;
|
||||
@@ -223,7 +226,7 @@ public:
|
||||
//-----------------------------------------------------------------------
|
||||
void pop_back(void)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.pop_back();
|
||||
};
|
||||
//
|
||||
@@ -237,7 +240,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
bool pop_copy_back(value_type & P)
|
||||
{ //-------------------------- begin -----------------------------
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
if (dq.size() == 0) return false;
|
||||
P = dq.back();
|
||||
dq.pop_back();
|
||||
@@ -254,7 +257,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
bool pop_move_back(value_type & P)
|
||||
{ //-------------------------- begin -----------------------------
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
if (dq.size() == 0) return false;
|
||||
P = std::move(dq.back());
|
||||
dq.pop_back();
|
||||
@@ -268,7 +271,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
void push_front(const value_type & D)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.push_front(D);
|
||||
};
|
||||
|
||||
@@ -280,7 +283,7 @@ public:
|
||||
template<class ... Args>
|
||||
void emplace_front(Args && ... args)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.emplace_front(std::forward <Args>(args) ...);
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
@@ -293,7 +296,7 @@ public:
|
||||
template<class Allocator2>
|
||||
deque_cnc & push_front(const std::deque<value_type, Allocator2> & V1)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
for (size_type i = 0; i < V1.size(); ++i)
|
||||
dq.push_front(V1[i]);
|
||||
return *this;
|
||||
@@ -307,7 +310,7 @@ public:
|
||||
//-----------------------------------------------------------------------
|
||||
deque_cnc & push_front(std::deque<value_type, Allocator> && V1)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
for (size_type i = 0; i < V1.size(); ++i)
|
||||
dq.emplace_front(std::move(V1[i]));
|
||||
return *this;
|
||||
@@ -319,7 +322,7 @@ public:
|
||||
//-----------------------------------------------------------------------
|
||||
void pop_front(void)
|
||||
{
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
dq.pop_front();
|
||||
};
|
||||
//
|
||||
@@ -333,7 +336,7 @@ public:
|
||||
//-----------------------------------------------------------------------
|
||||
bool pop_copy_front(value_type & P)
|
||||
{ //-------------------------- begin -----------------------------
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
if (dq.size() == 0) return false;
|
||||
P = dq.front();
|
||||
dq.pop_front();
|
||||
@@ -350,7 +353,7 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
bool pop_move_front(value_type & P)
|
||||
{ //-------------------------- begin -----------------------------
|
||||
std::lock_guard < spinlock > S(spl);
|
||||
std::lock_guard < spinlock_t > S(spl);
|
||||
if (dq.size() == 0) return false;
|
||||
P = std::move(dq.front());
|
||||
dq.pop_front();
|
||||
@@ -360,7 +363,8 @@ public:
|
||||
// end class deque_cnc
|
||||
|
||||
//***************************************************************************
|
||||
};// end namespace tools
|
||||
};// end namespace common
|
||||
};// end namespace sort
|
||||
};// end namespace boost
|
||||
//***************************************************************************
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace common
|
||||
/// @return
|
||||
/// @remarks
|
||||
//-----------------------------------------------------------------------------
|
||||
static int generate_file(const std::string & filename, size_t NElem)
|
||||
inline int generate_file(const std::string & filename, size_t NElem)
|
||||
{ //------------------------------- begin ----------------------------------
|
||||
std::ofstream ofile;
|
||||
ofile.open(filename, std::ios_base::out | std::ios_base::binary |
|
||||
@@ -73,7 +73,7 @@ static int generate_file(const std::string & filename, size_t NElem)
|
||||
/// @return
|
||||
/// @remarks
|
||||
//-----------------------------------------------------------------------------
|
||||
static int fill_vector_uint64(const std::string & filename,
|
||||
inline int fill_vector_uint64(const std::string & filename,
|
||||
std::vector<uint64_t> & V, size_t NElem)
|
||||
{ //----------------------- begin ------------------------------------------
|
||||
std::ifstream input(filename, std::ios_base::in | std::ios_base::binary);
|
||||
@@ -115,7 +115,7 @@ static int fill_vector_uint64(const std::string & filename,
|
||||
/// @return
|
||||
/// @remarks
|
||||
//-----------------------------------------------------------------------------
|
||||
static int write_file_uint64 (const std::vector<uint64_t> & V,
|
||||
inline int write_file_uint64 (const std::vector<uint64_t> & V,
|
||||
const std::string & filename)
|
||||
{ //--------------------------------- begin --------------------------------
|
||||
std::ofstream ofile;
|
||||
@@ -144,7 +144,7 @@ static int write_file_uint64 (const std::vector<uint64_t> & V,
|
||||
/// @return
|
||||
/// @remarks
|
||||
//-----------------------------------------------------------------------------
|
||||
static int fill_vector_string (const std::string & filename,
|
||||
inline int fill_vector_string (const std::string & filename,
|
||||
std::vector<std::string> & V, size_t NElem)
|
||||
{ //----------------------- begin ------------------------------------------
|
||||
std::ifstream input(filename, std::ios_base::in | std::ios_base::binary);
|
||||
@@ -189,7 +189,7 @@ static int fill_vector_string (const std::string & filename,
|
||||
/// @return
|
||||
/// @remarks
|
||||
//-----------------------------------------------------------------------------
|
||||
static int write_file_string (const std::vector<std::string> & V,
|
||||
inline int write_file_string (const std::vector<std::string> & V,
|
||||
const std::string & filename)
|
||||
{ //--------------------------------- begin --------------------------------
|
||||
std::ofstream ofile;
|
||||
|
||||
@@ -72,7 +72,7 @@ struct less_ptr_no_null
|
||||
/// @param index : vector where store the iterators
|
||||
//-----------------------------------------------------------------------------
|
||||
template<class Iter_t>
|
||||
static void create_index(Iter_t first, Iter_t last, std::vector<Iter_t> &index)
|
||||
void create_index(Iter_t first, Iter_t last, std::vector<Iter_t> &index)
|
||||
{
|
||||
auto nelem = last - first;
|
||||
assert(nelem >= 0);
|
||||
@@ -90,7 +90,7 @@ static void create_index(Iter_t first, Iter_t last, std::vector<Iter_t> &index)
|
||||
/// @param [in] index : vector of the iterators
|
||||
//-----------------------------------------------------------------------------
|
||||
template<class Iter_t>
|
||||
static void sort_index(Iter_t global_first, std::vector<Iter_t> &index)
|
||||
void sort_index(Iter_t global_first, std::vector<Iter_t> &index)
|
||||
{
|
||||
typedef util::value_iter<Iter_t> value_t;
|
||||
|
||||
@@ -129,8 +129,8 @@ static void sort_index(Iter_t global_first, std::vector<Iter_t> &index)
|
||||
};
|
||||
};
|
||||
|
||||
template<class func, class Iter_t, class Compare = compare_iter<Iter_t> >
|
||||
static void indirect_sort(func method, Iter_t first, Iter_t last, Compare comp)
|
||||
template<class func, class Iter_t, class Compare = util::compare_iter<Iter_t> >
|
||||
void indirect_sort(func method, Iter_t first, Iter_t last, Compare comp)
|
||||
{
|
||||
auto nelem = (last - first);
|
||||
assert(nelem >= 0);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_INT_ARRAY_HPP
|
||||
#define __BOOST_SORT_COMMON_INT_ARRAY_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_MERGE_BLOCK_HPP
|
||||
#define __BOOST_SORT_COMMON_MERGE_BLOCK_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <boost/sort/common/range.hpp>
|
||||
#include <boost/sort/common/rearrange.hpp>
|
||||
#include <boost/sort/common/util/merge.hpp>
|
||||
|
||||
@@ -13,12 +13,14 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_DETAIL_UTIL_MERGE_FOUR_HPP
|
||||
#define __BOOST_SORT_PARALLEL_DETAIL_UTIL_MERGE_FOUR_HPP
|
||||
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <boost/sort/common/range.hpp>
|
||||
#include <ciso646>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <boost/sort/common/range.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -14,12 +14,14 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_DETAIL_UTIL_MERGE_VECTOR_HPP
|
||||
#define __BOOST_SORT_PARALLEL_DETAIL_UTIL_MERGE_VECTOR_HPP
|
||||
|
||||
#include <boost/sort/common/merge_four.hpp>
|
||||
|
||||
#include <ciso646>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <boost/sort/common/merge_four.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -99,7 +101,7 @@ void merge_level4(range<Iter1_t> dest, std::vector<range<Iter2_t> > &v_input,
|
||||
template<class Value_t, class Iter_t, class Compare>
|
||||
void uninit_merge_level4(range<Value_t *> dest,
|
||||
std::vector<range<Iter_t> > &v_input,
|
||||
std::vector<range<Value_t *> > &v_output, Compare comp)
|
||||
std::vector <range<Value_t *> > &v_output, Compare comp)
|
||||
{
|
||||
typedef range<Value_t *> range1_t;
|
||||
typedef util::value_iter<Iter_t> type1;
|
||||
|
||||
1
linx64/include/boost/sort/common/pivot.hpp
Executable file → Normal file
1
linx64/include/boost/sort/common/pivot.hpp
Executable file → Normal file
@@ -13,6 +13,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_PIVOT_HPP
|
||||
#define __BOOST_SORT_COMMON_PIVOT_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <cstdint>
|
||||
|
||||
namespace boost
|
||||
|
||||
@@ -13,13 +13,15 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_DETAIL_UTIL_RANGE_HPP
|
||||
#define __BOOST_SORT_PARALLEL_DETAIL_UTIL_RANGE_HPP
|
||||
|
||||
#include <boost/sort/common/util/algorithm.hpp>
|
||||
#include <boost/sort/common/util/merge.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <ciso646>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <boost/sort/common/util/algorithm.hpp>
|
||||
#include <boost/sort/common/util/merge.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -13,13 +13,14 @@
|
||||
#ifndef __BOOST_SORT_COMMON_REARRANGE_HPP
|
||||
#define __BOOST_SORT_COMMON_REARRANGE_HPP
|
||||
|
||||
//#include <boost/sort/common/atomic.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <ciso646>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -14,15 +14,16 @@
|
||||
#ifndef __BOOST_SORT_COMMON_SCHEDULER_HPP
|
||||
#define __BOOST_SORT_COMMON_SCHEDULER_HPP
|
||||
|
||||
#include <boost/sort/common/spinlock.hpp>
|
||||
#include <boost/sort/common/search.hpp>
|
||||
#include <boost/sort/common/compare_traits.hpp>
|
||||
#include <ciso646>
|
||||
#include <scoped_allocator>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
#include <boost/sort/common/spinlock.hpp>
|
||||
#include <boost/sort/common/util/search.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -55,14 +56,21 @@ struct scheduler
|
||||
// D E F I N I T I O N S
|
||||
//-----------------------------------------------------------------------
|
||||
typedef std::scoped_allocator_adaptor <Allocator> scoped_alloc;
|
||||
template <class T>
|
||||
using alloc_t = typename std::allocator_traits<Allocator>::
|
||||
template rebind_alloc<T>;
|
||||
|
||||
|
||||
typedef std::deque <Func_t, scoped_alloc> deque_t;
|
||||
typedef typename deque_t::iterator it_deque;
|
||||
typedef std::thread::id key_t;
|
||||
typedef std::hash <key_t> hash_t;
|
||||
typedef std::equal_to <key_t> equal_t;
|
||||
typedef std::unique_lock <spinlock_t> lock_t;
|
||||
typedef std::unordered_map <key_t, deque_t, hash_t,
|
||||
equal_t, scoped_alloc> map_t;
|
||||
typedef std::pair<const key_t, deque_t> pair_t;
|
||||
|
||||
typedef std::unordered_map <key_t, deque_t, hash_t,
|
||||
equal_t, alloc_t <pair_t> > map_t;
|
||||
typedef typename map_t::iterator it_map;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -184,7 +192,7 @@ struct scheduler
|
||||
//--------------------------------------------------------------------
|
||||
// Metaprogramming
|
||||
//--------------------------------------------------------------------
|
||||
typedef value_iter<it_func> value2_t;
|
||||
typedef util::value_iter<it_func> value2_t;
|
||||
static_assert (std::is_same< Func_t, value2_t >::value,
|
||||
"Incompatible iterators\n");
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_SORT_BASIC_HPP
|
||||
#define __BOOST_SORT_COMMON_SORT_BASIC_HPP
|
||||
|
||||
//#include <boost/sort/spinsort/util/indirect.hpp>
|
||||
#include <boost/sort/insert_sort/insert_sort.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <boost/sort/common/range.hpp>
|
||||
#include <ciso646>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
@@ -24,6 +21,9 @@
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
#include <boost/sort/insert_sort/insert_sort.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <boost/sort/common/range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_DETAIL_UTIL_SPINLOCK_HPP
|
||||
#define __BOOST_SORT_PARALLEL_DETAIL_UTIL_SPINLOCK_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <atomic>
|
||||
#include <ctime>
|
||||
#include <functional>
|
||||
@@ -69,7 +70,7 @@ class spinlock_t
|
||||
//-------------------------------------------------------------------------
|
||||
bool try_lock ( ) noexcept
|
||||
{
|
||||
return not af.test_and_set (std::memory_order_acquire);
|
||||
return !af.test_and_set (std::memory_order_acquire);
|
||||
};
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_DETAIL_UTIL_STACK_CNC_HPP
|
||||
#define __BOOST_SORT_PARALLEL_DETAIL_UTIL_STACK_CNC_HPP
|
||||
|
||||
#include <boost/sort/common/spinlock.hpp>
|
||||
#include <ciso646>
|
||||
#include <vector>
|
||||
#include <boost/sort/common/spinlock.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_TOOLS_TIME_MEASURE_HPP
|
||||
#define __BOOST_SORT_PARALLEL_TOOLS_TIME_MEASURE_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <chrono>
|
||||
|
||||
namespace boost
|
||||
namespace boost
|
||||
{
|
||||
namespace sort
|
||||
namespace sort
|
||||
{
|
||||
namespace common
|
||||
namespace common
|
||||
{
|
||||
|
||||
namespace chrn = std::chrono;
|
||||
@@ -30,15 +31,13 @@ namespace chrn = std::chrono;
|
||||
//***************************************************************************
|
||||
typedef chrn::steady_clock::time_point time_point;
|
||||
|
||||
time_point now ( );
|
||||
double subtract_time ( const time_point & t1, const time_point & t2 );
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
// function : now
|
||||
/// @brief return the time system in a internal format ( steady_clock)
|
||||
/// @return time in steady_clock format
|
||||
//---------------------------------------------------------------------------
|
||||
time_point now ( ) { return chrn::steady_clock::now( ); };
|
||||
inline time_point now ( ) { return chrn::steady_clock::now( ); };
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
// function : subtract_time
|
||||
@@ -47,7 +46,7 @@ time_point now ( ) { return chrn::steady_clock::now( ); };
|
||||
/// @param [in] t2 : second time in time_point format
|
||||
/// @return time in seconds of the difference of t1 - t2
|
||||
//---------------------------------------------------------------------------
|
||||
double subtract_time ( const time_point & t1, const time_point & t2 )
|
||||
inline double subtract_time ( const time_point & t1, const time_point & t2 )
|
||||
{ //------------------------ begin ---------------------------------
|
||||
chrn::duration<double> time_span =
|
||||
chrn::duration_cast < chrn::duration < double > > ( t1 - t2 );
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_UTIL_ALGORITHM_HPP
|
||||
#define __BOOST_SORT_COMMON_UTIL_ALGORITHM_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef __BOOST_SORT_PARALLEL_DETAIL_UTIL_ATOMIC_HPP
|
||||
#define __BOOST_SORT_PARALLEL_DETAIL_UTIL_ATOMIC_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <atomic>
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_UTIL_CIRCULAR_BUFFER_HPP
|
||||
#define __BOOST_SORT_COMMON_UTIL_CIRCULAR_BUFFER_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
@@ -70,7 +71,7 @@ struct circular_buffer
|
||||
circular_buffer(void)
|
||||
: ptr(nullptr), nelem(0), first_pos(0), initialized(false)
|
||||
{
|
||||
ptr = std::get_temporary_buffer < Value_t > (NMAX).first;
|
||||
ptr = static_cast <Value_t*> (std::malloc (NMAX * sizeof(Value_t)));
|
||||
if (ptr == nullptr) throw std::bad_alloc();
|
||||
};
|
||||
//
|
||||
@@ -84,7 +85,7 @@ struct circular_buffer
|
||||
{ for (size_t i = 0; i < NMAX; ++i) (ptr + i)->~Value_t();
|
||||
initialized = false;
|
||||
};
|
||||
std::return_temporary_buffer(ptr);
|
||||
std::free(static_cast <void*> (ptr));
|
||||
}
|
||||
;
|
||||
//
|
||||
|
||||
@@ -13,10 +13,8 @@
|
||||
#ifndef __BOOST_SORT_COMMON_UTIL_INSERT_HPP
|
||||
#define __BOOST_SORT_COMMON_UTIL_INSERT_HPP
|
||||
|
||||
//#include <boost/sort/spinsort/util/indirect.hpp>
|
||||
#include <boost/sort/common/util/insert.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <boost/sort/common/util/algorithm.hpp>
|
||||
|
||||
#include <ciso646>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
@@ -24,6 +22,9 @@
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
#include <boost/sort/common/util/insert.hpp>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <boost/sort/common/util/algorithm.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_UTIL_MERGE_HPP
|
||||
#define __BOOST_SORT_COMMON_UTIL_MERGE_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
#ifndef __BOOST_SORT_COMMON_SEARCH_HPP
|
||||
#define __BOOST_SORT_COMMON_SEARCH_HPP
|
||||
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
#include <ciso646>
|
||||
#include <cassert>
|
||||
#include <boost/sort/common/util/traits.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef __BOOST_SORT_COMMON_UTIL_TRAITS_HPP
|
||||
#define __BOOST_SORT_COMMON_UTIL_TRAITS_HPP
|
||||
|
||||
#include <ciso646>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
|
||||
Reference in New Issue
Block a user