diff --git a/src_comb/Boost_bitset.h b/src_comb/Boost_bitset.h index f9979db..eae4ac4 100644 --- a/src_comb/Boost_bitset.h +++ b/src_comb/Boost_bitset.h @@ -9,17 +9,6 @@ #include #include -template std::vector FaceToVector(Face const &eSet) { - size_t nbVert = eSet.count(); - std::vector eList(nbVert); - boost::dynamic_bitset<>::size_type aRow = eSet.find_first(); - for (size_t i = 0; i < nbVert; i++) { - eList[i] = static_cast(aRow); - aRow = eSet.find_next(aRow); - } - return eList; -} - std::vector FaceTo01vector(Face const &eSet) { size_t nbVert = eSet.size(); size_t siz = eSet.count(); diff --git a/src_comb/Boost_bitset_kernel.h b/src_comb/Boost_bitset_kernel.h index de84df1..e370f59 100644 --- a/src_comb/Boost_bitset_kernel.h +++ b/src_comb/Boost_bitset_kernel.h @@ -380,6 +380,38 @@ vectface sort_vectface(vectface const &vf) { vectface unicize_vectface(vectface const &vf) { return sort_vectface(vf); } +template std::vector FaceToVector(Face const &eSet) { + size_t nbVert = eSet.count(); + std::vector eList(nbVert); + boost::dynamic_bitset<>::size_type aRow = eSet.find_first(); + for (size_t i = 0; i < nbVert; i++) { + eList[i] = static_cast(aRow); + aRow = eSet.find_next(aRow); + } + return eList; +} + +void WriteVectfaceGAP(std::ostream& os, vectface const& vf) { + bool IsFirst = true; + os << "["; + for (auto &trig : vf) { + if (!IsFirst) { + os << ",\n"; + } + IsFirst = false; + std::vector eList = FaceToVector(trig); + os << StringStdVectorGAP(eList); + } + os << "]"; +} + +std::string StringVectfaceGAP(vectface const& vf) { + std::ostringstream os; + WriteVectfaceGAP(os, vf); + return os.str(); +} + + /* template<> void std::swap(Face & x, Face & y)