remove broken flipping mechanics

This commit is contained in:
2020-06-28 15:07:10 -04:00
parent 9ff1dda9df
commit dfea554289

View File

@@ -28,15 +28,10 @@ struct Primitive {
~Primitive() = default;
inline void flip() {
if (N > 1) std::swap(inds[0], inds[1]);
}
void apply(const tc::Cosets &table, int gen) {
for (auto &ind : inds) {
ind = table.get(ind, gen);
}
flip();
}
};
@@ -74,28 +69,6 @@ std::vector<int> recontext_gens(
return s_sg_gens;
}
/**
* Determine whether the orientation of the group sg_gens is reversed from the group g_gens within group context
*/
int get_parity(
const tc::Group &context,
const std::vector<int> &g_gens,
const std::vector<int> &sg_gens
) {
if (g_gens.size() != sg_gens.size() + 1) return 0;
const auto proper_sg_gens = recontext_gens(context, g_gens, sg_gens);
int i = 0;
for (; i < sg_gens.size(); ++i) {
if (proper_sg_gens[i] != i) {
break;
}
}
return i & 1;
}
/**
* Solve the cosets generated by sg_gens within the subgroup generated by g_gens of the group context
*/
@@ -119,16 +92,6 @@ std::vector<Primitive<N>> apply(std::vector<Primitive<N>> prims, const tc::Coset
return prims;
}
/**
* Reverse the orientation of all primitives in this mesh.
*/
template<unsigned N>
void flip(std::vector<Primitive<N>> prims) {
for (auto &prim : prims) {
prim.flip();
}
}
/**
* Convert the indexes of this mesh to those of a different context, using g_gens to build the parent context and sg_gens to build this context.
*/
@@ -155,9 +118,6 @@ std::vector<Primitive<N>> recontext(
}
}
if (get_parity(context, g_gens, sg_gens) == 1)
flip(res);
return res;
}