add solver.cpp

This commit is contained in:
2023-10-12 17:31:58 +08:00
parent 9721976e4c
commit 4b2971d54d
3 changed files with 20 additions and 13 deletions

View File

@@ -62,18 +62,8 @@ namespace ufo
virtual Solver& operator()() = 0;
virtual ~Solver() = default;
inline static concurrencpp::generator<std::pair<Eigen::Vector<unsigned, 3>, unsigned>>
triplet_sequence(Eigen::Vector<unsigned, 3> range)
{
for (unsigned x = 0; x < range[0]; x++)
for (unsigned y = 0; y < range[1]; y++)
for (unsigned z = 0; z < range[2]; z++)
co_yield
{
Eigen::Vector<unsigned, 3>{{x}, {y}, {z}},
x * range[1] * range[2] + y * range[2] + z
};
}
static concurrencpp::generator<std::pair<Eigen::Vector<unsigned, 3>, unsigned>>
triplet_sequence(Eigen::Vector<unsigned, 3> range);
template <ZppSerializable T> inline static void zpp_write(const T& object, std::string filename)
{