#pragma once #include struct Cosets { int ngens; std::vector data; int len; Cosets(int ngens, const std::vector &data); void add_row(); void put(int coset, int gen, int target); void put(int idx, int target); [[nodiscard]] int get(int coset, int gen) const; [[nodiscard]] int get(int idx) const; }; struct Mult { int gen0, gen1, mult; }; struct RelTable { int gens[2]{}; int mult; std::vector lst_ptr; std::vector gen; explicit RelTable(Mult m); int add_row(); }; struct Group { int ngens; std::vector> _mults; explicit Group(int ngens, const std::vector &rels = {}); void setmult(Mult m); [[nodiscard]] std::vector get_mults() const; [[nodiscard]] Group product(const Group &other) const; [[nodiscard]] Group power(int p) const; };