Moves some stuff around
This commit is contained in:
parent
f1116a8bb7
commit
30f2101edd
10 changed files with 19 additions and 20 deletions
|
@ -1,8 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <boost/container/flat_set.hpp>
|
#include <boost/container/flat_set.hpp>
|
||||||
#include <cassert>
|
#include <vector>
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
// Using boost flat set was faster than std::set.
|
// Using boost flat set was faster than std::set.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
std::string colored_block(int color);
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include <boost/serialization/utility.hpp>
|
#include <boost/serialization/utility.hpp>
|
||||||
#include <boost/serialization/serialization.hpp>
|
#include <boost/serialization/serialization.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
struct BasicRulesBase {
|
struct BasicRulesBase {
|
||||||
unsigned int min_size;
|
unsigned int min_size;
|
||||||
|
@ -65,3 +67,7 @@ private:
|
||||||
// consider make_nvp for readable json
|
// consider make_nvp for readable json
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct DynamicGrid;
|
||||||
|
AnalyzedGrid<DynamicGrid> grid_from_file(std::string file_path);
|
||||||
|
void grid_to_file(AnalyzedGrid<DynamicGrid> const & grid, std::string file_path);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "data.hpp"
|
#include "data.hpp"
|
||||||
#include "clusters.hpp"
|
#include "clusters.hpp"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
template <typename Grid>
|
template <typename Grid>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
// Simple static vector (much faster)
|
// Simple static vector (much faster)
|
||||||
// Also slightly faster than boost::container::static_vector
|
// Also slightly faster than boost::container::static_vector
|
||||||
|
@ -17,3 +18,6 @@ struct small_vector{
|
||||||
auto begin() const { return &arr[0]; }
|
auto begin() const { return &arr[0]; }
|
||||||
auto end() const { return &arr[elements]; }
|
auto end() const { return &arr[elements]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Generates color codes for the terminal
|
||||||
|
std::string colored_block(int color);
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "data.hpp"
|
#include "data.hpp"
|
||||||
#include "dynamic_grid.hpp"
|
#include "dynamic_grid.hpp"
|
||||||
#include "solver.hpp"
|
|
||||||
#include "rules.hpp"
|
|
||||||
|
|
||||||
#include <boost/archive/text_oarchive.hpp>
|
#include <boost/archive/text_oarchive.hpp>
|
||||||
#include <boost/archive/text_iarchive.hpp>
|
#include <boost/archive/text_iarchive.hpp>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
inline auto grid_from_file(std::string file_path){
|
AnalyzedGrid<DynamicGrid> grid_from_file(std::string file_path){
|
||||||
std::ifstream file(file_path);
|
std::ifstream file(file_path);
|
||||||
boost::archive::text_iarchive ar(file);
|
boost::archive::text_iarchive ar(file);
|
||||||
|
|
||||||
|
@ -19,10 +14,9 @@ inline auto grid_from_file(std::string file_path){
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline auto grid_to_file(AnalyzedGrid<DynamicGrid> const & grid, std::string file_path){
|
void grid_to_file(const AnalyzedGrid<DynamicGrid>& grid, std::string file_path){
|
||||||
std::ofstream file(file_path);
|
std::ofstream file(file_path);
|
||||||
boost::archive::text_oarchive ar(file);
|
boost::archive::text_oarchive ar(file);
|
||||||
|
|
||||||
ar << grid;
|
ar << grid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "dynamic_grid.hpp"
|
#include "dynamic_grid.hpp"
|
||||||
#include "colored_output.hpp"
|
#include "utilities.hpp"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "colored_output.hpp"
|
#include "utilities.hpp"
|
||||||
|
|
||||||
static const bool disable_colors = false;
|
static const bool disable_colors = false;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#include "dynamic_grid.hpp"
|
#include "dynamic_grid.hpp"
|
||||||
#include "clusters.hpp"
|
|
||||||
#include "solver.hpp"
|
#include "solver.hpp"
|
||||||
#include "rules.hpp"
|
#include "rules.hpp"
|
||||||
#include "analyzed_grid.hpp"
|
#include "data.hpp"
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "dynamic_grid.hpp"
|
#include "dynamic_grid.hpp"
|
||||||
#include "analyzed_grid.hpp"
|
|
||||||
#include "clusters.hpp"
|
#include "clusters.hpp"
|
||||||
|
#include "rules.hpp"
|
||||||
|
#include "data.hpp"
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
|
|
Reference in a new issue