]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Move fully specialized templates to the .cc file.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Nov 2001 16:25:00 +0000 (16:25 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Nov 2001 16:25:00 +0000 (16:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@5247 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/filtered_matrix.templates.h
deal.II/lac/source/filtered_matrix.cc

index 7b59c9c662a46f42df95957d6bf7d00bcfd371f0..166c88dd4d0afa08399b99d81ad7ee5333ba7e1a 100644 (file)
@@ -141,78 +141,6 @@ apply_constraints (Vector     &v,
 
 
 
-template <>
-void
-FilteredMatrix<SparseMatrix<double>,Vector<double> >::
-get_column_entries (const unsigned int           index,
-                   std::vector<IndexValuePair> &column_entries,
-                   const bool                   matrix_is_symmetric) const
-{
-                                  // depending on whether the matrix
-                                  // can be assumed symmetric or not,
-                                  // either use a fast or a slow
-                                  // algorithm
-  if (matrix_is_symmetric == true)
-                                    // ok, matrix is symmetric. we
-                                    // may determine the matrix
-                                    // entries in this column by
-                                    // looking at the matrix entries
-                                    // in this row which is
-                                    // significantly faster since we
-                                    // can traverse them linearly and
-                                    // do not have to check each row
-                                    // for the possible existence of
-                                    // a matrix entry
-    {
-      const unsigned int *
-       col_nums   = &(matrix->get_sparsity_pattern().get_column_numbers()
-                      [matrix->get_sparsity_pattern().get_rowstart_indices()[index]]);
-      const unsigned int
-       row_length = matrix->get_sparsity_pattern().row_length(index);
-
-      for (unsigned int i=0; i<row_length; ++i)
-       {
-         const unsigned int c = *(col_nums+i);
-
-                                          // if not diagonal entry,
-                                          // add to list
-         if (c != index)
-           column_entries.push_back (std::make_pair(c, (*matrix)(c,index)));
-       };
-    }
-  else
-    {
-                                      // otherwise check each row for
-                                      // occurrence of an entry in
-                                      // this column
-      for (unsigned int row=0; row<n(); ++row)
-       if (row != index)
-         {
-           const unsigned int
-             global_index = matrix->get_sparsity_pattern()(row,index);
-           if (global_index != SparsityPattern::invalid_entry)
-             column_entries.push_back (std::make_pair(row,
-                                                      (*matrix)(row,index)));
-         };
-    };
-};
-
-
-
-template <>
-void
-FilteredMatrix<BlockSparseMatrix<double>,BlockVector<double> >::
-get_column_entries (const unsigned int           /*index*/,
-                   std::vector<IndexValuePair> &/*column_entries*/,
-                   const bool                   /*matrix_is_symmetric*/) const
-{
-                                  // presently not implemented, but
-                                  // should be fairly simple to do
-  Assert (false, ExcNotImplemented());
-};
-
-
-
 template <class Matrix, class Vector>
 void
 FilteredMatrix<Matrix,Vector>::pre_filter (Vector &v) const
@@ -375,59 +303,4 @@ FilteredMatrix<Matrix,Vector>::memory_consumption () const
 
 
 
-template <>
-void
-FilteredMatrix<SparseMatrix<double>,Vector<double> >::
-allocate_tmp_vector () 
-{
-  tmp_mutex.acquire ();
-  tmp_vector.reinit (matrix->n(), true);
-  tmp_mutex.release ();
-};
-
-
-
-template <>
-void
-FilteredMatrix<SparseMatrix<float>,Vector<float> >::
-allocate_tmp_vector () 
-{
-  tmp_mutex.acquire ();
-  tmp_vector.reinit (matrix->n(), true);
-  tmp_mutex.release ();
-};
-
-
-
-template <>
-void
-FilteredMatrix<BlockSparseMatrix<double>,BlockVector<double> >::
-allocate_tmp_vector () 
-{
-  std::vector<unsigned int> block_sizes (matrix->n_block_rows());
-  for (unsigned int i=0; i<block_sizes.size(); ++i)
-    block_sizes[i] = matrix->block(i,i).n();
-  
-  tmp_mutex.acquire ();
-  tmp_vector.reinit (block_sizes, true);
-  tmp_mutex.release ();
-};
-
-
-
-template <>
-void
-FilteredMatrix<BlockSparseMatrix<float>,BlockVector<float> >::
-allocate_tmp_vector () 
-{
-  std::vector<unsigned int> block_sizes (matrix->n_block_rows());
-  for (unsigned int i=0; i<block_sizes.size(); ++i)
-    block_sizes[i] = matrix->block(i,i).n();
-  
-  tmp_mutex.acquire ();
-  tmp_vector.reinit (block_sizes, true);
-  tmp_mutex.release ();
-};
-
-
 #endif
index 40dc8c42429ed45f0230e978ccfbad72f4dadf13..87949890c520f3b71353aeb3aabdc8394f5030c1 100644 (file)
 #include <lac/filtered_matrix.templates.h>
 
 
+template <>
+void
+FilteredMatrix<SparseMatrix<double>,Vector<double> >::
+get_column_entries (const unsigned int           index,
+                   std::vector<IndexValuePair> &column_entries,
+                   const bool                   matrix_is_symmetric) const
+{
+                                  // depending on whether the matrix
+                                  // can be assumed symmetric or not,
+                                  // either use a fast or a slow
+                                  // algorithm
+  if (matrix_is_symmetric == true)
+                                    // ok, matrix is symmetric. we
+                                    // may determine the matrix
+                                    // entries in this column by
+                                    // looking at the matrix entries
+                                    // in this row which is
+                                    // significantly faster since we
+                                    // can traverse them linearly and
+                                    // do not have to check each row
+                                    // for the possible existence of
+                                    // a matrix entry
+    {
+      const unsigned int *
+       col_nums   = &(matrix->get_sparsity_pattern().get_column_numbers()
+                      [matrix->get_sparsity_pattern().get_rowstart_indices()[index]]);
+      const unsigned int
+       row_length = matrix->get_sparsity_pattern().row_length(index);
+
+      for (unsigned int i=0; i<row_length; ++i)
+       {
+         const unsigned int c = *(col_nums+i);
+
+                                          // if not diagonal entry,
+                                          // add to list
+         if (c != index)
+           column_entries.push_back (std::make_pair(c, (*matrix)(c,index)));
+       };
+    }
+  else
+    {
+                                      // otherwise check each row for
+                                      // occurrence of an entry in
+                                      // this column
+      for (unsigned int row=0; row<n(); ++row)
+       if (row != index)
+         {
+           const unsigned int
+             global_index = matrix->get_sparsity_pattern()(row,index);
+           if (global_index != SparsityPattern::invalid_entry)
+             column_entries.push_back (std::make_pair(row,
+                                                      (*matrix)(row,index)));
+         };
+    };
+};
+
+
+
+template <>
+void
+FilteredMatrix<BlockSparseMatrix<double>,BlockVector<double> >::
+get_column_entries (const unsigned int           /*index*/,
+                   std::vector<IndexValuePair> &/*column_entries*/,
+                   const bool                   /*matrix_is_symmetric*/) const
+{
+                                  // presently not implemented, but
+                                  // should be fairly simple to do
+  Assert (false, ExcNotImplemented());
+};
+
+
+
+
+template <>
+void
+FilteredMatrix<SparseMatrix<double>,Vector<double> >::
+allocate_tmp_vector () 
+{
+  tmp_mutex.acquire ();
+  tmp_vector.reinit (matrix->n(), true);
+  tmp_mutex.release ();
+};
+
+
+
+template <>
+void
+FilteredMatrix<SparseMatrix<float>,Vector<float> >::
+allocate_tmp_vector () 
+{
+  tmp_mutex.acquire ();
+  tmp_vector.reinit (matrix->n(), true);
+  tmp_mutex.release ();
+};
+
+
+
+template <>
+void
+FilteredMatrix<BlockSparseMatrix<double>,BlockVector<double> >::
+allocate_tmp_vector () 
+{
+  std::vector<unsigned int> block_sizes (matrix->n_block_rows());
+  for (unsigned int i=0; i<block_sizes.size(); ++i)
+    block_sizes[i] = matrix->block(i,i).n();
+  
+  tmp_mutex.acquire ();
+  tmp_vector.reinit (block_sizes, true);
+  tmp_mutex.release ();
+};
+
+
+
+template <>
+void
+FilteredMatrix<BlockSparseMatrix<float>,BlockVector<float> >::
+allocate_tmp_vector () 
+{
+  std::vector<unsigned int> block_sizes (matrix->n_block_rows());
+  for (unsigned int i=0; i<block_sizes.size(); ++i)
+    block_sizes[i] = matrix->block(i,i).n();
+  
+  tmp_mutex.acquire ();
+  tmp_vector.reinit (block_sizes, true);
+  tmp_mutex.release ();
+};
+
+
 template class FilteredMatrix<SparseMatrix<double>,Vector<double> >;
 template class FilteredMatrix<BlockSparseMatrix<double>,BlockVector<double> >;

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.