#ifndef DESIGNER_H_06F8DE64 #define DESIGNER_H_06F8DE64 #include #include #include #include #include #include #include "cardset.h" #include "prefix_search.h" struct usage { size_t cardId; size_t strIndex; size_t strLen; usage(size_t ci, size_t si, size_t sl) : cardId(ci), strIndex(si), strLen(sl) {} }; struct solution { const ps_type& prefix; std::vector lengths; size_t score; }; class designer { public: designer(std::string text, const ps_type& titles) : text_(std::move(text)), titles_(titles), solutions_(text_.length() + 1) {} std::list generate(std::mt19937& rng) const; private: const solution& get(size_t i) const; solution calculate(size_t i) const; const std::string text_; const ps_type& titles_; mutable std::vector> solutions_; }; #endif /* end of include guard: DESIGNER_H_06F8DE64 */