diff --git a/src/models/AbstractModel.h b/src/models/AbstractModel.h index 2bec382c8..bd3583739 100644 --- a/src/models/AbstractModel.h +++ b/src/models/AbstractModel.h @@ -35,6 +35,18 @@ template class AbstractModel: public std::enable_shared_from_this> { 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 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 diff --git a/src/models/Ctmc.h b/src/models/Ctmc.h index bd1ef5c42..9c70b7416 100644 --- a/src/models/Ctmc.h +++ b/src/models/Ctmc.h @@ -53,7 +53,6 @@ public: : AbstractDeterministicModel(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. diff --git a/src/models/Ctmdp.h b/src/models/Ctmdp.h index 70b6dcbe8..64bb267ac 100644 --- a/src/models/Ctmdp.h +++ b/src/models/Ctmdp.h @@ -92,7 +92,6 @@ public: } } - //! Destructor /*! * Destructor. */ diff --git a/src/models/Mdp.h b/src/models/Mdp.h index e826db108..48a651e6d 100644 --- a/src/models/Mdp.h +++ b/src/models/Mdp.h @@ -94,7 +94,6 @@ public: } } - //! Destructor /*! * Destructor. */ diff --git a/src/storage/SparseMatrix.h b/src/storage/SparseMatrix.h index 3c768c60a..04fa0d4a7 100644 --- a/src/storage/SparseMatrix.h +++ b/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.