diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h index f4ed3244be487f42b04a3b4428bc72d30e51c783..c8d8eff28fe2bdd829f1290cd10e98c8f5e124e2 100644 --- a/src/TNL/Matrices/SparseMatrix.h +++ b/src/TNL/Matrices/SparseMatrix.h @@ -181,7 +181,7 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > * * \param matrix is the source matrix */ - SparseMatrix( const SparseMatrix& matrix1 ) = default; + explicit SparseMatrix( const SparseMatrix& matrix ); /** * \brief Move constructor. diff --git a/src/TNL/Matrices/SparseMatrix.hpp b/src/TNL/Matrices/SparseMatrix.hpp index 33c9296f2e68cc4ae71bdce0ed4956903e0e989a..48269db058e0c16fde07a4b3029758d53fbcd2b6 100644 --- a/src/TNL/Matrices/SparseMatrix.hpp +++ b/src/TNL/Matrices/SparseMatrix.hpp @@ -27,6 +27,24 @@ SparseMatrix( const RealAllocatorType& realAllocator, { } +template< typename Real, + typename Device, + typename Index, + typename MatrixType, + template< typename, typename, typename > class Segments, + typename ComputeReal, + typename RealAllocator, + typename IndexAllocator > +SparseMatrix< Real, Device, Index, MatrixType, Segments, ComputeReal, RealAllocator, IndexAllocator >:: +SparseMatrix( const SparseMatrix& matrix ) +: BaseType( matrix ), + columnIndexes( matrix.columnIndexes ), + segments( matrix.segments ), + indexAllocator( matrix.indexAllocator ), + view( this->getView() ) +{ +} + template< typename Real, typename Device, typename Index,