]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Actually instantiate SparseDirectMumps::initialize to make gcc-4.7 happy
authorMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 10 Oct 2012 08:17:13 +0000 (08:17 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 10 Oct 2012 08:17:13 +0000 (08:17 +0000)
Also fixup some unsigned int* -> int* type conversions gcc-4.7 barks about very
loudly because they are not permitted by ISO C++ (ISO C++ 11)

git-svn-id: https://svn.dealii.org/trunk@27044 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e63a1190dfd267dd234bab6f825f2d8be3c71028..df517a69a997892dc9978b4a28d854d4fd525526 100644 (file)
@@ -1305,8 +1305,8 @@ class SparseDirectMUMPS
 
   double       *a;
   double       *rhs;
-  unsigned int *irn;
-  unsigned int *jcn;
+  int          *irn;
+  int          *jcn;
   unsigned int  n;
   unsigned int  nz;
 
index 243e0966a201ceffd22d32493f30f417c9de7139..157ca2c3837e0e51098364aa156f36fd3f85dc00 100644 (file)
@@ -1994,12 +1994,12 @@ void SparseDirectMUMPS::initialize (const Matrix& matrix,
                          // column dimensions respectively of the
                          // matrix representation above (a): ie. a[k]
                          // is the matrix element (irn[k], jcn[k])
-      irn = new unsigned int[nz];
-      jcn = new unsigned int[nz];
+      irn = new int[nz];
+      jcn = new int[nz];
 
       unsigned int index = 0;
 
-      for (SparseMatrix<double>::const_iterator ptr = matrix.begin ();
+      for (typename Matrix::const_iterator ptr = matrix.begin ();
            ptr != matrix.end (); ++ptr)
         if (std::abs (ptr->value ()) > 0.0)
           {
@@ -2087,22 +2087,27 @@ void SparseDirectMA27::solve (const SparseMatrix<float>  &matrix,
                                    Vector<double> &);    \
   template    \
   void SparseDirectUMFPACK::initialize (const MATRIX &,    \
-                                        const AdditionalData)
+                                        const AdditionalData);
 
-InstantiateUMFPACK(SparseMatrix<double>);
-InstantiateUMFPACK(SparseMatrix<float>);
-InstantiateUMFPACK(SparseMatrixEZ<double>);
-InstantiateUMFPACK(SparseMatrixEZ<float>);
-InstantiateUMFPACK(BlockSparseMatrix<double>);
-InstantiateUMFPACK(BlockSparseMatrix<float>);
+InstantiateUMFPACK(SparseMatrix<double>)
+InstantiateUMFPACK(SparseMatrix<float>)
+InstantiateUMFPACK(SparseMatrixEZ<double>)
+InstantiateUMFPACK(SparseMatrixEZ<float>)
+InstantiateUMFPACK(BlockSparseMatrix<double>)
+InstantiateUMFPACK(BlockSparseMatrix<float>)
 
 // explicit instantiations for SparseDirectMUMPS
 #ifdef DEAL_II_USE_MUMPS
-template <class Matrix>
-void SparseDirectMUMPS::initialize (const Matrix& matrix,
-                                    const Vector<double>      & vector);
-
-void SparseDirectMUMPS::solve (Vector<double>& vector);
+#define InstantiateMUMPS(MATRIX) \
+  template \
+  void SparseDirectMUMPS::initialize (const MATRIX &, const Vector<double> &);
+
+InstantiateMUMPS(SparseMatrix<double>)
+InstantiateMUMPS(SparseMatrix<float>)
+// InstantiateMUMPS(SparseMatrixEZ<double>)
+// InstantiateMUMPS(SparseMatrixEZ<float>)
+InstantiateMUMPS(BlockSparseMatrix<double>)
+InstantiateMUMPS(BlockSparseMatrix<float>)
 #endif
 
 DEAL_II_NAMESPACE_CLOSE

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.