|
|
@ -180,20 +180,29 @@ namespace storm { |
|
|
|
std::vector<std::vector<size_t>> DFT<ValueType>::findSymmetries(DFTColouring<ValueType> const& colouring) const { |
|
|
|
std::vector<size_t> vec; |
|
|
|
vec.reserve(nrElements()); |
|
|
|
storm::utility::iota_n(std::back_inserter(vec), 14, 0); |
|
|
|
storm::utility::iota_n(std::back_inserter(vec), nrElements(), 0); |
|
|
|
BijectionCandidates<ValueType> completeCategories = colouring.colourSubdft(vec); |
|
|
|
std::vector<std::vector<size_t>> res; |
|
|
|
|
|
|
|
for(auto const& colourClass : completeCategories.gateCandidates) { |
|
|
|
if(colourClass.second.size() > 1) { |
|
|
|
std::vector<size_t> handledWithinClass; |
|
|
|
for(auto it1 = colourClass.second.cbegin(); it1 != colourClass.second.cend(); ++it1) { |
|
|
|
if(!getGate(*it1)->hasOnlyStaticParents()) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
std::vector<size_t> sortedParent1Ids = getGate(*it1)->parentIds(); |
|
|
|
std::sort(sortedParent1Ids.begin(), sortedParent1Ids.end()); |
|
|
|
auto it2 = it1; |
|
|
|
for(++it2; it2 != colourClass.second.cend(); ++it2) { |
|
|
|
if(!getGate(*it2)->hasOnlyStaticParents()) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
std::vector<size_t> sortedParent2Ids = getGate(*it2)->parentIds(); |
|
|
|
std::sort(sortedParent2Ids.begin(), sortedParent2Ids.end()); |
|
|
|
if(sortedParent1Ids == sortedParent2Ids) { |
|
|
|
std::cout << "Considering ids " << *it1 << ", " << *it2 << " for isomorphism." << std::endl; |
|
|
|
bool isSymmetry = false; |
|
|
|
std::vector<size_t> isubdft1 = getGate(*it1)->independentSubDft(); |
|
|
|
std::vector<size_t> isubdft2 = getGate(*it2)->independentSubDft(); |
|
|
|
if(!isubdft1.empty() && !isubdft2.empty() && isubdft1.size() == isubdft2.size()) { |
|
|
@ -201,7 +210,11 @@ namespace storm { |
|
|
|
auto LHS = colouring.colourSubdft(isubdft1); |
|
|
|
auto RHS = colouring.colourSubdft(isubdft2); |
|
|
|
auto IsoCheck = DFTIsomorphismCheck<ValueType>(LHS, RHS, *this); |
|
|
|
IsoCheck.findIsomorphism(); |
|
|
|
isSymmetry = IsoCheck.findIsomorphism(); |
|
|
|
} |
|
|
|
if(isSymmetry) { |
|
|
|
std::cout << "subdfts are symmetric" << std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|