ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
MultikeyQuickSort.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*------------------------ File MultikeyQuickSort.h ------------------------*/
3/*--------------------------------------------------------------------------*/
35/*--------------------------------------------------------------------------*/
36/*----------------------------- DEFINITIONS --------------------------------*/
37/*--------------------------------------------------------------------------*/
38
39#ifndef __ADS_MultikeyQuickSort
40 #define __ADS_MultikeyQuickSort
41/* self-identification: #endif constant */
42
43/*--------------------------------------------------------------------------*/
44/*------------------------------ INCLUDES ----------------------------------*/
45/*--------------------------------------------------------------------------*/
46
47#include "ADS/Contract.h"
48#include "ADS/sort/Sorted.h"
49
50#include <cstddef>
51#include <functional>
52#include <string>
53#include <utility>
54#include <vector>
55
56/*--------------------------------------------------------------------------*/
57/*--------------------------- NAMESPACE ------------------------------------*/
58/*--------------------------------------------------------------------------*/
59
60namespace ADS
61{
62
89template< StringStore Store >
90void multikeyQuickSort( Store && A );
91
93inline void multikeyQuickSort( std::vector< std::string > & A );
94
95/*--------------------------------------------------------------------------*/
96/*------------------------- THE SORTS OF A RANGE ---------------------------*/
97/*--------------------------------------------------------------------------*/
98
103template< SortRange R , class... P >
104 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
105 P &&... p )
106{
107 multikeyQuickSort( v , std::forward< P >( p )... );
108 }
109decltype( auto ) multikeyQuickSort( R && A , P &&... p )
110{
111 const auto f = [ & ]( auto & v ) -> decltype( auto ) {
112 return( multikeyQuickSort( v , std::forward< P >( p )... ) );
113 };
114 return( detail::sortRange( A , f ) );
115 }
116
117/*--------------------------------------------------------------------------*/
118
119} // end( namespace ADS )
120
121/*--------------------------------------------------------------------------*/
122/*-------------------------- IMPLEMENTATION --------------------------------*/
123/*--------------------------------------------------------------------------*/
124
125#include "ADS/sort/impl/MultikeyQuickSort.tpp"
126
127/*--------------------------------------------------------------------------*/
128
129#endif /* MultikeyQuickSort.h included */
130
131/*--------------------------------------------------------------------------*/
132/*---------------------- End File MultikeyQuickSort.h ----------------------*/
133/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
a range that the sorts take beside std::vector and std::span: random access, sized,...
Definition Sorted.h:153
void multikeyQuickSort(Store &&A)
the multikey quicksort of strings
Definition ADT.h:96