Browse Source

Cosmetics: Trailing whitespaces, space indentation, ...

main
gereon 12 years ago
parent
commit
6c19ddb877
  1. 6
      src/modelchecker/AbstractModelChecker.h
  2. 2
      src/modelchecker/EigenDtmcPrctlModelChecker.h
  3. 7
      src/parser/AutoParser.h
  4. 114
      src/parser/DeterministicSparseTransitionParser.cpp
  5. 4
      src/storage/SparseMatrix.h

6
src/modelchecker/AbstractModelChecker.h

@ -8,9 +8,11 @@
#ifndef STORM_MODELCHECKER_ABSTRACTMODELCHECKER_H_ #ifndef STORM_MODELCHECKER_ABSTRACTMODELCHECKER_H_
#define STORM_MODELCHECKER_ABSTRACTMODELCHECKER_H_ #define STORM_MODELCHECKER_ABSTRACTMODELCHECKER_H_
namespace storm { namespace modelChecker {
namespace storm {
namespace modelChecker {
template <class Type> class AbstractModelChecker; template <class Type> class AbstractModelChecker;
}}
}
}
#include "src/exceptions/InvalidPropertyException.h" #include "src/exceptions/InvalidPropertyException.h"
#include "src/formula/Formulas.h" #include "src/formula/Formulas.h"

2
src/modelchecker/EigenDtmcPrctlModelChecker.h

@ -123,7 +123,7 @@ private:
LOG4CPLUS_ERROR(logger, "Solving of Submatrix failed: InvalidInput"); LOG4CPLUS_ERROR(logger, "Solving of Submatrix failed: InvalidInput");
} else if(solver.info() == Eigen::ComputationInfo::NoConvergence) { } else if(solver.info() == Eigen::ComputationInfo::NoConvergence) {
// NoConvergence // NoConvergence
throw storm::exceptions::NoConvergenceException() << "Failed to converge within " << solver.iterations() << " out of a maximum of " << solver.maxIterations() << " iterations.";
throw storm::exceptions::NoConvergenceException() << "Failed to converge within " << solver.iterations() << " out of a maximum of " << solver.maxIterations() << " iterations.";
} else if(solver.info() == Eigen::ComputationInfo::NumericalIssue) { } else if(solver.info() == Eigen::ComputationInfo::NumericalIssue) {
// NumericalIssue // NumericalIssue
LOG4CPLUS_ERROR(logger, "Solving of Submatrix failed: NumericalIssue"); LOG4CPLUS_ERROR(logger, "Solving of Submatrix failed: NumericalIssue");

7
src/parser/AutoParser.h

@ -79,8 +79,11 @@ class AutoParser : Parser {
* @brief Returns the type of model that was parsed. * @brief Returns the type of model that was parsed.
*/ */
storm::models::ModelType getType() { storm::models::ModelType getType() {
if (this->model) return this->model->getType();
else return storm::models::Unknown;
if (this->model) {
return this->model->getType();
} else {
return storm::models::Unknown;
}
} }
/*! /*!

114
src/parser/DeterministicSparseTransitionParser.cpp

@ -55,68 +55,68 @@ uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, uint_fas
buf = strchr(buf, '\n') + 1; // skip format hint buf = strchr(buf, '\n') + 1; // skip format hint
} }
/*
* Check all transitions for non-zero diagonal entries and deadlock states.
*/
int_fast64_t lastRow = -1;
uint_fast64_t row, col;
/*
* Check all transitions for non-zero diagonal entries and deadlock states.
*/
int_fast64_t lastRow = -1;
int_fast64_t row, col;
uint_fast64_t readTransitionCount = 0; uint_fast64_t readTransitionCount = 0;
bool rowHadDiagonalEntry = false;
double val;
maxnode = 0;
while (buf[0] != '\0') {
/*
* Read row and column.
*/
row = checked_strtol(buf, &buf);
col = checked_strtol(buf, &buf);
if (!isRewardMatrix) {
if (lastRow != (int_fast64_t)row) {
if ((lastRow != -1) && (!rowHadDiagonalEntry)) {
++nonZeroEntryCount;
rowHadDiagonalEntry = true;
}
for (uint_fast64_t skippedRow = (uint_fast64_t)(lastRow + 1); skippedRow < row; ++skippedRow) {
++nonZeroEntryCount;
}
lastRow = row;
rowHadDiagonalEntry = false;
}
bool rowHadDiagonalEntry = false;
double val;
maxnode = 0;
while (buf[0] != '\0') {
/*
* Read row and column.
*/
row = checked_strtol(buf, &buf);
col = checked_strtol(buf, &buf);
if (col == row) {
rowHadDiagonalEntry = true;
} else if (col > row && !rowHadDiagonalEntry) {
if (!isRewardMatrix) {
if (lastRow != (int_fast64_t)row) {
if ((lastRow != -1) && (!rowHadDiagonalEntry)) {
++nonZeroEntryCount;
rowHadDiagonalEntry = true; rowHadDiagonalEntry = true;
}
for (uint_fast64_t skippedRow = (uint_fast64_t)(lastRow + 1); skippedRow < row; ++skippedRow) {
++nonZeroEntryCount; ++nonZeroEntryCount;
} }
}
/*
* Check if one is larger than the current maximum id.
*/
if (row > maxnode) maxnode = row;
if (col > maxnode) maxnode = col;
/*
* Read probability of this transition.
* Check, if the value is a probability, i.e. if it is between 0 and 1.
*/
val = checked_strtod(buf, &buf);
if ((val < 0.0) || (val > 1.0)) {
LOG4CPLUS_ERROR(logger, "Expected a positive probability but got \"" << val << "\".");
return 0;
}
++nonZeroEntryCount;
++readTransitionCount;
buf = trimWhitespaces(buf);
}
if (!rowHadDiagonalEntry && !isRewardMatrix) {
++nonZeroEntryCount;
}
return nonZeroEntryCount;
lastRow = row;
rowHadDiagonalEntry = false;
}
if (col == row) {
rowHadDiagonalEntry = true;
} else if (col > row && !rowHadDiagonalEntry) {
rowHadDiagonalEntry = true;
++nonZeroEntryCount;
}
}
/*
* Check if one is larger than the current maximum id.
*/
if (row > maxnode) maxnode = row;
if (col > maxnode) maxnode = col;
/*
* Read probability of this transition.
* Check, if the value is a probability, i.e. if it is between 0 and 1.
*/
val = checked_strtod(buf, &buf);
if ((val < 0.0) || (val > 1.0)) {
LOG4CPLUS_ERROR(logger, "Expected a positive probability but got \"" << val << "\".");
return 0;
}
++nonZeroEntryCount;
++readTransitionCount;
buf = trimWhitespaces(buf);
}
if (!rowHadDiagonalEntry && !isRewardMatrix) {
++nonZeroEntryCount;
}
return nonZeroEntryCount;
} }

4
src/storage/SparseMatrix.h

@ -26,10 +26,10 @@ extern log4cplus::Logger logger;
// Forward declaration for adapter classes. // Forward declaration for adapter classes.
namespace storm { namespace storm {
namespace adapters{
namespace adapters {
class GmmxxAdapter; class GmmxxAdapter;
class EigenAdapter; class EigenAdapter;
class StormAdapter;
class StormAdapter
} }
} }

Loading…
Cancel
Save