]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Convert unsigned int to size_type.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Feb 2013 20:56:58 +0000 (20:56 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Feb 2013 20:56:58 +0000 (20:56 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@28531 0785d39b-7218-0410-832d-ea1e28bc413d

24 files changed:
deal.II/files
deal.II/include/deal.II/grid/grid_generator.h
deal.II/include/deal.II/lac/slepc_solver.h
deal.II/include/deal.II/lac/solver_cg.h
deal.II/include/deal.II/lac/sparse_decomposition.h
deal.II/include/deal.II/lac/sparse_decomposition.templates.h
deal.II/include/deal.II/lac/sparse_direct.h
deal.II/include/deal.II/lac/sparse_ilu.h
deal.II/include/deal.II/lac/sparse_ilu.templates.h
deal.II/include/deal.II/lac/sparse_matrix.h
deal.II/include/deal.II/lac/sparse_matrix.templates.h
deal.II/include/deal.II/lac/sparse_matrix_ez.h
deal.II/include/deal.II/lac/sparse_matrix_ez.templates.h
deal.II/include/deal.II/lac/sparse_mic.h
deal.II/include/deal.II/lac/sparse_mic.templates.h
deal.II/include/deal.II/lac/sparse_vanka.h
deal.II/include/deal.II/lac/sparse_vanka.templates.h
deal.II/include/deal.II/lac/sparsity_pattern.h
deal.II/include/deal.II/lac/sparsity_tools.h
deal.II/source/grid/grid_generator.cc
deal.II/source/lac/slepc_solver.cc
deal.II/source/lac/sparse_direct.cc
deal.II/source/lac/sparsity_pattern.cc
deal.II/source/lac/sparsity_tools.cc

index 5e614a31aacb1ddd2eb657129af386b77b675c1b..da5d3954fea009301dcf67e5f24d8589156771f0 100644 (file)
@@ -90,10 +90,10 @@ KAINAN source/fe/mapping_q1.cc
 KAINAN source/fe/mapping_q1_eulerian.cc
 KAINAN source/fe/mapping_q.cc
 KAINAN source/fe/mapping_q_eulerian.cc
-source/grid/grid_generator.cc
-source/grid/grid_in.cc
-source/grid/grid_out.cc
-source/grid/grid_refinement.cc
+BRUNO source/grid/grid_generator.cc
+BRUNO source/grid/grid_in.cc
+BRUNO source/grid/grid_out.cc
+BRUNO source/grid/grid_refinement.cc
 source/grid/grid_reordering.cc
 source/grid/grid_tools.cc
 source/grid/intergrid_map.cc
@@ -144,19 +144,19 @@ BRUNO source/lac/petsc_vector.cc
 BRUNO source/lac/precondition_block.cc
 BRUNO source/lac/precondition_block_ez.cc
 BRUNO source/lac/relaxation_block.cc
-source/lac/slepc_solver.cc
-source/lac/slepc_spectral_transformation.cc
-source/lac/solver.cc
-source/lac/solver_control.cc
-source/lac/sparse_decomposition.cc
-source/lac/sparse_direct.cc
-source/lac/sparse_ilu.cc
-source/lac/sparse_matrix.cc
-source/lac/sparse_matrix_ez.cc
-source/lac/sparse_mic.cc
-source/lac/sparse_vanka.cc
-source/lac/sparsity_pattern.cc
-source/lac/sparsity_tools.cc
+BRUNO source/lac/slepc_solver.cc
+BRUNO source/lac/slepc_spectral_transformation.cc
+BRUNO source/lac/solver.cc
+BRUNO source/lac/solver_control.cc
+BRUNO source/lac/sparse_decomposition.cc
+BRUNO source/lac/sparse_direct.cc
+BRUNO source/lac/sparse_ilu.cc
+BRUNO source/lac/sparse_matrix.cc
+BRUNO source/lac/sparse_matrix_ez.cc
+BRUNO source/lac/sparse_mic.cc
+BRUNO source/lac/sparse_vanka.cc
+BRUNO source/lac/sparsity_pattern.cc
+BRUNO source/lac/sparsity_tools.cc
 BRUNO source/lac/swappable_vector.cc
 BRUNO source/lac/timestep_control.cc
 BRUNO source/lac/tridiagonal_matrix.cc
@@ -273,16 +273,16 @@ TIMO include/deal.II/distributed/tria.h
 MARKUS include/deal.II/dofs/block_info.h
 TIMO include/deal.II/dofs/dof_accessor.h
 TIMO include/deal.II/dofs/dof_accessor.templates.h
-include/deal.II/dofs/dof_constraints.h
+BRUNO include/deal.II/dofs/dof_constraints.h
 UWE include/deal.II/dofs/dof_faces.h
 MARKUS include/deal.II/dofs/dof_handler.h
 TIMO include/deal.II/dofs/dof_handler_policy.h
-include/deal.II/dofs/dof_iterator_selector.h
+BRUNO include/deal.II/dofs/dof_iterator_selector.h
 UWE include/deal.II/dofs/dof_levels.h
 UWE include/deal.II/dofs/dof_objects.h
 HELENE include/deal.II/dofs/dof_renumbering.h
 UWE include/deal.II/dofs/dof_tools.h
-include/deal.II/dofs/function_map.h
+BRUNO include/deal.II/dofs/function_map.h
 TIMO include/deal.II/dofs/number_cache.h
 GK include/deal.II/fe/fe_abf.h
 GK include/deal.II/fe/fe_base.h
@@ -316,12 +316,12 @@ KAINAN include/deal.II/fe/mapping_q1_eulerian.h
 KAINAN include/deal.II/fe/mapping_q1.h
 KAINAN include/deal.II/fe/mapping_q_eulerian.h
 KAINAN include/deal.II/fe/mapping_q.h
-include/deal.II/grid/filtered_iterator.h
-include/deal.II/grid/geometry_info.h
-include/deal.II/grid/grid_generator.h
-include/deal.II/grid/grid_in.h
-include/deal.II/grid/grid_out.h
-include/deal.II/grid/grid_refinement.h
+BRUNO include/deal.II/grid/filtered_iterator.h
+BRUNO include/deal.II/grid/geometry_info.h
+BRUNO include/deal.II/grid/grid_generator.h
+BRUNO include/deal.II/grid/grid_in.h
+BRUNO include/deal.II/grid/grid_out.h
+BRUNO include/deal.II/grid/grid_refinement.h
 include/deal.II/grid/grid_reordering.h
 include/deal.II/grid/grid_reordering_internal.h
 include/deal.II/grid/grid_tools.h
@@ -419,33 +419,33 @@ BRUNO include/deal.II/lac/relaxation_block.h
 BRUNO include/deal.II/lac/relaxation_block.templates.h
 BRUNO include/deal.II/lac/schur_matrix.h
 BRUNO include/deal.II/lac/shifted_matrix.h
-include/deal.II/lac/slepc_solver.h
-include/deal.II/lac/slepc_spectral_transformation.h
-include/deal.II/lac/solver_bicgstab.h
-include/deal.II/lac/solver_cg.h
-include/deal.II/lac/solver_control.h
-include/deal.II/lac/solver_gmres.h
-include/deal.II/lac/solver.h
-include/deal.II/lac/solver_minres.h
-include/deal.II/lac/solver_qmrs.h
-include/deal.II/lac/solver_relaxation.h
-include/deal.II/lac/solver_richardson.h
-include/deal.II/lac/solver_selector.h
-include/deal.II/lac/sparse_decomposition.h
-include/deal.II/lac/sparse_decomposition.templates.h
-include/deal.II/lac/sparse_direct.h
-include/deal.II/lac/sparse_ilu.h
-include/deal.II/lac/sparse_ilu.templates.h
-include/deal.II/lac/sparse_matrix_ez.h
-include/deal.II/lac/sparse_matrix_ez.templates.h
-include/deal.II/lac/sparse_matrix.h
-include/deal.II/lac/sparse_matrix.templates.h
-include/deal.II/lac/sparse_mic.h
-include/deal.II/lac/sparse_mic.templates.h
-include/deal.II/lac/sparse_vanka.h
-include/deal.II/lac/sparse_vanka.templates.h
-include/deal.II/lac/sparsity_pattern.h
-include/deal.II/lac/sparsity_tools.h
+BRUNO include/deal.II/lac/slepc_solver.h
+BRUNO include/deal.II/lac/slepc_spectral_transformation.h
+BRUNO include/deal.II/lac/solver_bicgstab.h
+BRUNO include/deal.II/lac/solver_cg.h
+BRUNO include/deal.II/lac/solver_control.h
+BRUNO include/deal.II/lac/solver_gmres.h
+BRUNO include/deal.II/lac/solver.h
+BRUNO include/deal.II/lac/solver_minres.h
+BRUNO include/deal.II/lac/solver_qmrs.h
+BRUNO include/deal.II/lac/solver_relaxation.h
+BRUNO include/deal.II/lac/solver_richardson.h
+BRUNO include/deal.II/lac/solver_selector.h
+BRUNO include/deal.II/lac/sparse_decomposition.h
+BRUNO include/deal.II/lac/sparse_decomposition.templates.h
+BRUNO include/deal.II/lac/sparse_direct.h
+BRUNO include/deal.II/lac/sparse_ilu.h
+BRUNO include/deal.II/lac/sparse_ilu.templates.h
+BRUNO include/deal.II/lac/sparse_matrix_ez.h
+BRUNO include/deal.II/lac/sparse_matrix_ez.templates.h
+BRUNO include/deal.II/lac/sparse_matrix.h
+BRUNO include/deal.II/lac/sparse_matrix.templates.h
+BRUNO include/deal.II/lac/sparse_mic.h
+BRUNO include/deal.II/lac/sparse_mic.templates.h
+BRUNO include/deal.II/lac/sparse_vanka.h
+BRUNO include/deal.II/lac/sparse_vanka.templates.h
+BRUNO include/deal.II/lac/sparsity_pattern.h
+BRUNO include/deal.II/lac/sparsity_tools.h
 BRUNO include/deal.II/lac/swappable_vector.h
 BRUNO include/deal.II/lac/swappable_vector.templates.h
 BRUNO include/deal.II/lac/transpose_matrix.h
index b92327f0bfea56b7522cb265880fa3042bfb3603..f899b62e7f566359f346d4fa605b715c79a70893 100644 (file)
@@ -51,6 +51,11 @@ template <typename number> class SparseMatrix;
 class GridGenerator
 {
 public:
+  /**
+   * Declare type for number of cell.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Initialize the given triangulation with a hypercube (line in 1D, square
    * in 2D, etc) consisting of exactly one cell. The hypercube volume is the
@@ -262,7 +267,7 @@ public:
   static
   void
   subdivided_parallelepiped (Triangulation<dim>  &tria,
-                             const unsigned int   n_subdivisions,
+                             const size_type     n_subdivisions,
                              const Point<dim>   (&corners) [dim],
                              const bool           colorize = false);
 
@@ -278,7 +283,7 @@ public:
   static
   void
   subdivided_parallelepiped (Triangulation<dim>  &tria,
-                             const unsigned int ( n_subdivisions) [dim],
+                             const size_type    ( n_subdivisions) [dim],
                              const Point<dim>   (&corners) [dim],
                              const bool           colorize = false);
 
@@ -486,7 +491,7 @@ public:
                            const Point<dim>     &center,
                            const double        inner_radius,
                            const double        outer_radius,
-                           const unsigned int  n_cells = 0,
+                           const size_type     n_cells = 0,
                            bool colorize = false);
 
   /**
@@ -515,7 +520,7 @@ public:
                                 const Point<dim>     &center,
                                 const double        inner_radius,
                                 const double        outer_radius,
-                                const unsigned int  n_cells = 0,
+                                const size_type     n_cells = 0,
                                 const bool colorize = false);
 
 
@@ -544,7 +549,7 @@ public:
                                    const Point<dim>     &center,
                                    const double        inner_radius,
                                    const double        outer_radius,
-                                   const unsigned int  n_cells = 0,
+                                   const size_type     n_cells = 0,
                                    const bool colorize = false);
 
   /**
@@ -564,8 +569,8 @@ public:
                               const double        length,
                               const double        inner_radius,
                               const double        outer_radius,
-                              const unsigned int  n_radial_cells = 0,
-                              const unsigned int  n_axial_cells = 0);
+                              const size_type     n_radial_cells = 0,
+                              const size_type     n_axial_cells = 0);
 
 
 
@@ -631,7 +636,7 @@ public:
    * @param r           The radius of the cylinder bend together as loop.
    */
   static void moebius (Triangulation<3,3> &tria,
-                       const unsigned int   n_cells,
+                       const size_type      n_cells,
                        const unsigned int   n_rotations,
                        const double         R,
                        const double         r);
@@ -684,7 +689,7 @@ public:
   static
   void
   extrude_triangulation(const Triangulation<2, 2> & input,
-                        const unsigned int n_slices,
+                        const size_type n_slices,
                         const double height,
                         Triangulation<3,3> &result);
 
@@ -702,7 +707,7 @@ public:
    */
   template <int dim>
   static void laplace_transformation (Triangulation<dim> &tria,
-                                      const std::map<unsigned int,Point<dim> > &new_points);
+                                      const std::map<size_type,Point<dim> > &new_points);
 
   /**
    * Exception
@@ -780,7 +785,7 @@ private:
   static
   void
   laplace_solve (const SparseMatrix<double>          &S,
-                 const std::map<unsigned int,double> &m,
+                 const std::map<size_type,double> &m,
                  Vector<double>                      &u);
 };
 
index 7c7a38f923f562dc79624e50e5d1116f093c1148..367a986fb059216dd79d3c488c2a8e1367d92b51 100644 (file)
@@ -105,6 +105,10 @@ namespace SLEPcWrappers
   class SolverBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
 
     /**
      * Constructor. Takes the MPI communicator over which parallel
@@ -143,7 +147,7 @@ namespace SLEPcWrappers
     solve (const PETScWrappers::MatrixBase &A,
            std::vector<double>             &kr,
            std::vector<OutputVector>       &vr,
-           const unsigned int              n_eigenvectors);
+           const size_type                  n_eigenvectors);
 
     /**
      * Same as above, but here a composite method for solving the
@@ -155,7 +159,7 @@ namespace SLEPcWrappers
            const PETScWrappers::MatrixBase &B,
            std::vector<double>             &kr,
            std::vector<OutputVector>       &vr,
-           const unsigned int               n_eigenvectors);
+           const size_type                  n_eigenvectors);
 
     /**
      * Initialize solver for the linear system $Ax=\lambda x$. (Note:
@@ -201,7 +205,7 @@ namespace SLEPcWrappers
      * SLEPc eigensolver used.
      */
     void
-    solve (const unsigned int n_eigenvectors, unsigned int *n_converged);
+    solve (const size_type n_eigenvectors, size_type *n_converged);
 
     /**
      * Access the solutions for a solved eigenvector problem, pair
@@ -209,7 +213,7 @@ namespace SLEPcWrappers
      * \text{n\_converged}-1$.
      */
     void
-    get_eigenpair (const unsigned int index,
+    get_eigenpair (const size_type index,
 #ifndef PETSC_USE_COMPLEX
                    double                    &kr,
 #else
@@ -637,9 +641,9 @@ namespace SLEPcWrappers
   SolverBase::solve (const PETScWrappers::MatrixBase &A,
                      std::vector<double>             &kr,
                      std::vector<OutputVector>       &vr,
-                     const unsigned int               n_eigenvectors = 1)
+                     const size_type                  n_eigenvectors = 1)
   {
-    unsigned int n_converged = 0;
+    size_type n_converged = 0;
 
     // Set the matrices of the problem
     set_matrices (A);
@@ -656,7 +660,7 @@ namespace SLEPcWrappers
     vr.resize (n_converged, vr.front());
     kr.resize (n_converged);
 
-    for (unsigned int index=0; index<n_converged; ++index)
+    for (size_type index=0; index<n_converged; ++index)
       get_eigenpair (index, kr[index], vr[index]);
   }
 
@@ -666,9 +670,9 @@ namespace SLEPcWrappers
                      const PETScWrappers::MatrixBase &B,
                      std::vector<double>             &kr,
                      std::vector<OutputVector>       &vr,
-                     const unsigned int               n_eigenvectors = 1)
+                     const size_type                  n_eigenvectors = 1)
   {
-    unsigned int n_converged = 0;
+    size_type n_converged = 0;
 
     // Set the matrices of the problem
     set_matrices (A, B);
@@ -686,7 +690,7 @@ namespace SLEPcWrappers
     vr.resize (n_converged, vr.front());
     kr.resize (n_converged);
 
-    for (unsigned int index=0; index<n_converged; ++index)
+    for (size_type index=0; index<n_converged; ++index)
       get_eigenpair (index, kr[index], vr[index]);
   }
 }
index afab462f791776f22b118cea01f570f04714fb36..b792d0cb8b4b1f58488d56ebc56d50e03c04a8a8 100644 (file)
@@ -71,6 +71,11 @@ template <class VECTOR = Vector<double> >
 class SolverCG : public Solver<VECTOR>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Standardized data struct to pipe
    * additional data to the solver.
@@ -403,7 +408,7 @@ SolverCG<VECTOR>::solve (const MATRIX         &A,
           if (additional_data.compute_all_condition_numbers && (diagonal.size()>1))
             {
               TridiagonalMatrix<double> T(diagonal.size(), true);
-              for (unsigned int i=0; i<diagonal.size(); ++i)
+              for (size_type i=0; i<diagonal.size(); ++i)
                 {
                   T(i,i) = diagonal[i];
                   if (i< diagonal.size()-1)
@@ -427,7 +432,7 @@ SolverCG<VECTOR>::solve (const MATRIX         &A,
   if (do_eigenvalues)
     {
       TridiagonalMatrix<double> T(diagonal.size(), true);
-      for (unsigned int i=0; i<diagonal.size(); ++i)
+      for (size_type i=0; i<diagonal.size(); ++i)
         {
           T(i,i) = diagonal[i];
           if (i< diagonal.size()-1)
@@ -441,7 +446,7 @@ SolverCG<VECTOR>::solve (const MATRIX         &A,
                 T.eigenvalue(T.n()-1)/T.eigenvalue(0) << std::endl;
       if (additional_data.compute_eigenvalues)
         {
-          for (unsigned int i=0; i<T.n(); ++i)
+          for (size_type i=0; i<T.n(); ++i)
             deallog << ' ' << T.eigenvalue(i);
           deallog << std::endl;
         }
index 3f3d9cf42a0ad8ec0b00adb90a9c02972d34c388..a0bb68cf4a2c6b9094a970081e5ce4e71dd2ddd4 100644 (file)
@@ -159,6 +159,11 @@ protected:
   SparseLUDecomposition (const SparsityPattern &sparsity) DEAL_II_DEPRECATED;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Destruction. Mark the
    * destructor pure to ensure that
@@ -389,7 +394,7 @@ protected:
    * <tt>strengthen_diagonal</tt>'s
    * value.
    */
-  virtual number get_strengthen_diagonal(const number rowsum, const unsigned int row) const;
+  virtual number get_strengthen_diagonal(const number rowsum, const size_type row) const;
 
   /**
    * State flag. If not in
@@ -421,7 +426,7 @@ protected:
    * available after invocation of
    * decompose().
    */
-  std::vector<const unsigned int *> prebuilt_lower_bound;
+  std::vector<const size_type *> prebuilt_lower_bound;
 
 private:
   /**
@@ -460,7 +465,7 @@ template <typename number>
 inline number
 SparseLUDecomposition<number>::
 get_strengthen_diagonal(const number /*rowsum*/,
-                        const unsigned int /*row*/) const
+                        const size_type /*row*/) const
 {
   return strengthen_diagonal;
 }
index 3935ef107b2efeab4abf3e7db903ff68571805da..c5426eae0046334e817a8c568ce2b31a8b05ef47 100644 (file)
@@ -54,7 +54,7 @@ void SparseLUDecomposition<number>::clear()
 {
   decomposed = false;
 
-  std::vector<const unsigned int *> tmp;
+  std::vector<const size_type *> tmp;
   tmp.swap (prebuilt_lower_bound);
 
   SparseMatrix<number>::clear();
@@ -129,7 +129,7 @@ void SparseLUDecomposition<number>::initialize (
           typename SparsityPattern::ExcDiagonalNotOptimized());
   decomposed = false;
   {
-    std::vector<const unsigned int *> tmp;
+    std::vector<const size_type *> tmp;
     tmp.swap (prebuilt_lower_bound);
   }
   SparseMatrix<number>::reinit (*sparsity_pattern_to_use);
@@ -160,7 +160,7 @@ void SparseLUDecomposition<number>::reinit (const SparsityPattern &sparsity)
           typename SparsityPattern::ExcDiagonalNotOptimized());
   decomposed = false;
   {
-    std::vector<const unsigned int *> tmp;
+    std::vector<const size_type *> tmp;
     tmp.swap (prebuilt_lower_bound);
   }
   SparseMatrix<number>::reinit (sparsity);
@@ -172,15 +172,15 @@ template<typename number>
 void
 SparseLUDecomposition<number>::prebuild_lower_bound()
 {
-  const unsigned int *const
+  const size_type *const
     column_numbers = this->get_sparsity_pattern().colnums;
   const std::size_t *const
     rowstart_indices = this->get_sparsity_pattern().rowstart;
-  const unsigned int N = this->m();
+  const size_type N = this->m();
  
    prebuilt_lower_bound.resize (N);
  
-   for (unsigned int row=0; row<N; row++)
+   for (size_type row=0; row<N; row++)
      {
        prebuilt_lower_bound[row]
          = Utilities::lower_bound (&column_numbers[rowstart_indices[row]+1],
@@ -214,7 +214,7 @@ SparseLUDecomposition<number>::copy_from (const SparseMatrix<somenumber> &matrix
   SparseMatrix<number>::operator= (number(0));
 
   // both allow more and less entries in the new matrix
-  for (unsigned int row=0; row<this->m(); ++row)
+  for (size_type row=0; row<this->m(); ++row)
     {
       typename SparseMatrix<number>::iterator index = this->begin(row);
       typename SparseMatrix<somenumber>::const_iterator
@@ -240,7 +240,7 @@ template <typename number>
 void
 SparseLUDecomposition<number>::strengthen_diagonal_impl ()
 {
-  for (unsigned int row=0; row<this->m(); ++row)
+  for (size_type row=0; row<this->m(); ++row)
     {
       // get the global index of the first
       // non-diagonal element in this row
index d236fbd6c9a6400b7ec4b95adc61ba3c53e51f9d..9c893d4638a666bba7b6a941732c2e95f9213eed 100644 (file)
@@ -191,6 +191,11 @@ DEAL_II_NAMESPACE_OPEN
 class SparseDirectMA27 : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index  size_type;
+
   /**
    * Constructor. See the
    * documentation of this class
@@ -458,14 +463,14 @@ private:
    * the sparsity pattern on and
    * above the diagonal.
    */
-  unsigned int n_nonzero_elements;
+  size_type n_nonzero_elements;
 
   /**
    * Arrays holding row and column
    * indices.
    */
-  std::vector<unsigned int> row_numbers;
-  std::vector<unsigned int> column_numbers;
+  std::vector<size_type> row_numbers;
+  std::vector<size_type> column_numbers;
 
   /**
    * Array to hold the matrix
@@ -477,7 +482,7 @@ private:
   /**
    * Length of the <tt>A</tt> array.
    */
-  unsigned int         LA;
+  size_type                 LA;
 
   /**
    * Scratch arrays and variables
@@ -488,13 +493,13 @@ private:
    * letters as is usual in
    * Fortran.
    */
-  unsigned int LIW;
-  std::vector<unsigned int> IW;
-  std::vector<unsigned int> IKEEP;
-  std::vector<unsigned int> IW1;
+  size_type LIW;
+  std::vector<size_type> IW;
+  std::vector<size_type> IKEEP;
+  std::vector<size_type> IW1;
 
-  unsigned int NSTEPS;
-  unsigned int MAXFRT;
+  size_type NSTEPS;
+  size_type MAXFRT;
 
   /**
    * Two values that live inside a
@@ -506,8 +511,8 @@ private:
    * from the Fortran functions to
    * the outside world.
    */
-  unsigned int NRLNEC;
-  unsigned int NIRNEC;
+  size_type NRLNEC;
+  size_type NIRNEC;
 
   /**
    * Flag indicating the level of
@@ -536,71 +541,71 @@ private:
    * with the given args, either
    * locally or remote.
    */
-  void call_ma27ad (const unsigned int *N,
-                    const unsigned int *NZ,
-                    const unsigned int *IRN,
-                    const unsigned int *ICN,
-                    unsigned int       *IW,
-                    const unsigned int *LIW,
-                    unsigned int       *IKEEP,
-                    unsigned int       *IW1,
-                    unsigned int       *NSTEPS,
-                    int                *IFLAG);
+  void call_ma27ad (const size_type *N,
+                    const size_type *NZ,
+                    const size_type *IRN,
+                    const size_type *ICN,
+                    size_type       *IW,
+                    const size_type *LIW,
+                    size_type       *IKEEP,
+                    size_type       *IW1,
+                    size_type       *NSTEPS,
+                    int             *IFLAG);
 
   /**
    * Call the respective function
    * with the given args, either
    * locally or remote.
    */
-  void call_ma27bd (const unsigned int *N,
-                    const unsigned int *NZ,
-                    const unsigned int *IRN,
-                    const unsigned int *ICN,
-                    double             *A,
-                    const unsigned int *LA,
-                    unsigned int       *IW,
-                    const unsigned int *LIW,
-                    const unsigned int *IKEEP,
-                    const unsigned int *NSTEPS,
-                    unsigned int       *MAXFRT,
-                    unsigned int       *IW1,
-                    int                *IFLAG);
+  void call_ma27bd (const size_type *N,
+                    const size_type *NZ,
+                    const size_type *IRN,
+                    const size_type *ICN,
+                    double          *A,
+                    const size_type *LA,
+                    size_type       *IW,
+                    const size_type *LIW,
+                    const size_type *IKEEP,
+                    const size_type *NSTEPS,
+                    size_type       *MAXFRT,
+                    size_type       *IW1,
+                    int             *IFLAG);
 
   /**
    * Call the respective function
    * with the given args, either
    * locally or remote.
    */
-  void call_ma27cd (const unsigned int *N,
-                    const double       *A,
-                    const unsigned int *LA,
-                    const unsigned int *IW,
-                    const unsigned int *LIW,
-                    const unsigned int *MAXFRT,
-                    double             *RHS,
-                    const unsigned int *IW1,
-                    const unsigned int *NSTEPS) const;
+  void call_ma27cd (const size_type *N,
+                    const double    *A,
+                    const size_type *LA,
+                    const size_type *IW,
+                    const size_type *LIW,
+                    const size_type *MAXFRT,
+                    double          *RHS,
+                    const size_type *IW1,
+                    const size_type *NSTEPS) const;
 
   /**
    * Call the respective function
    * with the given args, either
    * locally or remote.
    */
-  void call_ma27x1 (unsigned int *NRLNEC);
+  void call_ma27x1 (size_type *NRLNEC);
 
   /**
    * Call the respective function
    * with the given args, either
    * locally or remote.
    */
-  void call_ma27x2 (unsigned int *NIRNEC);
+  void call_ma27x2 (size_type *NIRNEC);
 
   /**
    * Call the respective function
    * with the given args, either
    * locally or remote.
    */
-  void call_ma27x3 (const unsigned int *LP);
+  void call_ma27x3 (const size_type *LP);
 };
 
 
@@ -681,6 +686,11 @@ private:
 class SparseDirectMA47 : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. See the
    * documentation of this class
@@ -896,13 +906,13 @@ private:
    * the sparsity pattern on and
    * above the diagonal.
    */
-  unsigned int n_nonzero_elements;
+  size_type n_nonzero_elements;
 
   /**
    * Control values set by <tt>MA47ID</tt>.
    */
-  double       CNTL[2];
-  unsigned int ICNTL[7];
+  double    CNTL[2];
+  size_type ICNTL[7];
 
   /**
    * Info field filled by the MA47
@@ -915,8 +925,8 @@ private:
    * Arrays holding row and column
    * indices.
    */
-  std::vector<unsigned int> row_numbers;
-  std::vector<unsigned int> column_numbers;
+  std::vector<size_type> row_numbers;
+  std::vector<size_type> column_numbers;
 
   /**
    * Array to hold the matrix
@@ -928,7 +938,7 @@ private:
   /**
    * Length of the <tt>A</tt> array.
    */
-  unsigned int         LA;
+  size_type                 LA;
 
   /**
    * Scratch arrays and variables
@@ -939,10 +949,10 @@ private:
    * letters as is usual in
    * Fortran.
    */
-  unsigned int LIW;
-  std::vector<unsigned int> IW;
-  std::vector<unsigned int> KEEP;
-  std::vector<unsigned int> IW1;
+  size_type LIW;
+  std::vector<size_type> IW;
+  std::vector<size_type> KEEP;
+  std::vector<size_type> IW1;
 
   /**
    * Mutex for synchronising access
@@ -961,52 +971,52 @@ private:
    * Call the <tt>ma47id</tt> function
    * with the given args.
    */
-  void call_ma47id (double       *CNTL,
-                    unsigned int *ICNTL);
+  void call_ma47id (double    *CNTL,
+                    size_type *ICNTL);
 
   /**
    * Call the <tt>ma47ad</tt> function
    * with the given args.
    */
-  void call_ma47ad (const unsigned int *n_rows,
-                    const unsigned int *n_nonzero_elements,
-                    unsigned int       *row_numbers,
-                    unsigned int       *column_numbers,
-                    unsigned int       *IW,
-                    const unsigned int *LIW,
-                    unsigned int       *KEEP,
-                    const unsigned int *ICNTL,
-                    int                *INFO);
+  void call_ma47ad (const size_type *n_rows,
+                    const size_type *n_nonzero_elements,
+                    size_type       *row_numbers,
+                    size_type       *column_numbers,
+                    size_type       *IW,
+                    const size_type *LIW,
+                    size_type       *KEEP,
+                    const size_type *ICNTL,
+                    int             *INFO);
 
   /**
    * Call the <tt>ma47bd</tt> function
    * with the given args.
    */
-  void call_ma47bd (const unsigned int *n_rows,
-                    const unsigned int *n_nonzero_elements,
-                    const unsigned int *column_numbers,
-                    double             *A,
-                    const unsigned int *LA,
-                    unsigned int       *IW,
-                    const unsigned int *LIW,
-                    const unsigned int *KEEP,
-                    const double       *CNTL,
-                    const unsigned int *ICNTL,
-                    unsigned int       *IW1,
-                    int                *INFO);
+  void call_ma47bd (const size_type *n_rows,
+                    const size_type *n_nonzero_elements,
+                    const size_type *column_numbers,
+                    double          *A,
+                    const size_type *LA,
+                    size_type       *IW,
+                    const size_type *LIW,
+                    const size_type *KEEP,
+                    const double    *CNTL,
+                    const size_type *ICNTL,
+                    size_type       *IW1,
+                    int             *INFO);
 
   /**
    * Call the <tt>ma47bd</tt> function
    * with the given args.
    */
-  void call_ma47cd (const unsigned int *n_rows,
-                    const double       *A,
-                    const unsigned int *LA,
-                    const unsigned int *IW,
-                    const unsigned int *LIW,
-                    double             *rhs_and_solution,
-                    unsigned int       *IW1,
-                    const unsigned int *ICNTL);
+  void call_ma47cd (const size_type *n_rows,
+                    const double    *A,
+                    const size_type *LA,
+                    const size_type *IW,
+                    const size_type *LIW,
+                    double          *rhs_and_solution,
+                    size_type       *IW1,
+                    const size_type *ICNTL);
 };
 
 
@@ -1304,12 +1314,12 @@ private:
   DMUMPS_STRUC_C id;
 #endif // DEAL_II_USE_MUMPS
 
-  double       *a;
-  double       *rhs;
-  int          *irn;
-  int          *jcn;
-  unsigned int  n;
-  unsigned int  nz;
+  double   *a;
+  double   *rhs;
+  int      *irn;
+  int      *jcn;
+  types::global_dof_index n;
+  types::global_dof_index nz;
 
   /**
    * This function initializes a MUMPS instance
@@ -1333,6 +1343,10 @@ private:
   bool initialize_called;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
 
   /**
    * Constructor
index ba745ccbbfb43ede877bd85072ba005f4aabcf99..3465cd7665edf1338ea15f0f07ec369ab20915fd 100644 (file)
@@ -53,6 +53,11 @@ template <typename number>
 class SparseILU : public SparseLUDecomposition<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Does nothing.
    *
index c695e9face7be95b844faacb20a281a374fb0b9d..4080ceafc9f4a26f5d9cb5d36517b6c3fdbc14b8 100644 (file)
@@ -71,29 +71,29 @@ void SparseILU<number>::decompose (const SparseMatrix<somenumber> &matrix,
   // translating in essence the algorithm given at the end of section 10.3.2,
   // using the names of variables used there
   const SparsityPattern     &sparsity = this->get_sparsity_pattern();
-  const std::size_t   *const ia      = sparsity.rowstart;
-  const unsigned int *const ja       = sparsity.colnums;
+  const std::size_t *const ia    = sparsity.rowstart;
+  const size_type *const ja      = sparsity.colnums;
 
   number *luval = this->SparseMatrix<number>::val;
 
-  const unsigned int N = this->m();
-  unsigned int jrow = 0;
+  const size_type N = this->m();
+  size_type jrow = 0;
 
-  std::vector<unsigned int> iw (N, numbers::invalid_unsigned_int);
+  std::vector<size_type> iw (N, numbers::invalid_unsigned_int);
 
-  for (unsigned int k=0; k<N; ++k)
+  for (size_type k=0; k<N; ++k)
     {
-      const unsigned int j1 = ia[k],
-                         j2 = ia[k+1]-1;
+      const size_type j1 = ia[k],
+                      j2 = ia[k+1]-1;
 
-      for (unsigned int j=j1; j<=j2; ++j)
+      for (size_type j=j1; j<=j2; ++j)
         iw[ja[j]] = j;
 
       // the algorithm in the book works on the elements of row k left of the
       // diagonal. however, since we store the diagonal element at the first
       // position, start at the element after the diagonal and run as long as
       // we don't walk into the right half
-      unsigned int j = j1+1;
+      size_type j = j1+1;
 
       // pathological case: the current row of the matrix has only the
       // diagonal entry. then we have nothing to do.
@@ -112,12 +112,12 @@ label_150:
         luval[j] = t1;
 
         // jj runs from just right of the diagonal to the end of the row
-        unsigned int jj = ia[jrow]+1;
+        size_type jj = ia[jrow]+1;
         while (ja[jj] < jrow)
           ++jj;
         for (; jj<ia[jrow+1]; ++jj)
           {
-            const unsigned int jw = iw[ja[jj]];
+            const size_type jw = iw[ja[jj]];
             if (jw != numbers::invalid_unsigned_int)
               luval[jw] -= t1 * luval[jj];
           }
@@ -142,7 +142,7 @@ label_200:
 
       luval[ia[k]] = 1./luval[ia[k]];
 
-      for (unsigned int j=j1; j<=j2; ++j)
+      for (size_type j=j1; j<=j2; ++j)
         iw[ja[j]] = numbers::invalid_unsigned_int;
     }
 }
@@ -158,10 +158,10 @@ void SparseILU<number>::vmult (Vector<somenumber>       &dst,
   Assert (dst.size() == src.size(), ExcDimensionMismatch(dst.size(), src.size()));
   Assert (dst.size() == this->m(), ExcDimensionMismatch(dst.size(), this->m()));
 
-  const unsigned int N=dst.size();
-  const std::size_t  *const rowstart_indices
+  const size_type N=dst.size();
+  const std::size_t *const rowstart_indices
     = this->get_sparsity_pattern().rowstart;
-  const unsigned int *const column_numbers
+  const size_type *const column_numbers
     = this->get_sparsity_pattern().colnums;
 
   // solve LUx=b in two steps:
@@ -177,19 +177,19 @@ void SparseILU<number>::vmult (Vector<somenumber>       &dst,
   // perform it at the outset of the
   // loop
   dst = src;
-  for (unsigned int row=0; row<N; ++row)
+  for (size_type row=0; row<N; ++row)
     {
       // get start of this row. skip the
       // diagonal element
-      const unsigned int *const rowstart = &column_numbers[rowstart_indices[row]+1];
+      const size_type *const rowstart = &column_numbers[rowstart_indices[row]+1];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       somenumber dst_row = dst(row);
       const number *luval = this->SparseMatrix<number>::val +
                             (rowstart - column_numbers);
-      for (const unsigned int *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
+      for (const size_type *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
         dst_row -= *luval * dst(*col);
       dst(row) = dst_row;
     }
@@ -205,15 +205,15 @@ void SparseILU<number>::vmult (Vector<somenumber>       &dst,
   for (int row=N-1; row>=0; --row)
     {
       // get end of this row
-      const unsigned int *const rowend = &column_numbers[rowstart_indices[row+1]];
+      const size_type *const rowend = &column_numbers[rowstart_indices[row+1]];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       somenumber dst_row = dst(row);
       const number *luval = this->SparseMatrix<number>::val +
                             (first_after_diagonal - column_numbers);
-      for (const unsigned int *col=first_after_diagonal; col!=rowend; ++col, ++luval)
+      for (const size_type *col=first_after_diagonal; col!=rowend; ++col, ++luval)
         dst_row -= *luval * dst(*col);
 
       // scale by the diagonal element.
@@ -232,10 +232,10 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
   Assert (dst.size() == src.size(), ExcDimensionMismatch(dst.size(), src.size()));
   Assert (dst.size() == this->m(), ExcDimensionMismatch(dst.size(), this->m()));
 
-  const unsigned int N=dst.size();
-  const std::size_t   *const rowstart_indices
+  const size_type N=dst.size();
+  const std::size_t *const rowstart_indices
     = this->get_sparsity_pattern().rowstart;
-  const unsigned int *const column_numbers
+  const size_type *const column_numbers
     = this->get_sparsity_pattern().colnums;
 
   // solve (LU)'x=b in two steps:
@@ -249,7 +249,7 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
   Vector<somenumber> tmp (N);
 
   dst = src;
-  for (unsigned int row=0; row<N; ++row)
+  for (size_type row=0; row<N; ++row)
     {
       dst(row) -= tmp (row);
       // scale by the diagonal element.
@@ -258,15 +258,15 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
       dst(row) *= this->diag_element(row);
 
       // get end of this row
-      const unsigned int *const rowend = &column_numbers[rowstart_indices[row+1]];
+      const size_type *const rowend = &column_numbers[rowstart_indices[row+1]];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       const somenumber dst_row = dst (row);
       const number *luval = this->SparseMatrix<number>::val +
                             (first_after_diagonal - column_numbers);
-      for (const unsigned int *col=first_after_diagonal; col!=rowend; ++col, ++luval)
+      for (const size_type *col=first_after_diagonal; col!=rowend; ++col, ++luval)
         tmp(*col) += *luval * dst_row;
     }
 
@@ -285,15 +285,15 @@ void SparseILU<number>::Tvmult (Vector<somenumber>       &dst,
 
       // get start of this row. skip the
       // diagonal element
-      const unsigned int *const rowstart = &column_numbers[rowstart_indices[row]+1];
+      const size_type *const rowstart = &column_numbers[rowstart_indices[row]+1];
       // find the position where the part
       // right of the diagonal starts
-      const unsigned int *const first_after_diagonal = this->prebuilt_lower_bound[row];
+      const size_type *const first_after_diagonal = this->prebuilt_lower_bound[row];
 
       const somenumber dst_row = dst (row);
       const number *luval = this->SparseMatrix<number>::val +
                             (rowstart - column_numbers);
-      for (const unsigned int *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
+      for (const size_type *col=rowstart; col!=first_after_diagonal; ++col, ++luval)
         tmp(*col) += *luval * dst_row;
     }
 }
index 41b672c7b1211bdb3000e6edb8bf0069c4369750..e23294bda0405e6fb910016730ab36956f7170f0 100644 (file)
@@ -38,6 +38,11 @@ template <typename number> class SparseILU;
  */
 namespace SparseMatrixIterators
 {
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   // forward declaration
   template <typename number, bool Constness>
   class Iterator;
@@ -97,9 +102,9 @@ namespace SparseMatrixIterators
      * @deprecated This constructor is deprecated. Use the other constructor
      * with a global index instead.
      */
-    Accessor (MatrixType         *matrix,
-              const unsigned int  row,
-              const unsigned int  index) DEAL_II_DEPRECATED;
+    Accessor (MatrixType     *matrix,
+              const size_type row,
+              const size_type index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor.
@@ -239,9 +244,9 @@ namespace SparseMatrixIterators
     /**
      * Constructor.
      */
-    Accessor (MatrixType         *matrix,
-              const unsigned int  row,
-              const unsigned int  index);
+    Accessor (MatrixType     *matrix,
+              const size_type row,
+              const size_type index);
 
     /**
      * Constructor.
@@ -345,9 +350,9 @@ namespace SparseMatrixIterators
      * @deprecated This constructor is deprecated. Use the other constructor
      * with a global index instead.
      */
-    Iterator (MatrixType        *matrix,
-              const unsigned int row,
-              const unsigned int index) DEAL_II_DEPRECATED;
+    Iterator (MatrixType     *matrix,
+              const size_type row,
+              const size_type index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor. Create an iterator into the matrix @p matrix for the given
@@ -423,7 +428,7 @@ namespace SparseMatrixIterators
     /**
      * Return an iterator that is @p n ahead of the current one.
      */
-    Iterator operator + (const unsigned int n) const;
+    Iterator operator + (const size_type n) const;
 
   private:
     /**
@@ -469,6 +474,11 @@ template <typename number>
 class SparseMatrix : public virtual Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Type of matrix entries. In analogy to the STL container classes.
    */
@@ -642,25 +652,25 @@ public:
    * Return the dimension of the image space. To remember: the matrix is of
    * dimension $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the range space. To remember: the matrix is of
    * dimension $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return the number of entries in a specific row.
    */
-  unsigned int get_row_length (const unsigned int row) const;
+  size_type get_row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero elements of this matrix. Actually, it
    * returns the number of entries in the sparsity pattern; if any of the
    * entries should happen to be zero, it is counted anyway.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return the number of actually nonzero elements of this matrix. It is
@@ -671,7 +681,7 @@ public:
    * count all entries of the sparsity pattern but only the ones that are
    * nonzero (or whose absolute value is greater than threshold).
    */
-  unsigned int n_actually_nonzero_elements (const double threshold = 0.) const;
+  size_type n_actually_nonzero_elements (const double threshold = 0.) const;
 
   /**
    * Return a (constant) reference to the underlying sparsity pattern of this
@@ -699,8 +709,8 @@ public:
    * entry does not exist or if <tt>value</tt> is not a finite number. Still,
    * it is allowed to store zero values in non-existent fields.
    */
-  void set (const unsigned int i,
-            const unsigned int j,
+  void set (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -719,7 +729,7 @@ public:
    * treated.
    */
   template <typename number2>
-  void set (const std::vector<unsigned int> &indices,
+  void set (const std::vector<size_type> &indices,
             const FullMatrix<number2>       &full_matrix,
             const bool                       elide_zero_values = false);
 
@@ -729,10 +739,10 @@ public:
    * and columns, respectively.
    */
   template <typename number2>
-  void set (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = false);
+  void set (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = false);
 
   /**
    * Set several elements in the specified row of the matrix with column
@@ -745,10 +755,10 @@ public:
    * treated.
    */
   template <typename number2>
-  void set (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number2>      &values,
-            const bool                       elide_zero_values = false);
+  void set (const size_type               row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number2>   &values,
+            const bool                    elide_zero_values = false);
 
   /**
    * Set several elements to values given by <tt>values</tt> in a given row in
@@ -760,19 +770,19 @@ public:
    * inserted/replaced.
    */
   template <typename number2>
-  void set (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = false);
+  void set (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = false);
 
   /**
    * Add <tt>value</tt> to the element (<i>i,j</i>).  Throws an error if the
    * entry does not exist or if <tt>value</tt> is not a finite number. Still,
    * it is allowed to store zero values in non-existent fields.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -790,9 +800,9 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Same function as before, but now including the possibility to use
@@ -800,10 +810,10 @@ public:
    * and columns, respectively.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Set several elements in the specified row of the matrix with column
@@ -815,10 +825,10 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number2>      &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type               row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number2>   &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by <tt>values</tt> in the given global
@@ -830,12 +840,12 @@ public:
    * i.e., zero values won't be added into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Multiply the entire matrix by a fixed factor.
@@ -940,8 +950,8 @@ public:
    * classes instead, since they are tailored better to a sparse matrix
    * structure.
    */
-  number operator () (const unsigned int i,
-                      const unsigned int j) const;
+  number operator () (const size_type i,
+                      const size_type j) const;
 
   /**
    * This function is mostly like operator()() in that it returns the value of
@@ -955,8 +965,8 @@ public:
    * classes instead, since they are tailored better to a sparse matrix
    * structure.
    */
-  number el (const unsigned int i,
-             const unsigned int j) const;
+  number el (const size_type i,
+             const size_type j) const;
 
   /**
    * Return the main diagonal element in the <i>i</i>th row. This function
@@ -968,13 +978,13 @@ public:
    * each row and access therefore does not involve searching for the right
    * column number.
    */
-  number diag_element (const unsigned int i) const;
+  number diag_element (const size_type i) const;
 
   /**
    * Same as above, but return a writeable reference. You're sure you know
    * what you do?
    */
-  number &diag_element (const unsigned int i);
+  number &diag_element (const size_type i);
 
   /**
    * Access to values in internal mode.  Returns the value of the
@@ -984,8 +994,8 @@ public:
    *
    * @deprecated Use iterator or const_iterator instead!
    */
-  number raw_entry (const unsigned int row,
-                    const unsigned int index) const DEAL_II_DEPRECATED;
+  number raw_entry (const size_type row,
+                    const size_type index) const DEAL_II_DEPRECATED;
 
   /**
    * This is for hackers. Get access to the <i>i</i>th element of this
@@ -1000,14 +1010,14 @@ public:
    *
    * @internal @deprecated Use iterator or const_iterator instead!
    */
-  number global_entry (const unsigned int i) const DEAL_II_DEPRECATED;
+  number global_entry (const size_type i) const DEAL_II_DEPRECATED;
 
   /**
    * Same as above, but with write access.  You certainly know what you do?
    *
    * @internal @deprecated Use iterator or const_iterator instead!
    */
-  number &global_entry (const unsigned int i) DEAL_II_DEPRECATED;
+  number &global_entry (const size_type i) DEAL_II_DEPRECATED;
 
 //@}
   /**
@@ -1291,8 +1301,8 @@ public:
    */
   template <typename somenumber>
   void PSOR (Vector<somenumber> &v,
-             const std::vector<unsigned int> &permutation,
-             const std::vector<unsigned int> &inverse_permutation,
+             const std::vector<size_type> &permutation,
+             const std::vector<size_type> &inverse_permutation,
              const number        om = 1.) const;
 
   /**
@@ -1307,8 +1317,8 @@ public:
    */
   template <typename somenumber>
   void TPSOR (Vector<somenumber> &v,
-              const std::vector<unsigned int> &permutation,
-              const std::vector<unsigned int> &inverse_permutation,
+              const std::vector<size_type> &permutation,
+              const std::vector<size_type> &inverse_permutation,
               const number        om = 1.) const;
 
   /**
@@ -1393,7 +1403,7 @@ public:
    * Note also the discussion in the general documentation of this class about
    * the order in which elements are accessed.
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -1404,7 +1414,7 @@ public:
    * particular the case if it is the end iterator for the last row of a
    * matrix.
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 
   /**
    * STL-like iterator with the first entry of row <tt>r</tt>. This is the
@@ -1418,7 +1428,7 @@ public:
    * Note the discussion in the general documentation of this class about
    * the order in which elements are accessed.
    */
-  iterator begin (const unsigned int r);
+  iterator begin (const size_type r);
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -1429,7 +1439,7 @@ public:
    * particular the case if it is the end iterator for the last row of a
    * matrix.
    */
-  iterator end (const unsigned int r);
+  iterator end (const size_type r);
 //@}
   /**
    * @name Input/Output
@@ -1615,7 +1625,7 @@ private:
 
 template <typename number>
 inline
-unsigned int SparseMatrix<number>::m () const
+typename SparseMatrix<number>::size_type SparseMatrix<number>::m () const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->rows;
@@ -1624,7 +1634,7 @@ unsigned int SparseMatrix<number>::m () const
 
 template <typename number>
 inline
-unsigned int SparseMatrix<number>::n () const
+typename SparseMatrix<number>::size_type SparseMatrix<number>::n () const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->cols;
@@ -1635,13 +1645,13 @@ unsigned int SparseMatrix<number>::n () const
 template <typename number>
 inline
 void
-SparseMatrix<number>::set (const unsigned int i,
-                           const unsigned int j,
+SparseMatrix<number>::set (const size_type i,
+                           const size_type j,
                            const number       value)
 {
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const unsigned int index = cols->operator()(i, j);
+  const size_type index = cols->operator()(i, j);
 
   // it is allowed to set elements of the matrix that are not part of the
   // sparsity pattern, if the value to which we set it is zero
@@ -1662,15 +1672,15 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::set (const std::vector<unsigned int> &indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::set (const std::vector<size_type> &indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (indices.size() == values.m(),
           ExcDimensionMismatch(indices.size(), values.m()));
   Assert (values.m() == values.n(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     set (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1681,17 +1691,17 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::set (const std::vector<unsigned int> &row_indices,
-                           const std::vector<unsigned int> &col_indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::set (const std::vector<size_type> &row_indices,
+                           const std::vector<size_type> &col_indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (row_indices.size() == values.m(),
           ExcDimensionMismatch(row_indices.size(), values.m()));
   Assert (col_indices.size() == values.n(),
           ExcDimensionMismatch(col_indices.size(), values.n()));
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     set (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1702,10 +1712,10 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::set (const unsigned int               row,
-                           const std::vector<unsigned int> &col_indices,
-                           const std::vector<number2>      &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::set (const size_type               row,
+                           const std::vector<size_type> &col_indices,
+                           const std::vector<number2>   &values,
+                           const bool                    elide_zero_values)
 {
   Assert (col_indices.size() == values.size(),
           ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1719,16 +1729,16 @@ SparseMatrix<number>::set (const unsigned int               row,
 template <typename number>
 inline
 void
-SparseMatrix<number>::add (const unsigned int i,
-                           const unsigned int j,
-                           const number       value)
+SparseMatrix<number>::add (const size_type i,
+                           const size_type j,
+                           const number    value)
 {
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
   if (value == 0)
     return;
 
-  const unsigned int index = cols->operator()(i, j);
+  const size_type index = cols->operator()(i, j);
 
   // it is allowed to add elements to the matrix that are not part of the
   // sparsity pattern, if the value to which we set it is zero
@@ -1749,15 +1759,15 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::add (const std::vector<unsigned int> &indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::add (const std::vector<size_type> &indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (indices.size() == values.m(),
           ExcDimensionMismatch(indices.size(), values.m()));
   Assert (values.m() == values.n(), ExcNotQuadratic());
 
-  for (unsigned int i=0; i<indices.size(); ++i)
+  for (size_type i=0; i<indices.size(); ++i)
     add (indices[i], indices.size(), &indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1768,17 +1778,17 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::add (const std::vector<unsigned int> &row_indices,
-                           const std::vector<unsigned int> &col_indices,
-                           const FullMatrix<number2>       &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::add (const std::vector<size_type> &row_indices,
+                           const std::vector<size_type> &col_indices,
+                           const FullMatrix<number2>    &values,
+                           const bool                    elide_zero_values)
 {
   Assert (row_indices.size() == values.m(),
           ExcDimensionMismatch(row_indices.size(), values.m()));
   Assert (col_indices.size() == values.n(),
           ExcDimensionMismatch(col_indices.size(), values.n()));
 
-  for (unsigned int i=0; i<row_indices.size(); ++i)
+  for (size_type i=0; i<row_indices.size(); ++i)
     add (row_indices[i], col_indices.size(), &col_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -1789,10 +1799,10 @@ template <typename number>
 template <typename number2>
 inline
 void
-SparseMatrix<number>::add (const unsigned int               row,
-                           const std::vector<unsigned int> &col_indices,
-                           const std::vector<number2>      &values,
-                           const bool                       elide_zero_values)
+SparseMatrix<number>::add (const size_type               row,
+                           const std::vector<size_type> &col_indices,
+                           const std::vector<number2>   &values,
+                           const bool                    elide_zero_values)
 {
   Assert (col_indices.size() == values.size(),
           ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1846,8 +1856,8 @@ SparseMatrix<number>::operator /= (const number factor)
 
 template <typename number>
 inline
-number SparseMatrix<number>::operator () (const unsigned int i,
-                                          const unsigned int j) const
+number SparseMatrix<number>::operator () (const size_type i,
+                                          const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (cols->operator()(i,j) != SparsityPattern::invalid_entry,
@@ -1859,11 +1869,11 @@ number SparseMatrix<number>::operator () (const unsigned int i,
 
 template <typename number>
 inline
-number SparseMatrix<number>::el (const unsigned int i,
-                                 const unsigned int j) const
+number SparseMatrix<number>::el (const size_type i,
+                                 const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
-  const unsigned int index = cols->operator()(i,j);
+  const size_type index = cols->operator()(i,j);
 
   if (index != SparsityPattern::invalid_entry)
     return val[index];
@@ -1875,7 +1885,7 @@ number SparseMatrix<number>::el (const unsigned int i,
 
 template <typename number>
 inline
-number SparseMatrix<number>::diag_element (const unsigned int i) const
+number SparseMatrix<number>::diag_element (const size_type i) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
@@ -1890,7 +1900,7 @@ number SparseMatrix<number>::diag_element (const unsigned int i) const
 
 template <typename number>
 inline
-number &SparseMatrix<number>::diag_element (const unsigned int i)
+number &SparseMatrix<number>::diag_element (const size_type i)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (m() == n(),  ExcNotQuadratic());
@@ -1906,8 +1916,8 @@ number &SparseMatrix<number>::diag_element (const unsigned int i)
 template <typename number>
 inline
 number
-SparseMatrix<number>::raw_entry (const unsigned int row,
-                                 const unsigned int index) const
+SparseMatrix<number>::raw_entry (const size_type row,
+                                 const size_type index) const
 {
   Assert(row<cols->rows, ExcIndexRange(row,0,cols->rows));
   Assert(index<cols->row_length(row),
@@ -1921,7 +1931,7 @@ SparseMatrix<number>::raw_entry (const unsigned int row,
 
 template <typename number>
 inline
-number SparseMatrix<number>::global_entry (const unsigned int j) const
+number SparseMatrix<number>::global_entry (const size_type j) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (j < cols->n_nonzero_elements(),
@@ -1934,7 +1944,7 @@ number SparseMatrix<number>::global_entry (const unsigned int j) const
 
 template <typename number>
 inline
-number &SparseMatrix<number>::global_entry (const unsigned int j)
+number &SparseMatrix<number>::global_entry (const size_type j)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (j < cols->n_nonzero_elements(),
@@ -1951,13 +1961,13 @@ void
 SparseMatrix<number>::copy_from (const ForwardIterator begin,
                                  const ForwardIterator end)
 {
-  Assert (static_cast<unsigned int>(std::distance (begin, end)) == m(),
+  Assert (static_cast<size_type>(std::distance (begin, end)) == m(),
           ExcIteratorRange (std::distance (begin, end), m()));
 
   // for use in the inner loop, we define a typedef to the type of the inner
   // iterators
   typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
-  unsigned int row=0;
+  size_type row=0;
   for (ForwardIterator i=begin; i!=end; ++i, ++row)
     {
       const inner_iterator end_of_row = i->end();
@@ -1976,9 +1986,9 @@ namespace SparseMatrixIterators
   template <typename number>
   inline
   Accessor<number,true>::
-  Accessor (const MatrixType   *matrix,
-            const unsigned int  row,
-            const unsigned int  index)
+  Accessor (const MatrixType *matrix,
+            const size_type   row,
+            const size_type   index)
     :
     SparsityPatternIterators::Accessor (&matrix->get_sparsity_pattern(),
                                         row, index),
@@ -2126,9 +2136,9 @@ namespace SparseMatrixIterators
   template <typename number>
   inline
   Accessor<number,false>::
-  Accessor (MatrixType         *matrix,
-            const unsigned int  row,
-            const unsigned int  index)
+  Accessor (MatrixType      *matrix,
+            const size_type  row,
+            const size_type  index)
     :
     SparsityPatternIterators::Accessor (&matrix->get_sparsity_pattern(),
                                         row, index),
@@ -2185,9 +2195,9 @@ namespace SparseMatrixIterators
   template <typename number, bool Constness>
   inline
   Iterator<number, Constness>::
-  Iterator (MatrixType        *matrix,
-            const unsigned int r,
-            const unsigned int i)
+  Iterator (MatrixType      *matrix,
+            const size_type  r,
+            const size_type  i)
     :
     accessor(matrix, r, i)
   {}
@@ -2325,10 +2335,10 @@ namespace SparseMatrixIterators
   inline
   Iterator<number,Constness>
   Iterator<number,Constness>::
-  operator + (const unsigned int n) const
+  operator + (const size_type n) const
   {
     Iterator x = *this;
-    for (unsigned int i=0; i<n; ++i)
+    for (size_type i=0; i<n; ++i)
       ++x;
 
     return x;
@@ -2377,7 +2387,7 @@ SparseMatrix<number>::end ()
 template <typename number>
 inline
 typename SparseMatrix<number>::const_iterator
-SparseMatrix<number>::begin (const unsigned int r) const
+SparseMatrix<number>::begin (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2389,7 +2399,7 @@ SparseMatrix<number>::begin (const unsigned int r) const
 template <typename number>
 inline
 typename SparseMatrix<number>::const_iterator
-SparseMatrix<number>::end (const unsigned int r) const
+SparseMatrix<number>::end (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2401,7 +2411,7 @@ SparseMatrix<number>::end (const unsigned int r) const
 template <typename number>
 inline
 typename SparseMatrix<number>::iterator
-SparseMatrix<number>::begin (const unsigned int r)
+SparseMatrix<number>::begin (const size_type r)
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2413,7 +2423,7 @@ SparseMatrix<number>::begin (const unsigned int r)
 template <typename number>
 inline
 typename SparseMatrix<number>::iterator
-SparseMatrix<number>::end (const unsigned int r)
+SparseMatrix<number>::end (const size_type r)
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
 
@@ -2432,14 +2442,14 @@ void SparseMatrix<number>::print (STREAM &out, bool across) const
 
   if (across)
     {
-      for (unsigned int i=0; i<cols->rows; ++i)
-        for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
+      for (size_type i=0; i<cols->rows; ++i)
+        for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
           out << ' ' << i << ',' << cols->colnums[j] << ':' << val[j];
       out << std::endl;
     }
   else
-    for (unsigned int i=0; i<cols->rows; ++i)
-      for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
+    for (size_type i=0; i<cols->rows; ++i)
+      for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
         out << "(" << i << "," << cols->colnums[j] << ") " << val[j] << std::endl;
 }
 
index 30f7c18a67b7b8c4214d31294da3339ac4f7f8b5..c049fdb8238f74fc17c0106d168685021682b4ee 100644 (file)
@@ -102,7 +102,7 @@ SparseMatrix<number>::SparseMatrix (const SparsityPattern &c,
   Assert (c.n_cols() == id.n(), ExcDimensionMismatch (c.n_cols(), id.n()));
 
   reinit (c);
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     this->set(i,i,1.);
 }
 
@@ -123,9 +123,11 @@ namespace internal
 {
   namespace SparseMatrix
   {
+    typedef types::global_dof_index size_type;
+
     template<typename T>
-    void zero_subrange (const unsigned int begin,
-                        const unsigned int end,
+    void zero_subrange (const size_type begin,
+                        const size_type end,
                         T *dst)
     {
       std::memset (dst+begin,0,(end-begin)*sizeof(T));
@@ -151,8 +153,8 @@ SparseMatrix<number>::operator = (const double d)
   // operator=. The grain size is chosen to reflect the number of rows in
   // minimum_parallel_grain_size, weighted by the number of nonzero entries
   // per row on average.
-  const unsigned int matrix_size = cols->n_nonzero_elements();
-  const unsigned int grain_size =
+  const size_type matrix_size = cols->n_nonzero_elements();
+  const size_type grain_size =
     internal::SparseMatrix::minimum_parallel_grain_size *
     (cols->n_nonzero_elements()+m()) / m();
   if (matrix_size>grain_size)
@@ -180,7 +182,7 @@ SparseMatrix<number>::operator= (const IdentityMatrix &id)
           ExcDimensionMismatch (cols->n_cols(), id.n()));
 
   *this = 0;
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     this->set(i,i,1.);
 
   return *this;
@@ -242,8 +244,8 @@ SparseMatrix<number>::empty () const
 
 
 template <typename number>
-unsigned int
-SparseMatrix<number>::get_row_length (const unsigned int row) const
+typename SparseMatrix<number>::size_type 
+SparseMatrix<number>::get_row_length (const size_type row) const
 {
   Assert (cols != 0, ExcNotInitialized());
   return cols->row_length(row);
@@ -252,7 +254,7 @@ SparseMatrix<number>::get_row_length (const unsigned int row) const
 
 
 template <typename number>
-unsigned int
+typename SparseMatrix<number>::size_type 
 SparseMatrix<number>::n_nonzero_elements () const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -262,14 +264,14 @@ SparseMatrix<number>::n_nonzero_elements () const
 
 
 template <typename number>
-unsigned int
+typename SparseMatrix<number>::size_type 
 SparseMatrix<number>::n_actually_nonzero_elements (const double threshold) const
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (threshold >= 0, ExcMessage ("Negative threshold!"));
-  unsigned int nnz = 0;
-  const unsigned int nnz_alloc = n_nonzero_elements();
-  for (unsigned int i=0; i<nnz_alloc; ++i)
+  size_type nnz = 0;
+  const size_type nnz_alloc = n_nonzero_elements();
+  for (size_type i=0; i<nnz_alloc; ++i)
     if (std::fabs(val[i]) > threshold)
       ++nnz;
   return nnz;
@@ -284,15 +286,15 @@ SparseMatrix<number>::symmetrize ()
   Assert (cols != 0, ExcNotInitialized());
   Assert (cols->rows == cols->cols, ExcNotQuadratic());
 
-  const unsigned int n_rows = m();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = m();
+  for (size_type row=0; row<n_rows; ++row)
     {
       // first skip diagonal entry
       number             *val_ptr = &val[cols->rowstart[row]];
       if (m() == n())
         ++val_ptr;
-      const unsigned int *colnum_ptr = &cols->colnums[cols->rowstart[row]+1];
-      const number       *const val_end_of_row = &val[cols->rowstart[row+1]];
+      const size_type *colnum_ptr = &cols->colnums[cols->rowstart[row]+1];
+      const number    *const val_end_of_row = &val[cols->rowstart[row+1]];
 
       // treat lower left triangle
       while ((val_ptr != val_end_of_row) && (*colnum_ptr<row))
@@ -342,8 +344,8 @@ SparseMatrix<number>::copy_from (const FullMatrix<somenumber> &matrix)
   *this = 0;
 
   // then copy old matrix
-  for (unsigned int row=0; row<matrix.m(); ++row)
-    for (unsigned int col=0; col<matrix.n(); ++col)
+  for (size_type row=0; row<matrix.m(); ++row)
+    for (size_type col=0; col<matrix.n(); ++col)
       if (matrix(row,col) != 0)
         set (row, col, matrix(row,col));
 }
@@ -385,21 +387,21 @@ namespace internal
     template <typename number,
              typename InVector,
              typename OutVector>
-    void vmult_on_subrange (const unsigned int  begin_row,
-                            const unsigned int  end_row,
-                            const number       *values,
+    void vmult_on_subrange (const size_type    begin_row,
+                            const size_type    end_row,
+                            const number      *values,
                             const std::size_t *rowstart,
-                            const unsigned int *colnums,
-                            const InVector     &src,
-                            OutVector          &dst,
-                            const bool          add)
+                            const size_type   *colnums,
+                            const InVector    &src,
+                            OutVector         &dst,
+                            const bool         add)
     {
-      const number       *val_ptr    = &values[rowstart[begin_row]];
-      const unsigned int *colnum_ptr = &colnums[rowstart[begin_row]];
+      const number    *val_ptr    = &values[rowstart[begin_row]];
+      const size_type *colnum_ptr = &colnums[rowstart[begin_row]];
       typename OutVector::iterator dst_ptr = dst.begin() + begin_row;
 
       if (add == false)
-        for (unsigned int row=begin_row; row<end_row; ++row)
+        for (size_type row=begin_row; row<end_row; ++row)
           {
             typename OutVector::value_type s = 0.;
             const number *const val_end_of_row = &values[rowstart[row+1]];
@@ -408,7 +410,7 @@ namespace internal
             *dst_ptr++ = s;
           }
       else
-        for (unsigned int row=begin_row; row<end_row; ++row)
+        for (size_type row=begin_row; row<end_row; ++row)
           {
             typename OutVector::value_type s = *dst_ptr;
             const number *const val_end_of_row = &values[rowstart[row+1]];
@@ -424,12 +426,12 @@ namespace internal
 template <typename number>
 template <typename number2>
 void
-SparseMatrix<number>::add (const unsigned int  row,
-                           const unsigned int  n_cols,
-                           const unsigned int *col_indices,
-                           const number2      *values,
-                           const bool          elide_zero_values,
-                           const bool          col_indices_are_sorted)
+SparseMatrix<number>::add (const size_type  row,
+                           const size_type  n_cols,
+                           const size_type *col_indices,
+                           const number2   *values,
+                           const bool       elide_zero_values,
+                           const bool       col_indices_are_sorted)
 {
   Assert (cols != 0, ExcNotInitialized());
 
@@ -444,14 +446,14 @@ SparseMatrix<number>::add (const unsigned int  row,
       // check whether the given indices are
       // really sorted
 #ifdef DEBUG
-      for (unsigned int i=1; i<n_cols; ++i)
+      for (size_type i=1; i<n_cols; ++i)
         Assert (col_indices[i] > col_indices[i-1],
                 ExcMessage("List of indices is unsorted or contains duplicates."));
 #endif
 
-      const unsigned int *this_cols =
+      const size_type *this_cols =
         &cols->colnums[cols->rowstart[row]];
-      const unsigned int row_length_1 = cols->row_length(row)-1;
+      const size_type row_length_1 = cols->row_length(row)-1;
       number *val_ptr = &val[cols->rowstart[row]];
 
       if (m() == n())
@@ -459,12 +461,12 @@ SparseMatrix<number>::add (const unsigned int  row,
 
           // find diagonal and add it if found
           Assert (this_cols[0] == row, ExcInternalError());
-          const unsigned int *diag_pos =
+          const size_type *diag_pos =
             Utilities::lower_bound (col_indices,
                                     col_indices+n_cols,
                                     row);
-          const unsigned int diag = diag_pos - col_indices;
-          unsigned int post_diag = diag;
+          const size_type diag = diag_pos - col_indices;
+          size_type post_diag = diag;
           if (diag != n_cols && *diag_pos == row)
             {
               val_ptr[0] += *(values+(diag_pos-col_indices));
@@ -472,8 +474,8 @@ SparseMatrix<number>::add (const unsigned int  row,
             }
 
           // add indices before diagonal
-          unsigned int counter = 1;
-          for (unsigned int i=0; i<diag; ++i)
+          size_type counter = 1;
+          for (size_type i=0; i<diag; ++i)
             {
               while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                 ++counter;
@@ -485,7 +487,7 @@ SparseMatrix<number>::add (const unsigned int  row,
             }
 
           // add indices after diagonal
-          for (unsigned int i=post_diag; i<n_cols; ++i)
+          for (size_type i=post_diag; i<n_cols; ++i)
             {
               while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                 ++counter;
@@ -501,8 +503,8 @@ SparseMatrix<number>::add (const unsigned int  row,
         }
       else
         {
-          unsigned int counter = 0;
-          for (unsigned int i=0; i<n_cols; ++i)
+          size_type counter = 0;
+          for (size_type i=0; i<n_cols; ++i)
             {
               while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                 ++counter;
@@ -521,11 +523,11 @@ SparseMatrix<number>::add (const unsigned int  row,
   // unsorted case: first, search all the
   // indices to find out which values we
   // actually need to add.
-  const unsigned int *const my_cols = cols->colnums;
-  unsigned int index = cols->rowstart[row];
-  const unsigned int next_row_index = cols->rowstart[row+1];
+  const size_type *const my_cols = cols->colnums;
+  size_type index = cols->rowstart[row];
+  const size_type next_row_index = cols->rowstart[row+1];
 
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     {
       const number value = values[j];
       Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -568,11 +570,11 @@ add_value:
 template <typename number>
 template <typename number2>
 void
-SparseMatrix<number>::set (const unsigned int  row,
-                           const unsigned int  n_cols,
-                           const unsigned int *col_indices,
-                           const number2      *values,
-                           const bool          elide_zero_values)
+SparseMatrix<number>::set (const size_type  row,
+                           const size_type  n_cols,
+                           const size_type *col_indices,
+                           const number2   *values,
+                           const bool       elide_zero_values)
 {
   Assert (cols != 0, ExcNotInitialized());
   Assert (row < m(), ExcInvalidIndex1(row));
@@ -580,13 +582,13 @@ SparseMatrix<number>::set (const unsigned int  row,
   // First, search all the indices to find
   // out which values we actually need to
   // set.
-  const unsigned int *my_cols = cols->colnums;
+  const size_type *my_cols = cols->colnums;
   std::size_t index = cols->rowstart[row], next_index = index;
   const std::size_t next_row_index = cols->rowstart[row+1];
 
   if (elide_zero_values == true)
     {
-      for (unsigned int j=0; j<n_cols; ++j)
+      for (size_type j=0; j<n_cols; ++j)
         {
           const number value = values[j];
           Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -622,7 +624,7 @@ set_value:
   else
     {
       // same code as above, but now check for zeros
-      for (unsigned int j=0; j<n_cols; ++j)
+      for (size_type j=0; j<n_cols; ++j)
         {
           const number value = values[j];
           Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -691,11 +693,11 @@ SparseMatrix<number>::Tvmult (OutVector &dst,
 
   dst = 0;
 
-  for (unsigned int i=0; i<m(); i++)
+  for (size_type i=0; i<m(); i++)
     {
-      for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
+      for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
         {
-          const unsigned int p = cols->colnums[j];
+          const size_type p = cols->colnums[j];
           dst(p) += val[j] * src(i);
         }
     }
@@ -744,10 +746,10 @@ SparseMatrix<number>::Tvmult_add (OutVector &dst,
 
   Assert (!PointerComparison::equal(&src, &dst), ExcSourceEqualsDestination());
 
-  for (unsigned int i=0; i<m(); i++)
-    for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
+  for (size_type i=0; i<m(); i++)
+    for (size_type j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
       {
-        const unsigned int p = cols->colnums[j];
+        const size_type p = cols->colnums[j];
         dst(p) += val[j] * src(i);
       }
 }
@@ -770,19 +772,19 @@ namespace internal
      */
     template <typename number,
              typename InVector>
-    number matrix_norm_sqr_on_subrange (const unsigned int  begin_row,
-                                        const unsigned int  end_row,
-                                        const number       *values,
+    number matrix_norm_sqr_on_subrange (const size_type    begin_row,
+                                        const size_type    end_row,
+                                        const number      *values,
                                         const std::size_t *rowstart,
-                                        const unsigned int *colnums,
-                                        const InVector     &v)
+                                        const size_type   *colnums,
+                                        const InVector    &v)
     {
       number norm_sqr=0.;
 
-      for (unsigned int i=begin_row; i<end_row; ++i)
+      for (size_type i=begin_row; i<end_row; ++i)
         {
           number s = 0;
-          for (unsigned int j=rowstart[i]; j<rowstart[i+1] ; j++)
+          for (size_type j=rowstart[i]; j<rowstart[i+1] ; j++)
             s += values[j] * v(colnums[j]);
           norm_sqr += v(i)*numbers::NumberTraits<number>::conjugate(s);
         }
@@ -833,20 +835,20 @@ namespace internal
      */
     template <typename number,
              typename InVector>
-    number matrix_scalar_product_on_subrange (const unsigned int  begin_row,
-                                              const unsigned int  end_row,
-                                              const number       *values,
+    number matrix_scalar_product_on_subrange (const size_type    begin_row,
+                                              const size_type    end_row,
+                                              const number      *values,
                                               const std::size_t *rowstart,
-                                              const unsigned int *colnums,
-                                              const InVector     &u,
-                                              const InVector     &v)
+                                              const size_type   *colnums,
+                                              const InVector    &u,
+                                              const InVector    &v)
     {
       number norm_sqr=0.;
 
-      for (unsigned int i=begin_row; i<end_row; ++i)
+      for (size_type i=begin_row; i<end_row; ++i)
         {
           number s = 0;
-          for (unsigned int j=rowstart[i]; j<rowstart[i+1] ; j++)
+          for (size_type j=rowstart[i]; j<rowstart[i+1] ; j++)
             s += values[j] * v(colnums[j]);
           norm_sqr += u(i)*numbers::NumberTraits<number>::conjugate(s);
         }
@@ -924,17 +926,17 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
       // CompressedSimpleSparsityPattern class.
       {
         CompressedSimpleSparsityPattern csp (m(), B.n());
-        for (unsigned int i = 0; i < csp.n_rows(); ++i)
+        for (size_type i = 0; i < csp.n_rows(); ++i)
           {
-            const unsigned int *rows = &sp_A.colnums[sp_A.rowstart[i]];
-            const unsigned int *const end_rows =
+            const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]];
+            const size_type *const end_rows =
               &sp_A.colnums[sp_A.rowstart[i+1]];
             for (; rows != end_rows; ++rows)
               {
-                const unsigned int col = *rows;
-                unsigned int *new_cols = const_cast<unsigned int *>
+                const size_type col = *rows;
+                size_type *new_cols = const_cast<size_type *>
                                          (&sp_B.colnums[sp_B.rowstart[col]]);
-                unsigned int *end_new_cols = const_cast<unsigned int *>
+                size_type *end_new_cols = const_cast<size_type *>
                                              (&sp_B.colnums[sp_B.rowstart[col+1]]);
 
                 // if B has a diagonal, need to add that manually. this way,
@@ -961,8 +963,8 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
   // create an array that caches some
   // elements that are going to be written
   // into the new matrix.
-  unsigned int max_n_cols_B = 0;
-  for (unsigned int i=0; i<B.m(); ++i)
+  size_type max_n_cols_B = 0;
+  for (size_type i=0; i<B.m(); ++i)
     max_n_cols_B = std::max (max_n_cols_B, sp_B.row_length(i));
   std::vector<numberC> new_entries(max_n_cols_B);
 
@@ -970,15 +972,15 @@ SparseMatrix<number>::mmult (SparseMatrix<numberC>       &C,
   // nested loops. One over the rows of A, for each row we then loop over all
   // the columns, and then we need to multiply each element with all the
   // elements in that row in B.
-  for (unsigned int i=0; i<C.m(); ++i)
+  for (size_type i=0; i<C.m(); ++i)
     {
-      const unsigned int *rows = &sp_A.colnums[sp_A.rowstart[i]];
-      const unsigned int *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
+      const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]];
+      const size_type *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
       for (; rows != end_rows; ++rows)
         {
           const double A_val = val[rows-&sp_A.colnums[sp_A.rowstart[0]]];
-          const unsigned int col = *rows;
-          const unsigned int *new_cols =
+          const size_type col = *rows;
+          const size_type *new_cols =
             (&sp_B.colnums[sp_B.rowstart[col]]);
 
           // special treatment for diagonal
@@ -1051,16 +1053,16 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
       // CompressedSimpleSparsityPattern class.
       {
         CompressedSimpleSparsityPattern csp (n(), B.n());
-        for (unsigned int i = 0; i < sp_A.n_rows(); ++i)
+        for (size_type i = 0; i < sp_A.n_rows(); ++i)
           {
-            const unsigned int *rows =
+            const size_type *rows =
               &sp_A.colnums[sp_A.rowstart[i]];
-            const unsigned int *const end_rows =
+            const size_type *const end_rows =
               &sp_A.colnums[sp_A.rowstart[i+1]];
             // cast away constness to conform with csp.add_entries interface
-            unsigned int *new_cols = const_cast<unsigned int *>
+            size_type *new_cols = const_cast<size_type*>
                                      (&sp_B.colnums[sp_B.rowstart[i]]);
-            unsigned int *end_new_cols = const_cast<unsigned int *>
+            size_type *end_new_cols = const_cast<size_type*>
                                          (&sp_B.colnums[sp_B.rowstart[i+1]]);
 
             if (sp_B.n_rows() == sp_B.n_cols())
@@ -1068,7 +1070,7 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
 
             for (; rows != end_rows; ++rows)
               {
-                const unsigned int row = *rows;
+                const size_type row = *rows;
 
                 // if B has a diagonal, need to add that manually. this way,
                 // we maintain sortedness.
@@ -1091,8 +1093,8 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
   // create an array that caches some
   // elements that are going to be written
   // into the new matrix.
-  unsigned int max_n_cols_B = 0;
-  for (unsigned int i=0; i<B.m(); ++i)
+  size_type max_n_cols_B = 0;
+  for (size_type i=0; i<B.m(); ++i)
     max_n_cols_B = std::max (max_n_cols_B, sp_B.row_length(i));
   std::vector<numberC> new_entries(max_n_cols_B);
 
@@ -1100,11 +1102,11 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
   // nested loops. One over the rows of A, for each row we then loop over all
   // the columns, and then we need to multiply each element with all the
   // elements in that row in B.
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      const unsigned int *rows = &sp_A.colnums[sp_A.rowstart[i]];
-      const unsigned int *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
-      const unsigned int *new_cols = &sp_B.colnums[sp_B.rowstart[i]];
+      const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]];
+      const size_type *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]];
+      const size_type *new_cols = &sp_B.colnums[sp_B.rowstart[i]];
       if (sp_B.n_rows() == sp_B.n_cols())
         ++new_cols;
 
@@ -1112,7 +1114,7 @@ SparseMatrix<number>::Tmmult (SparseMatrix<numberC>       &C,
 
       for (; rows != end_rows; ++rows)
         {
-          const unsigned int row = *rows;
+          const size_type row = *rows;
           const double A_val = val[rows-&sp_A.colnums[sp_A.rowstart[0]]];
 
           // special treatment for diagonal
@@ -1146,9 +1148,9 @@ SparseMatrix<number>::l1_norm () const
   Assert (val != 0, ExcNotInitialized());
 
   Vector<real_type> column_sums(n());
-  const unsigned int n_rows = m();
-  for (unsigned int row=0; row<n_rows; ++row)
-    for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1] ; ++j)
+  const size_type n_rows = m();
+  for (size_type row=0; row<n_rows; ++row)
+    for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1] ; ++j)
       column_sums(cols->colnums[j]) += numbers::NumberTraits<number>::abs(val[j]);
 
   return column_sums.linfty_norm();
@@ -1166,8 +1168,8 @@ SparseMatrix<number>::linfty_norm () const
   const number *val_ptr = &val[cols->rowstart[0]];
 
   real_type max=0;
-  const unsigned int n_rows = m();
-  for (unsigned int row=0; row<n_rows; ++row)
+  const size_type n_rows = m();
+  for (size_type row=0; row<n_rows; ++row)
     {
       real_type sum = 0;
       const number *const val_end_of_row = &val[cols->rowstart[row+1]];
@@ -1189,7 +1191,7 @@ SparseMatrix<number>::frobenius_norm () const
   // sparsity pattern, without taking any
   // reference to rows or columns
   real_type norm_sqr = 0;
-  const unsigned int n_rows = m();
+  const size_type n_rows = m();
   for (const number *ptr = &val[0];
        ptr != &val[cols->rowstart[n_rows]]; ++ptr)
     norm_sqr +=  numbers::NumberTraits<number>::abs_square(*ptr);
@@ -1217,21 +1219,21 @@ namespace internal
     template <typename number,
              typename InVector,
              typename OutVector>
-    number residual_sqr_on_subrange (const unsigned int  begin_row,
-                                     const unsigned int  end_row,
-                                     const number       *values,
+    number residual_sqr_on_subrange (const size_type    begin_row,
+                                     const size_type    end_row,
+                                     const number      *values,
                                      const std::size_t *rowstart,
-                                     const unsigned int *colnums,
-                                     const InVector     &u,
-                                     const InVector     &b,
-                                     OutVector          &dst)
+                                     const size_type   *colnums,
+                                     const InVector    &u,
+                                     const InVector    &b,
+                                     OutVector         &dst)
     {
       number norm_sqr=0.;
 
-      for (unsigned int i=begin_row; i<end_row; ++i)
+      for (size_type i=begin_row; i<end_row; ++i)
         {
           number s = b(i);
-          for (unsigned int j=rowstart[i]; j<rowstart[i+1] ; j++)
+          for (size_type j=rowstart[i]; j<rowstart[i+1] ; j++)
             s -= values[j] * u(colnums[j]);
           dst(i) = s;
           norm_sqr += s*numbers::NumberTraits<number>::conjugate(s);
@@ -1285,9 +1287,9 @@ SparseMatrix<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   AssertDimension (dst.size(), n());
   AssertDimension (src.size(), n());
 
-  const unsigned int n = src.size();
-  somenumber              *dst_ptr = dst.begin();
-  const somenumber        *src_ptr = src.begin();
+  const size_type n = src.size();
+  somenumber            *dst_ptr = dst.begin();
+  const somenumber      *src_ptr = src.begin();
   const std::size_t *rowstart_ptr = &cols->rowstart[0];
 
   // optimize the following loop for
@@ -1302,10 +1304,10 @@ SparseMatrix<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   // rowstart[i]. and we do have a
   // square matrix by above assertion
   if (om != 1.)
-    for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
+    for (size_type i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
       *dst_ptr = om * *src_ptr / val[*rowstart_ptr];
   else
-    for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
+    for (size_type i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
       *dst_ptr = *src_ptr / val[*rowstart_ptr];
 }
 
@@ -1329,9 +1331,9 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
   AssertDimension (dst.size(), n());
   AssertDimension (src.size(), n());
 
-  const unsigned int  n            = src.size();
-  const std::size_t  *rowstart_ptr = &cols->rowstart[0];
-  somenumber         *dst_ptr      = &dst(0);
+  const size_type    n            = src.size();
+  const std::size_t *rowstart_ptr = &cols->rowstart[0];
+  somenumber        *dst_ptr      = &dst(0);
 
   // case when we have stored the position
   // just right of the diagonal (then we
@@ -1342,7 +1344,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
               ExcDimensionMismatch (pos_right_of_diagonal.size(), dst.size()));
 
       // forward sweep
-      for (unsigned int row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
+      for (size_type row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
         {
           *dst_ptr = src(row);
           const std::size_t first_right_of_diagonal_index =
@@ -1350,7 +1352,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
           Assert (first_right_of_diagonal_index <= *(rowstart_ptr+1),
                   ExcInternalError());
           number s = 0;
-          for (unsigned int j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
+          for (size_type j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
             s += val[j] * dst(cols->colnums[j]);
 
           // divide by diagonal element
@@ -1369,11 +1371,11 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
       dst_ptr      = &dst(n-1);
       for (int row=n-1; row>=0; --row, --rowstart_ptr, --dst_ptr)
         {
-          const unsigned int end_row = *(rowstart_ptr+1);
-          const unsigned int first_right_of_diagonal_index
+          const size_type end_row = *(rowstart_ptr+1);
+          const size_type first_right_of_diagonal_index
             = pos_right_of_diagonal[row];
           number s = 0;
-          for (unsigned int j=first_right_of_diagonal_index; j<end_row; ++j)
+          for (size_type j=first_right_of_diagonal_index; j<end_row; ++j)
             s += val[j] * dst(cols->colnums[j]);
 
           *dst_ptr -= s * om;
@@ -1387,7 +1389,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
   // of the first element right of the
   // diagonal manually for each sweep.
   // forward sweep
-  for (unsigned int row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
+  for (size_type row=0; row<n; ++row, ++dst_ptr, ++rowstart_ptr)
     {
       *dst_ptr = src(row);
       // find the first element in this line
@@ -1397,7 +1399,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
       // note: the first entry in each
       // line denotes the diagonal element,
       // which we need not check.
-      const unsigned int first_right_of_diagonal_index
+      const size_type first_right_of_diagonal_index
         = (Utilities::lower_bound (&cols->colnums[*rowstart_ptr+1],
                                    &cols->colnums[*(rowstart_ptr+1)],
                                    row)
@@ -1405,7 +1407,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
            &cols->colnums[0]);
 
       number s = 0;
-      for (unsigned int j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
+      for (size_type j=(*rowstart_ptr)+1; j<first_right_of_diagonal_index; ++j)
         s += val[j] * dst(cols->colnums[j]);
 
       // divide by diagonal element
@@ -1416,7 +1418,7 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
 
   rowstart_ptr = &cols->rowstart[0];
   dst_ptr      = &dst(0);
-  for (unsigned int row=0; row<n; ++row, ++rowstart_ptr, ++dst_ptr)
+  for (size_type row=0; row<n; ++row, ++rowstart_ptr, ++dst_ptr)
     *dst_ptr *= (2.-om)*val[*rowstart_ptr];
 
   // backward sweep
@@ -1424,14 +1426,14 @@ SparseMatrix<number>::precondition_SSOR (Vector<somenumber>              &dst,
   dst_ptr      = &dst(n-1);
   for (int row=n-1; row>=0; --row, --rowstart_ptr, --dst_ptr)
     {
-      const unsigned int end_row = *(rowstart_ptr+1);
-      const unsigned int first_right_of_diagonal_index
+      const size_type end_row = *(rowstart_ptr+1);
+      const size_type first_right_of_diagonal_index
         = (Utilities::lower_bound (&cols->colnums[*rowstart_ptr+1],
                                    &cols->colnums[end_row],
-                                   static_cast<unsigned int>(row)) -
+                                   static_cast<size_type>(row)) -
            &cols->colnums[0]);
       number s = 0;
-      for (unsigned int j=first_right_of_diagonal_index; j<end_row; ++j)
+      for (size_type j=first_right_of_diagonal_index; j<end_row; ++j)
         s += val[j] * dst(cols->colnums[j]);
       *dst_ptr -= s * om;
       Assert(val[*rowstart_ptr]!= 0., ExcDivideByZero());
@@ -1481,12 +1483,12 @@ SparseMatrix<number>::SOR (Vector<somenumber> &dst,
   AssertDimension (m(), n());
   AssertDimension (dst.size(), n());
 
-  for (unsigned int row=0; row<m(); ++row)
+  for (size_type row=0; row<m(); ++row)
     {
       somenumber s = dst(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
-          const unsigned int col = cols->colnums[j];
+          const size_type col = cols->colnums[j];
           if (col < row)
             s -= val[j] * dst(col);
         }
@@ -1508,11 +1510,11 @@ SparseMatrix<number>::TSOR (Vector<somenumber> &dst,
   AssertDimension (m(), n());
   AssertDimension (dst.size(), n());
 
-  unsigned int row=m()-1;
+  size_type row=m()-1;
   while (true)
     {
       somenumber s = dst(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         if (cols->colnums[j] > row)
           s -= val[j] * dst(cols->colnums[j]);
 
@@ -1531,8 +1533,8 @@ template <typename number>
 template <typename somenumber>
 void
 SparseMatrix<number>::PSOR (Vector<somenumber> &dst,
-                            const std::vector<unsigned int> &permutation,
-                            const std::vector<unsigned int> &inverse_permutation,
+                            const std::vector<size_type> &permutation,
+                            const std::vector<size_type> &inverse_permutation,
                             const number om) const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -1545,14 +1547,14 @@ SparseMatrix<number>::PSOR (Vector<somenumber> &dst,
   Assert (m() == inverse_permutation.size(),
           ExcDimensionMismatch(m(), inverse_permutation.size()));
 
-  for (unsigned int urow=0; urow<m(); ++urow)
+  for (size_type urow=0; urow<m(); ++urow)
     {
-      const unsigned int row = permutation[urow];
+      const size_type row = permutation[urow];
       somenumber s = dst(row);
 
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
-          const unsigned int col = cols->colnums[j];
+          const size_type col = cols->colnums[j];
           if (inverse_permutation[col] < urow)
             {
               s -= val[j] * dst(col);
@@ -1569,8 +1571,8 @@ template <typename number>
 template <typename somenumber>
 void
 SparseMatrix<number>::TPSOR (Vector<somenumber> &dst,
-                             const std::vector<unsigned int> &permutation,
-                             const std::vector<unsigned int> &inverse_permutation,
+                             const std::vector<size_type> &permutation,
+                             const std::vector<size_type> &inverse_permutation,
                              const number om) const
 {
   Assert (cols != 0, ExcNotInitialized());
@@ -1583,14 +1585,14 @@ SparseMatrix<number>::TPSOR (Vector<somenumber> &dst,
   Assert (m() == inverse_permutation.size(),
           ExcDimensionMismatch(m(), inverse_permutation.size()));
 
-  for (unsigned int urow=m(); urow != 0;)
+  for (size_type urow=m(); urow != 0;)
     {
       --urow;
-      const unsigned int row = permutation[urow];
+      const size_type row = permutation[urow];
       somenumber s = dst(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
-          const unsigned int col = cols->colnums[j];
+          const size_type col = cols->colnums[j];
           if (inverse_permutation[col] > urow)
             s -= val[j] * dst(col);
         }
@@ -1646,10 +1648,10 @@ SparseMatrix<number>::SOR_step (Vector<somenumber> &v,
   Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
   Assert (m() == b.size(), ExcDimensionMismatch(m(),b.size()));
 
-  for (unsigned int row=0; row<m(); ++row)
+  for (size_type row=0; row<m(); ++row)
     {
       somenumber s = b(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
           s -= val[j] * v(cols->colnums[j]);
         }
@@ -1676,7 +1678,7 @@ SparseMatrix<number>::TSOR_step (Vector<somenumber> &v,
   for (int row=m()-1; row>=0; --row)
     {
       somenumber s = b(row);
-      for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+      for (size_type j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
         {
           s -= val[j] * v(cols->colnums[j]);
         }
@@ -1714,16 +1716,16 @@ SparseMatrix<number>::SSOR (Vector<somenumber> &dst,
   AssertDimension (m(), n());
   Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
 
-  const unsigned int  n = dst.size();
-  unsigned int  j;
+  const size_type n = dst.size();
+  size_type j;
   somenumber s;
 
-  for (unsigned int i=0; i<n; i++)
+  for (size_type i=0; i<n; i++)
     {
       s = 0.;
       for (j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
         {
-          const unsigned int p = cols->colnums[j];
+          const size_type p = cols->colnums[j];
           if (p != SparsityPattern::invalid_entry)
             {
               if (i>j) s += val[j] * dst(p);
@@ -1739,10 +1741,10 @@ SparseMatrix<number>::SSOR (Vector<somenumber> &dst,
       s = 0.;
       for (j=cols->rowstart[i]; j<cols->rowstart[i+1] ; j++)
         {
-          const unsigned int p = cols->colnums[j];
+          const size_type p = cols->colnums[j];
           if (p != SparsityPattern::invalid_entry)
             {
-              if (static_cast<unsigned int>(i)<j) s += val[j] * dst(p);
+              if (static_cast<size_type>(i)<j) s += val[j] * dst(p);
             }
         }
       Assert(val[cols->rowstart[i]]!= 0., ExcDivideByZero());
@@ -1791,9 +1793,9 @@ void SparseMatrix<number>::print_formatted (std::ostream &out,
         width = precision+2;
     }
 
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         if ((*cols)(i,j) != SparsityPattern::invalid_entry)
           out << std::setw(width)
               << val[cols->operator()(i,j)] * denominator << ' ';
@@ -1817,9 +1819,9 @@ void SparseMatrix<number>::print_pattern (std::ostream &out,
   Assert (cols != 0, ExcNotInitialized());
   Assert (val != 0, ExcNotInitialized());
 
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         if ((*cols)(i,j) == SparsityPattern::invalid_entry)
           out << '.';
         else if (std::fabs(val[cols->operator()(i,j)]) > threshold)
index a7fa2e7f466ea65955cd6e288727b0aec5804d42..b1c1c8ca1713095163037380d72dc9bce3e897f6 100644 (file)
@@ -97,6 +97,11 @@ template <typename number>
 class SparseMatrixEZ : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * The class for storing the
    * column number of an entry
@@ -115,13 +120,13 @@ public:
      * Constructor. Fills column
      * and value.
      */
-    Entry (const unsigned int column,
+    Entry (const size_type column,
            const number &value);
 
     /**
      * The column number.
      */
-    unsigned int column;
+    size_type column;
 
     /**
      * The value there.
@@ -131,7 +136,7 @@ public:
     /**
      * Non-existent column number.
      */
-    static const unsigned int invalid = numbers::invalid_unsigned_int;
+    static const size_type invalid = numbers::invalid_size_type;
   };
 
   /**
@@ -145,13 +150,13 @@ public:
     /**
      * Constructor.
      */
-    RowInfo (unsigned int start = Entry::invalid);
+    RowInfo (size_type start = Entry::invalid);
 
     /**
      * Index of first entry of
      * the row in the data field.
      */
-    unsigned int start;
+    size_type start;
     /**
      * Number of entries in this
      * row.
@@ -191,7 +196,7 @@ public:
        * pointer is sufficient.
        */
       Accessor (const SparseMatrixEZ<number> *matrix,
-                const unsigned int            row,
+                const size_type               row,
                 const unsigned short          index);
 
       /**
@@ -199,7 +204,7 @@ public:
        * represented by this
        * object.
        */
-      unsigned int row() const;
+      size_type row() const;
 
       /**
        * Index in row of the element
@@ -213,7 +218,7 @@ public:
        * element represented by
        * this object.
        */
-      unsigned int column() const;
+      size_type column() const;
 
       /**
        * Value of this matrix entry.
@@ -229,7 +234,7 @@ public:
       /**
        * Current row number.
        */
-      unsigned int a_row;
+      size_type a_row;
 
       /**
        * Current index in row.
@@ -248,7 +253,7 @@ public:
      * Constructor.
      */
     const_iterator(const SparseMatrixEZ<number> *matrix,
-                   const unsigned int            row,
+                   const size_type               row,
                    const unsigned short          index);
 
     /**
@@ -364,9 +369,9 @@ public:
    * efficient assembling of the
    * matrix.
    */
-  explicit SparseMatrixEZ (const unsigned int n_rows,
-                           const unsigned int n_columns,
-                           const unsigned int default_row_length = 0,
+  explicit SparseMatrixEZ (const size_type n_rows,
+                           const size_type n_columns,
+                           const size_type default_row_length = 0,
                            const unsigned int default_increment = 1);
 
   /**
@@ -415,11 +420,11 @@ public:
    * efficient assembling of the
    * matrix.
    */
-  void reinit (const unsigned int n_rows,
-               const unsigned int n_columns,
-               unsigned int default_row_length = 0,
+  void reinit (const size_type n_rows,
+               const size_type n_columns,
+               size_type default_row_length = 0,
                unsigned int default_increment = 1,
-               unsigned int reserve = 0);
+               size_type reserve = 0);
 
   /**
    * Release all memory and return
@@ -447,7 +452,7 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Return the dimension of the
@@ -455,19 +460,19 @@ public:
    * matrix is of dimension
    * $m \times n$.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Return the number of entries
    * in a specific row.
    */
-  unsigned int get_row_length (const unsigned int row) const;
+  size_type get_row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero
    * elements of this matrix.
    */
-  unsigned int n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Determine an estimate for the
@@ -501,10 +506,10 @@ public:
    * the number of entries in each
    * line is printed as well.
    */
-  void compute_statistics (unsigned int &used,
-                           unsigned int &allocated,
-                           unsigned int &reserved,
-                           std::vector<unsigned int> &used_by_line,
+  void compute_statistics (size_type &used,
+                           size_type &allocated,
+                           size_type &reserved,
+                           std::vector<size_type> &used_by_line,
                            const bool compute_by_line) const;
 //@}
   /**
@@ -520,7 +525,7 @@ public:
                    * finite number an exception
                    * is thrown.
                    */
-  void set (const unsigned int i, const unsigned int j,
+  void set (const size_type i, const size_type j,
             const number value);
 
   /**
@@ -532,8 +537,8 @@ public:
    * finite number an exception
    * is thrown.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const number value);
 
   /**
@@ -564,9 +569,9 @@ public:
    * into the matrix.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number2>       &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number2>    &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Same function as before, but now
@@ -576,8 +581,8 @@ public:
    * on rows and columns, respectively.
    */
   template <typename number2>
-  void add (const std::vector<unsigned int> &row_indices,
-            const std::vector<unsigned int> &col_indices,
+  void add (const std::vector<size_type> &row_indices,
+            const std::vector<size_type> &col_indices,
             const FullMatrix<number2>       &full_matrix,
             const bool                       elide_zero_values = true);
 
@@ -599,10 +604,10 @@ public:
    * into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int               row,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number2>      &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type               row,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number2>   &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by
@@ -622,12 +627,12 @@ public:
    * into the matrix.
    */
   template <typename number2>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number2      *values,
-            const bool          elide_zero_values = true,
-            const bool          col_indices_are_sorted = false);
+  void add (const size_type  row,
+            const size_type  n_cols,
+            const size_type *col_indices,
+            const number2   *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Copy the given matrix to this
@@ -696,16 +701,16 @@ public:
    * matrix), use the @p el
    * function.
    */
-  number operator () (const unsigned int i,
-                      const unsigned int j) const;
+  number operator () (const size_type i,
+                      const size_type j) const;
 
   /**
    * Return the value of the entry
    * (i,j). Returns zero for all
    * non-existing entries.
    */
-  number el (const unsigned int i,
-             const unsigned int j) const;
+  number el (const size_type i,
+             const size_type j) const;
 //@}
   /**
    * @name Multiplications
@@ -853,14 +858,14 @@ public:
    * is <tt>end(r)</tt>, which does NOT
    * point into row @p r..
    */
-  const_iterator begin (const unsigned int r) const;
+  const_iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row
    * @p r. The result may be
    * different from <tt>end()</tt>!
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 //@}
   /**
    * @name Input/Output
@@ -978,8 +983,8 @@ private:
    * zero-pointer if the entry does
    * not exist.
    */
-  const Entry *locate (const unsigned int row,
-                       const unsigned int col) const;
+  const Entry *locate (const size_type row,
+                       const size_type col) const;
 
   /**
    * Find an entry and return a
@@ -987,14 +992,14 @@ private:
    * zero-pointer if the entry does
    * not exist.
    */
-  Entry *locate (const unsigned int row,
-                 const unsigned int col);
+  Entry *locate (const size_type row,
+                 const size_type col);
 
   /**
    * Find an entry or generate it.
    */
-  Entry *allocate (const unsigned int row,
-                   const unsigned int col);
+  Entry *allocate (const size_type row,
+                   const size_type col);
 
   /**
    * Version of @p vmult which only
@@ -1008,8 +1013,8 @@ private:
   template <typename somenumber>
   void threaded_vmult (Vector<somenumber>       &dst,
                        const Vector<somenumber> &src,
-                       const unsigned int        begin_row,
-                       const unsigned int        end_row) const;
+                       const size_type           begin_row,
+                       const size_type           end_row) const;
 
   /**
    * Version of
@@ -1024,8 +1029,8 @@ private:
    */
   template <typename somenumber>
   void threaded_matrix_norm_square (const Vector<somenumber> &v,
-                                    const unsigned int        begin_row,
-                                    const unsigned int        end_row,
+                                    const size_type           begin_row,
+                                    const size_type           end_row,
                                     somenumber               *partial_sum) const;
 
   /**
@@ -1042,8 +1047,8 @@ private:
   template <typename somenumber>
   void threaded_matrix_scalar_product (const Vector<somenumber> &u,
                                        const Vector<somenumber> &v,
-                                       const unsigned int        begin_row,
-                                       const unsigned int        end_row,
+                                       const size_type           begin_row,
+                                       const size_type           end_row,
                                        somenumber               *partial_sum) const;
 
   /**
@@ -1051,7 +1056,7 @@ private:
    * used to check vector
    * dimensions only.
    */
-  unsigned int n_columns;
+  size_type n_columns;
 
   /**
    * Info structure for each row.
@@ -1084,7 +1089,7 @@ private:
 
 template <typename number>
 inline
-SparseMatrixEZ<number>::Entry::Entry(unsigned int column,
+SparseMatrixEZ<number>::Entry::Entry(size_type column,
                                      const number &value)
   :
   column(column),
@@ -1104,7 +1109,7 @@ SparseMatrixEZ<number>::Entry::Entry()
 
 template <typename number>
 inline
-SparseMatrixEZ<number>::RowInfo::RowInfo(unsigned int start)
+SparseMatrixEZ<number>::RowInfo::RowInfo(size_type start)
   :
   start(start),
   length(0),
@@ -1117,7 +1122,7 @@ template <typename number>
 inline
 SparseMatrixEZ<number>::const_iterator::Accessor::
 Accessor (const SparseMatrixEZ<number> *matrix,
-          const unsigned int            r,
+          const size_type               r,
           const unsigned short          i)
   :
   matrix(matrix),
@@ -1128,7 +1133,7 @@ Accessor (const SparseMatrixEZ<number> *matrix,
 
 template <typename number>
 inline
-unsigned int
+typename SparseMatrixEZ<number>::size_type 
 SparseMatrixEZ<number>::const_iterator::Accessor::row() const
 {
   return a_row;
@@ -1137,7 +1142,7 @@ SparseMatrixEZ<number>::const_iterator::Accessor::row() const
 
 template <typename number>
 inline
-unsigned int
+typename SparseMatrixEZ<number>::size_type 
 SparseMatrixEZ<number>::const_iterator::Accessor::column() const
 {
   return matrix->data[matrix->row_info[a_row].start+a_index].column;
@@ -1167,7 +1172,7 @@ template <typename number>
 inline
 SparseMatrixEZ<number>::const_iterator::
 const_iterator(const SparseMatrixEZ<number> *matrix,
-               const unsigned int            r,
+               const size_type               r,
                const unsigned short          i)
   :
   accessor(matrix, r, i)
@@ -1280,7 +1285,7 @@ operator < (const const_iterator &other) const
 //---------------------------------------------------------------------------
 template <typename number>
 inline
-unsigned int SparseMatrixEZ<number>::m () const
+typename SparseMatrixEZ<number>::size_type SparseMatrixEZ<number>::m () const
 {
   return row_info.size();
 }
@@ -1288,7 +1293,7 @@ unsigned int SparseMatrixEZ<number>::m () const
 
 template <typename number>
 inline
-unsigned int SparseMatrixEZ<number>::n () const
+typename SparseMatrixEZ<number>::size_type SparseMatrixEZ<number>::n () const
 {
   return n_columns;
 }
@@ -1297,15 +1302,15 @@ unsigned int SparseMatrixEZ<number>::n () const
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::Entry *
-SparseMatrixEZ<number>::locate (const unsigned int row,
-                                const unsigned int col)
+SparseMatrixEZ<number>::locate (const size_type row,
+                                const size_type col)
 {
   Assert (row<m(), ExcIndexRange(row,0,m()));
   Assert (col<n(), ExcIndexRange(col,0,n()));
 
   const RowInfo &r = row_info[row];
-  const unsigned int end = r.start + r.length;
-  for (unsigned int i=r.start; i<end; ++i)
+  const size_type end = r.start + r.length;
+  for (size_type i=r.start; i<end; ++i)
     {
       Entry *const entry = &data[i];
       if (entry->column == col)
@@ -1321,8 +1326,8 @@ SparseMatrixEZ<number>::locate (const unsigned int row,
 template <typename number>
 inline
 const typename SparseMatrixEZ<number>::Entry *
-SparseMatrixEZ<number>::locate (const unsigned int row,
-                                const unsigned int col) const
+SparseMatrixEZ<number>::locate (const size_type row,
+                                const size_type col) const
 {
   SparseMatrixEZ<number> *t = const_cast<SparseMatrixEZ<number>*> (this);
   return t->locate(row,col);
@@ -1332,16 +1337,16 @@ SparseMatrixEZ<number>::locate (const unsigned int row,
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::Entry *
-SparseMatrixEZ<number>::allocate (const unsigned int row,
-                                  const unsigned int col)
+SparseMatrixEZ<number>::allocate (const size_type row,
+                                  const size_type col)
 {
   Assert (row<m(), ExcIndexRange(row,0,m()));
   Assert (col<n(), ExcIndexRange(col,0,n()));
 
   RowInfo &r = row_info[row];
-  const unsigned int end = r.start + r.length;
+  const size_type end = r.start + r.length;
 
-  unsigned int i = r.start;
+  size_type i = r.start;
   // If diagonal exists and this
   // column is higher, start only
   // after diagonal.
@@ -1373,7 +1378,7 @@ SparseMatrixEZ<number>::allocate (const unsigned int row,
           data.insert(data.begin()+end, increment, Entry());
           // Update starts of
           // following rows
-          for (unsigned int rn=row+1; rn<row_info.size(); ++rn)
+          for (size_type rn=row+1; rn<row_info.size(); ++rn)
             row_info[rn].start += increment;
         }
     }
@@ -1409,7 +1414,7 @@ SparseMatrixEZ<number>::allocate (const unsigned int row,
 
   // Move all entries in this
   // row up by one
-  for (unsigned int j = i+1; j < end; ++j)
+  for (size_type j = i+1; j < end; ++j)
     {
       // There should be no invalid
       // entry below end
@@ -1429,8 +1434,8 @@ SparseMatrixEZ<number>::allocate (const unsigned int row,
 
 template <typename number>
 inline
-void SparseMatrixEZ<number>::set (const unsigned int i,
-                                  const unsigned int j,
+void SparseMatrixEZ<number>::set (const size_type i,
+                                  const size_type j,
                                   const number value)
 {
 
@@ -1456,8 +1461,8 @@ void SparseMatrixEZ<number>::set (const unsigned int i,
 
 template <typename number>
 inline
-void SparseMatrixEZ<number>::add (const unsigned int i,
-                                  const unsigned int j,
+void SparseMatrixEZ<number>::add (const size_type i,
+                                  const size_type j,
                                   const number value)
 {
 
@@ -1477,13 +1482,13 @@ void SparseMatrixEZ<number>::add (const unsigned int i,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &indices,
-                                  const FullMatrix<number2>       &full_matrix,
-                                  const bool                       elide_zero_values)
+void SparseMatrixEZ<number>::add (const std::vector<size_type> &indices,
+                                  const FullMatrix<number2>    &full_matrix,
+                                  const bool                    elide_zero_values)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int i=0; i<indices.size(); ++i)
-    for (unsigned int j=0; j<indices.size(); ++j)
+  for (size_type i=0; i<indices.size(); ++i)
+    for (size_type j=0; j<indices.size(); ++j)
       if ((full_matrix(i,j) != 0) || (elide_zero_values == false))
         add (indices[i], indices[j], full_matrix(i,j));
 }
@@ -1492,14 +1497,14 @@ void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &indices,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &row_indices,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const FullMatrix<number2>       &full_matrix,
-                                  const bool                       elide_zero_values)
+void SparseMatrixEZ<number>::add (const std::vector<size_type> &row_indices,
+                                  const std::vector<size_type> &col_indices,
+                                  const FullMatrix<number2>    &full_matrix,
+                                  const bool                    elide_zero_values)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int i=0; i<row_indices.size(); ++i)
-    for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type i=0; i<row_indices.size(); ++i)
+    for (size_type j=0; j<col_indices.size(); ++j)
       if ((full_matrix(i,j) != 0) || (elide_zero_values == false))
         add (row_indices[i], col_indices[j], full_matrix(i,j));
 }
@@ -1509,13 +1514,13 @@ void SparseMatrixEZ<number>::add (const std::vector<unsigned int> &row_indices,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const unsigned int               row,
-                                  const std::vector<unsigned int> &col_indices,
-                                  const std::vector<number2>      &values,
-                                  const bool                       elide_zero_values)
+void SparseMatrixEZ<number>::add (const size_type               row,
+                                  const std::vector<size_type> &col_indices,
+                                  const std::vector<number2>   &values,
+                                  const bool                    elide_zero_values)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int j=0; j<col_indices.size(); ++j)
+  for (size_type j=0; j<col_indices.size(); ++j)
     if ((values[j] != 0) || (elide_zero_values == false))
       add (row, col_indices[j], values[j]);
 }
@@ -1524,15 +1529,15 @@ void SparseMatrixEZ<number>::add (const unsigned int               row,
 
 template <typename number>
 template <typename number2>
-void SparseMatrixEZ<number>::add (const unsigned int  row,
-                                  const unsigned int  n_cols,
-                                  const unsigned int *col_indices,
-                                  const number2      *values,
-                                  const bool          elide_zero_values,
-                                  const bool          /*col_indices_are_sorted*/)
+void SparseMatrixEZ<number>::add (const size_type  row,
+                                  const size_type  n_cols,
+                                  const size_type *col_indices,
+                                  const number2   *values,
+                                  const bool       elide_zero_values,
+                                  const bool      /*col_indices_are_sorted*/)
 {
 //TODO: This function can surely be made more efficient
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     if ((values[j] != 0) || (elide_zero_values == false))
       add (row, col_indices[j], values[j]);
 }
@@ -1542,8 +1547,8 @@ void SparseMatrixEZ<number>::add (const unsigned int  row,
 
 template <typename number>
 inline
-number SparseMatrixEZ<number>::el (const unsigned int i,
-                                   const unsigned int j) const
+number SparseMatrixEZ<number>::el (const size_type i,
+                                   const size_type j) const
 {
   const Entry *entry = locate(i,j);
   if (entry)
@@ -1555,8 +1560,8 @@ number SparseMatrixEZ<number>::el (const unsigned int i,
 
 template <typename number>
 inline
-number SparseMatrixEZ<number>::operator() (const unsigned int i,
-                                           const unsigned int j) const
+number SparseMatrixEZ<number>::operator() (const size_type i,
+                                           const size_type j) const
 {
   const Entry *entry = locate(i,j);
   if (entry)
@@ -1586,7 +1591,7 @@ SparseMatrixEZ<number>::end () const
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::const_iterator
-SparseMatrixEZ<number>::begin (const unsigned int r) const
+SparseMatrixEZ<number>::begin (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   const_iterator result (this, r, 0);
@@ -1596,7 +1601,7 @@ SparseMatrixEZ<number>::begin (const unsigned int r) const
 template <typename number>
 inline
 typename SparseMatrixEZ<number>::const_iterator
-SparseMatrixEZ<number>::end (const unsigned int r) const
+SparseMatrixEZ<number>::end (const size_type r) const
 {
   Assert (r<m(), ExcIndexRange(r,0,m()));
   const_iterator result(this, r+1, 0);
@@ -1614,7 +1619,7 @@ SparseMatrixEZ<number>::copy_from (const MATRIX &M)
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // copy them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
@@ -1642,7 +1647,7 @@ SparseMatrixEZ<number>::add (const number factor,
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
   // add them into the current object
-  for (unsigned int row = 0; row < M.m(); ++row)
+  for (size_type row = 0; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
@@ -1682,13 +1687,13 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
   if (transpose)
     while (b1 != b_final)
       {
-        const unsigned int i = b1->column();
-        const unsigned int k = b1->row();
+        const size_type i = b1->column();
+        const size_type k = b1->row();
         typename MATRIXB::const_iterator b2 = B.begin();
         while (b2 != b_final)
           {
-            const unsigned int j = b2->column();
-            const unsigned int l = b2->row();
+            const size_type j = b2->column();
+            const size_type l = b2->row();
 
             const typename MATRIXA::value_type a = A.el(k,l);
 
@@ -1704,11 +1709,11 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
       // maximal row for a column in
       // advance.
 
-      std::vector<unsigned int> minrow(B.n(), B.m());
-      std::vector<unsigned int> maxrow(B.n(), 0);
+      std::vector<size_type> minrow(B.n(), B.m());
+      std::vector<size_type> maxrow(B.n(), 0);
       while (b1 != b_final)
         {
-          const unsigned int r = b1->row();
+          const size_type r = b1->row();
           if (r < minrow[b1->column()])
             minrow[b1->column()] = r;
           if (r > maxrow[b1->column()])
@@ -1745,7 +1750,7 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
               // the work
               if (b1->column() == ai->row() && (b1v != 0.))
                 {
-                  const unsigned int i = b1->row();
+                  const size_type i = b1->row();
 
                   typename MATRIXB::const_iterator
                   b2 = B.begin(minrow[ai->column()]);
@@ -1753,7 +1758,7 @@ SparseMatrixEZ<number>::conjugate_add (const MATRIXA &A,
                     {
                       if (b2->column() == ai->column())
                         {
-                          const unsigned int j = b2->row();
+                          const size_type j = b2->row();
                           add (i, j, a * b1v * b2->value());
                         }
                       ++b2;
@@ -1773,10 +1778,10 @@ inline
 void
 SparseMatrixEZ<number>::print_statistics(STREAM &out, bool full)
 {
-  unsigned int used;
-  unsigned int allocated;
-  unsigned int reserved;
-  std::vector<unsigned int> used_by_line;
+  size_type used;
+  size_type allocated;
+  size_type reserved;
+  std::vector<size_type> used_by_line;
 
   compute_statistics (used, allocated, reserved, used_by_line, full);
 
@@ -1786,7 +1791,7 @@ SparseMatrixEZ<number>::print_statistics(STREAM &out, bool full)
 
   if (full)
     {
-      for (unsigned int i=0; i< used_by_line.size(); ++i)
+      for (size_type i=0; i< used_by_line.size(); ++i)
         if (used_by_line[i] != 0)
           out << "SparseMatrixEZ:entries\t" << i
               << "\trows\t" << used_by_line[i]
index 1c4ee5b8f644e3596e798d04ea9535aa1fc6c825..4c1f6b7386dd272649b552c1f8bd572be6233d42 100644 (file)
@@ -44,9 +44,9 @@ SparseMatrixEZ<number>::SparseMatrixEZ(const SparseMatrixEZ<number> &m)
 
 
 template <typename number>
-SparseMatrixEZ<number>::SparseMatrixEZ(const unsigned int n_rows,
-                                       const unsigned int n_cols,
-                                       const unsigned int default_row_length,
+SparseMatrixEZ<number>::SparseMatrixEZ(const size_type    n_rows,
+                                       const size_type    n_cols,
+                                       const size_type    default_row_length,
                                        const unsigned int default_increment)
 {
   reinit(n_rows, n_cols, default_row_length, default_increment);
@@ -88,11 +88,11 @@ SparseMatrixEZ<number>::operator = (const double d)
 
 template <typename number>
 void
-SparseMatrixEZ<number>::reinit(const unsigned int n_rows,
-                               const unsigned int n_cols,
-                               unsigned int default_row_length,
-                               unsigned int default_increment,
-                               unsigned int reserve)
+SparseMatrixEZ<number>::reinit(const size_type n_rows,
+                               const size_type n_cols,
+                               size_type       default_row_length,
+                               unsigned int    default_increment,
+                               size_type       reserve)
 {
   clear();
 
@@ -104,7 +104,7 @@ SparseMatrixEZ<number>::reinit(const unsigned int n_rows,
     data.reserve(reserve);
   data.resize(default_row_length * n_rows);
 
-  for (unsigned int i=0; i<n_rows; ++i)
+  for (size_type i=0; i<n_rows; ++i)
     row_info[i].start = i * default_row_length;
 }
 
@@ -136,8 +136,8 @@ SparseMatrixEZ<number>::vmult (Vector<somenumber> &dst,
   Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
   Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
 
-  const unsigned int end_row = row_info.size();
-  for (unsigned int row = 0; row < end_row; ++row)
+  const size_type end_row = row_info.size();
+  for (size_type row = 0; row < end_row; ++row)
     {
       const RowInfo &ri = row_info[row];
       typename std::vector<Entry>::const_iterator
@@ -193,8 +193,8 @@ SparseMatrixEZ<number>::vmult_add (Vector<somenumber> &dst,
   Assert(m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
   Assert(n() == src.size(), ExcDimensionMismatch(n(),src.size()));
 
-  const unsigned int end_row = row_info.size();
-  for (unsigned int row = 0; row < end_row; ++row)
+  const size_type end_row = row_info.size();
+  for (size_type row = 0; row < end_row; ++row)
     {
       const RowInfo &ri = row_info[row];
       typename std::vector<Entry>::const_iterator
@@ -219,8 +219,8 @@ SparseMatrixEZ<number>::Tvmult_add (Vector<somenumber> &dst,
   Assert(n() == dst.size(), ExcDimensionMismatch(n(),dst.size()));
   Assert(m() == src.size(), ExcDimensionMismatch(m(),src.size()));
 
-  const unsigned int end_row = row_info.size();
-  for (unsigned int row = 0; row < end_row; ++row)
+  const size_type end_row = row_info.size();
+  for (size_type row = 0; row < end_row; ++row)
     {
       const RowInfo &ri = row_info[row];
       typename std::vector<Entry>::const_iterator
@@ -280,8 +280,8 @@ SparseMatrixEZ<number>::precondition_SOR (Vector<somenumber>       &dst,
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
       number s = *src_ptr;
-      const unsigned int end_row = ri->start + ri->diagonal;
-      for (unsigned int i=ri->start; i<end_row; ++i)
+      const size_type end_row = ri->start + ri->diagonal;
+      for (size_type i=ri->start; i<end_row; ++i)
         s -= data[i].value * dst(data[i].column);
 
       *dst_ptr = om * s / data[ri->start + ri->diagonal].value;
@@ -312,8 +312,8 @@ SparseMatrixEZ<number>::precondition_TSOR (Vector<somenumber>       &dst,
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
       number s = *src_ptr;
-      const unsigned int end_row = ri->start + ri->length;
-      for (unsigned int i=ri->start+ri->diagonal+1; i<end_row; ++i)
+      const size_type end_row = ri->start + ri->length;
+      for (size_type i=ri->start+ri->diagonal+1; i<end_row; ++i)
         s -= data[i].value * dst(data[i].column);
 
       *dst_ptr = om * s / data[ri->start + ri->diagonal].value;
@@ -344,8 +344,8 @@ SparseMatrixEZ<number>::precondition_SSOR (Vector<somenumber>       &dst,
     {
       Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
       number s = 0;
-      const unsigned int end_row = ri->start + ri->diagonal;
-      for (unsigned int i=ri->start; i<end_row; ++i)
+      const size_type end_row = ri->start + ri->diagonal;
+      for (size_type i=ri->start; i<end_row; ++i)
         s += data[i].value * dst(data[i].column);
 
       *dst_ptr = *src_ptr - s * om;
@@ -363,9 +363,9 @@ SparseMatrixEZ<number>::precondition_SSOR (Vector<somenumber>       &dst,
   dst_ptr = dst.begin()+dst.size()-1;
   for (rri = row_info.rbegin(); rri != rend; --dst_ptr, ++rri)
     {
-      const unsigned int end_row = rri->start + rri->length;
+      const size_type end_row = rri->start + rri->length;
       number s = 0;
-      for (unsigned int i=rri->start+rri->diagonal+1; i<end_row; ++i)
+      for (size_type i=rri->start+rri->diagonal+1; i<end_row; ++i)
         s += data[i].value * dst(data[i].column);
 
       *dst_ptr -= s * om;
@@ -381,15 +381,15 @@ SparseMatrixEZ<number>::memory_consumption() const
 {
   return
     sizeof (*this)
-    + sizeof(unsigned int) * row_info.capacity()
+    + sizeof(size_type) * row_info.capacity()
     + sizeof(typename SparseMatrixEZ<number>::Entry) * data.capacity();
 }
 
 
 
 template <typename number>
-unsigned int
-SparseMatrixEZ<number>::get_row_length (const unsigned int row) const
+typename SparseMatrixEZ<number>::size_type 
+SparseMatrixEZ<number>::get_row_length (const size_type row) const
 {
   return row_info[row].length;
 }
@@ -397,14 +397,14 @@ SparseMatrixEZ<number>::get_row_length (const unsigned int row) const
 
 
 template <typename number>
-unsigned int
+typename SparseMatrixEZ<number>::size_type 
 SparseMatrixEZ<number>::n_nonzero_elements() const
 {
   typename std::vector<RowInfo>::const_iterator row = row_info.begin();
   const typename std::vector<RowInfo>::const_iterator endrow = row_info.end();
 
   // Add up entries actually used
-  unsigned int used = 0;
+  size_type used = 0;
   for (; row != endrow ; ++ row)
     used += row->length;
   return used;
@@ -415,10 +415,10 @@ SparseMatrixEZ<number>::n_nonzero_elements() const
 template <typename number>
 void
 SparseMatrixEZ<number>::compute_statistics(
-  unsigned int &used,
-  unsigned int &allocated,
-  unsigned int &reserved,
-  std::vector<unsigned int> &used_by_line,
+  size_type &used,
+  size_type &allocated,
+  size_type &reserved,
+  std::vector<size_type> &used_by_line,
   const bool full) const
 {
   typename std::vector<RowInfo>::const_iterator row = row_info.begin();
@@ -426,7 +426,7 @@ SparseMatrixEZ<number>::compute_statistics(
 
   // Add up entries actually used
   used = 0;
-  unsigned int max_length = 0;
+  size_type max_length = 0;
   for (; row != endrow ; ++ row)
     {
       used += row->length;
@@ -503,9 +503,9 @@ SparseMatrixEZ<number>::print_formatted ( std::ostream          &out,
     }
 
   // TODO: Skip nonexisting entries
-  for (unsigned int i=0; i<m(); ++i)
+  for (size_type i=0; i<m(); ++i)
     {
-      for (unsigned int j=0; j<n(); ++j)
+      for (size_type j=0; j<n(); ++j)
         {
           const Entry *entry = locate(i,j);
           if (entry)
index fca18fafd6104559931e5940a7f9d27c0c32662b..fe82ff2bea1a8a30620772578ecc9cf7646d2a93 100644 (file)
@@ -41,6 +41,11 @@ template <typename number>
 class SparseMIC : public SparseLUDecomposition<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Does nothing, so
    * you have to call @p decompose
@@ -197,7 +202,7 @@ private:
    * Compute the row-th "inner
    * sum".
    */
-  number get_rowsum (const unsigned int row) const;
+  number get_rowsum (const size_type row) const;
 };
 
 /*@}*/
index 69034c07baed0c4cf59bb327467a6197abf40392..c35d9cafa73e56dc46bf4376df07e4c05bd9806a 100644 (file)
@@ -131,10 +131,10 @@ void SparseMIC<number>::decompose (const SparseMatrix<somenumber> &matrix,
   inner_sums.resize (this->m());
 
   // precalc sum(j=k+1, N, a[k][j]))
-  for (unsigned int row=0; row<this->m(); row++)
+  for (size_type row=0; row<this->m(); row++)
     inner_sums[row] = get_rowsum(row);
 
-  for (unsigned int row=0; row<this->m(); row++)
+  for (size_type row=0; row<this->m(); row++)
     {
       const number temp = this->begin(row)->value();
       number temp1 = 0;
@@ -158,7 +158,7 @@ void SparseMIC<number>::decompose (const SparseMatrix<somenumber> &matrix,
 
 template <typename number>
 inline number
-SparseMIC<number>::get_rowsum (const unsigned int row) const
+SparseMIC<number>::get_rowsum (const size_type row) const
 {
   Assert(this->m()==this->n(), ExcNotQuadratic());
 
@@ -184,13 +184,13 @@ SparseMIC<number>::vmult (Vector<somenumber>       &dst,
   Assert (dst.size() == src.size(), ExcDimensionMismatch(dst.size(), src.size()));
   Assert (dst.size() == this->m(), ExcDimensionMismatch(dst.size(), this->m()));
 
-  const unsigned int N=dst.size();
+  const size_type N=dst.size();
   // We assume the underlying matrix A is: A = X - L - U, where -L and -U are
   // strictly lower- and upper- diagonal parts of the system.
   //
   // Solve (X-L)X{-1}(X-U) x = b in 3 steps:
   dst = src;
-  for (unsigned int row=0; row<N; ++row)
+  for (size_type row=0; row<N; ++row)
     {
       // Now: (X-L)u = b
 
@@ -206,7 +206,7 @@ SparseMIC<number>::vmult (Vector<somenumber>       &dst,
     }
 
   // Now: v = Xu
-  for (unsigned int row=0; row<N; row++)
+  for (size_type row=0; row<N; row++)
     dst(row) *= diag[row];
 
   // x = (X-U)v
@@ -217,7 +217,7 @@ SparseMIC<number>::vmult (Vector<somenumber>       &dst,
            p = this->begin(row)+1;
            p != this->end(row);
            ++p)
-        if (p->column() > static_cast<unsigned int>(row))
+        if (p->column() > static_cast<size_type>(row))
           dst(row) -= p->value() * dst(p->column());
 
       dst(row) *= inv_diag[row];
index 0989a77bc71c046af8363f0673aa34b86eb29519..0ae7bcb75c94d3f2a92d0871303798977467a5a6 100644 (file)
@@ -129,6 +129,11 @@ template<typename number>
 class SparseVanka
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Gets the matrix
    * for preconditioning and a bit
@@ -309,8 +314,8 @@ private:
    * mode, several copies of this
    * function are spawned.
    */
-  void compute_inverses (const unsigned int begin,
-                         const unsigned int end);
+  void compute_inverses (const size_type begin,
+                         const size_type end);
 
   /**
    * Compute the inverse of the
@@ -326,8 +331,8 @@ private:
    * the case where this function
    * re-creates it each time.
    */
-  void compute_inverse (const unsigned int         row,
-                        std::vector<unsigned int> &local_indices);
+  void compute_inverse (const size_type         row,
+                        std::vector<size_type> &local_indices);
 
   /**
    * Make the derived class a
@@ -510,6 +515,11 @@ template<typename number>
 class SparseBlockVanka : public SparseVanka<number>
 {
 public:
+  /**
+   * Declate type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Enumeration of the different
    * methods by which the DoFs are
index afa510530d4cf3d174f270ed83b58bbc0b181802..519cfceabb9a812d00364f35f1016dc0ae7222a1 100644 (file)
@@ -66,12 +66,11 @@ SparseVanka<number>::compute_inverses ()
     compute_inverses (0, matrix->m());
   else
     {
-      const unsigned int n_inverses = std::count (selected.begin(),
-                                                  selected.end(),
-                                                  true);
+      const size_type n_inverses = std::count (selected.begin(),
+                                               selected.end(),
+                                               true);
 
-      const unsigned int n_inverses_per_thread = std::max(n_inverses / n_threads,
-                                                          1U);
+      const size_type n_inverses_per_thread = std::max(n_inverses / n_threads, 1U);
 
       // set up start and end index
       // for each of the
@@ -89,13 +88,13 @@ SparseVanka<number>::compute_inverses ()
       // consecutive, with other
       // consecutive regions where we
       // do not have to do something
-      std::vector<std::pair<unsigned int, unsigned int> > blocking (n_threads);
+      std::vector<std::pair<size_type, size_type> > blocking (n_threads);
 
       unsigned int c       = 0;
       unsigned int thread  = 0;
       blocking[0].first = 0;
 
-      for (unsigned int i=0; (i<matrix->m()) && (thread+1<n_threads); ++i)
+      for (size_type i=0; (i<matrix->m()) && (thread+1<n_threads); ++i)
         {
           if (selected[i] == true)
             ++c;
@@ -110,8 +109,8 @@ SparseVanka<number>::compute_inverses ()
         };
       blocking[n_threads-1].second = matrix->m();
 
-      typedef void (SparseVanka<number>::*FunPtr)(const unsigned int,
-                                                  const unsigned int);
+      typedef void (SparseVanka<number>::*FunPtr)(const size_type,
+                                                  const size_type);
       const FunPtr fun_ptr = &SparseVanka<number>::compute_inverses;
 
       // Now spawn the threads
@@ -127,17 +126,17 @@ SparseVanka<number>::compute_inverses ()
 
 template <typename number>
 void
-SparseVanka<number>::compute_inverses (const unsigned int begin,
-                                       const unsigned int end)
+SparseVanka<number>::compute_inverses (const size_type begin,
+                                       const size_type end)
 {
   // set-up the vector that will be used
   // by the functions which we call
   // below.
-  std::vector<unsigned int> local_indices;
+  std::vector<size_type> local_indices;
 
   // traverse all rows of the matrix
   // which are selected
-  for (unsigned int row=begin; row<end; ++row)
+  for (size_type row=begin; row<end; ++row)
     if (selected[row] == true)
       compute_inverse (row, local_indices);
 }
@@ -146,8 +145,8 @@ SparseVanka<number>::compute_inverses (const unsigned int begin,
 
 template <typename number>
 void
-SparseVanka<number>::compute_inverse (const unsigned int         row,
-                                      std::vector<unsigned int> &local_indices)
+SparseVanka<number>::compute_inverse (const size_type         row,
+                                      std::vector<size_type> &local_indices)
 {
   // first define an alias to the sparsity
   // pattern of the matrix, since this
@@ -155,14 +154,14 @@ SparseVanka<number>::compute_inverse (const unsigned int         row,
   const SparsityPattern &structure
     = matrix->get_sparsity_pattern();
 
-  const unsigned int row_length = structure.row_length(row);
+  const size_type row_length = structure.row_length(row);
 
   inverses[row] = new FullMatrix<float> (row_length, row_length);
 
   // collect the dofs that couple
   // with @p row
   local_indices.resize (row_length);
-  for (unsigned int i=0; i<row_length; ++i)
+  for (size_type i=0; i<row_length; ++i)
     local_indices[i] = structure.column_number(row, i);
 
   // Build local matrix
@@ -227,16 +226,16 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
   Vector<float> b (structure.max_entries_per_row());
   Vector<float> x (structure.max_entries_per_row());
 
-  std::map<unsigned int, unsigned int> local_index;
+  std::map<size_type, size_type> local_index;
 
   // traverse all rows of the matrix
   // which are selected
-  const unsigned int n = matrix->m();
-  for (unsigned int row=0; row<n; ++row)
+  const size_type n = matrix->m();
+  for (size_type row=0; row<n; ++row)
     if ((selected[row] == true) &&
         ((range_is_restricted == false) || ((*dof_mask)[row] == true)))
       {
-        const unsigned int row_length = structure.row_length(row);
+        const size_type row_length = structure.row_length(row);
 
         // if we don't store the
         // inverse matrices, then alias
@@ -265,21 +264,21 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
         // all degrees of freedom that
         // couple with @p row.
         local_index.clear ();
-        for (unsigned int i=0; i<row_length; ++i)
-          local_index.insert(std::pair<unsigned int, unsigned int>
+        for (size_type i=0; i<row_length; ++i)
+          local_index.insert(std::pair<size_type, size_type>
                              (structure.column_number(row, i), i));
 
         // Build local matrix and rhs
-        for (std::map<unsigned int, unsigned int>::const_iterator is=local_index.begin();
+        for (std::map<size_type, size_type>::const_iterator is=local_index.begin();
              is!=local_index.end(); ++is)
           {
             // irow loops over all DoFs that
             // couple with the present DoF
-            const unsigned int irow = is->first;
+            const size_type irow = is->first;
             // index of DoF irow in the matrix
             // row corresponding to DoF @p row.
             // runs between 0 and row_length
-            const unsigned int i = is->second;
+            const size_type i = is->second;
 
             // copy rhs
             b(i) = src(irow);
@@ -296,7 +295,7 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
                 // which itself couples with
                 // @p row) also couples with
                 // @p row.
-                const std::map<unsigned int, unsigned int>::const_iterator js
+                const std::map<size_type, size_type>::const_iterator js
                   = local_index.find(p->column());
                 // if not, then still use
                 // this dof to modify the rhs
@@ -325,11 +324,11 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
         inverses[row]->vmult(x,b);
 
         // Distribute new values
-        for (std::map<unsigned int, unsigned int>::const_iterator is=local_index.begin();
+        for (std::map<size_type, size_type>::const_iterator is=local_index.begin();
              is!=local_index.end(); ++is)
           {
-            const unsigned int irow = is->first;
-            const unsigned int i = is->second;
+            const size_type irow = is->first;
+            const size_type i = is->second;
 
             if (!range_is_restricted ||
                 ((*dof_mask)[irow] == true))
@@ -354,7 +353,7 @@ SparseVanka<number>::memory_consumption () const
 {
   std::size_t mem = (sizeof(*this) +
                      MemoryConsumption::memory_consumption (selected));
-  for (unsigned int i=0; i<inverses.size(); ++i)
+  for (size_type i=0; i<inverses.size(); ++i)
     mem += MemoryConsumption::memory_consumption (*inverses[i]);
 
   return mem;
@@ -388,14 +387,14 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
 {
   Assert (n_blocks > 0, ExcInternalError());
 
-  const unsigned int n_inverses = std::count (selected.begin(),
-                                              selected.end(),
-                                              true);
+  const size_type n_inverses = std::count (selected.begin(),
+                                           selected.end(),
+                                           true);
 
-  const unsigned int n_inverses_per_block = std::max(n_inverses / n_blocks, 1U);
+  const size_type n_inverses_per_block = std::max(n_inverses / n_blocks, 1U);
 
   // precompute the splitting points
-  std::vector<std::pair<unsigned int, unsigned int> > intervals (n_blocks);
+  std::vector<std::pair<size_type, size_type> > intervals (n_blocks);
 
   // set up start and end index for
   // each of the blocks. note that
@@ -417,7 +416,7 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
       unsigned int block   = 0;
       intervals[0].first   = 0;
 
-      for (unsigned int i=0; (i<M.m()) && (block+1<n_blocks); ++i)
+      for (size_type i=0; (i<M.m()) && (block+1<n_blocks); ++i)
         {
           if (selected[i] == true)
             ++c;
@@ -465,16 +464,16 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
       // Lagrange dofs of each
       // block access the different
       // dofs
-      Table<2,unsigned int> access_count (n_blocks, M.m());
+      Table<2,size_type> access_count (n_blocks, M.m());
 
       // set-up the map that will
       // be used to store the
       // indices each Lagrange dof
       // accesses
-      std::map<unsigned int, unsigned int> local_index;
+      std::map<size_type, size_type> local_index;
       const SparsityPattern &structure = M.get_sparsity_pattern();
 
-      for (unsigned int row=0; row<M.m(); ++row)
+      for (size_type row=0; row<M.m(); ++row)
         if (selected[row] == true)
           {
             // first find out to
@@ -491,8 +490,8 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
             // dofs number the
             // present index wants
             // to write
-            const unsigned int row_length = structure.row_length(row);
-            for (unsigned int i=0; i<row_length; ++i)
+            const size_type row_length = structure.row_length(row);
+            for (size_type i=0; i<row_length; ++i)
               ++access_count[block_number][structure.column_number(row, i)];
           };
 
@@ -508,7 +507,7 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
       // the of course we leave it
       // to the block we put it
       // into in the first place
-      for (unsigned int row=0; row<M.m(); ++row)
+      for (size_type row=0; row<M.m(); ++row)
         if (selected[row] == true)
           {
             unsigned int block_number = 0;
@@ -522,7 +521,7 @@ SparseBlockVanka<number>::compute_dof_masks (const SparseMatrix<number> &M,
             // find out which block
             // accesses this dof
             // the most often
-            unsigned int max_accesses     = 0;
+            size_type max_accesses        = 0;
             unsigned int max_access_block = 0;
             for (unsigned int block=0; block<n_blocks; ++block)
               if (access_count[block][row] > max_accesses)
@@ -599,7 +598,7 @@ std::size_t
 SparseBlockVanka<number>::memory_consumption () const
 {
   std::size_t mem = SparseVanka<number>::memory_consumption();
-  for (unsigned int i=0; i<dof_masks.size(); ++i)
+  for (size_type i=0; i<dof_masks.size(); ++i)
     mem += MemoryConsumption::memory_consumption (dof_masks[i]);
   return mem;
 }
index 5e93dea2bb2c0630f175772655a7444ce5bce790..00f7433ca27476a9323110efc0d59f2cb24f8e42 100644 (file)
@@ -51,13 +51,18 @@ namespace internals
 {
   namespace SparsityPatternTools
   {
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Helper function to get the column index from a dereferenced iterator in
      * the copy_from() function, if the inner iterator type points to plain
      * unsigned integers.
      */
-    unsigned int
-    get_column_index_from_iterator (const unsigned int i);
+    size_type 
+    get_column_index_from_iterator (const size_type i);
 
     /**
      * Helper function to get the column index from a dereferenced iterator in
@@ -65,8 +70,8 @@ namespace internals
      * unsigned integers and some other value.
      */
     template <typename value>
-    unsigned int
-    get_column_index_from_iterator (const std::pair<unsigned int, value> &i);
+    size_type 
+    get_column_index_from_iterator (const std::pair<size_type, value> &i);
 
     /**
      * Likewise, but sometimes needed for certain types of containers that
@@ -74,8 +79,8 @@ namespace internals
      * <tt>std::map</tt>).
      */
     template <typename value>
-    unsigned int
-    get_column_index_from_iterator (const std::pair<const unsigned int, value> &i);
+    size_type 
+    get_column_index_from_iterator (const std::pair<const size_type, value> &i);
 
   }
 }
@@ -89,6 +94,11 @@ namespace SparsityPatternIterators
   // forward declaration
   class Iterator;
 
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Accessor class for iterators into sparsity patterns. This class is
    * also the base class for both const and non-const accessor classes
@@ -112,8 +122,8 @@ namespace SparsityPatternIterators
      * with a global index instead.
      */
     Accessor (const SparsityPattern *matrix,
-              const unsigned int     row,
-              const unsigned int     index) DEAL_II_DEPRECATED;
+              const size_type        row,
+              const size_type        index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor.
@@ -130,19 +140,19 @@ namespace SparsityPatternIterators
      * Row number of the element represented by this object. This function can
      * only be called for entries for which is_valid_entry() is true.
      */
-    unsigned int row () const;
+    size_type row () const;
 
     /**
      * Index within the current row of the element represented by this object. This function
      * can only be called for entries for which is_valid_entry() is true.
      */
-    unsigned int index () const;
+    size_type index () const;
 
     /**
      * Column number of the element represented by this object. This function
      * can only be called for entries for which is_valid_entry() is true.
      */
-    unsigned int column () const;
+    size_type column () const;
 
     /**
      * Return whether the sparsity pattern entry pointed to by this iterator
@@ -237,8 +247,8 @@ namespace SparsityPatternIterators
      * with a global index instead.
      */
     Iterator (const SparsityPattern *sp,
-              const unsigned int     row,
-              const unsigned int     index) DEAL_II_DEPRECATED;
+              const size_type        row,
+              const size_type        index) DEAL_II_DEPRECATED;
 
     /**
      * Constructor. Create an iterator into the sparsity pattern @p sp for the
@@ -334,6 +344,11 @@ namespace SparsityPatternIterators
 class SparsityPattern : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Typedef an iterator class that allows to walk over all nonzero elements
    * of a sparsity pattern.
@@ -349,7 +364,7 @@ public:
    * @deprecated This typedef is deprecated. Use proper iterators instead.
    */
   typedef
-  const unsigned int *row_iterator;
+  const size_type *row_iterator;
 
   /**
    * Typedef an iterator class that allows to walk over all nonzero elements
@@ -377,7 +392,7 @@ public:
    * perform some optimizations, but the actual value of the variable may
    * change over time.
    */
-  static const unsigned int invalid_entry = numbers::invalid_unsigned_int;
+  static const size_type invalid_entry = numbers::invalid_size_type;
 
   /**
    * @name Construction and setup
@@ -419,9 +434,9 @@ public:
    * @deprecated Use the constructor without the last argument since
    *   it is ignored.
    */
-  SparsityPattern (const unsigned int m,
-                   const unsigned int n,
-                   const unsigned int max_per_row,
+  SparsityPattern (const size_type m,
+                   const size_type n,
+                   const size_type max_per_row,
                    const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -431,9 +446,9 @@ public:
    * @arg n number of columns
    * @arg max_per_row maximum number of nonzero entries per row
    */
-  SparsityPattern (const unsigned int m,
-                   const unsigned int n,
-                   const unsigned int max_per_row);
+  SparsityPattern (const size_type m,
+                   const size_type n,
+                   const size_type max_per_row);
 
   /**
    * Initialize a rectangular matrix.
@@ -447,9 +462,9 @@ public:
    * @deprecated Use the constructor without the last argument since
    *   it is ignored.
    */
-  SparsityPattern (const unsigned int               m,
-                   const unsigned int               n,
-                   const std::vector<unsigned int> &row_lengths,
+  SparsityPattern (const size_type               m,
+                   const size_type               n,
+                   const std::vector<size_type> &row_lengths,
                    const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -460,9 +475,9 @@ public:
    * @arg row_lengths possible number of nonzero entries for each row.  This
    * vector must have one entry for each row.
    */
-  SparsityPattern (const unsigned int               m,
-                   const unsigned int               n,
-                   const std::vector<unsigned int> &row_lengths);
+  SparsityPattern (const size_type               m,
+                   const size_type               n,
+                   const std::vector<size_type> &row_lengths);
 
   /**
    * Initialize a quadratic matrix of dimension <tt>n</tt> with at most
@@ -472,8 +487,8 @@ public:
    * elements. To avoid this, use the constructor taking row and column
    * numbers separately.
    */
-  SparsityPattern (const unsigned int n,
-                   const unsigned int max_per_row);
+  SparsityPattern (const size_type n,
+                   const size_type max_per_row);
 
   /**
    * Initialize a quadratic matrix.
@@ -486,8 +501,8 @@ public:
    * @deprecated Use the constructor without the last argument since
    *   it is ignored.
    */
-  SparsityPattern (const unsigned int               m,
-                   const std::vector<unsigned int> &row_lengths,
+  SparsityPattern (const size_type               m,
+                   const std::vector<size_type> &row_lengths,
                    const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -497,8 +512,8 @@ public:
    * @arg row_lengths possible number of nonzero entries for each row.  This
    * vector must have one entry for each row.
    */
-  SparsityPattern (const unsigned int               m,
-                   const std::vector<unsigned int> &row_lengths);
+  SparsityPattern (const size_type               m,
+                   const std::vector<size_type> &row_lengths);
 
   /**
    * Make a copy with extra off-diagonals.
@@ -523,8 +538,8 @@ public:
    * compressed after this function finishes.
    */
   SparsityPattern (const SparsityPattern &original,
-                   const unsigned int      max_per_row,
-                   const unsigned int      extra_off_diagonals);
+                   const size_type        max_per_row,
+                   const size_type        extra_off_diagonals);
 
   /**
    * Destructor.
@@ -549,9 +564,9 @@ public:
    * @deprecated The last argument of this function is ignored. Use the
    *     version of this function without the last argument.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
-               const unsigned int max_per_row,
+  void reinit (const size_type m,
+               const size_type n,
+               const size_type max_per_row,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -562,9 +577,9 @@ public:
    * This function simply maps its operations to the other <tt>reinit</tt>
    * function.
    */
-  void reinit (const unsigned int m,
-               const unsigned int n,
-               const unsigned int max_per_row);
+  void reinit (const size_type m,
+               const size_type n,
+               const size_type max_per_row);
 
   /**
    * Reallocate memory for a matrix of size <tt>m x n</tt>. The number of
@@ -583,9 +598,9 @@ public:
    * @deprecated The last argument of this function is ignored. Use the
    *     version of this function without the last argument.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const std::vector<unsigned int> &row_lengths,
+  void reinit (const size_type               m,
+               const size_type               n,
+               const std::vector<size_type> &row_lengths,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
@@ -602,9 +617,9 @@ public:
    * is true, diagonal elements are stored first in each row to allow
    * optimized access in relaxation methods of SparseMatrix.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const std::vector<unsigned int> &row_lengths);
+  void reinit (const size_type               m,
+               const size_type               n,
+               const std::vector<size_type> &row_lengths);
 
   /**
    * Same as above, but with a VectorSlice argument instead.
@@ -612,17 +627,17 @@ public:
    * @deprecated The last argument of this function is ignored. Use the
    *     version of this function without the last argument.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const VectorSlice<const std::vector<unsigned int> > &row_lengths,
+  void reinit (const size_type                                   m,
+               const size_type                                   n,
+               const VectorSlice<const std::vector<size_type> > &row_lengths,
                const bool optimize_diagonal) DEAL_II_DEPRECATED;
 
   /**
    * Same as above, but with a VectorSlice argument instead.
    */
-  void reinit (const unsigned int               m,
-               const unsigned int               n,
-               const VectorSlice<const std::vector<unsigned int> > &row_lengths);
+  void reinit (const size_type                                   m,
+               const size_type                                   n,
+               const VectorSlice<const std::vector<size_type> > &row_lengths);
 
   /**
    * This function compresses the sparsity structure that this object
@@ -718,8 +733,8 @@ public:
    *     version of this function without the last argument.
    */
   template <typename ForwardIterator>
-  void copy_from (const unsigned int    n_rows,
-                  const unsigned int    n_cols,
+  void copy_from (const size_type       n_rows,
+                  const size_type       n_cols,
                   const ForwardIterator begin,
                   const ForwardIterator end,
                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
@@ -801,8 +816,8 @@ public:
    * iterators that point to such pairs.
    */
   template <typename ForwardIterator>
-  void copy_from (const unsigned int    n_rows,
-                  const unsigned int    n_cols,
+  void copy_from (const size_type n_rows,
+                  const size_type n_cols,
                   const ForwardIterator begin,
                   const ForwardIterator end);
 
@@ -867,8 +882,8 @@ public:
    *
    * If the entry already exists, nothing bad happens.
    */
-  void add (const unsigned int i,
-            const unsigned int j);
+  void add (const size_type i,
+            const size_type j);
 
   /**
    * Add several nonzero entries to the specified matrix row.  This function
@@ -877,10 +892,10 @@ public:
    * If some of the entries already exist, nothing bad happens.
    */
   template <typename ForwardIterator>
-  void add_entries (const unsigned int row,
-                    ForwardIterator    begin,
-                    ForwardIterator    end,
-                    const bool         indices_are_sorted = false);
+  void add_entries (const size_type row,
+                    ForwardIterator begin,
+                    ForwardIterator end,
+                    const bool      indices_are_sorted = false);
 
 // @}
   /**
@@ -914,7 +929,7 @@ public:
    * Note also the discussion in the general documentation of this class about
    * the order in which elements are accessed.
    */
-  iterator begin (const unsigned int r) const;
+  iterator begin (const size_type r) const;
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -924,7 +939,7 @@ public:
    * particular the case if it is the end iterator for the last row of a
    * matrix.
    */
-  iterator end (const unsigned int r) const;
+  iterator end (const size_type r) const;
 
   /**
    * STL-like iterator with the first entry of row <tt>r</tt>.
@@ -937,7 +952,7 @@ public:
    * @deprecated Use the iterators provided by the begin() and end()
    * functions instead.
    */
-  row_iterator row_begin (const unsigned int r) const DEAL_II_DEPRECATED;
+  row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
 
   /**
    * Final iterator of row <tt>r</tt>. It points to the first element past the
@@ -950,7 +965,7 @@ public:
    * @deprecated Use the iterators provided by the begin() and end()
    * functions instead.
    */
-  row_iterator row_end (const unsigned int r) const DEAL_II_DEPRECATED;
+  row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
 
 // @}
   /**
@@ -973,7 +988,7 @@ public:
    * equals the number given to the constructor, while after compression, it
    * equals the maximum number of entries actually allocated by the user.
    */
-  unsigned int max_entries_per_row () const;
+  size_type max_entries_per_row () const;
 
   /**
    * Compute the bandwidth of the matrix represented by this structure. The
@@ -981,7 +996,7 @@ public:
    * represents a nonzero entry of the matrix. Consequently, the maximum
    * bandwidth a $n\times m$ matrix can have is $\max\{n-1,m-1\}$.
    */
-  unsigned int bandwidth () const;
+  size_type bandwidth () const;
 
   /**
    * Return the number of nonzero elements of this matrix. Actually, it
@@ -991,7 +1006,7 @@ public:
    * This function may only be called if the matrix struct is compressed. It
    * does not make too much sense otherwise anyway.
    */
-  std::size_t n_nonzero_elements () const;
+  size_type n_nonzero_elements () const;
 
   /**
    * Return whether the structure is compressed or not.
@@ -1002,18 +1017,18 @@ public:
    * Return number of rows of this matrix, which equals the dimension of the
    * image space.
    */
-  unsigned int n_rows () const;
+  size_type n_rows () const;
 
   /**
    * Return number of columns of this matrix, which equals the dimension of
    * the range space.
    */
-  unsigned int n_cols () const;
+  size_type n_cols () const;
 
   /**
    * Number of entries in a specific row.
    */
-  unsigned int row_length (const unsigned int row) const;
+  size_type row_length (const size_type row) const;
 
   /**
    * Determine whether the matrix uses the special convention for quadratic
@@ -1071,8 +1086,8 @@ public:
    * single row. In such cases, it is more efficient to use iterators over
    * the elements of the sparsity pattern or of the sparse matrix.
    */
-  unsigned int operator() (const unsigned int i,
-                           const unsigned int j) const;
+  size_type operator() (const size_type i,
+                        const size_type j) const;
 
   /**
    * This is the inverse operation to operator()(): given a global index, find
@@ -1085,14 +1100,14 @@ public:
    * If <tt>N</tt> is the number of rows of this matrix, then the complexity
    * of this function is <i>log(N)</i>.
    */
-  std::pair<unsigned int, unsigned int>
-  matrix_position (const unsigned int global_index) const;
+  std::pair<size_type, size_type>
+  matrix_position (const size_type global_index) const;
 
   /**
    * Check if a value at a certain position may be non-zero.
    */
-  bool exists (const unsigned int i,
-               const unsigned int j) const;
+  bool exists (const size_type i,
+               const size_type j) const;
 
   /**
    * The index of a global matrix entry in its row.
@@ -1101,8 +1116,8 @@ public:
    * with respect to the total field, but only with respect to the row
    * <tt>j</tt>.
    */
-  unsigned int row_position(const unsigned int i,
-                            const unsigned int j) const;
+  size_type row_position(const size_type i,
+                         const size_type j) const;
 
   /**
    * Access to column number field.  Return the column number of the
@@ -1115,8 +1130,8 @@ public:
    * i.e. <tt>column_number(row,i)</tt> <tt><</tt>
    * <tt>column_number(row,i+1)</tt>.
    */
-  unsigned int column_number (const unsigned int row,
-                              const unsigned int index) const;
+  size_type column_number (const size_type row,
+                           const size_type index) const;
 
 
 // @}
@@ -1268,7 +1283,7 @@ public:
    * yourself, you should also rename this function to avoid programs relying
    * on outdated information!
    */
-  const unsigned int *get_column_numbers () const DEAL_II_DEPRECATED;
+  const size_type *get_column_numbers () const DEAL_II_DEPRECATED;
 
   BOOST_SERIALIZATION_SPLIT_MEMBER()
   /** @addtogroup Exceptions
@@ -1326,24 +1341,24 @@ private:
    * be larger than #rows and in this case #rowstart has more elements than
    * are used.
    */
-  unsigned int max_dim;
+  size_type max_dim;
 
   /**
    * Number of rows that this sparsity structure shall represent.
    */
-  unsigned int rows;
+  size_type rows;
 
   /**
    * Number of columns that this sparsity structure shall represent.
    */
-  unsigned int cols;
+  size_type cols;
 
   /**
    * Size of the actually allocated array #colnums. Here, the same applies as
    * for the #rowstart array, i.e. it may be larger than the actually used
    * part of the array.
    */
-  std::size_t max_vec_len;
+  size_type max_vec_len;
 
   /**
    * Maximum number of elements per row. This is set to the value given to the
@@ -1352,7 +1367,7 @@ private:
    * reinit versions are called. Its value is more or less meaningless after
    * compress() has been called.
    */
-  unsigned int max_row_length;
+  size_type max_row_length;
 
   /**
    * Array which hold for each row which is the first element in #colnums
@@ -1391,7 +1406,7 @@ private:
    * sorted, such that finding whether an element exists and determining its
    * position can be done by a binary search.
    */
-  unsigned int *colnums;
+  size_type *colnums;
 
   /**
    * Store whether the compress() function was called for this object.
@@ -1433,8 +1448,8 @@ namespace SparsityPatternIterators
   inline
   Accessor::
   Accessor (const SparsityPattern *sparsity_pattern,
-            const unsigned int     r,
-            const unsigned int     i)
+            const size_type        r,
+            const size_type        i)
     :
     sparsity_pattern(sparsity_pattern),
     index_within_sparsity(sparsity_pattern->rowstart[r]+i)
@@ -1472,7 +1487,7 @@ namespace SparsityPatternIterators
 
 
   inline
-  unsigned int
+  size_type 
   Accessor::row() const
   {
     Assert (is_valid_entry() == true, ExcInvalidIterator());
@@ -1486,7 +1501,7 @@ namespace SparsityPatternIterators
 
 
   inline
-  unsigned int
+  size_type 
   Accessor::column() const
   {
     Assert (is_valid_entry() == true, ExcInvalidIterator());
@@ -1496,7 +1511,7 @@ namespace SparsityPatternIterators
 
 
   inline
-  unsigned int
+  size_type 
   Accessor::index() const
   {
     Assert (is_valid_entry() == true, ExcInvalidIterator());
@@ -1541,8 +1556,8 @@ namespace SparsityPatternIterators
 
   inline
   Iterator::Iterator (const SparsityPattern *sparsity_pattern,
-                      const unsigned int     r,
-                      const unsigned int     i)
+                      const size_type        r,
+                      const size_type        i)
     :
     accessor(sparsity_pattern, sparsity_pattern->rowstart[r]+i)
   {}
@@ -1653,7 +1668,7 @@ SparsityPattern::end () const
 
 inline
 SparsityPattern::iterator
-SparsityPattern::begin (const unsigned int r) const
+SparsityPattern::begin (const size_type r) const
 {
   Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
 
@@ -1664,7 +1679,7 @@ SparsityPattern::begin (const unsigned int r) const
 
 inline
 SparsityPattern::iterator
-SparsityPattern::end (const unsigned int r) const
+SparsityPattern::end (const size_type r) const
 {
   Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
 
@@ -1675,7 +1690,7 @@ SparsityPattern::end (const unsigned int r) const
 
 inline
 SparsityPattern::row_iterator
-SparsityPattern::row_begin (const unsigned int r) const
+SparsityPattern::row_begin (const size_type r) const
 {
   Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
   return &colnums[rowstart[r]];
@@ -1685,7 +1700,7 @@ SparsityPattern::row_begin (const unsigned int r) const
 
 inline
 SparsityPattern::row_iterator
-SparsityPattern::row_end (const unsigned int r) const
+SparsityPattern::row_end (const size_type r) const
 {
   Assert (r<n_rows(), ExcIndexRange(r,0,n_rows()));
   return &colnums[rowstart[r+1]];
@@ -1694,7 +1709,7 @@ SparsityPattern::row_end (const unsigned int r) const
 
 
 inline
-unsigned int
+SparsityPattern::size_type 
 SparsityPattern::n_rows () const
 {
   return rows;
@@ -1702,7 +1717,7 @@ SparsityPattern::n_rows () const
 
 
 inline
-unsigned int
+SparsityPattern::size_type 
 SparsityPattern::n_cols () const
 {
   return cols;
@@ -1742,7 +1757,7 @@ SparsityPattern::get_rowstart_indices () const
 
 
 inline
-const unsigned int *
+const SparsityPattern::size_type *
 SparsityPattern::get_column_numbers () const
 {
   return colnums;
@@ -1751,8 +1766,8 @@ SparsityPattern::get_column_numbers () const
 
 
 inline
-unsigned int
-SparsityPattern::row_length (const unsigned int row) const
+SparsityPattern::size_type 
+SparsityPattern::row_length (const size_type row) const
 {
   Assert(row<rows, ExcIndexRange(row,0,rows));
   return rowstart[row+1]-rowstart[row];
@@ -1761,9 +1776,9 @@ SparsityPattern::row_length (const unsigned int row) const
 
 
 inline
-unsigned int
-SparsityPattern::column_number (const unsigned int row,
-                                const unsigned int index) const
+SparsityPattern::size_type 
+SparsityPattern::column_number (const size_type row,
+                                const size_type index) const
 {
   Assert(row<rows, ExcIndexRange(row,0,rows));
   Assert(index<row_length(row), ExcIndexRange(index,0,row_length(row)));
@@ -1773,7 +1788,7 @@ SparsityPattern::column_number (const unsigned int row,
 
 
 inline
-std::size_t
+SparsityPattern::size_type
 SparsityPattern::n_nonzero_elements () const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
@@ -1786,7 +1801,7 @@ SparsityPattern::n_nonzero_elements () const
 template <class Archive>
 inline
 void
-SparsityPattern::save (Archive &ar, const unsigned int) const
+SparsityPattern::save (Archive &ar, const size_type) const
 {
   // forward to serialization function in the base class.
   ar   &static_cast<const Subscriptor &>(*this);
@@ -1802,15 +1817,15 @@ SparsityPattern::save (Archive &ar, const unsigned int) const
 template <class Archive>
 inline
 void
-SparsityPattern::load (Archive &ar, const unsigned int)
+SparsityPattern::load (Archive &ar, const size_type)
 {
   // forward to serialization function in the base class.
   ar   &static_cast<Subscriptor &>(*this);
 
   ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed &store_diagonal_first_in_row;
 
-  rowstart = new std::size_t [max_dim + 1];
-  colnums = new unsigned int [max_vec_len];
+  rowstart = new size_type [max_dim + 1];
+  colnums = new size_type [max_vec_len];
 
   ar &boost::serialization::make_array(rowstart, max_dim + 1);
   ar &boost::serialization::make_array(colnums, max_vec_len);
@@ -1832,11 +1847,11 @@ SparsityPattern::operator == (const SparsityPattern &sp2)  const
       store_diagonal_first_in_row != sp2.store_diagonal_first_in_row)
     return false;
 
-  for (unsigned int i = 0; i < rows+1; ++i)
+  for (size_type i = 0; i < rows+1; ++i)
     if (rowstart[i] != sp2.rowstart[i])
       return false;
 
-  for (unsigned int i = 0; i < rowstart[rows]; ++i)
+  for (size_type i = 0; i < rowstart[rows]; ++i)
     if (colnums[i] != sp2.colnums[i])
       return false;
 
@@ -1848,10 +1863,15 @@ SparsityPattern::operator == (const SparsityPattern &sp2)  const
 namespace internal
 {
   namespace SparsityPatternTools
-  {
+  { 
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;       
+   
     inline
-    unsigned int
-    get_column_index_from_iterator (const unsigned int i)
+    size_type 
+    get_column_index_from_iterator (const size_type i)
     {
       return i;
     }
@@ -1860,8 +1880,8 @@ namespace internal
 
     template <typename value>
     inline
-    unsigned int
-    get_column_index_from_iterator (const std::pair<unsigned int, value> &i)
+    size_type 
+    get_column_index_from_iterator (const std::pair<size_type, value> &i)
     {
       return i.first;
     }
@@ -1870,8 +1890,8 @@ namespace internal
 
     template <typename value>
     inline
-    unsigned int
-    get_column_index_from_iterator (const std::pair<const unsigned int, value> &i)
+    size_type 
+    get_column_index_from_iterator (const std::pair<const size_type, value> &i)
     {
       return i.first;
     }
@@ -1882,8 +1902,8 @@ namespace internal
 
 template <typename ForwardIterator>
 void
-SparsityPattern::copy_from (const unsigned int    n_rows,
-                            const unsigned int    n_cols,
+SparsityPattern::copy_from (const size_type       n_rows,
+                            const size_type       n_cols,
                             const ForwardIterator begin,
                             const ForwardIterator end,
                             const bool)
@@ -1895,12 +1915,12 @@ SparsityPattern::copy_from (const unsigned int    n_rows,
 
 template <typename ForwardIterator>
 void
-SparsityPattern::copy_from (const unsigned int    n_rows,
-                            const unsigned int    n_cols,
+SparsityPattern::copy_from (const size_type       n_rows,
+                            const size_type       n_cols,
                             const ForwardIterator begin,
                             const ForwardIterator end)
 {
-  Assert (static_cast<unsigned int>(std::distance (begin, end)) == n_rows,
+  Assert (static_cast<size_type>(std::distance (begin, end)) == n_rows,
           ExcIteratorRange (std::distance (begin, end), n_rows));
 
   // first determine row lengths for each row. if the matrix is quadratic,
@@ -1908,7 +1928,7 @@ SparsityPattern::copy_from (const unsigned int    n_rows,
   // is not yet present. as we have to call compress anyway later on, don't
   // bother to check whether that diagonal entry is in a certain row or not
   const bool is_square = (n_rows == n_cols);
-  std::vector<unsigned int> row_lengths;
+  std::vector<size_type> row_lengths;
   row_lengths.reserve(n_rows);
   for (ForwardIterator i=begin; i!=end; ++i)
     row_lengths.push_back (std::distance (i->begin(), i->end())
@@ -1921,15 +1941,15 @@ SparsityPattern::copy_from (const unsigned int    n_rows,
   //
   // for use in the inner loop, we define a typedef to the type of the inner
   // iterators
-  unsigned int row = 0;
+  size_type row = 0;
   typedef typename std::iterator_traits<ForwardIterator>::value_type::const_iterator inner_iterator;
   for (ForwardIterator i=begin; i!=end; ++i, ++row)
     {
-      unsigned int *cols = &colnums[rowstart[row]] + (is_square ? 1 : 0);
+      size_type *cols = &colnums[rowstart[row]] + (is_square ? 1 : 0);
       const inner_iterator end_of_row = i->end();
       for (inner_iterator j=i->begin(); j!=end_of_row; ++j)
         {
-          const unsigned int col
+          const size_type col
             = internal::SparsityPatternTools::get_column_index_from_iterator(*j);
           Assert (col < n_cols, ExcIndexRange(col,0,n_cols));
 
index e65cd32405538e46c84dd480b1931008a3c0a2f4..5f572a16f5f60bfe42d932f2521265b908c10b8c 100644 (file)
@@ -41,6 +41,11 @@ class SparsityPattern;
 */
 namespace SparsityTools
 {
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Use the METIS partitioner to generate
    * a partitioning of the degrees of
@@ -191,8 +196,8 @@ namespace SparsityTools
    */
   void
   reorder_Cuthill_McKee (const SparsityPattern     &sparsity,
-                         std::vector<unsigned int> &new_indices,
-                         const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
+                         std::vector<size_type> &new_indices,
+                         const std::vector<size_type> &starting_indices = std::vector<size_type>());
 
 
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
@@ -237,7 +242,7 @@ namespace SparsityTools
    */
   template <class CSP_t>
   void distribute_sparsity_pattern(CSP_t &csp,
-                                   const std::vector<unsigned int> &rows_per_cpu,
+                                   const std::vector<size_type> &rows_per_cpu,
                                    const MPI_Comm &mpi_comm,
                                    const IndexSet &myrange);
 #endif
index 1c59e4b54355dc0595244e18e2d298a36bf8d695..fa4125060e2b161f94e007eff65ce90221426054 100644 (file)
@@ -182,7 +182,7 @@ void GridGenerator::hyper_cube (Triangulation<dim,spacedim> &tria,
 void
 GridGenerator::moebius (
   Triangulation<3> &tria,
-  const unsigned int   n_cells,
+  const size_type      n_cells,
   const unsigned int   n_rotations,
   const double         R,
   const double         r)
@@ -197,7 +197,7 @@ GridGenerator::moebius (
   double beta_step=n_rotations*numbers::PI/2.0/n_cells;
   double alpha_step=2.0*numbers::PI/n_cells;
 
-  for (unsigned int i=0; i<n_cells; ++i)
+  for (size_type i=0; i<n_cells; ++i)
     for (unsigned int j=0; j<4; ++j)
       {
         vertices[4*i+j][0]=R*std::cos(i*alpha_step)+r*std::cos(i*beta_step+j*numbers::PI/2.0)*std::cos(i*alpha_step);
@@ -205,10 +205,10 @@ GridGenerator::moebius (
         vertices[4*i+j][2]=r*std::sin(i*beta_step+j*numbers::PI/2.0);
       }
 
-  unsigned int offset=0;
+  size_type offset=0;
 
   std::vector<CellData<dim> > cells (n_cells);
-  for (unsigned int i=0; i<n_cells; ++i)
+  for (size_type i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0; j<2; ++j)
         {
@@ -482,13 +482,13 @@ GridGenerator::parallelepiped (Triangulation<dim>  &tria,
 template<int dim>
 void
 GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
-                                          const unsigned int   n_subdivisions,
+                                          const size_type      n_subdivisions,
                                           const Point<dim>   (&corners) [dim],
                                           const bool           colorize)
 {
   // Equalise number of subdivisions in each dim-direction, heir
   // validity will be checked later
-  unsigned int (n_subdivisions_) [dim];
+  size_type (n_subdivisions_) [dim];
   for (unsigned int i=0; i<dim; ++i)
     n_subdivisions_[i] = n_subdivisions;
 
@@ -501,7 +501,7 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
 template<int dim>
 void
 GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
-                                          const unsigned int ( n_subdivisions) [dim],
+                                          const size_type    ( n_subdivisions) [dim],
                                           const Point<dim>   (&corners) [dim],
                                           const bool           colorize)
 {
@@ -525,20 +525,20 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
   switch (dim)
     {
     case 1:
-      for (unsigned int x=0; x<=n_subdivisions[0]; ++x)
+      for (size_type x=0; x<=n_subdivisions[0]; ++x)
         points.push_back (Point<dim> (x*delta[0]));
       break;
 
     case 2:
-      for (unsigned int y=0; y<=n_subdivisions[1]; ++y)
-        for (unsigned int x=0; x<=n_subdivisions[0]; ++x)
+      for (size_type y=0; y<=n_subdivisions[1]; ++y)
+        for (size_type x=0; x<=n_subdivisions[0]; ++x)
           points.push_back (Point<dim> (x*delta[0] + y*delta[1]));
       break;
 
     case 3:
-      for (unsigned int z=0; z<=n_subdivisions[2]; ++z)
-        for (unsigned int y=0; y<=n_subdivisions[1]; ++y)
-          for (unsigned int x=0; x<=n_subdivisions[0]; ++x)
+      for (size_type z=0; z<=n_subdivisions[2]; ++z)
+        for (size_type y=0; y<=n_subdivisions[1]; ++y)
+          for (size_type x=0; x<=n_subdivisions[0]; ++x)
             points.push_back (Point<dim> (x*delta[0] + y*delta[1] + z*delta[2]));
       break;
 
@@ -547,7 +547,7 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
     }
 
   // Prepare cell data
-  unsigned int n_cells = 1;
+  size_type n_cells = 1;
   for (unsigned int i=0; i<dim; ++i)
     n_cells *= n_subdivisions[i];
   std::vector<CellData<dim> > cells (n_cells);
@@ -556,7 +556,7 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
   switch (dim)
     {
     case 1:
-      for (unsigned int x=0; x<n_subdivisions[0]; ++x)
+      for (size_type x=0; x<n_subdivisions[0]; ++x)
         {
           cells[x].vertices[0] = x;
           cells[x].vertices[1] = x+1;
@@ -569,13 +569,13 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
     case 2:
     {
       // Shorthand
-      const unsigned int n_dy = n_subdivisions[1];
-      const unsigned int n_dx = n_subdivisions[0];
+      const size_type n_dy = n_subdivisions[1];
+      const size_type n_dx = n_subdivisions[0];
 
-      for (unsigned int y=0; y<n_dy; ++y)
-        for (unsigned int x=0; x<n_dx; ++x)
+      for (size_type y=0; y<n_dy; ++y)
+        for (size_type x=0; x<n_dx; ++x)
           {
-            const unsigned int c = y*n_dx         + x;
+            const size_type    c = y*n_dx         + x;
             cells[c].vertices[0] = y*(n_dx+1)     + x;
             cells[c].vertices[1] = y*(n_dx+1)     + x+1;
             cells[c].vertices[2] = (y+1)*(n_dx+1) + x;
@@ -590,15 +590,15 @@ GridGenerator::subdivided_parallelepiped (Triangulation<dim>  &tria,
     case 3:
     {
       // Shorthand
-      const unsigned int n_dz = n_subdivisions[2];
-      const unsigned int n_dy = n_subdivisions[1];
-      const unsigned int n_dx = n_subdivisions[0];
+      const size_type n_dz = n_subdivisions[2];
+      const size_type n_dy = n_subdivisions[1];
+      const size_type n_dx = n_subdivisions[0];
 
-      for (unsigned int z=0; z<n_dz; ++z)
-        for (unsigned int y=0; y<n_dy; ++y)
-          for (unsigned int x=0; x<n_dx; ++x)
+      for (size_type z=0; z<n_dz; ++z)
+        for (size_type y=0; y<n_dy; ++y)
+          for (size_type x=0; x<n_dx; ++x)
             {
-              const unsigned int c = z*n_dy*n_dx             + y*n_dx         + x;
+              const size_type    c = z*n_dy*n_dx             + y*n_dx         + x;
 
               cells[c].vertices[0] = z*(n_dy+1)*(n_dx+1)     + y*(n_dx+1)     + x;
               cells[c].vertices[1] = z*(n_dy+1)*(n_dx+1)     + y*(n_dx+1)     + x+1;
@@ -932,7 +932,7 @@ GridGenerator::subdivided_hyper_rectangle(
         }
 
       double x = 0;
-      for (unsigned int j=0; j<step_sizes.at(i).size(); j++)
+      for (size_type j=0; j<step_sizes.at(i).size(); j++)
         x += step_sizes[i][j];
       Assert(std::fabs(x - (p2(i)-p1(i))) <= 1e-12*std::fabs(x),
              ExcInvalidRepetitions (i) );
@@ -947,7 +947,7 @@ GridGenerator::subdivided_hyper_rectangle(
     case 1:
     {
       double x=0;
-      for (unsigned int i=0; ; ++i)
+      for (size_type i=0; ; ++i)
         {
           points.push_back (Point<dim> (p1[0]+x));
 
@@ -967,10 +967,10 @@ GridGenerator::subdivided_hyper_rectangle(
     case 2:
     {
       double y=0;
-      for (unsigned int j=0; ; ++j)
+      for (size_type j=0; ; ++j)
         {
           double x=0;
-          for (unsigned int i=0; ; ++i)
+          for (size_type i=0; ; ++i)
             {
               points.push_back (Point<dim> (p1[0]+x,
                                             p1[1]+y));
@@ -991,13 +991,13 @@ GridGenerator::subdivided_hyper_rectangle(
     case 3:
     {
       double z=0;
-      for (unsigned int k=0; ; ++k)
+      for (size_type k=0; ; ++k)
         {
           double y=0;
-          for (unsigned int j=0; ; ++j)
+          for (size_type j=0; ; ++j)
             {
               double x=0;
-              for (unsigned int i=0; ; ++i)
+              for (size_type i=0; ; ++i)
                 {
                   points.push_back (Point<dim> (p1[0]+x,
                                                 p1[1]+y,
@@ -1034,7 +1034,7 @@ GridGenerator::subdivided_hyper_rectangle(
     case 1:
     {
       cells.resize (step_sizes[0].size());
-      for (unsigned int x=0; x<step_sizes[0].size(); ++x)
+      for (size_type x=0; x<step_sizes[0].size(); ++x)
         {
           cells[x].vertices[0] = x;
           cells[x].vertices[1] = x+1;
@@ -1046,10 +1046,10 @@ GridGenerator::subdivided_hyper_rectangle(
     case 2:
     {
       cells.resize (step_sizes[1].size()*step_sizes[0].size());
-      for (unsigned int y=0; y<step_sizes[1].size(); ++y)
-        for (unsigned int x=0; x<step_sizes[0].size(); ++x)
+      for (size_type y=0; y<step_sizes[1].size(); ++y)
+        for (size_type x=0; x<step_sizes[0].size(); ++x)
           {
-            const unsigned int c = x+y*step_sizes[0].size();
+            const size_type c = x+y*step_sizes[0].size();
             cells[c].vertices[0] = y*(step_sizes[0].size()+1)+x;
             cells[c].vertices[1] = y*(step_sizes[0].size()+1)+x+1;
             cells[c].vertices[2] = (y+1)*(step_sizes[0].size()+1)+x;
@@ -1061,15 +1061,15 @@ GridGenerator::subdivided_hyper_rectangle(
 
     case 3:
     {
-      const unsigned int n_x  = (step_sizes[0].size()+1);
-      const unsigned int n_xy = (step_sizes[0].size()+1)*(step_sizes[1].size()+1);
+      const size_type n_x  = (step_sizes[0].size()+1);
+      const size_type n_xy = (step_sizes[0].size()+1)*(step_sizes[1].size()+1);
 
       cells.resize (step_sizes[2].size()*step_sizes[1].size()*step_sizes[0].size());
-      for (unsigned int z=0; z<step_sizes[2].size(); ++z)
-        for (unsigned int y=0; y<step_sizes[1].size(); ++y)
-          for (unsigned int x=0; x<step_sizes[0].size(); ++x)
+      for (size_type z=0; z<step_sizes[2].size(); ++z)
+        for (size_type y=0; y<step_sizes[1].size(); ++y)
+          for (size_type x=0; x<step_sizes[0].size(); ++x)
             {
-              const unsigned int c = x+y*step_sizes[0].size() +
+              const size_type    c = x+y*step_sizes[0].size() +
                                      z*step_sizes[0].size()*step_sizes[1].size();
               cells[c].vertices[0] = z*n_xy + y*n_x + x;
               cells[c].vertices[1] = z*n_xy + y*n_x + x+1;
@@ -1130,13 +1130,13 @@ GridGenerator::subdivided_hyper_rectangle (
   Assert(spacing.size() == 1,
          ExcInvalidRepetitionsDimension(1));
 
-  const unsigned int n_cells = material_id.size(0);
+  const size_type n_cells = material_id.size(0);
 
   Assert(spacing[0].size() == n_cells,
          ExcInvalidRepetitionsDimension(1));
 
   double delta = std::numeric_limits<double>::max();
-  for (unsigned int i=0; i<n_cells; i++)
+  for (size_type i=0; i<n_cells; i++)
     {
       Assert (spacing[0][i] >= 0, ExcInvalidRepetitions(-1));
       delta = std::min (delta, spacing[0][i]);
@@ -1145,20 +1145,20 @@ GridGenerator::subdivided_hyper_rectangle (
   // generate the necessary points
   std::vector<Point<1> > points;
   double ax = p[0];
-  for (unsigned int x=0; x<=n_cells; ++x)
+  for (size_type x=0; x<=n_cells; ++x)
     {
       points.push_back (Point<1> (ax));
       if (x<n_cells)
         ax += spacing[0][x];
     }
   // create the cells
-  unsigned int n_val_cells = 0;
-  for (unsigned int i=0; i<n_cells; i++)
+  size_type n_val_cells = 0;
+  for (size_type i=0; i<n_cells; i++)
     if (material_id[i]!=numbers::invalid_material_id) n_val_cells++;
 
   std::vector<CellData<1> > cells(n_val_cells);
-  unsigned int id = 0;
-  for (unsigned int x=0; x<n_cells; ++x)
+  size_type id = 0;
+  for (size_type x=0; x<n_cells; ++x)
     if (material_id[x] != numbers::invalid_material_id)
       {
         cells[id].vertices[0] = x;
@@ -1191,14 +1191,14 @@ GridGenerator::subdivided_hyper_rectangle (
   Assert(spacing.size() == 2,
          ExcInvalidRepetitionsDimension(2));
 
-  std::vector<unsigned int> repetitions(2);
-  unsigned int n_cells = 1;
+  std::vector<size_type> repetitions(2);
+  size_type n_cells = 1;
   double delta = std::numeric_limits<double>::max();
   for (unsigned int i=0; i<2; i++)
     {
       repetitions[i] = spacing[i].size();
       n_cells *= repetitions[i];
-      for (unsigned int j=0; j<repetitions[i]; j++)
+      for (size_type j=0; j<repetitions[i]; j++)
         {
           Assert (spacing[i][j] >= 0, ExcInvalidRepetitions(-1));
           delta = std::min (delta, spacing[i][j]);
@@ -1210,10 +1210,10 @@ GridGenerator::subdivided_hyper_rectangle (
   // generate the necessary points
   std::vector<Point<2> > points;
   double ay = p[1];
-  for (unsigned int y=0; y<=repetitions[1]; ++y)
+  for (size_type y=0; y<=repetitions[1]; ++y)
     {
       double ax = p[0];
-      for (unsigned int x=0; x<=repetitions[0]; ++x)
+      for (size_type x=0; x<=repetitions[0]; ++x)
         {
           points.push_back (Point<2> (ax,ay));
           if (x<repetitions[0])
@@ -1224,16 +1224,16 @@ GridGenerator::subdivided_hyper_rectangle (
     }
 
   // create the cells
-  unsigned int n_val_cells = 0;
-  for (unsigned int i=0; i<material_id.size(0); i++)
-    for (unsigned int j=0; j<material_id.size(1); j++)
+  size_type n_val_cells = 0;
+  for (size_type i=0; i<material_id.size(0); i++)
+    for (size_type j=0; j<material_id.size(1); j++)
       if (material_id[i][j] != numbers::invalid_material_id)
         n_val_cells++;
 
   std::vector<CellData<2> > cells(n_val_cells);
-  unsigned int id = 0;
-  for (unsigned int y=0; y<repetitions[1]; ++y)
-    for (unsigned int x=0; x<repetitions[0]; ++x)
+  size_type id = 0;
+  for (size_type y=0; y<repetitions[1]; ++y)
+    for (size_type x=0; x<repetitions[0]; ++x)
       if (material_id[x][y]!=numbers::invalid_material_id)
         {
           cells[id].vertices[0] = y*(repetitions[0]+1)+x;
@@ -1291,14 +1291,14 @@ GridGenerator::subdivided_hyper_rectangle (
   Assert(spacing.size() == dim,
          ExcInvalidRepetitionsDimension(dim));
 
-  std::vector<unsigned int> repetitions(dim);
-  unsigned int n_cells = 1;
+  std::vector<size_type > repetitions(dim);
+  size_type n_cells = 1;
   double delta = std::numeric_limits<double>::max();
   for (unsigned int i=0; i<dim; i++)
     {
       repetitions[i] = spacing[i].size();
       n_cells *= repetitions[i];
-      for (unsigned int j=0; j<repetitions[i]; j++)
+      for (size_type j=0; j<repetitions[i]; j++)
         {
           Assert (spacing[i][j] >= 0, ExcInvalidRepetitions(-1));
           delta = std::min (delta, spacing[i][j]);
@@ -1310,13 +1310,13 @@ GridGenerator::subdivided_hyper_rectangle (
   // generate the necessary points
   std::vector<Point<dim> > points;
   double az = p[2];
-  for (unsigned int z=0; z<=repetitions[2]; ++z)
+  for (size_type z=0; z<=repetitions[2]; ++z)
     {
       double ay = p[1];
-      for (unsigned int y=0; y<=repetitions[1]; ++y)
+      for (size_type y=0; y<=repetitions[1]; ++y)
         {
           double ax = p[0];
-          for (unsigned int x=0; x<=repetitions[0]; ++x)
+          for (size_type x=0; x<=repetitions[0]; ++x)
             {
               points.push_back (Point<dim> (ax,ay,az));
               if (x<repetitions[0])
@@ -1330,20 +1330,20 @@ GridGenerator::subdivided_hyper_rectangle (
     }
 
   // create the cells
-  unsigned int n_val_cells = 0;
-  for (unsigned int i=0; i<material_id.size(0); i++)
-    for (unsigned int j=0; j<material_id.size(1); j++)
-      for (unsigned int k=0; k<material_id.size(2); k++)
+  size_type n_val_cells = 0;
+  for (size_type i=0; i<material_id.size(0); i++)
+    for (size_type j=0; j<material_id.size(1); j++)
+      for (size_type k=0; k<material_id.size(2); k++)
         if (material_id[i][j][k]!=numbers::invalid_material_id)
           n_val_cells++;
 
   std::vector<CellData<dim> > cells(n_val_cells);
-  unsigned int id = 0;
-  const unsigned int n_x  = (repetitions[0]+1);
-  const unsigned int n_xy = (repetitions[0]+1)*(repetitions[1]+1);
-  for (unsigned int z=0; z<repetitions[2]; ++z)
-    for (unsigned int y=0; y<repetitions[1]; ++y)
-      for (unsigned int x=0; x<repetitions[0]; ++x)
+  size_type id = 0;
+  const size_type n_x  = (repetitions[0]+1);
+  const size_type n_xy = (repetitions[0]+1)*(repetitions[1]+1);
+  for (size_type z=0; z<repetitions[2]; ++z)
+    for (size_type y=0; y<repetitions[1]; ++y)
+      for (size_type x=0; x<repetitions[0]; ++x)
         if (material_id[x][y][z]!=numbers::invalid_material_id)
           {
             cells[id].vertices[0] = z*n_xy + y*n_x + x;
@@ -1532,7 +1532,7 @@ void GridGenerator::hyper_shell (Triangulation<1> &,
                                  const Point<1> &,
                                  const double,
                                  const double,
-                                 const unsigned int,
+                                 const size_type ,
                                  const bool)
 {
   Assert (false, ExcNotImplemented());
@@ -1554,8 +1554,8 @@ void GridGenerator::cylinder_shell (Triangulation<1> &,
                                     const double,
                                     const double,
                                     const double,
-                                    const unsigned int,
-                                    const unsigned int)
+                                    const size_type ,
+                                    const size_type )
 {
   Assert (false, ExcNotImplemented());
 }
@@ -1577,7 +1577,7 @@ GridGenerator::half_hyper_shell (Triangulation<1> &,
                                  const Point<1> &,
                                  const double,
                                  const double,
-                                 const unsigned int,
+                                 const size_type ,
                                  const bool)
 {
   Assert (false, ExcNotImplemented());
@@ -1588,7 +1588,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<1> &,
                                          const Point<1> &,
                                          const double,
                                          const double,
-                                         const unsigned int,
+                                         const size_type ,
                                          const bool)
 {
   Assert (false, ExcNotImplemented());
@@ -1834,11 +1834,11 @@ GridGenerator::colorize_hyper_shell (
 
 
 template <>
-void GridGenerator::hyper_shell (Triangulation<2>   &tria,
-                                 const Point<2>     &center,
-                                 const double        inner_radius,
-                                 const double        outer_radius,
-                                 const unsigned int  n_cells,
+void GridGenerator::hyper_shell (Triangulation<2> &tria,
+                                 const Point<2>   &center,
+                                 const double      inner_radius,
+                                 const double      outer_radius,
+                                 const size_type   n_cells,
                                  const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -1855,11 +1855,11 @@ void GridGenerator::hyper_shell (Triangulation<2>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N = (n_cells == 0 ?
-                          static_cast<unsigned int>
-                          (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
-                                     (outer_radius - inner_radius))) :
-                          n_cells);
+  const size_type N = (n_cells == 0 ?
+                       static_cast<size_type>
+                       (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
+                                  (outer_radius - inner_radius))) :
+                       n_cells);
 
   // set up N vertices on the
   // outer and N vertices on
@@ -1868,7 +1868,7 @@ void GridGenerator::hyper_shell (Triangulation<2>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices(2*N);
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       vertices[i] = Point<2>( std::cos(2*pi * i/N),
                               std::sin(2*pi * i/N)) * outer_radius;
@@ -1880,7 +1880,7 @@ void GridGenerator::hyper_shell (Triangulation<2>   &tria,
 
   std::vector<CellData<2> > cells (N, CellData<2>());
 
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       cells[i].vertices[0] = i;
       cells[i].vertices[1] = (i+1)%N;
@@ -1938,8 +1938,8 @@ void GridGenerator::cylinder_shell (Triangulation<2> &,
                                     const double,
                                     const double,
                                     const double,
-                                    const unsigned int,
-                                    const unsigned int)
+                                    const size_type,
+                                    const size_type)
 {
   Assert (false, ExcNotImplemented());
 }
@@ -2009,11 +2009,11 @@ GridGenerator::half_hyper_ball (Triangulation<2> &tria,
 // Implementation for 2D only
 template <>
 void
-GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
-                                 const Point<2>     &center,
-                                 const double        inner_radius,
-                                 const double        outer_radius,
-                                 const unsigned int  n_cells,
+GridGenerator::half_hyper_shell (Triangulation<2> &tria,
+                                 const Point<2>   &center,
+                                 const double      inner_radius,
+                                 const double      outer_radius,
+                                 const size_type   n_cells,
                                  const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -2029,11 +2029,11 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N = (n_cells == 0 ?
-                          static_cast<unsigned int>
-                          (std::ceil((pi* (outer_radius + inner_radius)/2) /
-                                     (outer_radius - inner_radius))) :
-                          n_cells);
+  const size_type N = (n_cells == 0 ?
+                       static_cast<size_type>
+                       (std::ceil((pi* (outer_radius + inner_radius)/2) /
+                                  (outer_radius - inner_radius))) :
+                       n_cells);
 
   // set up N+1 vertices on the
   // outer and N+1 vertices on
@@ -2042,7 +2042,7 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices(2*(N+1));
-  for (unsigned int i=0; i<=N; ++i)
+  for (size_type i=0; i<=N; ++i)
     {
       // enforce that the x-coordinates
       // of the first and last point of
@@ -2063,7 +2063,7 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
 
   std::vector<CellData<2> > cells (N, CellData<2>());
 
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       cells[i].vertices[0] = i;
       cells[i].vertices[1] = (i+1)%(N+1);
@@ -2090,11 +2090,11 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
 
 
 template <>
-void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
-                                         const Point<2>     &center,
-                                         const double        inner_radius,
-                                         const double        outer_radius,
-                                         const unsigned int  n_cells,
+void GridGenerator::quarter_hyper_shell (Triangulation<2> &tria,
+                                         const Point<2>   &center,
+                                         const double      inner_radius,
+                                         const double      outer_radius,
+                                         const size_type   n_cells,
                                          const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
@@ -2110,11 +2110,11 @@ void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N = (n_cells == 0 ?
-                          static_cast<unsigned int>
-                          (std::ceil((pi* (outer_radius + inner_radius)/4) /
-                                     (outer_radius - inner_radius))) :
-                          n_cells);
+  const size_type N = (n_cells == 0 ?
+                       static_cast<size_type>
+                       (std::ceil((pi* (outer_radius + inner_radius)/4) /
+                                  (outer_radius - inner_radius))) :
+                       n_cells);
 
   // set up N+1 vertices on the
   // outer and N+1 vertices on
@@ -2123,7 +2123,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices(2*(N+1));
-  for (unsigned int i=0; i<=N; ++i)
+  for (size_type i=0; i<=N; ++i)
     {
       // enforce that the x-coordinates
       // of the last point is exactly
@@ -2143,7 +2143,7 @@ void GridGenerator::quarter_hyper_shell (Triangulation<2>   &tria,
 
   std::vector<CellData<2> > cells (N, CellData<2>());
 
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
       cells[i].vertices[0] = i;
       cells[i].vertices[1] = (i+1)%(N+1);
@@ -2302,12 +2302,12 @@ void GridGenerator::truncated_cone (Triangulation<3> &triangulation,
                                     const double half_length)
 {
   // Determine number of cells and vertices
-  const unsigned int
-  n_cells = static_cast<unsigned int>(std::floor (half_length /
+  const size_type 
+  n_cells = static_cast<size_type>(std::floor (half_length /
                                                   std::max (radius_0,
                                                             radius_1) +
                                                   0.5));
-  const unsigned int n_vertices = 4 * (n_cells + 1);
+  const size_type n_vertices = 4 * (n_cells + 1);
   std::vector<Point<3> > vertices_tmp(n_vertices);
 
   vertices_tmp[0] = Point<3> (-half_length, 0, -radius_0);
@@ -2317,7 +2317,7 @@ void GridGenerator::truncated_cone (Triangulation<3> &triangulation,
 
   const double dx = 2 * half_length / n_cells;
 
-  for (unsigned int i = 0; i < n_cells; ++i)
+  for (size_type i = 0; i < n_cells; ++i)
     {
       vertices_tmp[4 * (i + 1)]
         = vertices_tmp[4 * i] +
@@ -2337,13 +2337,13 @@ void GridGenerator::truncated_cone (Triangulation<3> &triangulation,
                                          vertices_tmp.end());
   Table<2,unsigned int> cell_vertices(n_cells,GeometryInfo<3>::vertices_per_cell);
 
-  for (unsigned int i = 0; i < n_cells; ++i)
+  for (size_type i = 0; i < n_cells; ++i)
     for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
       cell_vertices[i][j] = 4 * i + j;
 
   std::vector<CellData<3> > cells (n_cells, CellData<3> ());
 
-  for (unsigned int i = 0; i < n_cells; ++i)
+  for (size_type i = 0; i < n_cells; ++i)
     {
       for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
         cells[i].vertices[j] = cell_vertices[i][j];
@@ -3243,12 +3243,12 @@ void GridGenerator::quarter_hyper_shell (Triangulation<3> &tria,
 
 // Implementation for 3D only
 template <>
-void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
-                                    const double        length,
-                                    const double        inner_radius,
-                                    const double        outer_radius,
-                                    const unsigned int  n_radial_cells,
-                                    const unsigned int  n_axial_cells)
+void GridGenerator::cylinder_shell (Triangulation<3> &tria,
+                                    const double      length,
+                                    const double      inner_radius,
+                                    const double      outer_radius,
+                                    const size_type   n_radial_cells,
+                                    const size_type   n_axial_cells)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
           ExcInvalidRadii ());
@@ -3264,16 +3264,16 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
   // radial extent (which is the
   // difference between the two
   // radii)
-  const unsigned int N_r = (n_radial_cells == 0 ?
-                            static_cast<unsigned int>
-                            (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
-                                       (outer_radius - inner_radius))) :
-                            n_radial_cells);
-  const unsigned int N_z = (n_axial_cells == 0 ?
-                            static_cast<unsigned int>
-                            (std::ceil (length /
-                                        (2*pi*(outer_radius + inner_radius)/2/N_r))) :
-                            n_axial_cells);
+  const size_type N_r = (n_radial_cells == 0 ?
+                         static_cast<size_type>
+                         (std::ceil((2*pi* (outer_radius + inner_radius)/2) /
+                                    (outer_radius - inner_radius))) :
+                         n_radial_cells);
+  const size_type N_z = (n_axial_cells == 0 ?
+                         static_cast<size_type>
+                         (std::ceil (length /
+                                     (2*pi*(outer_radius + inner_radius)/2/N_r))) :
+                         n_axial_cells);
 
   // set up N vertices on the
   // outer and N vertices on
@@ -3282,7 +3282,7 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
   // outer one, and all are
   // numbered counter-clockwise
   std::vector<Point<2> > vertices_2d(2*N_r);
-  for (unsigned int i=0; i<N_r; ++i)
+  for (size_type i=0; i<N_r; ++i)
     {
       vertices_2d[i] = Point<2>( std::cos(2*pi * i/N_r),
                                  std::sin(2*pi * i/N_r)) * outer_radius;
@@ -3291,8 +3291,8 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
 
   std::vector<Point<3> > vertices_3d;
   vertices_3d.reserve (2*N_r*(N_z+1));
-  for (unsigned int j=0; j<=N_z; ++j)
-    for (unsigned int i=0; i<2*N_r; ++i)
+  for (size_type j=0; j<=N_z; ++j)
+    for (size_type i=0; i<2*N_r; ++i)
       {
         const Point<3> v (vertices_2d[i][0],
                           vertices_2d[i][1],
@@ -3302,8 +3302,8 @@ void GridGenerator::cylinder_shell (Triangulation<3>   &tria,
 
   std::vector<CellData<3> > cells (N_r*N_z, CellData<3>());
 
-  for (unsigned int j=0; j<N_z; ++j)
-    for (unsigned int i=0; i<N_r; ++i)
+  for (size_type j=0; j<N_z; ++j)
+    for (size_type i=0; i<N_r; ++i)
       {
         cells[i+j*N_r].vertices[0] = i + (j+1)*2*N_r;
         cells[i+j*N_r].vertices[1] = (i+1)%N_r + (j+1)*2*N_r;
@@ -3370,7 +3370,7 @@ merge_triangulations (const Triangulation<dim, spacedim> &triangulation_1,
   // throw out duplicated vertices from the two meshes
   // and create the triangulation
   SubCellData subcell_data;
-  std::vector<unsigned int> considered_vertices;
+  std::vector<size_type> considered_vertices;
   GridTools::delete_duplicated_vertices (vertices, cells, subcell_data, considered_vertices);
   result.clear ();
   result.create_triangulation (vertices, cells, subcell_data);
@@ -3379,7 +3379,7 @@ merge_triangulations (const Triangulation<dim, spacedim> &triangulation_1,
 void
 GridGenerator::
 extrude_triangulation(const Triangulation<2, 2> & input,
-                      const unsigned int n_slices,
+                      const size_type n_slices,
                       const double height,
                       Triangulation<3,3> &result)
 {
@@ -3393,9 +3393,9 @@ extrude_triangulation(const Triangulation<2, 2> & input,
   std::vector<CellData<3> > cells;
   cells.reserve((n_slices-1)*input.n_active_cells());
 
-  for (unsigned int slice=0;slice<n_slices;++slice)
+  for (size_type slice=0;slice<n_slices;++slice)
     {
-      for (unsigned int i=0;i<input.n_vertices();++i)
+      for (size_type i=0;i<input.n_vertices();++i)
 
       {
         const Point<2> & v = input.get_vertices()[i];
@@ -3408,7 +3408,7 @@ extrude_triangulation(const Triangulation<2, 2> & input,
   for (Triangulation<2,2>::cell_iterator
       cell = input.begin(); cell != input.end(); ++cell)
     {
-      for (unsigned int slice=0;slice<n_slices-1;++slice)
+      for (size_type slice=0;slice<n_slices-1;++slice)
         {
           CellData<3> this_cell;
           for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
@@ -3436,7 +3436,7 @@ extrude_triangulation(const Triangulation<2, 2> & input,
           {
             quad.boundary_id = cell->face(f)->boundary_indicator();
             bid = std::max(bid, quad.boundary_id);
-          for (unsigned int slice=0;slice<n_slices-1;++slice)
+          for (size_type slice=0;slice<n_slices-1;++slice)
             {
               quad.vertices[0] = cell->face(f)->vertex_index(0)+slice*input.n_vertices();
               quad.vertices[1] = cell->face(f)->vertex_index(1)+slice*input.n_vertices();
@@ -3480,10 +3480,10 @@ extrude_triangulation(const Triangulation<2, 2> & input,
 // this is not necessary here as this is an internal only function.
 inline
 void GridGenerator::laplace_solve (const SparseMatrix<double> &S,
-                                   const std::map<unsigned int,double> &m,
+                                   const std::map<size_type,double> &m,
                                    Vector<double> &u)
 {
-  const unsigned int n_dofs=S.n();
+  const size_type n_dofs=S.n();
   FilteredMatrix<Vector<double> > SF (S);
   PreconditionJacobi<SparseMatrix<double> > prec;
   prec.initialize(S, 1.2);
@@ -3504,7 +3504,7 @@ void GridGenerator::laplace_solve (const SparseMatrix<double> &S,
 // Implementation for 1D only
 template <>
 void GridGenerator::laplace_transformation (Triangulation<1> &,
-                                            const std::map<unsigned int,Point<1> > &)
+                                            const std::map<size_type,Point<1> > &)
 {
   Assert(false, ExcNotImplemented());
 }
@@ -3513,7 +3513,7 @@ void GridGenerator::laplace_transformation (Triangulation<1> &,
 // Implementation for dimensions except 1
 template <int dim>
 void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
-                                            const std::map<unsigned int,Point<dim> > &new_points)
+                                            const std::map<size_type,Point<dim> > &new_points)
 {
   // first provide everything that is
   // needed for solving a Laplace
@@ -3541,9 +3541,9 @@ void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
 
   // set up the boundary values for
   // the laplace problem
-  std::vector<std::map<unsigned int,double> > m(dim);
-  typename std::map<unsigned int,Point<dim> >::const_iterator map_iter;
-  typename std::map<unsigned int,Point<dim> >::const_iterator map_end=new_points.end();
+  std::vector<std::map<size_type,double> > m(dim);
+  typename std::map<size_type,Point<dim> >::const_iterator map_iter;
+  typename std::map<size_type,Point<dim> >::const_iterator map_end=new_points.end();
 
   // fill these maps using the data
   // given by new_points
@@ -3560,12 +3560,12 @@ void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
               for (unsigned int vertex_no=0;
                    vertex_no<GeometryInfo<dim>::vertices_per_face; ++vertex_no)
                 {
-                  const unsigned int vertex_index=face->vertex_index(vertex_no);
+                  const size_type vertex_index=face->vertex_index(vertex_no);
                   map_iter=new_points.find(vertex_index);
 
                   if (map_iter!=map_end)
                     for (unsigned int i=0; i<dim; ++i)
-                      m[i].insert(std::pair<unsigned int,double> (
+                      m[i].insert(std::pair<size_type,double> (
                                     face->vertex_dof_index(vertex_no, 0), map_iter->second(i)));
                 }
           }
@@ -3588,11 +3588,11 @@ void GridGenerator::laplace_transformation (Triangulation<dim> &tria,
   // points of the triangulation
   // according to the computed values
   for (cell=dof_handler.begin_active(); cell!=endc; ++cell)
-    for (unsigned int vertex_no=0;
+    for (size_type vertex_no=0;
          vertex_no<GeometryInfo<dim>::vertices_per_cell; ++vertex_no)
       {
         Point<dim> &v=cell->vertex(vertex_no);
-        const unsigned int dof_index=cell->vertex_dof_index(vertex_no, 0);
+        const size_type dof_index=cell->vertex_dof_index(vertex_no, 0);
         for (unsigned int i=0; i<dim; ++i)
           v(i)=us[i](dof_index);
       }
@@ -3605,7 +3605,7 @@ void GridGenerator::hyper_cube_with_cylindrical_hole (Triangulation<1> &,
                                                       const double,
                                                       const double,
                                                       const double,
-                                                      const unsigned int,
+                                                      const size_type,
                                                       bool)
 {
   Assert(false, ExcNotImplemented());
@@ -3619,7 +3619,7 @@ GridGenerator::hyper_cube_with_cylindrical_hole (Triangulation<2> &triangulation
                                                  const double inner_radius,
                                                  const double outer_radius,
                                                  const double, // width,
-                                                 const unsigned int, // width_repetition,
+                                                 const size_type, // width_repetition,
                                                  bool colorize)
 {
   const int dim = 2;
@@ -3643,7 +3643,7 @@ GridGenerator::hyper_cube_with_cylindrical_hole (Triangulation<2> &triangulation
           {
             for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
               {
-                unsigned int vv = cell->face(f)->vertex_index(v);
+                size_type vv = cell->face(f)->vertex_index(v);
                 if (treated_vertices[vv] == false)
                   {
                     treated_vertices[vv] = true;
@@ -3706,7 +3706,7 @@ void GridGenerator::hyper_cube_with_cylindrical_hole(Triangulation<3> &triangula
                                                      const double inner_radius,
                                                      const double outer_radius,
                                                      const double L,
-                                                     const unsigned int Nz,
+                                                     const size_type Nz,
                                                      bool colorize)
 {
   const int dim = 3;
@@ -3733,11 +3733,11 @@ void GridGenerator::hyper_cube_with_cylindrical_hole(Triangulation<3> &triangula
           {
             for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
               {
-                unsigned int vv = cell->face(f)->vertex_index(v);
+                size_type vv = cell->face(f)->vertex_index(v);
                 if (treated_vertices[vv] == false)
                   {
                     treated_vertices[vv] = true;
-                    for (unsigned int i=0; i<=Nz; ++i)
+                    for (size_type i=0; i<=Nz; ++i)
                       {
                         double d = ((double) i)*L/((double) Nz);
                         switch (vv-i*16)
index fc3996e06e27679c8e8e451370a3d758d6d13fe4..2f6637ae380a312fcc90296b8dea32015e33a3e7 100644 (file)
@@ -95,7 +95,7 @@ namespace SLEPcWrappers
   }
 
   void
-  SolverBase::solve (const unsigned int n_eigenvectors, unsigned int *n_converged)
+  SolverBase::solve (const size_type n_eigenvectors, size_type *n_converged)
   {
     int ierr;
 
@@ -204,7 +204,7 @@ namespace SLEPcWrappers
   }
 
   void
-  SolverBase::get_eigenpair (const unsigned int         index,
+  SolverBase::get_eigenpair (const size_type            index,
 #ifndef PETSC_USE_COMPLEX
                              double                    &kr,
 #else
index 8585f4cba45183b508fc87e03546e597b0d9cf20..c585b15296b15c9ddcdd29ff2c53ea99a8a8a77c 100644 (file)
@@ -49,16 +49,18 @@ namespace HSL
 {
   namespace MA27
   {
+    typedef types::global_dof_index size_type;
+
     extern "C"
-    void ma27ad_ (const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  unsigned int *,
-                  const unsigned int *,
-                  unsigned int *,
-                  unsigned int *,
-                  unsigned int *,
+    void ma27ad_ (const size_type *,
+                  const size_type *,
+                  const size_type *,
+                  const size_type *,
+                  size_type *,
+                  const size_type *,
+                  size_type *,
+                  size_type *,
+                  size_type *,
                   int *)
     {
       AssertThrow (false,
@@ -69,18 +71,18 @@ namespace HSL
 
 
     extern "C"
-    void ma27bd_ (const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
+    void ma27bd_ (const size_type *,
+                  const size_type *,
+                  const size_type *,
+                  const size_type *,
                   double *,
-                  const unsigned int *,
-                  unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  unsigned int *,
-                  unsigned int *,
+                  const size_type *,
+                  size_type *,
+                  const size_type *,
+                  const size_type *,
+                  const size_type *,
+                  size_type *,
+                  size_type *,
                   int *)
     {
       AssertThrow (false,
@@ -91,16 +93,16 @@ namespace HSL
 
 
     extern "C"
-    void ma27cd_ (const unsigned int *,
+    void ma27cd_ (const size_type *,
                   const double *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
+                  const size_type *,
+                  const size_type *,
+                  const size_type *,
                   double *,
-                  const unsigned int *,
+                  const size_type *,
                   double *,
-                  const unsigned int *,
-                  const unsigned int *)
+                  const size_type *,
+                  const size_type *)
     {
       AssertThrow (false,
                    ExcMessage("You can only use the HSL functions after putting "
@@ -109,7 +111,7 @@ namespace HSL
     }
 
 
-    extern "C" void ma27x1_ (unsigned int *)
+    extern "C" void ma27x1_ (size_type *)
     {
       AssertThrow (false,
                    ExcMessage("You can only use the HSL functions after putting "
@@ -118,7 +120,7 @@ namespace HSL
     }
 
 
-    extern "C" void ma27x2_ (unsigned int *)
+    extern "C" void ma27x2_ (size_type *)
     {
       AssertThrow (false,
                    ExcMessage("You can only use the HSL functions after putting "
@@ -127,7 +129,7 @@ namespace HSL
     }
 
 
-    extern "C" void ma27x3_ (const unsigned int *)
+    extern "C" void ma27x3_ (const size_type *)
     {
       AssertThrow (false,
                    ExcMessage("You can only use the HSL functions after putting "
@@ -144,9 +146,11 @@ namespace HSL
 {
   namespace MA47
   {
+    typedef types::global_dof_index size_type;
+
     extern "C"
     void ma47id_ (double *,
-                  unsigned int *)
+                  size_type *)
     {
       AssertThrow (false,
                    ExcMessage("You can only use the HSL functions after putting "
@@ -156,14 +160,14 @@ namespace HSL
 
 
     extern "C"
-    void ma47ad_ (const unsigned int *,
-                  const unsigned int *,
-                  unsigned int *,
-                  unsigned int *,
-                  unsigned int *,
-                  const unsigned int *,
-                  unsigned int *,
-                  const unsigned int *,
+    void ma47ad_ (const size_type *,
+                  const size_type *,
+                  size_type *,
+                  size_type *,
+                  size_type *,
+                  const size_type *,
+                  size_type *,
+                  const size_type *,
                   double *,
                   int *)
     {
@@ -175,17 +179,17 @@ namespace HSL
 
 
     extern "C"
-    void ma47bd_ (const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
+    void ma47bd_ (const size_type *,
+                  const size_type *,
+                  const size_type *,
                   double *,
-                  const unsigned int *,
-                  unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
+                  const size_type *,
+                  size_type *,
+                  const size_type *,
+                  const size_type *,
                   const double *,
-                  const unsigned int *,
-                  unsigned int *,
+                  const size_type *,
+                  size_type *,
                   double *,
                   int *)
     {
@@ -197,15 +201,15 @@ namespace HSL
 
 
     extern "C"
-    void ma47cd_ (const unsigned int *,
+    void ma47cd_ (const size_type *,
                   const double *,
-                  const unsigned int *,
-                  const unsigned int *,
-                  const unsigned int *,
+                  const size_type *,
+                  const size_type *,
+                  const size_type *,
                   double *,
                   double *,
-                  unsigned int *,
-                  const unsigned int *)
+                  size_type *,
+                  const size_type *)
     {
       AssertThrow (false,
                    ExcMessage("You can only use the HSL functions after putting "
@@ -293,7 +297,7 @@ struct SparseDirectMA27::DetachedModeData
             const std::size_t N,
             const char * /*debug_info*/) const
   {
-    unsigned int count = 0;
+    size_type count = 0;
     while (count < sizeof(T)*N)
       {
         // repeat writing until
@@ -332,7 +336,7 @@ struct SparseDirectMA27::DetachedModeData
             const std::size_t N,
             const char * /*debug_info*/) const
   {
-    unsigned int count = 0;
+    size_type count = 0;
     while (count < sizeof(T)*N)
       {
         int ret = -1;
@@ -532,19 +536,19 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
   // requested
   if (suppress_output)
     {
-      const unsigned int LP = 0;
+      const size_type LP = 0;
       call_ma27x3 (&LP);
     };
 
   sparsity_pattern = &sp;
 
-  const unsigned int
+  const size_type 
   n_rows           = sparsity_pattern->n_rows();
 
   // first count number of nonzero elements in the upper right part. the
   // matrix is symmetric, so this suffices
   n_nonzero_elements = 0;
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     for (SparsityPattern::iterator col = sparsity_pattern->begin(row);
          col < sparsity_pattern->end(row); ++col)
       if (row <= col->column())
@@ -557,8 +561,8 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
   row_numbers.resize (n_nonzero_elements);
   column_numbers.resize (n_nonzero_elements);
 
-  unsigned int global_index = 0;
-  for (unsigned int row=0; row<n_rows; ++row)
+  size_type global_index = 0;
+  for (size_type row=0; row<n_rows; ++row)
     for (SparsityPattern::iterator col = sparsity_pattern->begin(row);
          col < sparsity_pattern->end(row); ++col)
       // note that the matrix must be
@@ -576,7 +580,7 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
 
   // initialize scratch arrays and
   // variables
-  LIW = static_cast<unsigned int>((2*n_nonzero_elements + 3*n_rows + 1) *
+  LIW = static_cast<size_type>((2*n_nonzero_elements + 3*n_rows + 1) *
                                   LIW_factor_1);
   IW.resize    (detached_mode_set() ? 0 : LIW);
   IKEEP.resize (detached_mode_set() ? 0 : 3*n_rows);
@@ -604,7 +608,7 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
         break;
 
       // otherwise: increase LIW and retry
-      LIW = static_cast<unsigned int>(LIW * LIW_increase_factor_1);
+      LIW = static_cast<size_type>(LIW * LIW_increase_factor_1);
       IW.resize (LIW);
     }
   while (true);
@@ -652,11 +656,11 @@ SparseDirectMA27::factorize (const SparseMatrix<number> &matrix)
   // if necessary extend IW
   if (LIW < NIRNEC * LIW_factor_2)
     {
-      LIW = static_cast<unsigned int>(NIRNEC * LIW_factor_2);
+      LIW = static_cast<size_type>(NIRNEC * LIW_factor_2);
       IW.resize (LIW);
     };
 
-  const unsigned int n_rows = matrix.get_sparsity_pattern().n_rows();
+  const size_type n_rows = matrix.get_sparsity_pattern().n_rows();
 
   // loop until memory requirements
   // are satisfied or we are not
@@ -678,7 +682,7 @@ SparseDirectMA27::factorize (const SparseMatrix<number> &matrix)
       // more used
       if (call_succeeded)
         {
-          std::vector<unsigned int> tmp1, tmp2, tmp3;
+          std::vector<size_type> tmp1, tmp2, tmp3;
           row_numbers.swap (tmp1);
           column_numbers.swap (tmp2);
           IKEEP.swap (tmp3);
@@ -697,7 +701,7 @@ SparseDirectMA27::factorize (const SparseMatrix<number> &matrix)
           if (LIW_increase_factor_2 <= 1)
             goto exit_loop;
 
-          LIW = static_cast<unsigned int>(LIW * LIW_increase_factor_2);
+          LIW = static_cast<size_type>(LIW * LIW_increase_factor_2);
           IW.resize (LIW);
           break;
         };
@@ -739,7 +743,7 @@ SparseDirectMA27::factorize (const SparseMatrix<number> &matrix)
           // allocation.
           std::cout << "<*>" << std::flush;
 
-          LA  = static_cast<unsigned int>(LA * LA_increase_factor);
+          LA  = static_cast<size_type>(LA * LA_increase_factor);
           if (true)
             {
               std::vector<double> tmp;
@@ -783,7 +787,7 @@ SparseDirectMA27::solve (Vector<double> &rhs_and_solution) const
 {
   Assert (factorize_called == true, ExcFactorizeNotCalled());
 
-  const unsigned int n_rows = rhs_and_solution.size();
+  const size_type n_rows = rhs_and_solution.size();
   call_ma27cd (&n_rows, &A[0], &LA,
                &IW[0], &LIW, &MAXFRT,
                &rhs_and_solution(0), &IW1[0], &NSTEPS);
@@ -802,7 +806,7 @@ SparseDirectMA27::solve (Vector<float> &rhs_and_solution) const
   Vector<double> tmp (rhs_and_solution.size());
   tmp = rhs_and_solution;
 
-  const unsigned int n_rows = rhs_and_solution.size();
+  const size_type n_rows = rhs_and_solution.size();
   call_ma27cd (&n_rows, &A[0], &LA,
                &IW[0], &LIW, &MAXFRT,
                &tmp(0), &IW1[0], &NSTEPS);
@@ -858,10 +862,10 @@ SparseDirectMA27::fill_A (const SparseMatrix<number> &matrix)
 
   const SparsityPattern &sparsity_pattern = matrix.get_sparsity_pattern ();
 
-  const unsigned int n_rows = sparsity_pattern.n_rows();
+  const size_type n_rows = sparsity_pattern.n_rows();
 
-  unsigned int global_index = 0;
-  for (unsigned int row=0; row<n_rows; ++row)
+  size_type global_index = 0;
+  for (size_type row=0; row<n_rows; ++row)
     for (typename SparseMatrix<number>::const_iterator col=matrix.begin(row);
          col < matrix.end(row); ++col)
       // note that the matrix must be
@@ -898,16 +902,16 @@ SparseDirectMA27::fill_A (const SparseMatrix<number> &matrix)
 
 
 
-void SparseDirectMA27::call_ma27ad (const unsigned int *N,
-                                    const unsigned int *NZ,
-                                    const unsigned int *IRN,
-                                    const unsigned int *ICN,
-                                    unsigned int       *IW,
-                                    const unsigned int *LIW,
-                                    unsigned int       *IKEEP,
-                                    unsigned int       *IW1,
-                                    unsigned int       *NSTEPS,
-                                    int                *IFLAG)
+void SparseDirectMA27::call_ma27ad (const size_type *N,
+                                    const size_type *NZ,
+                                    const size_type *IRN,
+                                    const size_type *ICN,
+                                    size_type       *IW,
+                                    const size_type *LIW,
+                                    size_type       *IKEEP,
+                                    size_type       *IW1,
+                                    size_type       *NSTEPS,
+                                    int             *IFLAG)
 {
   if (detached_mode_set() == false)
     HSL::MA27::ma27ad_ (N, NZ, IRN, ICN, IW, LIW,
@@ -942,19 +946,19 @@ void SparseDirectMA27::call_ma27ad (const unsigned int *N,
 
 
 
-void SparseDirectMA27::call_ma27bd (const unsigned int *N,
-                                    const unsigned int *NZ,
-                                    const unsigned int *IRN,
-                                    const unsigned int *ICN,
-                                    double             *A,
-                                    const unsigned int *LA,
-                                    unsigned int       *IW,
-                                    const unsigned int *LIW,
-                                    const unsigned int *IKEEP,
-                                    const unsigned int *NSTEPS,
-                                    unsigned int       *MAXFRT,
-                                    unsigned int       *IW1,
-                                    int                *IFLAG)
+void SparseDirectMA27::call_ma27bd (const size_type *N,
+                                    const size_type *NZ,
+                                    const size_type *IRN,
+                                    const size_type *ICN,
+                                    double          *A,
+                                    const size_type *LA,
+                                    size_type       *IW,
+                                    const size_type *LIW,
+                                    const size_type *IKEEP,
+                                    const size_type *NSTEPS,
+                                    size_type       *MAXFRT,
+                                    size_type       *IW1,
+                                    int             *IFLAG)
 {
   if (detached_mode_set() == false)
     HSL::MA27::ma27bd_ (N, NZ, IRN, ICN, A, LA, IW, LIW,
@@ -978,15 +982,15 @@ void SparseDirectMA27::call_ma27bd (const unsigned int *N,
 
 
 
-void SparseDirectMA27::call_ma27cd (const unsigned int *N,
-                                    const double       *A,
-                                    const unsigned int *LA,
-                                    const unsigned int *IW,
-                                    const unsigned int *LIW,
-                                    const unsigned int *MAXFRT,
-                                    double             *RHS,
-                                    const unsigned int *IW1,
-                                    const unsigned int *NSTEPS) const
+void SparseDirectMA27::call_ma27cd (const size_type *N,
+                                    const double    *A,
+                                    const size_type *LA,
+                                    const size_type *IW,
+                                    const size_type *LIW,
+                                    const size_type *MAXFRT,
+                                    double          *RHS,
+                                    const size_type *IW1,
+                                    const size_type *NSTEPS) const
 {
   if (detached_mode_set() == false)
     {
@@ -1006,7 +1010,7 @@ void SparseDirectMA27::call_ma27cd (const unsigned int *N,
 
 
 
-void SparseDirectMA27::call_ma27x1 (unsigned int *NRLNEC)
+void SparseDirectMA27::call_ma27x1 (size_type *NRLNEC)
 {
   if (detached_mode_set() == false)
     HSL::MA27::ma27x1_ (NRLNEC);
@@ -1023,7 +1027,7 @@ void SparseDirectMA27::call_ma27x1 (unsigned int *NRLNEC)
 
 
 
-void SparseDirectMA27::call_ma27x2 (unsigned int *NIRNEC)
+void SparseDirectMA27::call_ma27x2 (size_type *NIRNEC)
 {
   if (detached_mode_set() == false)
     HSL::MA27::ma27x2_ (NIRNEC);
@@ -1040,7 +1044,7 @@ void SparseDirectMA27::call_ma27x2 (unsigned int *NIRNEC)
 
 
 
-void SparseDirectMA27::call_ma27x3 (const unsigned int *LP)
+void SparseDirectMA27::call_ma27x3 (const size_type *LP)
 {
   if (detached_mode_set() == false)
     HSL::MA27::ma27x3_ (LP);
@@ -1101,7 +1105,7 @@ SparseDirectMA47::initialize (const SparseMatrix<double> &m)
   matrix = &m;
   const SparsityPattern &sparsity_pattern = matrix->get_sparsity_pattern();
 
-  const unsigned int
+  const size_type 
   n_rows           = sparsity_pattern.n_rows();
 
   // first count number of nonzero
@@ -1109,7 +1113,7 @@ SparseDirectMA47::initialize (const SparseMatrix<double> &m)
   // part. the matrix is symmetric,
   // so this suffices
   n_nonzero_elements = 0;
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     for (SparseMatrix<double>::const_iterator col = m.begin(row);
          col < m.end(row); ++col)
       // skip zero elements, as required by the docs of MA47
@@ -1126,8 +1130,8 @@ SparseDirectMA47::initialize (const SparseMatrix<double> &m)
   row_numbers.resize (n_nonzero_elements);
   column_numbers.resize (n_nonzero_elements);
 
-  unsigned int global_index = 0;
-  for (unsigned int row=0; row<n_rows; ++row)
+  size_type global_index = 0;
+  for (size_type row=0; row<n_rows; ++row)
     for (SparseMatrix<double>::const_iterator col = m.begin(row);
          col < m.end(row); ++col)
       // note that the matrix must be
@@ -1145,7 +1149,7 @@ SparseDirectMA47::initialize (const SparseMatrix<double> &m)
 
   // initialize scratch arrays and
   // variables
-  LIW = static_cast<unsigned int>((2*n_nonzero_elements + 5*n_rows + 4) *
+  LIW = static_cast<size_type>((2*n_nonzero_elements + 5*n_rows + 4) *
                                   LIW_factor_1);
   IW.resize (LIW);
   KEEP.resize (n_nonzero_elements + 5*n_rows + 2);
@@ -1166,7 +1170,7 @@ SparseDirectMA47::initialize (const SparseMatrix<double> &m)
         break;
 
       // otherwise: increase LIW and retry
-      LIW = static_cast<unsigned int>(LIW * LIW_increase_factor_1);
+      LIW = static_cast<size_type>(LIW * LIW_increase_factor_1);
       IW.resize (LIW);
     }
   while (true);
@@ -1205,11 +1209,11 @@ SparseDirectMA47::factorize (const SparseMatrix<double> &m)
   // if necessary extend IW
   if (LIW < INFO[6] * LIW_factor_2)
     {
-      LIW = static_cast<unsigned int>(INFO[6] * LIW_factor_2);
+      LIW = static_cast<size_type>(INFO[6] * LIW_factor_2);
       IW.resize (LIW);
     };
 
-  const unsigned int n_rows = m.get_sparsity_pattern().n_rows();
+  const size_type n_rows = m.get_sparsity_pattern().n_rows();
   IW1.resize (2*n_rows+2);
 
   // output info flags
@@ -1237,7 +1241,7 @@ SparseDirectMA47::factorize (const SparseMatrix<double> &m)
           if (LIW_increase_factor_2 <= 1)
             goto exit_loop;
 
-          LIW = static_cast<unsigned int>(LIW * LIW_increase_factor_2);
+          LIW = static_cast<size_type>(LIW * LIW_increase_factor_2);
           IW.resize (LIW);
           break;
         };
@@ -1279,7 +1283,7 @@ SparseDirectMA47::factorize (const SparseMatrix<double> &m)
           // allocation.
           std::cout << "<*>" << std::flush;
 
-          LA  = static_cast<unsigned int>(LA * LA_increase_factor);
+          LA  = static_cast<size_type>(LA * LA_increase_factor);
           if (true)
             {
               std::vector<double> tmp;
@@ -1319,7 +1323,7 @@ SparseDirectMA47::solve (Vector<double> &rhs_and_solution)
 {
   Assert (factorize_called == true, ExcFactorizeNotCalled());
 
-  const unsigned int n_rows = rhs_and_solution.size();
+  const size_type n_rows = rhs_and_solution.size();
   call_ma47cd (&n_rows, &A[0], &LA,
                &IW[0], &LIW,
                &rhs_and_solution(0), &IW1[0], &ICNTL[0]);
@@ -1367,10 +1371,10 @@ SparseDirectMA47::fill_A (const SparseMatrix<double> &matrix)
 
   const SparsityPattern &sparsity_pattern = matrix.get_sparsity_pattern ();
 
-  const unsigned int n_rows = sparsity_pattern.n_rows();
+  const size_type n_rows = sparsity_pattern.n_rows();
 
-  unsigned int global_index = 0;
-  for (unsigned int row=0; row<n_rows; ++row)
+  size_type global_index = 0;
+  for (size_type row=0; row<n_rows; ++row)
     for (SparseMatrix<double>::const_iterator col=matrix.begin(row);
          col < matrix.end(row); ++col)
       // note that the matrix must be
@@ -1415,13 +1419,13 @@ SparseDirectMA47::call_ma47id (double       *CNTL,   // length 2
 
 void
 SparseDirectMA47::
-call_ma47ad (const unsigned int *n_rows,             //scalar
-             const unsigned int *n_nonzero_elements, //scalar
-             unsigned int       *row_numbers,        //length n_nonzero
-             unsigned int       *column_numbers,     //length n_nonzero
-             unsigned int       *IW,                 //length LIW
-             const unsigned int *LIW,                //scalar
-             unsigned int       *KEEP,               //n_nonzero+5*n_rows+2
+call_ma47ad (const size_type    *n_rows,             //scalar
+             const size_type    *n_nonzero_elements, //scalar
+             size_type          *row_numbers,        //length n_nonzero
+             size_type          *column_numbers,     //length n_nonzero
+             size_type          *IW,                 //length LIW
+             const size_type    *LIW,                //scalar
+             size_type          *KEEP,               //n_nonzero+5*n_rows+2
              const unsigned int *ICNTL,              //length 7
              int                *INFO)               //length 24
 {
@@ -1436,17 +1440,17 @@ call_ma47ad (const unsigned int *n_rows,             //scalar
 
 void
 SparseDirectMA47::
-call_ma47bd (const unsigned int *n_rows,             //scalar
-             const unsigned int *n_nonzero_elements, //scalar
-             const unsigned int *column_numbers,     //length n_nonzero
+call_ma47bd (const size_type    *n_rows,             //scalar
+             const size_type    *n_nonzero_elements, //scalar
+             const size_type    *column_numbers,     //length n_nonzero
              double             *A,                  //length LA
-             const unsigned int *LA,                 //scalar
-             unsigned int       *IW,                 //length LIW
-             const unsigned int *LIW,                //scalar
-             const unsigned int *KEEP,               //n_nonzero+5*n_rows+2
+             const size_type    *LA,                 //scalar
+             size_type          *IW,                 //length LIW
+             const size_type    *LIW,                //scalar
+             const size_type    *KEEP,               //n_nonzero+5*n_rows+2
              const double       *CNTL,               //length 2
              const unsigned int *ICNTL,              //length 7
-             unsigned int       *IW1,                //2*n_rows+2
+             size_type          *IW1,                //2*n_rows+2
              int                *INFO)               //length 24
 {
   double RINFO[4];
@@ -1460,13 +1464,13 @@ call_ma47bd (const unsigned int *n_rows,             //scalar
 
 void
 SparseDirectMA47::
-call_ma47cd (const unsigned int *n_rows,           //scalar
+call_ma47cd (const size_type    *n_rows,           //scalar
              const double       *A,                //length LA
-             const unsigned int *LA,               //scalar
-             const unsigned int *IW,               //length LIW
-             const unsigned int *LIW,              //scalar
+             const size_type    *LA,               //scalar
+             const size_type    *IW,               //length LIW
+             const size_type    *LIW,              //scalar
              double             *rhs_and_solution, //length n_rows
-             unsigned int       *IW1,              //length 2*n_rows+2
+             size_type          *IW1,              //length 2*n_rows+2
              const unsigned int *ICNTL)            //length 7
 {
   std::vector<double> W(*n_rows);
@@ -1555,7 +1559,7 @@ sort_arrays (const SparseMatrix<number> &matrix)
   // second entry in a row
   //
   // ignore rows with only one or no entry
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
       // we may have to move some elements
       // that are left of the diagonal but
@@ -1595,7 +1599,7 @@ SparseDirectUMFPACK::
 sort_arrays (const SparseMatrixEZ<number> &matrix)
 {
   //same thing for SparseMatrixEZ
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
       long int cursor = Ap[row];
       while ((cursor < Ap[row+1]-1) &&
@@ -1626,10 +1630,10 @@ sort_arrays (const BlockSparseMatrix<number> &matrix)
   // columns. we can do the same
   // thing as above, but we have to
   // do it multiple times
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  for (size_type row=0; row<matrix.m(); ++row)
     {
       long int cursor = Ap[row];
-      for (unsigned int block=0; block<matrix.n_block_cols(); ++block)
+      for (size_type block=0; block<matrix.n_block_cols(); ++block)
         {
 
           // find the next
@@ -1669,7 +1673,7 @@ factorize (const Matrix &matrix)
 
   clear ();
 
-  const unsigned int N = matrix.m();
+  const size_type N = matrix.m();
 
   // copy over the data from the matrix to
   // the data structures UMFPACK wants. note
@@ -1706,9 +1710,9 @@ factorize (const Matrix &matrix)
 
   // first fill row lengths array
   Ap[0] = 0;
-  for (unsigned int row=1; row<=N; ++row)
+  for (size_type row=1; row<=N; ++row)
     Ap[row] = Ap[row-1] + matrix.get_row_length(row-1);
-  Assert (static_cast<unsigned int>(Ap.back()) == Ai.size(),
+  Assert (static_cast<size_type>(Ap.back()) == Ai.size(),
           ExcInternalError());
 
   // then copy over matrix
@@ -1728,7 +1732,7 @@ factorize (const Matrix &matrix)
 
     // loop over the elements of the matrix row by row, as suggested
     // in the documentation of the sparse matrix iterator class
-    for (unsigned int row = 0; row < matrix.m(); ++row)
+    for (size_type row = 0; row < matrix.m(); ++row)
       {
         for (typename Matrix::const_iterator p=matrix.begin(row);
             p!=matrix.end(row); ++p)
@@ -1745,7 +1749,7 @@ factorize (const Matrix &matrix)
 
     // at the end, we should have
     // written all rows completely
-    for (unsigned int i=0; i<Ap.size()-1; ++i)
+    for (size_type i=0; i<Ap.size()-1; ++i)
       Assert (row_pointers[i] == Ap[i+1], ExcInternalError());
   }
 
@@ -1958,11 +1962,11 @@ void SparseDirectMUMPS::initialize_matrix (const Matrix &matrix)
       irn = new int[nz];
       jcn = new int[nz];
 
-      unsigned int index = 0;
+      size_type index = 0;
 
       // loop over the elements of the matrix row by row, as suggested
       // in the documentation of the sparse matrix iterator class
-      for (unsigned int row = 0; row < matrix.m(); ++row)
+      for (size_type row = 0; row < matrix.m(); ++row)
         {
           for (typename Matrix::const_iterator ptr = matrix.begin (row);
               ptr != matrix.end (row); ++ptr)
@@ -2004,7 +2008,7 @@ void SparseDirectMUMPS::initialize (const Matrix &matrix,
       // Object denoting a MUMPS data structure
       rhs = new double[n];
 
-      for (unsigned int i = 0; i < n; ++i)
+      for (size_type i = 0; i < n; ++i)
         rhs[i] = vector (i);
 
       id.rhs = rhs;
@@ -2016,7 +2020,7 @@ void SparseDirectMUMPS::copy_solution (Vector<double> &vector)
   // Copy solution into the given vector
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
-      for (unsigned int i=0; i<n; ++i)
+      for (size_type i=0; i<n; ++i)
         vector(i) = rhs[i];
 
       delete[] rhs;
@@ -2066,7 +2070,7 @@ void SparseDirectMUMPS::vmult (Vector<double>       &dst,
       // Object denoting a MUMPS data structure:
       rhs = new double[n];
 
-      for (unsigned int i = 0; i < n; ++i)
+      for (size_type i = 0; i < n; ++i)
         rhs[i] = src (i);
 
       id.rhs = rhs;
index 5fa9044356189860a66d367043ca2cbbaed87fa5..26fbeb23eac6ba555df404d7fba38a35847b5944 100644 (file)
@@ -32,7 +32,7 @@ DEAL_II_NAMESPACE_OPEN
 #ifdef DEAL_II_MSVC
 __declspec(selectany) // Weak extern binding due to multiple link error
 #endif
-const unsigned int SparsityPattern::invalid_entry;
+const SparsityPattern::size_type SparsityPattern::invalid_entry;
 
 
 
@@ -70,9 +70,9 @@ SparsityPattern::SparsityPattern (const SparsityPattern &s)
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
-                                  const unsigned int max_per_row,
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
+                                  const size_type max_per_row,
                                   const bool)
   :
   max_dim(0),
@@ -87,9 +87,9 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
-                                  const unsigned int max_per_row)
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
+                                  const size_type max_per_row)
   :
   max_dim(0),
   max_vec_len(0),
@@ -103,9 +103,9 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
-                                  const std::vector<unsigned int> &row_lengths,
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
+                                  const std::vector<size_type> &row_lengths,
                                   const bool)
   :
   max_dim(0),
@@ -118,9 +118,9 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 }
 
 
-SparsityPattern::SparsityPattern (const unsigned int m,
-                                  const unsigned int n,
-                                  const std::vector<unsigned int> &row_lengths)
+SparsityPattern::SparsityPattern (const size_type m,
+                                  const size_type n,
+                                  const std::vector<size_type> &row_lengths)
   :
   max_dim(0),
   max_vec_len(0),
@@ -133,8 +133,8 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int n,
-                                  const unsigned int max_per_row)
+SparsityPattern::SparsityPattern (const size_type n,
+                                  const size_type max_per_row)
   :
   max_dim(0),
   max_vec_len(0),
@@ -146,8 +146,8 @@ SparsityPattern::SparsityPattern (const unsigned int n,
 
 
 
-SparsityPattern::SparsityPattern (const unsigned int               m,
-                                  const std::vector<unsigned int> &row_lengths,
+SparsityPattern::SparsityPattern (const size_type               m,
+                                  const std::vector<size_type> &row_lengths,
                                   const bool)
   :
   max_dim(0),
@@ -159,8 +159,8 @@ SparsityPattern::SparsityPattern (const unsigned int               m,
 }
 
 
-SparsityPattern::SparsityPattern (const unsigned int               m,
-                                  const std::vector<unsigned int> &row_lengths)
+SparsityPattern::SparsityPattern (const size_type               m,
+                                  const std::vector<size_type> &row_lengths)
   :
   max_dim(0),
   max_vec_len(0),
@@ -173,8 +173,8 @@ SparsityPattern::SparsityPattern (const unsigned int               m,
 
 
 SparsityPattern::SparsityPattern (const SparsityPattern &original,
-                                  const unsigned int     max_per_row,
-                                  const unsigned int     extra_off_diagonals)
+                                  const size_type        max_per_row,
+                                  const size_type        extra_off_diagonals)
   :
   max_dim(0),
   max_vec_len(0),
@@ -188,7 +188,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
 
   // now copy the entries from
   // the other object
-  for (unsigned int row=0; row<original.rows; ++row)
+  for (size_type row=0; row<original.rows; ++row)
     {
       // copy the elements of this row
       // of the other object
@@ -207,12 +207,12 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
       // the rest from that element onwards
       // which is not a side-diagonal any
       // more.
-      const unsigned int *const
+      const size_type *const
       original_row_start = &original.colnums[original.rowstart[row]] + 1;
       // the following requires that
       // @p{original} be compressed since
       // otherwise there might be invalid_entry's
-      const unsigned int *const
+      const size_type *const
       original_row_end   = &original.colnums[original.rowstart[row+1]];
 
       // find pointers before and
@@ -222,7 +222,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
       // these pointers such that no
       // copying is necessary (see
       // the @p{copy} commands)
-      const unsigned int *const
+      const size_type *const
       original_last_before_side_diagonals
         = (row > extra_off_diagonals ?
            Utilities::lower_bound (original_row_start,
@@ -230,7 +230,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
                                    row-extra_off_diagonals) :
            original_row_start);
 
-      const unsigned int *const
+      const size_type *const
       original_first_after_side_diagonals
         = (row < rows-extra_off_diagonals-1 ?
            std::upper_bound (original_row_start,
@@ -241,7 +241,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
       // find first free slot. the
       // first slot in each row is
       // the diagonal element
-      unsigned int *next_free_slot = &colnums[rowstart[row]] + 1;
+      size_type *next_free_slot = &colnums[rowstart[row]] + 1;
 
       // copy elements before side-diagonals
       next_free_slot = std::copy (original_row_start,
@@ -249,10 +249,10 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
                                   next_free_slot);
 
       // insert left and right side-diagonals
-      for (unsigned int i=1; i<=std::min(row,extra_off_diagonals);
+      for (size_type i=1; i<=std::min(row,extra_off_diagonals);
            ++i, ++next_free_slot)
         *next_free_slot = row-i;
-      for (unsigned int i=1; i<=std::min(extra_off_diagonals, rows-row-1);
+      for (size_type i=1; i<=std::min(extra_off_diagonals, rows-row-1);
            ++i, ++next_free_slot)
         *next_free_slot = row+i;
 
@@ -301,36 +301,36 @@ SparsityPattern::operator = (const SparsityPattern &s)
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
-                         const unsigned int max_per_row,
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
+                         const size_type max_per_row,
                          const bool)
 {
   // simply map this function to the
   // other @p{reinit} function
-  const std::vector<unsigned int> row_lengths (m, max_per_row);
+  const std::vector<size_type> row_lengths (m, max_per_row);
   reinit (m, n, row_lengths);
 }
 
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
-                         const unsigned int max_per_row)
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
+                         const size_type max_per_row)
 {
   // simply map this function to the
   // other @p{reinit} function
-  const std::vector<unsigned int> row_lengths (m, max_per_row);
+  const std::vector<size_type> row_lengths (m, max_per_row);
   reinit (m, n, row_lengths);
 }
 
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
-                         const VectorSlice<const std::vector<unsigned int> > &row_lengths,
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
+                         const VectorSlice<const std::vector<size_type> > &row_lengths,
                          const bool)
 {
   reinit (m, n, row_lengths);
@@ -339,9 +339,9 @@ SparsityPattern::reinit (const unsigned int m,
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
-                         const VectorSlice<const std::vector<unsigned int> > &row_lengths)
+SparsityPattern::reinit (const size_type m,
+                         const size_type n,
+                         const VectorSlice<const std::vector<size_type> > &row_lengths)
 {
   AssertDimension (row_lengths.size(), m);
 
@@ -382,7 +382,7 @@ SparsityPattern::reinit (const unsigned int m,
   // per row is bounded by the number
   // of columns
   std::size_t vec_len = 0;
-  for (unsigned int i=0; i<m; ++i)
+  for (size_type i=0; i<m; ++i)
     vec_len += std::min((store_diagonal_first_in_row ?
                          std::max(row_lengths[i], 1U) :
                          row_lengths[i]),
@@ -405,7 +405,7 @@ SparsityPattern::reinit (const unsigned int m,
         }
 
       max_vec_len = vec_len;
-      colnums = new unsigned int[max_vec_len];
+      colnums = new size_type[max_vec_len];
     }
 
   max_row_length = (row_lengths.size() == 0 ?
@@ -454,12 +454,12 @@ SparsityPattern::reinit (const unsigned int m,
         }
 
       max_vec_len = vec_len;
-      colnums = new unsigned int[max_vec_len];
+      colnums = new size_type[max_vec_len];
     }
 
   // set the rowstart array
   rowstart[0] = 0;
-  for (unsigned int i=1; i<=rows; ++i)
+  for (size_type i=1; i<=rows; ++i)
     rowstart[i] = rowstart[i-1] +
                   (store_diagonal_first_in_row ?
                    std::max(std::min(row_lengths[i-1],n),1U) :
@@ -478,7 +478,7 @@ SparsityPattern::reinit (const unsigned int m,
   // special: let the first entry in
   // each row be the diagonal value
   if (store_diagonal_first_in_row)
-    for (unsigned int i=0; i<rows; i++)
+    for (size_type i=0; i<rows; i++)
       colnums[rowstart[i]] = i;
 
   compressed = false;
@@ -495,9 +495,9 @@ SparsityPattern::compress ()
   if (compressed)
     return;
 
-  unsigned int next_free_entry = 0,
-               next_row_start  = 0,
-               row_length      = 0;
+  size_type next_free_entry = 0,
+            next_row_start  = 0,
+            row_length      = 0;
 
   // first find out how many non-zero
   // elements there are, in order to
@@ -506,22 +506,22 @@ SparsityPattern::compress ()
   const std::size_t nonzero_elements
     = std::count_if (&colnums[rowstart[0]],
                      &colnums[rowstart[rows]],
-                     std::bind2nd(std::not_equal_to<unsigned int>(), invalid_entry));
+                     std::bind2nd(std::not_equal_to<size_type>(), invalid_entry));
   // now allocate the respective memory
-  unsigned int *new_colnums = new unsigned int[nonzero_elements];
+  size_type *new_colnums = new size_type[nonzero_elements];
 
 
   // reserve temporary storage to
   // store the entries of one row
-  std::vector<unsigned int> tmp_entries (max_row_length);
+  std::vector<size_type> tmp_entries (max_row_length);
 
   // Traverse all rows
-  for (unsigned int line=0; line<rows; ++line)
+  for (size_type line=0; line<rows; ++line)
     {
       // copy used entries, break if
       // first unused entry is reached
       row_length = 0;
-      for (unsigned int j=rowstart[line]; j<rowstart[line+1]; ++j,++row_length)
+      for (size_type j=rowstart[line]; j<rowstart[line+1]; ++j,++row_length)
         if (colnums[j] != invalid_entry)
           tmp_entries[row_length] = colnums[j];
         else
@@ -545,7 +545,7 @@ SparsityPattern::compress ()
 
       // insert column numbers
       // into the new field
-      for (unsigned int j=0; j<row_length; ++j)
+      for (size_type j=0; j<row_length; ++j)
         new_colnums[next_free_entry++] = tmp_entries[j];
 
       // note new start of this and
@@ -637,8 +637,8 @@ SparsityPattern::copy_from (const CSP &csp)
   // diagonal entry is in a certain
   // row or not
   const bool do_diag_optimize = (csp.n_rows() == csp.n_cols());
-  std::vector<unsigned int> row_lengths (csp.n_rows());
-  for (unsigned int i=0; i<csp.n_rows(); ++i)
+  std::vector<size_type> row_lengths (csp.n_rows());
+  for (size_type i=0; i<csp.n_rows(); ++i)
     {
       row_lengths[i] = csp.row_length(i);
       if (do_diag_optimize && !csp.exists(i,i))
@@ -653,15 +653,15 @@ SparsityPattern::copy_from (const CSP &csp)
   // the diagonal element
   // preallocated
   if (n_rows() != 0 && n_cols() != 0)
-    for (unsigned int row = 0; row<csp.n_rows(); ++row)
+    for (size_type row = 0; row<csp.n_rows(); ++row)
       {
-        unsigned int *cols = &colnums[rowstart[row]] + (do_diag_optimize ? 1 : 0);
+        size_type *cols = &colnums[rowstart[row]] + (do_diag_optimize ? 1 : 0);
         typename CSP::row_iterator col_num = csp.row_begin (row),
                                    end_row = csp.row_end (row);
 
         for (; col_num != end_row; ++col_num)
           {
-            const unsigned int col = *col_num;
+            const size_type col = *col_num;
             if ((col!=row) || !do_diag_optimize)
               *cols++ = col;
           }
@@ -693,10 +693,10 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
   // also have to allocate memory for the
   // diagonal entry, unless we have already
   // counted it
-  std::vector<unsigned int> entries_per_row (matrix.m(), 0);
-  for (unsigned int row=0; row<matrix.m(); ++row)
+  std::vector<size_type> entries_per_row (matrix.m(), 0);
+  for (size_type row=0; row<matrix.m(); ++row)
     {
-      for (unsigned int col=0; col<matrix.n(); ++col)
+      for (size_type col=0; col<matrix.n(); ++col)
         if (matrix(row,col) != 0)
           ++entries_per_row[row];
       if ((matrix.m() == matrix.n())
@@ -710,8 +710,8 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
   reinit (matrix.m(), matrix.n(), entries_per_row);
 
   // now set entries
-  for (unsigned int row=0; row<matrix.m(); ++row)
-    for (unsigned int col=0; col<matrix.n(); ++col)
+  for (size_type row=0; row<matrix.m(); ++row)
+    for (size_type col=0; col<matrix.n(); ++col)
       if (matrix(row,col) != 0)
         add (row,col);
 
@@ -721,9 +721,9 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
-                         const std::vector<unsigned int> &row_lengths,
+SparsityPattern::reinit (const size_type               m,
+                         const size_type               n,
+                         const std::vector<size_type> &row_lengths,
                          const bool)
 {
   reinit(m, n, make_slice(row_lengths));
@@ -732,9 +732,9 @@ SparsityPattern::reinit (const unsigned int m,
 
 
 void
-SparsityPattern::reinit (const unsigned int m,
-                         const unsigned int n,
-                         const std::vector<unsigned int> &row_lengths)
+SparsityPattern::reinit (const size_type               m,
+                         const size_type               n,
+                         const std::vector<size_type> &row_lengths)
 {
   reinit(m, n, make_slice(row_lengths));
 }
@@ -769,7 +769,7 @@ SparsityPattern::empty () const
 
 
 
-unsigned int
+SparsityPattern::size_type 
 SparsityPattern::max_entries_per_row () const
 {
   // if compress() has not yet been
@@ -782,18 +782,18 @@ SparsityPattern::max_entries_per_row () const
   // if compress() was called, we
   // use a better algorithm which
   // gives us a sharp bound
-  unsigned int m = 0;
-  for (unsigned int i=1; i<rows; ++i)
-    m = std::max (m, static_cast<unsigned int>(rowstart[i]-rowstart[i-1]));
+  size_type m = 0;
+  for (size_type i=1; i<rows; ++i)
+    m = std::max (m, static_cast<size_type>(rowstart[i]-rowstart[i-1]));
 
   return m;
 }
 
 
 
-unsigned int
-SparsityPattern::operator () (const unsigned int i,
-                              const unsigned int j) const
+SparsityPattern::size_type 
+SparsityPattern::operator () (const size_type i,
+                              const size_type j) const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
@@ -824,11 +824,11 @@ SparsityPattern::operator () (const unsigned int i,
   // top of this function, so it may
   // not be called for noncompressed
   // structures.
-  const unsigned int *sorted_region_start = (store_diagonal_first_in_row ?
-                                             &colnums[rowstart[i]+1] :
-                                             &colnums[rowstart[i]]);
-  const unsigned int *const p
-    = Utilities::lower_bound<const unsigned int *> (sorted_region_start,
+  const size_type *sorted_region_start = (store_diagonal_first_in_row ?
+                                          &colnums[rowstart[i]+1] :
+                                          &colnums[rowstart[i]]);
+  const size_type *const p
+    = Utilities::lower_bound<const size_type *> (sorted_region_start,
                                                     &colnums[rowstart[i+1]],
                                                     j);
   if ((p != &colnums[rowstart[i+1]])  &&  (*p == j))
@@ -840,8 +840,8 @@ SparsityPattern::operator () (const unsigned int i,
 
 
 void
-SparsityPattern::add (const unsigned int i,
-                      const unsigned int j)
+SparsityPattern::add (const size_type i,
+                      const size_type j)
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
@@ -869,10 +869,10 @@ SparsityPattern::add (const unsigned int i,
 
 template <typename ForwardIterator>
 void
-SparsityPattern::add_entries (const unsigned int row,
-                              ForwardIterator    begin,
-                              ForwardIterator    end,
-                              const bool         indices_are_sorted)
+SparsityPattern::add_entries (const size_type row,
+                              ForwardIterator begin,
+                              ForwardIterator end,
+                              const bool      indices_are_sorted)
 {
   if (indices_are_sorted == true)
     {
@@ -913,13 +913,13 @@ SparsityPattern::add_entries (const unsigned int row,
 
 
 bool
-SparsityPattern::exists (const unsigned int i, const unsigned int j) const
+SparsityPattern::exists (const size_type i, const size_type j) const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
   Assert (j<cols, ExcIndexRange(j,0,cols));
 
-  for (unsigned int k=rowstart[i]; k<rowstart[i+1]; k++)
+  for (size_type k=rowstart[i]; k<rowstart[i+1]; k++)
     {
       // entry already exists
       if (colnums[k] == j) return true;
@@ -929,14 +929,14 @@ SparsityPattern::exists (const unsigned int i, const unsigned int j) const
 
 
 
-unsigned int
-SparsityPattern::row_position (const unsigned int i, const unsigned int j) const
+SparsityPattern::size_type 
+SparsityPattern::row_position (const size_type i, const size_type j) const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
   Assert (i<rows, ExcIndexRange(i,0,rows));
   Assert (j<cols, ExcIndexRange(j,0,cols));
 
-  for (unsigned int k=rowstart[i]; k<rowstart[i+1]; k++)
+  for (size_type k=rowstart[i]; k<rowstart[i+1]; k++)
     {
       // entry exists
       if (colnums[k] == j) return k-rowstart[i];
@@ -946,8 +946,8 @@ SparsityPattern::row_position (const unsigned int i, const unsigned int j) const
 
 
 
-std::pair<unsigned int, unsigned int>
-SparsityPattern::matrix_position (const unsigned int global_index) const
+std::pair<SparsityPattern::size_type, SparsityPattern::size_type>
+SparsityPattern::matrix_position (const size_type global_index) const
 {
   Assert (compressed == true, ExcNotCompressed());
   Assert (global_index < n_nonzero_elements(),
@@ -962,14 +962,14 @@ SparsityPattern::matrix_position (const unsigned int global_index) const
   // for the one-past-last row, we
   // can simply use a bisection
   // search on it
-  const unsigned int row
+  const size_type row
     = (std::upper_bound (&rowstart[0], &rowstart[rows], global_index)
        - &rowstart[0] - 1);
 
   // now, the column index is simple
   // since that is what the colnums
   // array stores:
-  const unsigned int col = colnums[global_index];
+  const size_type col = colnums[global_index];
 
   // so return the respective pair
   return std::make_pair (row,col);
@@ -998,8 +998,8 @@ SparsityPattern::symmetrize ()
   // 2. that the @p{add} function can
   // be called on elements that
   // already exist without any harm
-  for (unsigned int row=0; row<rows; ++row)
-    for (unsigned int k=rowstart[row]; k<rowstart[row+1]; k++)
+  for (size_type row=0; row<rows; ++row)
+    for (size_type k=rowstart[row]; k<rowstart[row+1]; k++)
       {
         // check whether we are at
         // the end of the entries of
@@ -1027,10 +1027,10 @@ SparsityPattern::print (std::ostream &out) const
 
   AssertThrow (out, ExcIO());
 
-  for (unsigned int i=0; i<rows; ++i)
+  for (size_type i=0; i<rows; ++i)
     {
       out << '[' << i;
-      for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
+      for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
         if (colnums[j] != invalid_entry)
           out << ',' << colnums[j];
       out << ']' << std::endl;
@@ -1048,8 +1048,8 @@ SparsityPattern::print_gnuplot (std::ostream &out) const
 
   AssertThrow (out, ExcIO());
 
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
       if (colnums[j] != invalid_entry)
         // while matrix entries are
         // usually written (i,j),
@@ -1065,16 +1065,16 @@ SparsityPattern::print_gnuplot (std::ostream &out) const
 
 
 
-unsigned int
+SparsityPattern::size_type 
 SparsityPattern::bandwidth () const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
-  unsigned int b=0;
-  for (unsigned int i=0; i<rows; ++i)
-    for (unsigned int j=rowstart[i]; j<rowstart[i+1]; ++j)
+  size_type b=0;
+  for (size_type i=0; i<rows; ++i)
+    for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
       if (colnums[j] != invalid_entry)
         {
-          if (static_cast<unsigned int>(std::abs(static_cast<int>(i-colnums[j]))) > b)
+          if (static_cast<size_type>(std::abs(static_cast<int>(i-colnums[j]))) > b)
             b = std::abs(static_cast<signed int>(i-colnums[j]));
         }
       else
@@ -1144,7 +1144,7 @@ SparsityPattern::block_read (std::istream &in)
     delete[] colnums;
 
   rowstart = new std::size_t[max_dim+1];
-  colnums  = new unsigned int[max_vec_len];
+  colnums  = new size_type[max_vec_len];
 
   // then read data
   in.read (reinterpret_cast<char *>(&rowstart[0]),
@@ -1166,9 +1166,9 @@ SparsityPattern::block_read (std::istream &in)
 std::size_t
 SparsityPattern::memory_consumption () const
 {
-  return (max_dim * sizeof(unsigned int) +
+  return (max_dim * sizeof(size_type) +
           sizeof(*this) +
-          max_vec_len * sizeof(unsigned int));
+          max_vec_len * sizeof(size_type));
 }
 
 
@@ -1195,21 +1195,21 @@ template void SparsityPattern::copy_from<CompressedSimpleSparsityPattern> (const
 template void SparsityPattern::copy_from<float> (const FullMatrix<float> &);
 template void SparsityPattern::copy_from<double> (const FullMatrix<double> &);
 
-template void SparsityPattern::add_entries<const unsigned int *> (const unsigned int,
-    const unsigned int *,
-    const unsigned int *,
+template void SparsityPattern::add_entries<const SparsityPattern::size_type *> (const size_type ,
+    const size_type *,
+    const size_type *,
     const bool);
 #ifndef DEAL_II_VECTOR_ITERATOR_IS_POINTER
-template void SparsityPattern::add_entries<std::vector<unsigned int>::const_iterator>
-(const unsigned int,
- std::vector<unsigned int>::const_iterator,
- std::vector<unsigned int>::const_iterator,
+template void SparsityPattern::add_entries<std::vector<SparsityPattern::size_type>::const_iterator>
+(const size_type,
+ std::vector<size_type>::const_iterator,
+ std::vector<size_type>::const_iterator,
  const bool);
 #endif
-template void SparsityPattern::add_entries<std::vector<unsigned int>::iterator>
-(const unsigned int,
- std::vector<unsigned int>::iterator,
- std::vector<unsigned int>::iterator,
+template void SparsityPattern::add_entries<std::vector<SparsityPattern::size_type>::iterator>
+(const size_type,
+ std::vector<size_type>::iterator,
+ std::vector<size_type>::iterator,
  const bool);
 
 DEAL_II_NAMESPACE_CLOSE
index 99e69a582ecc9451f2f8b61ce95f86014ece292c..bb82de0bde19a2b76528b29d9360f21336379a1f 100644 (file)
@@ -89,7 +89,7 @@ namespace SparsityTools
     int_rowstart.reserve(sparsity_pattern.n_rows()+1);
     std::vector<idx_t> int_colnums;
     int_colnums.reserve(sparsity_pattern.n_nonzero_elements());
-    for (unsigned int row=0; row<sparsity_pattern.n_rows(); ++row)
+    for (size_type row=0; row<sparsity_pattern.n_rows(); ++row)
       {
         for (SparsityPattern::iterator col=sparsity_pattern.begin(row);
              col < sparsity_pattern.end(row); ++col)
@@ -142,14 +142,14 @@ namespace SparsityTools
      * invalid_unsigned_int indicates that a node has not been numbered yet),
      * pick a valid starting index among the as-yet unnumbered one.
      */
-    unsigned int
+    size_type 
     find_unnumbered_starting_index (const SparsityPattern     &sparsity,
-                                    const std::vector<unsigned int> &new_indices)
+                                    const std::vector<size_type> &new_indices)
     {
       {
-        unsigned int starting_point   = numbers::invalid_unsigned_int;
-        unsigned int min_coordination = sparsity.n_rows();
-        for (unsigned int row=0; row<sparsity.n_rows(); ++row)
+        size_type starting_point   = numbers::invalid_unsigned_int;
+        size_type min_coordination = sparsity.n_rows();
+        for (size_type row=0; row<sparsity.n_rows(); ++row)
           // look over all as-yet unnumbered indices
           if (new_indices[row] == numbers::invalid_unsigned_int)
             {
@@ -161,7 +161,7 @@ namespace SparsityTools
                   break;
               // post-condition after loop: coordination, i.e. the number of
               // entries in this row is now j-rowstart[row]
-              if (static_cast<unsigned int>(j-sparsity.begin(row)) <
+              if (static_cast<size_type>(j-sparsity.begin(row)) <
                   min_coordination)
                 {
                   min_coordination = j-sparsity.begin(row);
@@ -178,7 +178,7 @@ namespace SparsityTools
         // starting point, e.g. the first unnumbered one
         if (starting_point == numbers::invalid_unsigned_int)
           {
-            for (unsigned int i=0; i<new_indices.size(); ++i)
+            for (size_type i=0; i<new_indices.size(); ++i)
               if (new_indices[i] == numbers::invalid_unsigned_int)
                 {
                   starting_point = i;
@@ -197,8 +197,8 @@ namespace SparsityTools
 
   void
   reorder_Cuthill_McKee (const SparsityPattern     &sparsity,
-                         std::vector<unsigned int> &new_indices,
-                         const std::vector<unsigned int> &starting_indices)
+                         std::vector<size_type> &new_indices,
+                         const std::vector<size_type> &starting_indices)
   {
     Assert (sparsity.n_rows() == sparsity.n_cols(),
             ExcDimensionMismatch (sparsity.n_rows(), sparsity.n_cols()));
@@ -206,26 +206,26 @@ namespace SparsityTools
             ExcDimensionMismatch (sparsity.n_rows(), new_indices.size()));
     Assert (starting_indices.size() <= sparsity.n_rows(),
             ExcMessage ("You can't specify more starting indices than there are rows"));
-    for (unsigned int i=0; i<starting_indices.size(); ++i)
+    for (size_type i=0; i<starting_indices.size(); ++i)
       Assert (starting_indices[i] < sparsity.n_rows(),
               ExcMessage ("Invalid starting index"));
 
     // store the indices of the dofs renumbered in the last round. Default to
     // starting points
-    std::vector<unsigned int> last_round_dofs (starting_indices);
+    std::vector<size_type> last_round_dofs (starting_indices);
 
     // initialize the new_indices array with invalid values
     std::fill (new_indices.begin(), new_indices.end(),
                numbers::invalid_unsigned_int);
 
     // delete disallowed elements
-    for (unsigned int i=0; i<last_round_dofs.size(); ++i)
+    for (size_type i=0; i<last_round_dofs.size(); ++i)
       if ((last_round_dofs[i]==numbers::invalid_unsigned_int) ||
           (last_round_dofs[i]>=sparsity.n_rows()))
         last_round_dofs[i] = numbers::invalid_unsigned_int;
 
     std::remove_if (last_round_dofs.begin(), last_round_dofs.end(),
-                    std::bind2nd(std::equal_to<unsigned int>(),
+                    std::bind2nd(std::equal_to<size_type>(),
                                  numbers::invalid_unsigned_int));
 
     // now if no valid points remain: find dof with lowest coordination number
@@ -235,10 +235,10 @@ namespace SparsityTools
                                                             new_indices));
 
     // store next free dof index
-    unsigned int next_free_number = 0;
+    size_type next_free_number = 0;
 
     // enumerate the first round dofs
-    for (unsigned int i=0; i!=last_round_dofs.size(); ++i)
+    for (size_type i=0; i!=last_round_dofs.size(); ++i)
       new_indices[last_round_dofs[i]] = next_free_number++;
 
     // now do as many steps as needed to
@@ -247,12 +247,12 @@ namespace SparsityTools
       {
         // store the indices of the dofs to be
         // renumbered in the next round
-        std::vector<unsigned int> next_round_dofs;
+        std::vector<size_type> next_round_dofs;
 
         // find all neighbors of the
         // dofs numbered in the last
         // round
-        for (unsigned int i=0; i<last_round_dofs.size(); ++i)
+        for (size_type i=0; i<last_round_dofs.size(); ++i)
           for (SparsityPattern::iterator j=sparsity.begin(last_round_dofs[i]);
                j<sparsity.end(last_round_dofs[i]); ++j)
             if (j->is_valid_entry() == false)
@@ -264,7 +264,7 @@ namespace SparsityTools
         std::sort (next_round_dofs.begin(), next_round_dofs.end());
 
         // delete multiple entries
-        std::vector<unsigned int>::iterator end_sorted;
+        std::vector<size_type>::iterator end_sorted;
         end_sorted = std::unique (next_round_dofs.begin(), next_round_dofs.end());
         next_round_dofs.erase (end_sorted, next_round_dofs.end());
 
@@ -327,14 +327,14 @@ namespace SparsityTools
         // store for each coordination
         // number the dofs with these
         // coordination number
-        std::multimap<unsigned int, int> dofs_by_coordination;
+        std::multimap<size_type, int> dofs_by_coordination;
 
         // find coordination number for
         // each of these dofs
-        for (std::vector<unsigned int>::iterator s=next_round_dofs.begin();
+        for (std::vector<size_type>::iterator s=next_round_dofs.begin();
              s!=next_round_dofs.end(); ++s)
           {
-            unsigned int coordination = 0;
+            size_type coordination = 0;
             for (SparsityPattern::iterator j=sparsity.begin(*s);
                  j<sparsity.end(*s); ++j)
               if (j->is_valid_entry() == false)
@@ -344,14 +344,14 @@ namespace SparsityTools
 
             // insert this dof at its
             // coordination number
-            const std::pair<const unsigned int, int> new_entry (coordination, *s);
+            const std::pair<const size_type, int> new_entry (coordination, *s);
             dofs_by_coordination.insert (new_entry);
           }
 
         // assign new DoF numbers to
         // the elements of the present
         // front:
-        std::multimap<unsigned int, int>::iterator i;
+        std::multimap<size_type, int>::iterator i;
         for (i = dofs_by_coordination.begin(); i!=dofs_by_coordination.end(); ++i)
           new_indices[i->second] = next_free_number++;
 
@@ -377,27 +377,27 @@ namespace SparsityTools
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
   template <class CSP_t>
   void distribute_sparsity_pattern(CSP_t &csp,
-                                   const std::vector<unsigned int> &rows_per_cpu,
+                                   const std::vector<size_type> &rows_per_cpu,
                                    const MPI_Comm &mpi_comm,
                                    const IndexSet &myrange)
   {
-    unsigned int myid = Utilities::MPI::this_mpi_process(mpi_comm);
-    std::vector<unsigned int> start_index(rows_per_cpu.size()+1);
+    size_type myid = Utilities::MPI::this_mpi_process(mpi_comm);
+    std::vector<size_type> start_index(rows_per_cpu.size()+1);
     start_index[0]=0;
-    for (unsigned int i=0; i<rows_per_cpu.size(); ++i)
+    for (size_type i=0; i<rows_per_cpu.size(); ++i)
       start_index[i+1]=start_index[i]+rows_per_cpu[i];
 
-    typedef std::map<unsigned int, std::vector<unsigned int> > map_vec_t;
+    typedef std::map<size_type, std::vector<size_type> > map_vec_t;
 
     map_vec_t send_data;
 
     {
       unsigned int dest_cpu=0;
 
-      unsigned int n_local_rel_rows = myrange.n_elements();
-      for (unsigned int row_idx=0; row_idx<n_local_rel_rows; ++row_idx)
+      size_type n_local_rel_rows = myrange.n_elements();
+      for (size_type row_idx=0; row_idx<n_local_rel_rows; ++row_idx)
         {
-          unsigned int row=myrange.nth_index_in_set(row_idx);
+          size_type row=myrange.nth_index_in_set(row_idx);
 
           //calculate destination CPU
           while (row>=start_index[dest_cpu+1])
@@ -410,21 +410,21 @@ namespace SparsityTools
               continue;
             }
 
-          unsigned int rlen = csp.row_length(row);
+          size_type rlen = csp.row_length(row);
 
           //skip empty lines
           if (!rlen)
             continue;
 
           //save entries
-          std::vector<unsigned int> &dst = send_data[dest_cpu];
+          std::vector<size_type> &dst = send_data[dest_cpu];
 
           dst.push_back(rlen); // number of entries
           dst.push_back(row); // row index
-          for (unsigned int c=0; c<rlen; ++c)
+          for (size_type c=0; c<rlen; ++c)
             {
               //columns
-              unsigned int column = csp.column_number(row, c);
+              size_type column = csp.column_number(row, c);
               dst.push_back(column);
             }
         }

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.