From 51a5012dba705b4b819b8d697a0f0907c6a04293 Mon Sep 17 00:00:00 2001 From: gereon Date: Wed, 6 Feb 2013 12:56:07 +0100 Subject: [PATCH 1/2] fixed warnings in SparseMatrix --- src/storage/SparseMatrix.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/storage/SparseMatrix.h b/src/storage/SparseMatrix.h index 90807f1bc..4127b76e1 100644 --- a/src/storage/SparseMatrix.h +++ b/src/storage/SparseMatrix.h @@ -197,18 +197,18 @@ public: throw storm::exceptions::InvalidArgumentException("Trying to initialize from an Eigen matrix that is not in compressed form."); } - if (eigenSparseMatrix.rows() > this->rowCount) { + if ((uint_fast64_t)eigenSparseMatrix.rows() > this->rowCount) { triggerErrorState(); LOG4CPLUS_ERROR(logger, "Trying to initialize from an Eigen matrix that has more rows than the target matrix."); throw storm::exceptions::InvalidArgumentException("Trying to initialize from an Eigen matrix that has more rows than the target matrix."); } - if (eigenSparseMatrix.cols() > this->colCount) { + if ((uint_fast64_t)eigenSparseMatrix.cols() > this->colCount) { triggerErrorState(); LOG4CPLUS_ERROR(logger, "Trying to initialize from an Eigen matrix that has more columns than the target matrix."); throw storm::exceptions::InvalidArgumentException("Trying to initialize from an Eigen matrix that has more columns than the target matrix."); } - const _Index entryCount = eigenSparseMatrix.nonZeros(); + const uint_fast64_t entryCount = eigenSparseMatrix.nonZeros(); nonZeroEntryCount = entryCount; lastRow = 0; @@ -232,7 +232,7 @@ public: LOG4CPLUS_ERROR(logger, "Unable to allocate internal storage."); throw std::bad_alloc(); } else { - if ((eigenSparseMatrix.innerSize() > nonZeroEntryCount) || (entryCount > nonZeroEntryCount)) { + if (((uint_fast64_t)eigenSparseMatrix.innerSize() > nonZeroEntryCount) || (entryCount > nonZeroEntryCount)) { triggerErrorState(); LOG4CPLUS_ERROR(logger, "Invalid internal composition of Eigen Sparse Matrix"); throw storm::exceptions::InvalidArgumentException("Invalid internal composition of Eigen Sparse Matrix"); @@ -278,7 +278,7 @@ public: // Now copy the elements. As the matrix is in ColMajor format, // we need to iterate over the columns to find the next non-zero // entry. - int i = 0; + uint_fast64_t i = 0; int currentRow = 0; int currentColumn = 0; while (i < entryCount) { From 10e25fbd6173e1238429316de1a3eef54ec8f9d5 Mon Sep 17 00:00:00 2001 From: gereon Date: Wed, 6 Feb 2013 12:59:01 +0100 Subject: [PATCH 2/2] fixed warnings in ParseMdpTest --- test/parser/ParseMdpTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parser/ParseMdpTest.cpp b/test/parser/ParseMdpTest.cpp index cfa50f1c7..53100426b 100644 --- a/test/parser/ParseMdpTest.cpp +++ b/test/parser/ParseMdpTest.cpp @@ -20,10 +20,10 @@ TEST(ParseMdpTest, parseAndOutput) { std::shared_ptr> mdp = mdpParser->getMdp(); std::shared_ptr> matrix = mdp->getTransitionProbabilityMatrix(); - ASSERT_EQ(mdp->getNumberOfStates(), 3); - ASSERT_EQ(mdp->getNumberOfTransitions(), 11); - ASSERT_EQ(matrix->getRowCount(), 2 * 3); - ASSERT_EQ(matrix->getColumnCount(), 3); + ASSERT_EQ(mdp->getNumberOfStates(), (uint_fast64_t)3); + ASSERT_EQ(mdp->getNumberOfTransitions(), (uint_fast64_t)11); + ASSERT_EQ(matrix->getRowCount(), (uint_fast64_t)2 * 3); + ASSERT_EQ(matrix->getColumnCount(), (uint_fast64_t)3); delete mdpParser;