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(libs ${libs} ${Boost_LIBRARIES})
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_subdirectory("include")
add_subdirectory("lib") add_subdirectory("lib")
add_subdirectory("src") 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 #pragma once
#include <cassert>
#include <set>
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
#include <cassert>
// Using boost flat set was faster than std::set. // 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 { namespace detail {
template <typename Field> template <typename Field>
auto same_group(Field const & field, typename Field::Position const & p, typename Field::Position const & q){ 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; 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 <cassert>
#include <utility> #include <utility>
#include <array>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <random>
#include <iosfwd> #include <iosfwd>
#include <functional>
// Position {0,0} is bottom left. // Position {0,0} is bottom left.
// Position {W-1, H-1} is top right. // Position {W-1, H-1} is top right.

View file

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

View file

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

View file

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