]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move allocation of vectors outside the loop.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 17 Jan 2000 14:34:05 +0000 (14:34 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 17 Jan 2000 14:34:05 +0000 (14:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@2234 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_vanka.templates.h

index 4f8de920fbd32fdffeea0c7679bec803f8213c22..d6f538c4740be349a0143c3c29dd997dd4fada62 100644 (file)
@@ -53,7 +53,9 @@ SparseVanka<number>::operator ()(Vector<number2>       &dst,
     = matrix->get_sparsity_pattern();
                                   // space to be used for local systems
   FullMatrix<float> local_matrix;
-
+  Vector<float> b;
+  Vector<float> x;
+  
                                   // traverse all rows of the matrix
   for (unsigned int row=0; row< matrix->m() ; ++row)
     {
@@ -93,8 +95,8 @@ SparseVanka<number>::operator ()(Vector<number2>       &dst,
        if (build_matrix)
          inverses[row]->reinit (row_length, row_length);
       
-      Vector<float> b(row_length);
-      Vector<float> x(row_length);
+      b.reinit (row_length);
+      x.reinit (row_length);
 
                                       // mapping between:
                                       // 1 column number of all

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.