ENH: Remove template Group<> and Cosets<>

This commit is contained in:
David Allemang
2023-02-06 09:42:47 -05:00
parent cb758166fa
commit 84a47db73b
11 changed files with 73 additions and 188 deletions

View File

@@ -1,54 +1,54 @@
#include <tc/core.hpp>
namespace tc {
Cosets<>::Cosets(size_t rank)
Cosets::Cosets(size_t rank)
: _rank(rank), _order(0), _complete(false), _data() {}
void Cosets<>::set(size_t coset, size_t gen, size_t target) {
void Cosets::set(size_t coset, size_t gen, size_t target) {
set(coset * rank() + gen, target);
}
[[nodiscard]] size_t Cosets<>::get(size_t coset, size_t gen) const {
[[nodiscard]] size_t Cosets::get(size_t coset, size_t gen) const {
return get(coset * rank() + gen);
}
[[nodiscard]] bool Cosets<>::isset(size_t coset, size_t gen) const {
[[nodiscard]] bool Cosets::isset(size_t coset, size_t gen) const {
return isset(coset * rank() + gen);
}
[[nodiscard]] size_t Cosets<>::rank() const {
[[nodiscard]] size_t Cosets::rank() const {
return _rank;
}
[[nodiscard]] size_t Cosets<>::order() const {
[[nodiscard]] size_t Cosets::order() const {
return _order;
}
[[nodiscard]] bool Cosets<>::complete() const {
[[nodiscard]] bool Cosets::complete() const {
return _complete;
}
[[nodiscard]] size_t Cosets<>::size() const {
[[nodiscard]] size_t Cosets::size() const {
return _data.size();
}
void Cosets<>::add_row() {
void Cosets::add_row() {
_data.resize(_data.size() + rank(), UNSET);
_order++;
}
void Cosets<>::set(size_t idx, size_t target) {
void Cosets::set(size_t idx, size_t target) {
size_t coset = idx / rank();
size_t gen = idx % rank();
_data[idx] = target;
_data[target * rank() + gen] = coset;
}
[[nodiscard]] size_t Cosets<>::get(size_t idx) const {
[[nodiscard]] size_t Cosets::get(size_t idx) const {
return _data[idx];
}
[[nodiscard]] bool Cosets<>::isset(size_t idx) const {
[[nodiscard]] bool Cosets::isset(size_t idx) const {
return get(idx) != UNSET;
}