Browse Source

experimented with custom style checker, fixed a few minor issues

tempestpy_adaptions
gereon 12 years ago
parent
commit
facec2b040
  1. 18
      src/models/AbstractModel.cpp
  2. 2
      src/parser/AtomicPropositionLabelingParser.h
  3. 2
      src/parser/SparseStateRewardParser.h
  4. 8
      src/storage/BitVector.h
  5. 27
      src/storage/SparseMatrix.h
  6. 8
      src/utility/Settings.h

18
src/models/AbstractModel.cpp

@ -13,13 +13,13 @@
* @return Output stream os.
*/
std::ostream& storm::models::operator<<(std::ostream& os, storm::models::ModelType const type) {
switch (type) {
case storm::models::Unknown: os << "Unknown"; break;
case storm::models::DTMC: os << "DTMC"; break;
case storm::models::CTMC: os << "CTMC"; break;
case storm::models::MDP: os << "MDP"; break;
case storm::models::CTMDP: os << "CTMDP"; break;
default: os << "Invalid ModelType"; break;
}
return os;
switch (type) {
case storm::models::Unknown: os << "Unknown"; break;
case storm::models::DTMC: os << "DTMC"; break;
case storm::models::CTMC: os << "CTMC"; break;
case storm::models::MDP: os << "MDP"; break;
case storm::models::CTMDP: os << "CTMDP"; break;
default: os << "Invalid ModelType"; break;
}
return os;
}

2
src/parser/AtomicPropositionLabelingParser.h

@ -24,7 +24,7 @@ class AtomicPropositionLabelingParser : Parser {
std::shared_ptr<storm::models::AtomicPropositionsLabeling> getLabeling() {
return this->labeling;
}
private:
std::shared_ptr<storm::models::AtomicPropositionsLabeling> labeling;
};

2
src/parser/SparseStateRewardParser.h

@ -20,7 +20,7 @@ class SparseStateRewardParser : Parser {
std::shared_ptr<std::vector<double>> getStateRewards() {
return this->stateRewards;
}
private:
std::shared_ptr<std::vector<double>> stateRewards;
};

8
src/storage/BitVector.h

@ -69,13 +69,17 @@ public:
* Returns the index of the current bit that is set to true.
* @return The index of the current bit that is set to true.
*/
uint_fast64_t operator*() const { return currentIndex; }
uint_fast64_t operator*() const {
return currentIndex;
}
/*!
* Compares the iterator with another iterator to determine whether
* the iteration process has reached the end.
*/
bool operator!=(const constIndexIterator& rhs) const { return currentIndex != rhs.currentIndex; }
bool operator!=(const constIndexIterator& rhs) const {
return currentIndex != rhs.currentIndex;
}
private:
/*! The bit vector to search for set bits. */

27
src/storage/SparseMatrix.h

@ -25,10 +25,13 @@
extern log4cplus::Logger logger;
// Forward declaration for adapter classes.
namespace storm { namespace adapters{ class GmmxxAdapter; } }
namespace storm {
namespace adapters{
class GmmxxAdapter;
}
}
namespace storm {
namespace storage {
/*!
@ -49,7 +52,7 @@ public:
* a row, we can simply iterate over the array (part) itself.
*/
typedef const uint_fast64_t * const constIndexIterator;
/*!
* Iterator type if we want to iterate over elements.
*/
@ -91,7 +94,8 @@ public:
* Constructs a square sparse matrix object with the given number rows
* @param size The number of rows and cols in the matrix
*/
SparseMatrix(uint_fast64_t size) : rowCount(size), colCount(size), nonZeroEntryCount(0),
SparseMatrix(uint_fast64_t size)
: rowCount(size), colCount(size), nonZeroEntryCount(0),
internalStatus(MatrixStatus::UnInitialized), currentSize(0), lastRow(0) { }
//! Copy Constructor
@ -208,7 +212,7 @@ public:
// Try to prepare the internal storage and throw an error in case of
// failure.
// Get necessary pointers to the contents of the Eigen matrix.
const T* valuePtr = eigenSparseMatrix.valuePtr();
const _Index* indexPtr = eigenSparseMatrix.innerIndexPtr();
@ -318,7 +322,6 @@ public:
throw storm::exceptions::OutOfRangeException("Trying to add a value at illegal position.");
}
// If we switched to another row, we have to adjust the missing
// entries in the row_indications array.
if (row != lastRow) {
@ -415,8 +418,8 @@ public:
/*!
* Gets the matrix element at the given row and column to the given value.
* NOTE: This function does not check the internal status for errors for performance reasons.
* WARNING: It is possible to modify through this function. Usage only valid
* for elements EXISTING in the sparse matrix! If the requested value does not exist,
* WARNING: It is possible to modify through this function. Usage only valid
* for elements EXISTING in the sparse matrix! If the requested value does not exist,
* an exception will be thrown.
* @param row The row in which the element is to be read.
* @param col The column in which the element is to be read.
@ -917,7 +920,7 @@ public:
constIndexIterator endConstColumnIterator(uint_fast64_t row) const {
return &(this->columnIndications[0]) + this->rowIndications[row + 1];
}
/*!
* Returns an iterator over the elements of the given row. The iterator
* will include no zero entries.
@ -937,7 +940,7 @@ public:
constIterator endConstIterator(uint_fast64_t row) const {
return &(this->valueStorage[0]) + this->rowIndications[row + 1];
}
/*!
* @brief Calculate sum of all entries in given row.
*
@ -953,7 +956,7 @@ public:
}
return sum;
}
/*!
* @brief Checks if it is a submatrix of the given matrix.
*
@ -1042,7 +1045,7 @@ private:
setState(MatrixStatus::Error);
}
/*!
/*!
* Sets the internal status to the given state if the current state is not
* the error state.
* @param new_state The new state to be switched to.

8
src/utility/Settings.h

@ -57,19 +57,19 @@ namespace settings {
}
/*!
* @brief Get value of string option
* @brief Get value of string option.
*/
inline const std::string& getString(std::string const & name) const {
return this->get<std::string>(name);
}
/*!
* @brief Check if an option is set
* @brief Check if an option is set.
*/
inline const bool isSet(std::string const & name) const {
return this->vm.count(name) > 0;
}
/*!
* @brief Register a new module.
*
@ -118,7 +118,7 @@ namespace settings {
// Store module.
Settings::modules[ trigger ] = desc;
}
friend std::ostream& help(std::ostream& os);
friend std::ostream& helpConfigfile(std::ostream& os);
friend Settings* instance();

Loading…
Cancel
Save