Skip to content

Commit

Permalink
Merge pull request #170 from Morwenn/develop
Browse files Browse the repository at this point in the history
Release 1.8.0
  • Loading branch information
Morwenn committed Sep 27, 2020
2 parents 4de62a1 + 68f86b2 commit beeab4e
Show file tree
Hide file tree
Showing 396 changed files with 9,152 additions and 8,860 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy-to-wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Wiki Deployment

on:
push:
branches:
- master
paths:
- 'docs/**'

jobs:
sync-wiki-files:
name: Sync Wiki Files

runs-on: ubuntu-latest

steps:
- name: Checkout /docs
uses: actions/checkout@master
- name: Sync .wiki with /docs
uses: SwiftDocOrg/github-wiki-publish-action@rsync
with:
path: docs/
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.DEPLOY_TO_WIKI_ACCESS_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright (c) 2015-2020 Morwenn
# SPDX-License-Identifier: MIT

# Project-specific directory
benchmarks/plots
build

# Compiled Object files
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2015-2020 Morwenn
# SPDX-License-Identifier: MIT

language: cpp

_packages:
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2015-2020 Morwenn
# SPDX-License-Identifier: MIT

cmake_minimum_required(VERSION 3.8.0)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
Expand Down
File renamed without changes.
229 changes: 229 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
cpp-sort

The MIT License (MIT)

Copyright (c) Morwenn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

----------------------------------------------------

In addition, certain files include the notices provided below.



/*
* WikiSort: a public domain implementation of "Block Sort"
* https://github.com/BonzaiThePenguin/WikiSort
*/

----------------------

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

----------------------

//----------------------------------------------------------------------------
/// @file merge.hpp
/// @brief low level merge functions
///
/// @author Copyright (c) 2016 Francisco Jose Tapia (fjtapia@gmail.com )
/// Distributed under the Boost Software License, Version 1.0.
/// ( See accompanying file LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt )
/// @version 0.1
///
/// @remarks
//-----------------------------------------------------------------------------

----------------------

//----------------------------------------------------------------------------
/// @file range.hpp
/// @brief Define a range [first, last), and the associated operations
///
/// @author Copyright (c) 2016 Francisco José Tapia (fjtapia@gmail.com )
/// Distributed under the Boost Software License, Version 1.0.
/// ( See accompanyingfile LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt )
/// @version 0.1
///
/// @remarks
//-----------------------------------------------------------------------------

----------------------

//----------------------------------------------------------------------------
/// @file spinsort.hpp
/// @brief Spin Sort algorithm
///
/// @author Copyright (c) 2016 Francisco José Tapia (fjtapia@gmail.com )
/// Distributed under the Boost Software License, Version 1.0.
/// ( See accompanying file LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt )
/// @version 0.1
///
/// @remarks
//-----------------------------------------------------------------------------

----------------------

/*
The MIT license (MIT)

A C++ reimplementation of a drop-merge sort, originally made by Emil Ernerfeldt:
https://github.com/emilk/drop-merge-sort

There are two versions of this function.

The first one is identical to the reference Rust implementation.
It doesn't support uncopyable types.
Here, it's used only for trivially copyable types.
(just like the Rust version, which required the Copy trait).

The second version is copy-free, so it supports noncopyable types like std::unique_ptr.
It's also more efficient for types with expensive copying, like std::string.
However, being copy-free involves some extra bookkeeping, so for trivial types
it's a bit less efficient than the original function - which is why I use both versions.
*/

----------------------

/*
pdqsort.h - Pattern-defeating quicksort.

Copyright (c) 2015 Orson Peters

This software is provided 'as-is', without any express or implied warranty. In no event will the
authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the
original software. If you use this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as
being the original software.

3. This notice may not be removed or altered from any source distribution.
*/

----------------------

/*
* Grail sorting
*
* (c) 2013 by Andrey Astrelin
*
* Stable sorting that works in O(N*log(N)) time
* and uses O(1) extra memory
*
*/

----------------------

// Range v3 library
//
// Copyright Eric Niebler 2013-2014
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
//

----------------------

// Copyright Malte Skarupke 2016.
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
//

----------------------

/*
* File: Smoothsort.hh
* Author: Keith Schwarz (htiek@cs.stanford.edu)
*
* An implementation of Dijkstra's Smoothsort algorithm, a modification of
* heapsort that runs in O(n lg n) in the worst case, but O(n) if the data
* are already sorted. For more information about how this algorithm works
* and some of the details necessary for its proper operation, please see
*
* http://www.keithschwarz.com/smoothsort/
*
* This implementation is designed to work on a 64-bit machine.
*/

----------------------

// Copyright Steven J. Ross 2001 - 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// See http://www.boost.org/libs/sort for library home page.

----------------------

// Copyright (c) 2020, Matthew Bentley (mattreecebentley@gmail.com) www.plflib.org

// zLib license (https://www.zlib.net/zlib_license.html):
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgement in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

----------------------

# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.

----------------------

# This file is part of CMake-codecov.
#
# Copyright (c)
# 2015-2017 RWTH Aachen University, Federal Republic of Germany
#
# See the LICENSE file in the package base directory for details
#
# Written by Alexander Haase, alexander.haase@rwth-aachen.de
#
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ should be trivial enough:
```cpp
#include <array>
#include <iostream>
#include <cpp-sort/sort.h>
#include <cpp-sort/sorters/smooth_sorter.h>

int main()
{
std::array<int, 5u> arr = { 5, 8, 3, 2, 9 };
cppsort::sort(arr);
std::array<int, 5> arr = { 5, 8, 3, 2, 9 };
cppsort::smooth_sort(arr);

// prints 2 3 5 8 9
for (int val: arr) {
std::cout << val << ' ';
Expand Down Expand Up @@ -63,15 +63,14 @@ int main()

// When used, this sorter will use a pattern-defeating quicksort
// to sort random-access collections, and a mergesort otherwise
using sorter = cppsort::hybrid_adapter<
cppsort::hybrid_adapter<
cppsort::pdq_sorter,
cppsort::merge_sorter
>;
sorter sort;
> sorter;

// Sort li and vec in reverse order using their value member
sort(li, std::greater<>{}, &wrapper::value);
sort(vec, std::greater<>{}, &wrapper::value);
sorter(li, std::greater<>{}, &wrapper::value);
sorter(vec, std::greater<>{}, &wrapper::value);

assert(std::equal(
std::begin(li), std::end(li),
Expand Down Expand Up @@ -199,14 +198,17 @@ of the algorithm.
* The algorithm used by `grail_sorter` has been adapted from Mrrl's
[GrailSort](https://github.com/Mrrl/GrailSort), hence the name.

* The algorithm used by `indirect_adapter` with forward or bidirectional iterators is a
slightly modified version of Matthew Bentley's [indiesort](https://github.com/mattreecebentley/plf_indiesort).

* The algorithms 0 to 16 used by `sorting_network_sorter` have been generated with
Perl's [`Algorithm::Networksort` module](https://metacpan.org/pod/release/JGAMBLE/Algorithm-Networksort-1.30/lib/Algorithm/Networksort.pm).

* The algorithms 17 and 18 used by `sorting_network_sorter` correspond to the ones found
by Symmetry and Evolution based Network Sort Optimization (SENSO) published in *Using
* The algorithm 17 used by `sorting_network_sorter` correspond to the ones found by
Symmetry and Evolution based Network Sort Optimization (SENSO) published in *Using
Symmetry and Evolutionary Search to Minimize Sorting Networks* by Valsalam and Miikkulainen.

* The algorithms 19 to 26 and 28 used by `sorting_network_sorter` have been found and
* The algorithms 18 to 26 and 28 used by `sorting_network_sorter` have been found and
proposed for inclusion by Bert Dobbelaere with his [SorterHunter project](https://github.com/bertdobbelaere/SorterHunter).
Huge thanks for this contribution :) You can find a full list of most well-known sorting
networks up to 32 inputs on his website.
Expand All @@ -222,3 +224,6 @@ slightly adapted to be 0-based and draw the network from top to bottom.

* The CMake tools embedded in the projects include scripts from [RWTH-HPC/CMake-codecov](https://github.com/RWTH-HPC/CMake-codecov)
and [Crascit/DownloadProject](https://github.com/Crascit/DownloadProject).

* Some of the benchmarks use a [colorblind-friendly palette](https://gist.github.com/thriveth/8560036)
developed by Thøger Rivera-Thorsen.

0 comments on commit beeab4e

Please sign in to comment.