Browse Source

permutation of items

tempestpy_adaptions
Sebastian Junges 5 years ago
parent
commit
340be99e78
  1. 11
      src/storm/models/sparse/ItemLabeling.cpp
  2. 2
      src/storm/models/sparse/ItemLabeling.h

11
src/storm/models/sparse/ItemLabeling.cpp

@ -93,6 +93,17 @@ namespace storm {
return result;
}
void ItemLabeling::permuteItems(std::vector<uint64_t> const& inversePermutation) {
STORM_LOG_THROW(inversePermutation.size() == itemCount, storm::exceptions::InvalidArgumentException, "Permutation does not match number of items");
std::vector<storm::storage::BitVector> newLabelings;
for (storm::storage::BitVector const& source : this->labelings) {
newLabelings.push_back(source.permute(inversePermutation));
}
this->labelings = newLabelings;
}
void ItemLabeling::addLabel(std::string const& label, storage::BitVector const& labeling) {
STORM_LOG_THROW(!this->containsLabel(label), storm::exceptions::InvalidArgumentException, "Label '" << label << "' already exists.");
STORM_LOG_THROW(labeling.size() == itemCount, storm::exceptions::InvalidArgumentException, "Labeling vector has invalid size. Expected: " << itemCount << " Actual: " << labeling.size());

2
src/storm/models/sparse/ItemLabeling.h

@ -113,8 +113,8 @@ namespace storm {
*/
std::size_t getNumberOfItems() const;
void permuteItems(std::vector<uint64_t> const& inversePermutation);
/*!
* Prints information about the labeling to the specified stream.
*

Loading…
Cancel
Save