#include #include #include #include #include #include #include #include #include #include #include #include #include using std::string; using std::endl; #include "dlk_util.cpp" #include "exact_cover_mt.cpp" struct Exact_cover_2 : Exact_cover_u { typedef Exact_cover_u::nodeix nodeix; void search_trans(const Square& dlk) { init_trans(dlk); dance(&Exact_cover_2::save_trans); } void search_mates_cout() { init_disjoint(); bool found = 0; do { dance(&headsDyn[0],&nodesDyn[0],&O2[0],&found,order); if(found) { Square mate(order); get_mate(mate,&O2[0]); std::cout<headsDyn[c].size) return -1; for( unsigned i=0; i<*path; ++i) { r = nodesDyn[r].down; if(!r) return -1; } for(nodeix j = nodesSt[r].right; j != r; j = nodesSt[j].right) cover_column(nodesSt[j].column, headsDyn.data(),nodesDyn.data()); O2[level] = r; //std::cerr<<"r="< path; path.resize(argc-1); path[argc-2]=0; Square in; if(!name && !name[0]) throw std::runtime_error("No input square"); in.Decode(name); if(!in.width()) throw std::runtime_error("Zero-width input"); Exact_cover_2 dlx; dlx.search_trans(in); std::cerr<<"num_dtrans: "<