Browse Source

Fixed/added missing Copy Constructors for Models and the SparseMatrix

Former-commit-id: 730eaae49f
tempestpy_adaptions
PBerger 12 years ago
parent
commit
d596f126b2
  1. 12
      src/models/AbstractModel.h
  2. 1
      src/models/Ctmc.h
  3. 1
      src/models/Ctmdp.h
  4. 1
      src/models/Mdp.h
  5. 12
      src/storage/SparseMatrix.h

12
src/models/AbstractModel.h

@ -35,6 +35,18 @@ template<class T>
class AbstractModel: public std::enable_shared_from_this<AbstractModel<T>> {
public:
/*! Copy Constructor for an abstract model from the given transition matrix and
* the given labeling of the states. Creates copies of all given references.
* @param other The Source Abstract Model
*/
AbstractModel(AbstractModel<T> const& other)
: transitionMatrix(other.transitionMatrix),
stateLabeling(other.stateLabeling),
stateRewardVector(other.stateRewardVector),
transitionRewardMatrix(other.transitionRewardMatrix) {
// Intentionally left empty.
}
/*! Move Constructor for an abstract model from the given transition matrix and
* the given labeling of the states. Creates copies of all given references.
* @param other The Source Abstract Model

1
src/models/Ctmc.h

@ -53,7 +53,6 @@ public:
: AbstractDeterministicModel<T>(rateMatrix, stateLabeling, optionalStateRewardVector, optionalTransitionRewardMatrix) {
}
//! Copy Constructor
/*!
* Copy Constructor. Performs a deep copy of the given CTMC.
* @param ctmc A reference to the CTMC that is to be copied.

1
src/models/Ctmdp.h

@ -92,7 +92,6 @@ public:
}
}
//! Destructor
/*!
* Destructor.
*/

1
src/models/Mdp.h

@ -94,7 +94,6 @@ public:
}
}
//! Destructor
/*!
* Destructor.
*/

12
src/storage/SparseMatrix.h

@ -243,6 +243,18 @@ public:
other.currentSize = 0;
other.lastRow = 0;
}
/*!
* Copy Constructor.
*
* @param other The Matrix from which to copy the content
*/
SparseMatrix(SparseMatrix const& other)
: rowCount(other.rowCount), colCount(other.colCount), nonZeroEntryCount(other.nonZeroEntryCount),
internalStatus(other.internalStatus), currentSize(other.currentSize),
valueStorage(other.valueStorage), columnIndications(other.columnIndications),
rowIndications(other.rowIndications), lastRow(other.lastRow) {
}
/*!
* Constructs a sparse matrix object with the given (moved) contents.

Loading…
Cancel
Save