]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Added a copy constructor to the Trilinos sparse matrix class.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Sep 2008 16:05:24 +0000 (16:05 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Sep 2008 16:05:24 +0000 (16:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@17031 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/trilinos_sparse_matrix.h
deal.II/lac/source/trilinos_sparse_matrix.cc

index 3ea0425fa3b177691830ca21260d9ec080e378f7..9ecf706bdfccd26a2bdfb8a90cc743196c85e032 100755 (executable)
@@ -442,6 +442,15 @@ namespace TrilinosWrappers
                    const Epetra_Map                &InputColMap,
                    const std::vector<unsigned int> &n_entries_per_row);
 
+                                       /**
+                                        * Copy constructor. Sets the
+                                        * calling matrix to be the same
+                                        * as the input matrix, i.e.,
+                                        * using the same sparsity
+                                        * pattern and entries.
+                                        */
+      SparseMatrix (const SparseMatrix &InputMatrix);
+
                                        /**
                                         * Destructor. Made virtual so
                                         * that one can use pointers to
index 9e3ef01181fdf462a5c1c947d763047a8ba34cf7..eeabeb3c0dea6b12b5cd69c1d58eb7aecbaf8838 100755 (executable)
@@ -142,6 +142,17 @@ namespace TrilinosWrappers
                                            false)))
   {}
 
+  SparseMatrix::SparseMatrix (const SparseMatrix &InputMatrix)
+                 :
+                  Subscriptor(),
+                  row_map (InputMatrix.row_map),
+                 col_map (InputMatrix.col_map),
+                 last_action (Zero),
+                 compressed (true),
+                 matrix (std::auto_ptr<Epetra_FECrsMatrix>
+                         (new Epetra_FECrsMatrix(*InputMatrix.matrix)))
+  {}
+
 
 
   SparseMatrix::~SparseMatrix ()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.