From: bangerth Date: Wed, 27 Aug 2008 21:31:45 +0000 (+0000) Subject: Implement a copy_from function. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=949f8f4b82eb1af3f53b15626056d7c08056f9c5;p=dealii-svn.git Implement a copy_from function. git-svn-id: https://svn.dealii.org/trunk@16678 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/trilinos_sparse_matrix.h b/deal.II/lac/include/lac/trilinos_sparse_matrix.h index 1e15b143fd..14ba1f4784 100755 --- a/deal.II/lac/include/lac/trilinos_sparse_matrix.h +++ b/deal.II/lac/include/lac/trilinos_sparse_matrix.h @@ -414,6 +414,16 @@ namespace TrilinosWrappers */ virtual ~SparseMatrix (); + /** + * Copy the given matrix to this + * one. + * + * The function returns a reference to + * *this. + */ + SparseMatrix & + copy_from (const SparseMatrix &source); + /** * This function initializes the * Trilinos matrix with a deal.II diff --git a/deal.II/lac/source/trilinos_sparse_matrix.cc b/deal.II/lac/source/trilinos_sparse_matrix.cc index 0c4b9ccdbf..e04d300dbd 100755 --- a/deal.II/lac/source/trilinos_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_sparse_matrix.cc @@ -146,6 +146,15 @@ namespace TrilinosWrappers + SparseMatrix & + SparseMatrix::copy_from (const SparseMatrix &m) + { + *matrix = *m.matrix; + return *this; + } + + + void SparseMatrix::reinit (const SparsityPattern &sparsity_pattern) {