Browse Source

Removed illegal typename keywords in SparseMatrix.cpp.

Refactored the constexpr in the AutoParser.
@CDehnert: SparseMatrix Lines 59 to 65 - that cant be right.


Former-commit-id: 21c458604c
tempestpy_adaptions
PBerger 10 years ago
parent
commit
2757dd31e2
  1. 12
      src/parser/AutoParser.cpp
  2. 4
      src/parser/AutoParser.h
  3. 10
      src/storage/SparseMatrix.cpp

12
src/parser/AutoParser.cpp

@ -76,18 +76,18 @@ namespace storm {
// Open the file.
MappedFile file(filename.c_str());
LOG_THROW(file.getDataSize() >= hintLength, storm::exceptions::WrongFormatException, "File too short to be readable.");
LOG_THROW(file.getDataSize() >= STORM_PARSER_AUTOPARSER_HINT_LENGTH, storm::exceptions::WrongFormatException, "File too short to be readable.");
char const* fileData = file.getData();
char filehintBuffer[hintLength + 1];
memcpy(filehintBuffer, fileData, hintLength);
filehintBuffer[hintLength] = 0;
char filehintBuffer[STORM_PARSER_AUTOPARSER_HINT_LENGTH + 1];
memcpy(filehintBuffer, fileData, STORM_PARSER_AUTOPARSER_HINT_LENGTH);
filehintBuffer[STORM_PARSER_AUTOPARSER_HINT_LENGTH] = 0;
// Find and read in the hint.
std::string formatString = "%" + std::to_string(hintLength) + "s";
std::string formatString = "%" + std::to_string(STORM_PARSER_AUTOPARSER_HINT_LENGTH) + "s";
char hint[5];
#ifdef WINDOWS
sscanf_s(filehintBuffer, formatString.c_str(), hint, hintLength + 1);
sscanf_s(filehintBuffer, formatString.c_str(), hint, STORM_PARSER_AUTOPARSER_HINT_LENGTH + 1);
#else
int ret = sscanf(filehintBuffer, formatString.c_str(), hint);
#endif

4
src/parser/AutoParser.h

@ -5,6 +5,8 @@
#include <string>
#define STORM_PARSER_AUTOPARSER_HINT_LENGTH (10ull)
namespace storm {
/*!
@ -48,7 +50,7 @@ namespace storm {
private:
// Define the maximal length of a hint in the file.
static constexpr uint_fast64_t hintLength = 10;
static uint_fast64_t hintLength;
/*!
* Opens the given file and parses the file format hint.

10
src/storage/SparseMatrix.cpp

@ -749,9 +749,9 @@ namespace storm {
void SparseMatrix<ValueType>::multiplyWithVectorSequential(std::vector<ValueType> const& vector, std::vector<ValueType>& result) const {
const_iterator it = this->begin();
const_iterator ite;
typename std::vector<index_type>::const_iterator rowIterator = rowIndications.begin();
typename std::vector<ValueType>::iterator resultIterator = result.begin();
typename std::vector<ValueType>::iterator resultIteratorEnd = result.end();
std::vector<index_type>::const_iterator rowIterator = rowIndications.begin();
std::vector<ValueType>::iterator resultIterator = result.begin();
std::vector<ValueType>::iterator resultIteratorEnd = result.end();
for (; resultIterator != resultIteratorEnd; ++rowIterator, ++resultIterator) {
*resultIterator = storm::utility::constantZero<ValueType>();
@ -773,8 +773,8 @@ namespace storm {
const_iterator ite;
std::vector<index_type>::const_iterator rowIterator = this->rowIndications.begin() + startRow;
std::vector<index_type>::const_iterator rowIteratorEnd = this->rowIndications.begin() + endRow;
typename std::vector<ValueType>::iterator resultIterator = result.begin() + startRow;
typename std::vector<ValueType>::iterator resultIteratorEnd = result.begin() + endRow;
std::vector<ValueType>::iterator resultIterator = result.begin() + startRow;
std::vector<ValueType>::iterator resultIteratorEnd = result.begin() + endRow;
for (; resultIterator != resultIteratorEnd; ++rowIterator, ++resultIterator) {
*resultIterator = storm::utility::constantZero<ValueType>();

Loading…
Cancel
Save