comment pseudocode for add_row
This commit is contained in:
32
main.cpp
32
main.cpp
@@ -19,7 +19,7 @@ void pp(const Table &t) {
|
||||
}
|
||||
}
|
||||
|
||||
void new_coset(const int ngens, const std::vector<Gens> &rels,
|
||||
void add_row(const int ngens, const std::vector<Gens> &rels,
|
||||
Table &cosets, std::vector<Table> &reltables,
|
||||
Table &starts, Table &ends) {
|
||||
|
||||
@@ -27,7 +27,7 @@ void new_coset(const int ngens, const std::vector<Gens> &rels,
|
||||
|
||||
cosets.emplace_back(ngens, -1);
|
||||
|
||||
for (size_t i = 0; i < rels.size(); ++i) {
|
||||
for (unsigned int i = 0; i < rels.size(); ++i) {
|
||||
auto &table = reltables[i];
|
||||
|
||||
unsigned int R = rels[i].size();
|
||||
@@ -41,7 +41,27 @@ void new_coset(const int ngens, const std::vector<Gens> &rels,
|
||||
}
|
||||
}
|
||||
|
||||
Table solve_tc(int ngens, const Gens &sub, const std::vector<Gens> &rels) {
|
||||
/**
|
||||
* @return true if anything was learned
|
||||
*/
|
||||
void learn(Table &coset, const std::vector<Gens> &rels,
|
||||
std::vector<Table> &reltables, Table &starts, Table &ends) {
|
||||
|
||||
// set learning
|
||||
// while learning
|
||||
// not learning
|
||||
// for each table
|
||||
// for each row of the table
|
||||
// load left and right from starts/ends
|
||||
// if the left and right already meet, skip
|
||||
// try to deduce more about the row from the left (don't pass right)
|
||||
// try to deduce more about the row from the right (don't pass left)
|
||||
// if the left and right meet
|
||||
// set learning
|
||||
// write to the coset table
|
||||
}
|
||||
|
||||
Table solve_tc(int ngens, const Gens &subgens, const std::vector<Gens> &rels) {
|
||||
Table cosets;
|
||||
std::vector<Table> reltables(rels.size());
|
||||
|
||||
@@ -49,7 +69,11 @@ Table solve_tc(int ngens, const Gens &sub, const std::vector<Gens> &rels) {
|
||||
Table starts(rels.size()); // [rel_table][coset]
|
||||
Table ends(rels.size());
|
||||
|
||||
new_coset(ngens, rels, cosets, reltables, starts, ends);
|
||||
// set up initial coset
|
||||
add_row(ngens, rels, cosets, reltables, starts, ends);
|
||||
for (const auto &gen : subgens) {
|
||||
cosets[0][gen] = 0;
|
||||
}
|
||||
|
||||
return cosets;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user