Skip to content

Commit

Permalink
Some small restructuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuDutSik committed Sep 21, 2024
1 parent f8d9411 commit 7662a1a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src_comb/Boost_bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
#include <string>
#include <vector>

template <typename Tidx> std::vector<Tidx> FaceToVector(Face const &eSet) {
size_t nbVert = eSet.count();
std::vector<Tidx> eList(nbVert);
boost::dynamic_bitset<>::size_type aRow = eSet.find_first();
for (size_t i = 0; i < nbVert; i++) {
eList[i] = static_cast<Tidx>(aRow);
aRow = eSet.find_next(aRow);
}
return eList;
}

std::vector<int> FaceTo01vector(Face const &eSet) {
size_t nbVert = eSet.size();
size_t siz = eSet.count();
Expand Down
32 changes: 32 additions & 0 deletions src_comb/Boost_bitset_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,38 @@ vectface sort_vectface(vectface const &vf) {

vectface unicize_vectface(vectface const &vf) { return sort_vectface(vf); }

template <typename Tidx> std::vector<Tidx> FaceToVector(Face const &eSet) {
size_t nbVert = eSet.count();
std::vector<Tidx> eList(nbVert);
boost::dynamic_bitset<>::size_type aRow = eSet.find_first();
for (size_t i = 0; i < nbVert; i++) {
eList[i] = static_cast<Tidx>(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<size_t> eList = FaceToVector<size_t>(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)
Expand Down

0 comments on commit 7662a1a

Please sign in to comment.