Skip to content

Commit 37dc6ad

Browse files
authored
Merge pull request #234 from Morwenn/1.x.y-develop
Release 1.17.1
2 parents 1edd0e4 + 8ce7b76 commit 37dc6ad

File tree

16 files changed

+118
-85
lines changed

16 files changed

+118
-85
lines changed

.github/workflows/deploy-to-wiki.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.8.0)
55

66
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
77

8-
project(cpp-sort VERSION 1.17.0 LANGUAGES CXX)
8+
project(cpp-sort VERSION 1.17.1 LANGUAGES CXX)
99

1010
include(CMakePackageConfigHelpers)
1111
include(GNUInstallDirs)
@@ -24,7 +24,7 @@ if (CPPSORT_USE_LIBASSERT)
2424
include(DownloadProject)
2525
download_project(PROJ libassert
2626
GIT_REPOSITORY https://github.com/jeremy-rifkin/libassert
27-
GIT_TAG 634f50fb4086d377ad9a2f83d693d2e8fe4972a7 # v2.1.4
27+
GIT_TAG bd33ba116f209bf71761c58dccc2f3bf277e0824 # v2.2.1
2828
UPDATE_DISCONNECTED 1
2929
)
3030
add_subdirectory(${libassert_SOURCE_DIR} ${libassert_BINARY_DIR})

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
![cpp-sort logo](docs/images/cpp-sort-logo.svg)
22

3-
[![Latest Release](https://img.shields.io/badge/release-1.17.0-blue.svg)](https://github.com/Morwenn/cpp-sort/releases/tag/1.17.0)
4-
[![Conan Package](https://img.shields.io/badge/conan-cpp--sort%2F1.17.0-blue.svg)](https://conan.io/center/recipes/cpp-sort?version=1.17.0)
3+
[![Latest Release](https://img.shields.io/badge/release-1.17.1-blue.svg)](https://github.com/Morwenn/cpp-sort/releases/tag/1.17.1)
4+
[![Conan Package](https://img.shields.io/badge/conan-cpp--sort%2F1.17.1-blue.svg)](https://conan.io/center/recipes/cpp-sort?version=1.17.1)
55
[![Code Coverage](https://codecov.io/gh/Morwenn/cpp-sort/branch/develop/graph/badge.svg)](https://codecov.io/gh/Morwenn/cpp-sort)
66
[![Pitchfork Layout](https://img.shields.io/badge/standard-PFL-orange.svg)](https://github.com/vector-of-bool/pitchfork)
77

8+
> [!WARNING]
9+
> **Branch 1.x.y of this library is now in maintenance-only mode: bug fixes might happen and lead to patch versions, but new development will now exclusively happen in branch 2.x.y, which requires at least C++17.**
10+
811
> *It would be nice if only one or two of the sorting methods would dominate all of the others,
912
> regardless of application or the computer being used. But in fact, each method has its own
1013
> peculiar virtues. [...] Thus we find that nearly all of the algorithms deserve to be remembered,
@@ -117,9 +120,10 @@ page][benchmarks].
117120

118121
# Compiler support & tooling
119122

120-
![Ubuntu builds status](https://github.com/Morwenn/cpp-sort/workflows/Ubuntu%20Builds/badge.svg?branch=develop)
121-
![Windows builds status](https://github.com/Morwenn/cpp-sort/workflows/MSVC%20Builds/badge.svg?branch=develop)
122-
![MacOS builds status](https://github.com/Morwenn/cpp-sort/workflows/MacOS%20Builds/badge.svg?branch=develop)
123+
![Ubuntu builds status](https://github.com/Morwenn/cpp-sort/actions/workflows/build-ubuntu.yml/badge.svg?branch=1.x.y-develop)
124+
![MSVC builds status](https://github.com/Morwenn/cpp-sort/actions/workflows/build-msvc.yml/badge.svg?branch=1.x.y-develop)
125+
![MinGW-w64 builds status](https://github.com/Morwenn/cpp-sort/actions/workflows/build-mingw.yml/badge.svg?branch=1.x.y-develop)
126+
![MacOS builds status](https://github.com/Morwenn/cpp-sort/actions/workflows/build-macos.yml/badge.svg?branch=1.x.y-develop)
123127

124128
**cpp-sort** requires C++14 support, and should work with the following compilers:
125129
* g++-9 or more recent.

cmake/DownloadProject.CMakeLists.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Distributed under the OSI-approved MIT License. See accompanying
22
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
33

4-
cmake_minimum_required(VERSION 2.8.2)
4+
cmake_minimum_required(VERSION 3.5.0)
55

66
project(${DL_ARGS_PROJ}-download NONE)
77

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class CppSortConan(ConanFile):
1818
name = "cpp-sort"
19-
version = "1.17.0"
19+
version = "1.17.1"
2020
description = "Sorting algorithms & related tools"
2121
license = "MIT"
2222
url = "https://github.com/Morwenn/cpp-sort"

docs/Home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![cpp-sort logo](images/cpp-sort-logo.svg)
22

3-
Welcome to the **cpp-sort 1.17.0** documentation!
3+
Welcome to the **cpp-sort 1.17.1** documentation!
44

55
This wiki contains documentation about the library: basic documentation about the many sorting tools and how to use them, documentation about the additional utilities provided by the library, as well as a few tutorials about writing your own sorters or sorter adapters. This main page explains a few general things that didn't quite fit in other parts of the documentation.
66

docs/Measures-of-presortedness.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Computes the *Oscillation* measure described by C. Levcopoulos and O. Petersson
235235

236236
When there isn't enough extra memory available, `probe::osc` falls back to an in-place O(n²) algorithm.
237237

238-
`max_for_size`: (|*X*| * (|*X*| - 2) - 1) / 2 when the values in *X* are strongly oscillating.
238+
`max_for_size`: it is reached when the values in $X$ are strongly oscillating, and equals $\frac{|X|(|X| - 2)}{2}$ when $|X|$ is even, and $\frac{|X|(|X| - 2) - 1}{2}$ when $|X|$ is odd.
239239

240240
**Note:** *Osc* does not respect Mannila's criterion 5: $Osc(\langle 2, 4, 1, 3, 1, 3 \rangle) \not \le |\langle 4, 1, 3, 1, 3 \rangle| + Osc(\langle 4, 1, 3, 1, 3 \rangle)$, though it is possible that it only happens when equivalent elements are involved.
241241

@@ -303,7 +303,7 @@ Spearman's footrule distance: sum of distances between the position of individua
303303
#include <cpp-sort/probes/sus.h>
304304
```
305305

306-
Computes the minimum number of non-decreasing subsequences (of possibly not adjacent elements) into which *X* can be partitioned. It happens to correspond to the size of the [longest decreasing subsequence][longest-increasing-subsequence] of *X*.
306+
Computes the minimum number of non-decreasing subsequences (of possibly not adjacent elements) into which *X* can be partitioned, minus 1. It happens to correspond to the size of the [longest decreasing subsequence][longest-increasing-subsequence] of *X* minus 1.
307307

308308
*SUS* stands for *Shuffled Up-Sequences* and was introduced in *Sorting Shuffled Monotone Sequences* by C. Levcopoulos and O. Petersson.
309309

docs/Tooling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Note: when `CPPSORT_ENABLE_AUDITS` is `ON`, assertions in the library are enable
6363
conan search cpp-sort --remote=conancenter
6464
```
6565

66-
And then install any version to your local cache as follows (here with version 1.17.0):
66+
And then install any version to your local cache as follows (here with version 1.17.1):
6767

6868
```sh
69-
conan install --requires=cpp-sort/1.17.0
69+
conan install --requires=cpp-sort/1.17.1
7070
```
7171

7272
The packages downloaded from conan-center are minimal and only contain the files required to use **cpp-sort** as a library: the headers, CMake files and licensing information. If you need anything else you have to create your own package with the `conanfile.py` available in this repository.
@@ -78,7 +78,7 @@ The packages downloaded from conan-center are minimal and only contain the files
7878
[Gollum][gollum], if installed, can be used to browse this documentation offline:
7979

8080
1. Navigate to the main `cpp-sort` directory in the command line
81-
2. `gollum --page-file-dir docs --ref <branch-name>`
81+
2. `gollum --page-file-dir docs --ref <branch-name> --math katex`
8282
3. Visit http://localhost:4567/Home
8383

8484
This can notably used to browse old versions of the documentation. It seems however that `--ref` doesn't understand Git tags, so you have to create a proper branch from the version tag you want to browse beforehand.

include/cpp-sort/detail/move.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2022 Morwenn
2+
* Copyright (c) 2019-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_DETAIL_MOVE_H_
@@ -102,8 +102,9 @@ namespace detail
102102
-> T*
103103
{
104104
using truth_type = std::integral_constant<bool,
105-
std::is_trivial<value_type_t<InputIterator>>::value &&
106-
std::is_trivial<T>::value
105+
std::is_trivially_copyable<value_type_t<InputIterator>>::value &&
106+
std::is_trivially_copyable<T>::value &&
107+
sizeof(T) == sizeof(value_type_t<InputIterator>)
107108
>;
108109
return uninitialized_move_impl(truth_type{}, std::move(first), std::move(last),
109110
std::move(result), destroyer);

include/cpp-sort/probes/osc.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2022 Morwenn
2+
* Copyright (c) 2016-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_PROBES_OSC_H_
@@ -210,7 +210,12 @@ namespace probe
210210
static constexpr auto max_for_size(Integer n)
211211
-> Integer
212212
{
213-
return n == 0 ? 0 : (n * (n - 2) - 1) / 2;
213+
if (n < 2) return 0;
214+
if (n % 2 == 0) {
215+
return (n * (n - 2)) / 2;
216+
} else {
217+
return (n * (n - 2) - 1) / 2;
218+
}
214219
}
215220
};
216221
}

0 commit comments

Comments
 (0)