OLD | NEW |
| (Empty) |
1 /*Boost Software License - Version 1.0 - August 17th, 2003 | |
2 | |
3 Permission is hereby granted, free of charge, to any person or organization | |
4 obtaining a copy of the software and accompanying documentation covered by | |
5 this license (the "Software") to use, reproduce, display, distribute, | |
6 execute, and transmit the Software, and to prepare derivative works of the | |
7 Software, and to permit third-parties to whom the Software is furnished to | |
8 do so, all subject to the following: | |
9 | |
10 The copyright notices in the Software and this entire statement, including | |
11 the above license grant, this restriction and the following disclaimer, | |
12 must be included in all copies of the Software, in whole or in part, and | |
13 all derivative works of the Software, unless such copies or derivative | |
14 works are solely in the form of machine-executable object code generated by | |
15 a source language processor. | |
16 | |
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
19 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | |
20 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | |
21 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | |
22 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
23 DEALINGS IN THE SOFTWARE.*/ | |
24 #ifndef BOOST_SPREADSORT_CONSTANTS | |
25 #define BOOST_SPREADSORT_CONSTANTS | |
26 namespace boost { | |
27 namespace detail { | |
28 //Tuning constants | |
29 //Sets the minimum number of items per bin. | |
30 static const unsigned LOG_MEAN_BIN_SIZE = 2; | |
31 //This should be tuned to your processor cache; if you go too large you get cach
e misses on bins | |
32 //The smaller this number, the less worst-case memory usage. If too small, too
many recursions slow down spreadsort | |
33 static const unsigned MAX_SPLITS = 10; | |
34 //Used to force a comparison-based sorting for small bins, if it's faster. Mini
mum value 0 | |
35 static const unsigned LOG_MIN_SPLIT_COUNT = 5; | |
36 //There is a minimum size below which it is not worth using spreadsort | |
37 static const long MIN_SORT_SIZE = 1000; | |
38 //This is the constant on the log base n of m calculation; make this larger the
faster std::sort is relative to spreadsort | |
39 static const unsigned LOG_CONST = 2; | |
40 } | |
41 } | |
42 #endif | |
OLD | NEW |