Browse Source

src/storage/BitVector: Replaced constant 1 unsigned long long with cast to decltype. This fixes a template resolvation error in std::max.

src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp: Replaced "auto state = 0" with decltype declaration. This solves an issue where state is always signed, but should be unsigned.
src/storage/dft/DFTBuilder.cpp: Added a static_cast to enforce proper conversion to size_t and silence the signed/unsigned comparison warning.


Former-commit-id: 7a1a4c1f45
main
PBerger 9 years ago
parent
commit
67244869db
  1. 2
      src/storage/BitVector.cpp
  2. 4
      src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp
  3. 2
      src/storage/dft/DFTBuilder.cpp

2
src/storage/BitVector.cpp

@ -256,7 +256,7 @@ namespace storm {
void BitVector::enlargeLiberally(uint_fast64_t minimumLength, bool init) {
if(minimumLength > this->size()) {
uint_fast64_t newLength = this->bucketCount();
newLength = std::max(newLength, 1ull) << 6;
newLength = std::max(newLength, static_cast<decltype(newLength)>(1u)) << 6;
while(newLength < minimumLength) {
newLength = newLength << 1;
}

4
src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp

@ -74,7 +74,7 @@ namespace storm {
}
}
for (auto state = 0; state < this->model.getNumberOfStates(); ++state) {
for (decltype(this->model.getNumberOfStates()) state = 0; state < this->model.getNumberOfStates(); ++state) {
updateOrderedQuotientDistributions(state);
}
}
@ -248,7 +248,7 @@ namespace storm {
template<typename ModelType>
bool NondeterministicModelBisimulationDecomposition<ModelType>::checkQuotientDistributions() const {
std::vector<uint_fast64_t> nondeterministicChoiceIndices = this->model.getTransitionMatrix().getRowGroupIndices();
for (auto state = 0; state < this->model.getNumberOfStates(); ++state) {
for (decltype(this->model.getNumberOfStates()) state = 0; state < this->model.getNumberOfStates(); ++state) {
for (auto choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) {
storm::storage::Distribution<ValueType> distribution;
for (auto const& element : this->model.getTransitionMatrix().getRow(choice)) {

2
src/storage/dft/DFTBuilder.cpp

@ -79,7 +79,7 @@ namespace storm {
template<typename ValueType>
unsigned DFTBuilder<ValueType>::computeRank(DFTElementPointer const& elem) {
if(elem->rank() == -1) {
if(elem->rank() == static_cast<decltype(elem->rank())>(-1)) {
if(elem->nrChildren() == 0 || elem->isDependency()) {
elem->setRank(0);
} else {

Loading…
Cancel
Save