Browse Source

Started to rework the interface of the sparse matrix class.

Former-commit-id: 6ae2699da6
tempestpy_adaptions
dehnert 11 years ago
parent
commit
8a47d03cf7
  1. 2
      src/solver/GmmxxLinearEquationSolver.h
  2. 18
      src/storage/SparseMatrix.cpp
  3. 1555
      src/storage/SparseMatrix.h
  4. 4
      src/utility/vector.h

2
src/solver/GmmxxLinearEquationSolver.h

@ -205,7 +205,7 @@ namespace storm {
bool relative = s->getOptionByLongName("relative").getArgument(0).getValueAsBoolean();
// Get a Jacobi decomposition of the matrix A.
typename storm::storage::SparseMatrix<Type>::SparseJacobiDecomposition_t jacobiDecomposition = A.getJacobiDecomposition();
std::pair<storm::storage::SparseMatrix<Type>, storm::storage::SparseMatrix<Type>> jacobiDecomposition = A.getJacobiDecomposition();
// Convert the (inverted) diagonal matrix to gmm++'s format.
gmm::csr_matrix<Type>* gmmxxDiagonalInverted = storm::adapters::GmmxxAdapter::toGmmxxSparseMatrix<Type>(std::move(jacobiDecomposition.second));

18
src/storage/SparseMatrix.cpp

@ -8,9 +8,12 @@
#include <iomanip>
#include <boost/functional/hash.hpp>
#include "gmm/gmm_matrix.h"
#include "src/storage/SparseMatrix.h"
#include "src/exceptions/InvalidStateException.h"
#include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h"
extern log4cplus::Logger logger;
namespace storm {
namespace storage {
@ -805,7 +808,7 @@ namespace storage {
}
template<typename T>
typename SparseMatrix<T>::SparseJacobiDecomposition_t SparseMatrix<T>::getJacobiDecomposition() const {
typename std::pair<storm::storage::SparseMatrix<T>, storm::storage::SparseMatrix<T>> SparseMatrix<T>::getJacobiDecomposition() const {
uint_fast64_t rowCount = this->getRowCount();
uint_fast64_t colCount = this->getColumnCount();
if (rowCount != colCount) {
@ -990,15 +993,6 @@ namespace storage {
return true;
}
template<typename T>
std::string SparseMatrix<T>::toStringCompressed() const {
std::stringstream result;
result << rowIndications << std::endl;
result << columnIndications << std::endl;
result << valueStorage << std::endl;
return result.str();
}
template<typename T>
std::string SparseMatrix<T>::toString(std::vector<uint_fast64_t> const* rowGroupIndices) const {
std::stringstream result;

1555
src/storage/SparseMatrix.h
File diff suppressed because it is too large
View File

4
src/utility/vector.h

@ -7,6 +7,10 @@
#include <algorithm>
#include <functional>
#include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h"
extern log4cplus::Logger logger;
namespace storm {
namespace utility {
namespace vector {

Loading…
Cancel
Save