Skip to content

Commit

Permalink
Added some more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mraggi committed Aug 19, 2016
1 parent 04e7f56 commit af1a487
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
18 changes: 8 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ set(BUILD_SHARED_LIBS ON)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/Discreture)

# add_subdirectory(src/SFML)

# if (USE_CLANG)
# SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
# SET (CMAKE_AR "/usr/bin/llvm-ar")
# SET (CMAKE_LINKER "/usr/bin/llvm-ld")
# SET (CMAKE_NM "/usr/bin/llvm-nm")
# SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
# SET (CMAKE_RANLIB "/usr/bin/llvm-ranlib")
# endif (USE_CLANG)
if (USE_CLANG)
SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
SET (CMAKE_AR "/usr/bin/llvm-ar")
SET (CMAKE_LINKER "/usr/bin/llvm-ld")
SET (CMAKE_NM "/usr/bin/llvm-nm")
SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
SET (CMAKE_RANLIB "/usr/bin/llvm-ranlib")
endif (USE_CLANG)

add_definitions(-std=c++14)
add_definitions(-Ofast -march=native)
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ for (int n = 8; n < 34; n += 1)
}
```

## Discreture vs Sagemath

This comparison isn't even fair (c++ vs python). On the same system, iterating over all (24 choose 12) combinations, sage takes 12.2 seconds. Discreture takes approximately 0.01 seconds. No point in graphing that.

## CLANG vs GCC
On a i7-5820K CPU @ 3.30GHz, on Linux, compiling with -Ofast yields the following results:

Expand All @@ -174,7 +178,8 @@ On a i7-5820K CPU @ 3.30GHz, on Linux, compiling with -Ofast yields the followin
| Time taken to see all 42355950 set partitions a set of 15 elements with 4 parts | 1.20166s | **1.01687s** |
| **Total Time** | **19.7s** | 22.1s |



# Acknowledgements
I would like to thank Manuel Alejandro Romo de Vivar (manolo) for his work on dyck paths, motzkin paths, and his contribution to partition numbers.

# Contributing
Please help us testing, debugging, benchmarking, packaging for the various distros, etc. Also, if you use discreture for your own purposes, let us know!
7 changes: 7 additions & 0 deletions Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,13 @@ void testCombinationsSpeed(int n, int k)
// ++i;
}
cout << "Time taken to see all (" << n << " choose " << k << ") = " << X.size() << " combinations in reverse order: " << C.Reset() << "s" << endl;

combinations Z(24,12);
for (auto& z : Z)
{

}
cout << "Time taken to see all (" << 24 << " choose " << 12 << ") = " << Z.size() << " combinations: " << C.Reset() << "s" << endl;
}

void testPermutationsSpeed(int n)
Expand Down

0 comments on commit af1a487

Please sign in to comment.