Program Listing for File Sort.h

↰ Return to documentation for file (ADS/sort/Sort.h)

/*--------------------------------------------------------------------------*/
/*------------------------------ File Sort.h -------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef __ADS_Sort
 #define __ADS_Sort
                      /* self-identification: #endif constant */

/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/Contract.h"
#include "ADS/sort/EngineeredQuickSorts.h"
#include "ADS/sort/RadixSort.h"
#include "ADS/sort/RunSorts.h"
#include "ADS/sort/SampleSort.h"
#include "ADS/sort/StringSort.h"
#include "ADS/sort/VectorQuickSort.h"

#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <functional>
#include <memory>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/

namespace ADS {

inline constexpr std::size_t kRadix = 512;

inline constexpr std::size_t kStrings = 64;

inline constexpr std::size_t kRuns = 16;

template< class T , class C = std::less<> >
void sort( std::vector< T > & A , C less = C() );

template< class T , class C = std::less<> >
void stableSort( std::vector< T > & A , C less = C() );

/*--------------------------------------------------------------------------*/

}  // end( namespace ADS )

/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/sort/impl/Sort.tpp"

/*--------------------------------------------------------------------------*/

#endif  /* Sort.h included */

/*--------------------------------------------------------------------------*/
/*---------------------------- End File Sort.h -----------------------------*/
/*--------------------------------------------------------------------------*/