Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Morwenn committed Oct 18, 2019
1 parent 6da604e commit e451bbb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## TimSort [![Build Status](https://travis-ci.org/timsort/cpp-TimSort.svg?branch=master)](https://travis-ci.org/timsort/cpp-TimSort)
[![Latest Release](https://img.shields.io/badge/release-cpp--TimSort%2F1.0.0-blue.svg)](https://github.com/timsort/cpp-TimSort/releases)
[![Build Status](https://travis-ci.org/timsort/cpp-TimSort.svg?branch=master)](https://travis-ci.org/timsort/cpp-TimSort)
[![License](https://img.shields.io/:license-mit-blue.svg)](https://doge.mit-license.org)

## TimSort

A C++ implementation of TimSort, an O(n log n) stable sorting algorithm, ported from Python's and OpenJDK's.

Expand Down Expand Up @@ -46,12 +50,21 @@ cd build
make install
```

## CONFIGURATION
## DIAGNOSTICS & INFORMATION

A few configuration macros allow gfx::timsort to emit diagnostic, which might be helpful to diagnose issues:
* Defining `GFX_TIMSORT_ENABLE_ASSERT` inserts assertions in key locations in the algorithm to avoid logic errors.
* Defining `GFX_TIMSORT_ENABLE_LOG` inserts logs in key locations, which allow to follow more closely the flow of the algorithm.

**cpp-TimSort** follows semantic versioning and provides the following macros to retrieve the current major, minor
and patch versions:

```cpp
GFX_TIMSORT_VERSION_MAJOR
GFX_TIMSORT_VERSION_MINOR
GFX_TIMSORT_VERSION_PATCH
```

## TESTS

The tests are written with Catch2 (branch 1.x) and can be compiled with CMake and run through CTest.
Expand Down
8 changes: 8 additions & 0 deletions include/gfx/timsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
#include <iterator>
#include <vector>

// Semantic versioning macros

#define GFX_TIMSORT_VERSION_MAJOR 1
#define GFX_TIMSORT_VERSION_MINOR 0
#define GFX_TIMSORT_VERSION_PATCH 0

// Diagnostic selection macros

#ifdef GFX_TIMSORT_ENABLE_ASSERT
# include <cassert>
# define GFX_TIMSORT_ASSERT(expr) assert(expr)
Expand Down

0 comments on commit e451bbb

Please sign in to comment.