1
Fork 0

Cleans up project

This commit is contained in:
Joshua Moerman 2014-02-17 16:29:20 +01:00
parent f4ef3d2837
commit 6d2696973f
8 changed files with 19 additions and 21 deletions

View file

@ -9,5 +9,6 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
set(libs ${libs} ${Boost_LIBRARIES})
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_subdirectory("include")
add_subdirectory("lib")
add_subdirectory("src")

4
include/CMakeLists.txt Normal file
View file

@ -0,0 +1,4 @@
# Hack to show headers in Qt Creator
file(GLOB headers "*.hpp")
add_library(dummy ${headers} dummy.cpp)

View file

@ -1,11 +1,19 @@
#pragma once
#include <cassert>
#include <set>
#include <boost/container/flat_set.hpp>
#include <cassert>
// Using boost flat set was faster than std::set.
template <typename Field, typename Cluster>
auto make_empty(Field field, Cluster const & c){
for(auto&& p : c){
field.get(p) = 0;
}
field.collapse();
return field;
}
namespace detail {
template <typename Field>
auto same_group(Field const & field, typename Field::Position const & p, typename Field::Position const & q){
@ -48,13 +56,3 @@ auto all_clusters(Field const & field, Rules const & rules){
}
return ret;
}
template <typename Field, typename Cluster>
auto make_empty(Field field, Cluster const & c){
using namespace std;
for(auto&& p : c){
field.get(p) = 0;
}
field.collapse();
return field;
}

2
include/dummy.cpp Normal file
View file

@ -0,0 +1,2 @@
// Needed for the hack to show headers in Qt Creator
static int x = x;

View file

@ -4,11 +4,10 @@
#include <cassert>
#include <utility>
#include <array>
#include <vector>
#include <algorithm>
#include <random>
#include <iosfwd>
#include <functional>
// Position {0,0} is bottom left.
// Position {W-1, H-1} is top right.

View file

@ -1,7 +1,6 @@
#pragma once
#include "grid.hpp"
#include <random>
namespace detail {

View file

@ -6,7 +6,7 @@
#include <utility>
#include <array>
#include <algorithm>
#include <iosfwd>
#include <iostream>
// Position {0,0} is bottom left.
// Position {W-1, H-1} is top right.

View file

@ -1,17 +1,12 @@
#include "dynamic_grid.hpp"
#include "clusters.hpp"
#include "solver.hpp"
#include "generator.hpp"
#include "rules.hpp"
#include <boost/program_options.hpp>
#include <iostream>
#include <random>
#include <chrono>
#include <thread>
#include <algorithm>
int main(int argc, char** argv){
namespace po = boost::program_options;