]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Convert unsigned int to size_type in lac.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Feb 2013 15:35:26 +0000 (15:35 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Feb 2013 15:35:26 +0000 (15:35 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@28509 0785d39b-7218-0410-832d-ea1e28bc413d

41 files changed:
deal.II/files
deal.II/include/deal.II/lac/full_matrix.h
deal.II/include/deal.II/lac/full_matrix.templates.h
deal.II/include/deal.II/lac/householder.h
deal.II/include/deal.II/lac/identity_matrix.h
deal.II/include/deal.II/lac/lapack_full_matrix.h
deal.II/include/deal.II/lac/matrix_block.h
deal.II/include/deal.II/lac/matrix_iterator.h
deal.II/include/deal.II/lac/matrix_lib.h
deal.II/include/deal.II/lac/matrix_lib.templates.h
deal.II/include/deal.II/lac/matrix_out.h
deal.II/include/deal.II/lac/petsc_block_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_block_vector.h
deal.II/include/deal.II/lac/petsc_full_matrix.h
deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_parallel_block_vector.h
deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_parallel_vector.h
deal.II/include/deal.II/lac/petsc_precondition.h
deal.II/include/deal.II/lac/petsc_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_vector.h
deal.II/include/deal.II/lac/petsc_vector_base.h
deal.II/include/deal.II/lac/precondition.h
deal.II/include/deal.II/lac/precondition_block.h
deal.II/include/deal.II/lac/precondition_block.templates.h
deal.II/include/deal.II/lac/precondition_block_base.h
deal.II/include/deal.II/lac/relaxation_block.h
deal.II/include/deal.II/lac/relaxation_block.templates.h
deal.II/source/lac/lapack_full_matrix.cc
deal.II/source/lac/matrix_lib.cc
deal.II/source/lac/matrix_out.cc
deal.II/source/lac/petsc_block_sparse_matrix.cc
deal.II/source/lac/petsc_full_matrix.cc
deal.II/source/lac/petsc_matrix_base.cc
deal.II/source/lac/petsc_parallel_block_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_vector.cc
deal.II/source/lac/petsc_sparse_matrix.cc
deal.II/source/lac/petsc_vector.cc
deal.II/source/lac/petsc_vector_base.cc

index dddf84496343d7af029ea273fd4a8b172488ae55..5e614a31aacb1ddd2eb657129af386b77b675c1b 100644 (file)
@@ -123,27 +123,27 @@ MARKUS source/lac/compressed_set_sparsity_pattern.cc
 MARKUS source/lac/compressed_simple_sparsity_pattern.cc
 MARKUS source/lac/compressed_sparsity_pattern.cc
 WOLFGANG source/lac/constraint_matrix.cc
-source/lac/full_matrix.cc
-source/lac/lapack_full_matrix.cc
-source/lac/matrix_lib.cc
-source/lac/matrix_out.cc
-source/lac/operator.cc
+BRUNO source/lac/full_matrix.cc
+BRUNO source/lac/lapack_full_matrix.cc
+BRUNO source/lac/matrix_lib.cc
+BRUNO source/lac/matrix_out.cc
+BRUNO source/lac/operator.cc
 MARKUS source/lac/parallel_vector.cc
-source/lac/petsc_block_sparse_matrix.cc
-source/lac/petsc_full_matrix.cc
-source/lac/petsc_matrix_base.cc
-source/lac/petsc_parallel_block_sparse_matrix.cc
-source/lac/petsc_parallel_block_vector.cc
-source/lac/petsc_parallel_sparse_matrix.cc
-source/lac/petsc_parallel_vector.cc
-source/lac/petsc_precondition.cc
-source/lac/petsc_solver.cc
-source/lac/petsc_sparse_matrix.cc
-source/lac/petsc_vector_base.cc
-source/lac/petsc_vector.cc
-source/lac/precondition_block.cc
-source/lac/precondition_block_ez.cc
-source/lac/relaxation_block.cc
+BRUNO source/lac/petsc_block_sparse_matrix.cc
+BRUNO source/lac/petsc_full_matrix.cc
+BRUNO source/lac/petsc_matrix_base.cc
+BRUNO source/lac/petsc_parallel_block_sparse_matrix.cc
+BRUNO source/lac/petsc_parallel_block_vector.cc
+BRUNO source/lac/petsc_parallel_sparse_matrix.cc
+BRUNO source/lac/petsc_parallel_vector.cc
+BRUNO source/lac/petsc_precondition.cc
+BRUNO source/lac/petsc_solver.cc
+BRUNO source/lac/petsc_sparse_matrix.cc
+BRUNO source/lac/petsc_vector_base.cc
+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
@@ -361,7 +361,7 @@ BRUNO include/deal.II/lac/block_indices.h
 BRUNO include/deal.II/lac/block_list.h
 BRUNO include/deal.II/lac/block_matrix_array.h
 BRUNO include/deal.II/lac/block_matrix_base.h
-include/deal.II/lac/block_matrix.h
+BRUNO include/deal.II/lac/block_matrix.h
 MARKUS include/deal.II/lac/block_sparse_matrix_ez.h
 MARKUS include/deal.II/lac/block_sparse_matrix_ez.templates.h
 MARKUS include/deal.II/lac/block_sparse_matrix.h
@@ -381,44 +381,44 @@ WOLFGANG include/deal.II/lac/constraint_matrix.templates.h
 BRUNO include/deal.II/lac/eigen.h
 BRUNO include/deal.II/lac/exceptions.h
 BRUNO include/deal.II/lac/filtered_matrix.h
-include/deal.II/lac/full_matrix.h
-include/deal.II/lac/full_matrix.templates.h
-include/deal.II/lac/householder.h
-include/deal.II/lac/identity_matrix.h
-include/deal.II/lac/iterative_inverse.h
-include/deal.II/lac/lapack_full_matrix.h
-include/deal.II/lac/lapack_support.h
-include/deal.II/lac/matrix_block.h
-include/deal.II/lac/matrix_iterator.h
-include/deal.II/lac/matrix_lib.h
-include/deal.II/lac/matrix_lib.templates.h
-include/deal.II/lac/matrix_out.h
+BRUNO include/deal.II/lac/full_matrix.h
+BRUNO include/deal.II/lac/full_matrix.templates.h
+BRUNO include/deal.II/lac/householder.h
+BRUNO include/deal.II/lac/identity_matrix.h
+BRUNO include/deal.II/lac/iterative_inverse.h
+BRUNO include/deal.II/lac/lapack_full_matrix.h
+BRUNO include/deal.II/lac/lapack_support.h
+BRUNO include/deal.II/lac/matrix_block.h
+BRUNO include/deal.II/lac/matrix_iterator.h
+BRUNO include/deal.II/lac/matrix_lib.h
+BRUNO include/deal.II/lac/matrix_lib.templates.h
+BRUNO include/deal.II/lac/matrix_out.h
 MARKUS include/deal.II/lac/parallel_block_vector.h
 MARKUS include/deal.II/lac/parallel_vector.h
 MARKUS include/deal.II/lac/parallel_vector.templates.h
-include/deal.II/lac/petsc_block_sparse_matrix.h
-include/deal.II/lac/petsc_block_vector.h
-include/deal.II/lac/petsc_full_matrix.h
-include/deal.II/lac/petsc_matrix_base.h
-include/deal.II/lac/petsc_parallel_block_sparse_matrix.h
-include/deal.II/lac/petsc_parallel_block_vector.h
-include/deal.II/lac/petsc_parallel_sparse_matrix.h
-include/deal.II/lac/petsc_parallel_vector.h
-include/deal.II/lac/petsc_precondition.h
-include/deal.II/lac/petsc_solver.h
-include/deal.II/lac/petsc_sparse_matrix.h
-include/deal.II/lac/petsc_vector_base.h
-include/deal.II/lac/petsc_vector.h
-include/deal.II/lac/pointer_matrix.h
-include/deal.II/lac/precondition_block_base.h
-include/deal.II/lac/precondition_block.h
-include/deal.II/lac/precondition_block.templates.h
-include/deal.II/lac/precondition.h
-include/deal.II/lac/precondition_selector.h
-include/deal.II/lac/relaxation_block.h
-include/deal.II/lac/relaxation_block.templates.h
-include/deal.II/lac/schur_matrix.h
-include/deal.II/lac/shifted_matrix.h
+BRUNO include/deal.II/lac/petsc_block_sparse_matrix.h
+BRUNO include/deal.II/lac/petsc_block_vector.h
+BRUNO include/deal.II/lac/petsc_full_matrix.h
+BRUNO include/deal.II/lac/petsc_matrix_base.h
+BRUNO include/deal.II/lac/petsc_parallel_block_sparse_matrix.h
+BRUNO include/deal.II/lac/petsc_parallel_block_vector.h
+BRUNO include/deal.II/lac/petsc_parallel_sparse_matrix.h
+BRUNO include/deal.II/lac/petsc_parallel_vector.h
+BRUNO include/deal.II/lac/petsc_precondition.h
+BRUNO include/deal.II/lac/petsc_solver.h
+BRUNO include/deal.II/lac/petsc_sparse_matrix.h
+BRUNO include/deal.II/lac/petsc_vector_base.h
+BRUNO include/deal.II/lac/petsc_vector.h
+BRUNO include/deal.II/lac/pointer_matrix.h
+BRUNO include/deal.II/lac/precondition_block_base.h
+BRUNO include/deal.II/lac/precondition_block.h
+BRUNO include/deal.II/lac/precondition_block.templates.h
+BRUNO include/deal.II/lac/precondition.h
+BRUNO include/deal.II/lac/precondition_selector.h
+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
index e38bb47873928e82c7138cd28542088ebf63d0eb..71ba524f5f202a91441ffc009d58e8fda0fe8d92 100644 (file)
@@ -1476,7 +1476,7 @@ public:
 
 template <typename number>
 inline
-types::global_dof_index
+typename FullMatrix<number>::size_type
 FullMatrix<number>::m() const
 {
   return this->n_rows();
@@ -1486,7 +1486,7 @@ FullMatrix<number>::m() const
 
 template <typename number>
 inline
-types::global_dof_index
+typename FullMatrix<number>::size_type
 FullMatrix<number>::n() const
 {
   return this->n_cols();
@@ -1529,7 +1529,7 @@ FullMatrix<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);
@@ -1550,7 +1550,7 @@ FullMatrix<number>::copy_transposed (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);
@@ -1654,7 +1654,7 @@ Accessor (const FullMatrix<number> *matrix,
 
 template <typename number>
 inline
-types::global_dof_index
+typename FullMatrix<number>::size_type
 FullMatrix<number>::Accessor::row() const
 {
   return a_row;
@@ -1663,7 +1663,7 @@ FullMatrix<number>::Accessor::row() const
 
 template <typename number>
 inline
-types::global_dof_index
+typename FullMatrix<number>::size_type
 FullMatrix<number>::Accessor::column() const
 {
   return a_col;
index d7adfc766f90ff7d9e9bb49052119f23b098bf68..d6cdf55406d2e9585fdfa4cf3e82f60b2b402a37 100644 (file)
@@ -32,23 +32,23 @@ DEAL_II_NAMESPACE_OPEN
 
 
 template <typename number>
-FullMatrix<number>::FullMatrix (const unsigned int n)
+FullMatrix<number>::FullMatrix (const size_type n)
   :
   Table<2,number> (n,n)
 {}
 
 
 template <typename number>
-FullMatrix<number>::FullMatrix (const unsigned int m,
-                                const unsigned int n)
+FullMatrix<number>::FullMatrix (const size_type m,
+                                const size_type n)
   :
   Table<2,number> (m, n)
 {}
 
 
 template <typename number>
-FullMatrix<number>::FullMatrix (const unsigned int m,
-                                const unsigned int n,
+FullMatrix<number>::FullMatrix (const size_type m,
+                                const size_type n,
                                 const number *entries)
   :
   Table<2,number> (m, n)
@@ -70,7 +70,7 @@ FullMatrix<number>::FullMatrix (const IdentityMatrix &id)
   :
   Table<2,number> (id.m(), id.n())
 {
-  for (unsigned int i=0; i<id.m(); ++i)
+  for (size_type i=0; i<id.m(); ++i)
     (*this)(i,i) = 1;
 }
 
@@ -100,7 +100,7 @@ FullMatrix<number> &
 FullMatrix<number>::operator = (const IdentityMatrix &id)
 {
   this->reinit (id.m(), id.n());
-  for (unsigned int i=0; i<id.m(); ++i)
+  for (size_type i=0; i<id.m(); ++i)
     (*this)(i,i) = 1.;
 
   return *this;
@@ -115,8 +115,8 @@ FullMatrix<number>::operator = (const LAPACKFullMatrix<number2> &M)
 {
   Assert (this->m() == M.n_rows(), ExcDimensionMismatch(this->m(), M.n_rows()));
   Assert (this->n() == M.n_cols(), ExcDimensionMismatch(this->n(), M.n_rows()));
-  for (unsigned int i=0; i<this->m(); ++i)
-    for (unsigned int j=0; j<this->n(); ++j)
+  for (size_type i=0; i<this->m(); ++i)
+    for (size_type j=0; j<this->n(); ++j)
       (*this)(i,j) = M(i,j);
 
   return *this;
@@ -199,11 +199,11 @@ FullMatrix<number>::vmult (Vector<number2> &dst,
   // avoid copying it when using the ()
   // operator
   const number2 *src_ptr = &(*const_cast<Vector<number2>*>(&src))(0);
-  const unsigned int size_m = m(), size_n = n();
-  for (unsigned int i=0; i<size_m; ++i)
+  const size_type size_m = m(), size_n = n();
+  for (size_type i=0; i<size_m; ++i)
     {
       number2 s = adding ? dst(i) : 0.;
-      for (unsigned int j=0; j<size_n; ++j)
+      for (size_type j=0; j<size_n; ++j)
         s += src_ptr[j] * number2(*(e++));
       dst(i) = s;
     }
@@ -226,19 +226,19 @@ void FullMatrix<number>::Tvmult (Vector<number2>       &dst,
 
   const number *e = &this->values[0];
   number2 *dst_ptr = &dst(0);
-  const unsigned int size_m = m(), size_n = n();
+  const size_type size_m = m(), size_n = n();
 
   // zero out data if we are not adding
   if (!adding)
-    for (unsigned int j=0; j<size_n; ++j)
+    for (size_type j=0; j<size_n; ++j)
       dst_ptr[j] = 0.;
 
   // write the loop in a way that we can
   // access the data contiguously
-  for (unsigned int i=0; i<size_m; ++i)
+  for (size_type i=0; i<size_m; ++i)
     {
       const number2 d = src(i);
-      for (unsigned int j=0; j<size_n; ++j)
+      for (size_type j=0; j<size_n; ++j)
         dst_ptr[j] += d * number2(*(e++));
     };
 }
@@ -259,12 +259,12 @@ number FullMatrix<number>::residual (Vector<number2> &dst,
   Assert (&src != &dst, ExcSourceEqualsDestination());
 
   number res = 0.;
-  const unsigned int size_m = m(),
-                     size_n = n();
-  for (unsigned int i=0; i<size_n; ++i)
+  const size_type size_m = m(),
+                  size_n = n();
+  for (size_type i=0; i<size_n; ++i)
     {
       number s = number(right(i));
-      for (unsigned int j=0; j<size_m; ++j)
+      for (size_type j=0; j<size_m; ++j)
         s -= number(src(j)) * (*this)(i,j);
       dst(i) = s;
       res += s*s;
@@ -284,8 +284,8 @@ void FullMatrix<number>::forward (Vector<number2>       &dst,
   Assert (dst.size() == m(), ExcDimensionMismatch(dst.size(), m()));
   Assert (src.size() == n(), ExcDimensionMismatch(src.size(), n()));
 
-  unsigned int i,j;
-  unsigned int nu = ( (m()<n()) ? m() : n());
+  size_type i,j;
+  size_type nu = ( (m()<n()) ? m() : n());
   for (i=0; i<nu; ++i)
     {
       number s = number(src(i));
@@ -304,8 +304,8 @@ void FullMatrix<number>::backward (Vector<number2>       &dst,
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  unsigned int j;
-  unsigned int nu = (m()<n() ? m() : n());
+  size_type j;
+  size_type nu = (m()<n() ? m() : n());
   for (int i=nu-1; i>=0; --i)
     {
       number2 s = src(i);
@@ -320,10 +320,10 @@ void FullMatrix<number>::backward (Vector<number2>       &dst,
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::fill (const FullMatrix<number2> &src,
-                               const unsigned int dst_offset_i,
-                               const unsigned int dst_offset_j,
-                               const unsigned int src_offset_i,
-                               const unsigned int src_offset_j)
+                               const size_type dst_offset_i,
+                               const size_type dst_offset_j,
+                               const size_type src_offset_i,
+                               const size_type src_offset_j)
 {
   Assert (dst_offset_i < m(),
           ExcIndexRange (dst_offset_i, 0, m()));
@@ -335,13 +335,13 @@ void FullMatrix<number>::fill (const FullMatrix<number2> &src,
           ExcIndexRange (src_offset_j, 0, src.n()));
 
   // Compute maximal size of copied block
-  const unsigned int rows = std::min (m() - dst_offset_i,
+  const size_type rows = std::min (m() - dst_offset_i,
                                       src.m() - src_offset_i);
-  const unsigned int cols = std::min (n() - dst_offset_j,
+  const size_type cols = std::min (n() - dst_offset_j,
                                       src.n() - src_offset_j);
 
-  for (unsigned int i=0; i<rows ; ++i)
-    for (unsigned int j=0; j<cols ; ++j)
+  for (size_type i=0; i<rows ; ++i)
+    for (size_type j=0; j<cols ; ++j)
       (*this)(dst_offset_i+i,dst_offset_j+j)
         = src(src_offset_i+i,src_offset_j+j);
 }
@@ -350,16 +350,16 @@ void FullMatrix<number>::fill (const FullMatrix<number2> &src,
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::fill_permutation (const FullMatrix<number2> &src,
-                                           const std::vector<unsigned int> &p_rows,
-                                           const std::vector<unsigned int> &p_cols)
+                                           const std::vector<size_type> &p_rows,
+                                           const std::vector<size_type> &p_cols)
 {
   Assert (p_rows.size() == this->n_rows(),
           ExcDimensionMismatch (p_rows.size(), this->n_rows()));
   Assert (p_cols.size() == this->n_cols(),
           ExcDimensionMismatch (p_cols.size(), this->n_cols()));
 
-  for (unsigned int i=0; i<this->n_rows(); ++i)
-    for (unsigned int j=0; j<this->n_cols(); ++j)
+  for (size_type i=0; i<this->n_rows(); ++i)
+    for (size_type j=0; j<this->n_cols(); ++j)
       (*this)(i,j) = src(p_rows[i], p_cols[j]);
 }
 
@@ -376,75 +376,75 @@ void FullMatrix<number>::fill_permutation (const FullMatrix<number2> &src,
 
 
 template <typename number>
-void FullMatrix<number>::add_row (const unsigned int i,
+void FullMatrix<number>::add_row (const size_type i,
                                   const number s,
-                                  const unsigned int j)
+                                  const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<m(); ++k)
+  for (size_type k=0; k<m(); ++k)
     (*this)(i,k) += s*(*this)(j,k);
 }
 
 
 template <typename number>
-void FullMatrix<number>::add_row (const unsigned int i,
+void FullMatrix<number>::add_row (const size_type i,
                                   const number s,
-                                  const unsigned int j,
+                                  const size_type j,
                                   const number t,
-                                  const unsigned int k)
+                                  const size_type k)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  const unsigned int size_m = m();
-  for (unsigned int l=0; l<size_m; ++l)
+  const size_type size_m = m();
+  for (size_type l=0; l<size_m; ++l)
     (*this)(i,l) += s*(*this)(j,l) + t*(*this)(k,l);
 }
 
 
 template <typename number>
-void FullMatrix<number>::add_col (const unsigned int i, const number s,
-                                  const unsigned int j)
+void FullMatrix<number>::add_col (const size_type i, const number s,
+                                  const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<n(); ++k)
+  for (size_type k=0; k<n(); ++k)
     (*this)(k,i) += s*(*this)(k,j);
 }
 
 
 template <typename number>
-void FullMatrix<number>::add_col (const unsigned int i, const number s,
-                                  const unsigned int j, const number t,
-                                  const unsigned int k)
+void FullMatrix<number>::add_col (const size_type i, const number s,
+                                  const size_type j, const number t,
+                                  const size_type k)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int l=0; l<n(); ++l)
+  for (size_t l=0; l<n(); ++l)
     (*this)(l,i) += s*(*this)(l,j) + t*(*this)(l,k);
 }
 
 
 
 template <typename number>
-void FullMatrix<number>::swap_row (const unsigned int i,
-                                   const unsigned int j)
+void FullMatrix<number>::swap_row (const size_type i,
+                                   const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<n(); ++k)
+  for (size_type k=0; k<n(); ++k)
     std::swap ((*this)(i,k),
                (*this)(j,k));
 }
 
 
 template <typename number>
-void FullMatrix<number>::swap_col (const unsigned int i,
-                                   const unsigned int j)
+void FullMatrix<number>::swap_col (const size_type i,
+                                   const size_type j)
 {
   Assert (!this->empty(), ExcEmptyMatrix());
 
-  for (unsigned int k=0; k<m(); ++k)
+  for (size_type k=0; k<m(); ++k)
     std::swap ((*this)(k,i),
                (*this)(k,j));
 }
@@ -456,7 +456,7 @@ void FullMatrix<number>::diagadd (const number src)
   Assert (!this->empty(), ExcEmptyMatrix());
   Assert (m() == n(), ExcDimensionMismatch(m(),n()));
 
-  for (unsigned int i=0; i<n(); ++i)
+  for (size_type i=0; i<n(); ++i)
     (*this)(i,i) += src;
 }
 
@@ -471,8 +471,8 @@ void FullMatrix<number>::equ (const number               a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j));
 }
 
@@ -492,8 +492,8 @@ FullMatrix<number>::equ (const number               a,
   Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
   Assert (n() == B.n(), ExcDimensionMismatch(n(), B.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j)) + b * number(B(i,j));
 }
 
@@ -517,8 +517,8 @@ FullMatrix<number>::equ (const number               a,
   Assert (m() == C.m(), ExcDimensionMismatch(m(), C.m()));
   Assert (n() == C.n(), ExcDimensionMismatch(n(), C.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j)) +
                      b * number(B(i,j)) +
                      c * number(C(i,j));
@@ -592,7 +592,7 @@ void FullMatrix<number>::mmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = this->m(), n = src.n(), l = this->n();
+  const size_type m = this->m(), n = src.n(), l = this->n();
 
   // arrange the loops in a way that
   // we keep write operations low,
@@ -600,11 +600,11 @@ void FullMatrix<number>::mmult (FullMatrix<number2>       &dst,
   // than reading), even though we
   // need to access the data in src
   // not in a contiguous way.
-  for (unsigned int i=0; i<m; i++)
-    for (unsigned int j=0; j<n; j++)
+  for (size_type i=0; i<m; i++)
+    for (size_type j=0; j<n; j++)
       {
         number2 add_value = adding ? dst(i,j) : 0.;
-        for (unsigned int k=0; k<l; k++)
+        for (size_type k=0; k<l; k++)
           add_value += (number2)(*this)(i,k) * (number2)(src(k,j));
         dst(i,j) = add_value;
       }
@@ -680,7 +680,7 @@ void FullMatrix<number>::Tmmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = n(), n = src.n(), l = this->m();
+  const size_type m = n(), n = src.n(), l = this->m();
 
   // arrange the loops in a way that
   // we keep write operations low,
@@ -692,11 +692,11 @@ void FullMatrix<number>::Tmmult (FullMatrix<number2>       &dst,
   // optimized gemm operation in case
   // the matrix is big, so this
   // shouldn't be too bad.
-  for (unsigned int i=0; i<m; i++)
-    for (unsigned int j=0; j<n; j++)
+  for (size_type i=0; i<m; i++)
+    for (size_type j=0; j<n; j++)
       {
         number2 add_value = adding ? dst(i,j) : 0.;
-        for (unsigned int k=0; k<l; k++)
+        for (size_type k=0; k<l; k++)
           add_value += (number2)(*this)(k,i) * (number2)(src(k,j));
         dst(i,j) = add_value;
       }
@@ -771,17 +771,17 @@ void FullMatrix<number>::mTmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = this->m(), n = src.m(), l = this->n();
+  const size_type m = this->m(), n = src.m(), l = this->n();
 
   // arrange the loops in a way that
   // we keep write operations low,
   // (writing is usually more costly
   // than reading).
-  for (unsigned int i=0; i<m; i++)
-    for (unsigned int j=0; j<n; j++)
+  for (size_type i=0; i<m; i++)
+    for (size_type j=0; j<n; j++)
       {
         number2 add_value = adding ? dst(i,j) : 0.;
-        for (unsigned int k=0; k<l; k++)
+        for (size_type k=0; k<l; k++)
           add_value += (number2)(*this)(i,k) * (number2)(src(j,k));
         dst(i,j) = add_value;
       }
@@ -856,7 +856,7 @@ void FullMatrix<number>::TmTmult (FullMatrix<number2>       &dst,
 
 #endif
 
-  const unsigned int m = n(), n = src.m(), l = this->m();
+  const size_type m = n(), n = src.m(), l = this->m();
 
   // arrange the loops in a way that
   // we keep write operations low,
@@ -869,11 +869,11 @@ void FullMatrix<number>::TmTmult (FullMatrix<number2>       &dst,
   // optimized gemm operation in case
   // the matrix is big, so this
   // shouldn't be too bad.
-  for (unsigned int i=0; i<m; i++)
-    for (unsigned int j=0; j<n; j++)
+  for (size_type i=0; i<m; i++)
+    for (size_type j=0; j<n; j++)
       {
         number2 add_value = adding ? dst(i,j) : 0.;
-        for (unsigned int k=0; k<l; k++)
+        for (size_type k=0; k<l; k++)
           add_value += (number2)(*this)(k,i) * (number2)(src(j,k));
         dst(i,j) = add_value;
       }
@@ -913,25 +913,25 @@ FullMatrix<number>::triple_product(
 
   // For all entries of the product
   // AD
-  for (unsigned int i=0; i<A.m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<A.m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       {
         // Compute the entry
         number ADij = 0.;
         if (transpose_D)
-          for (unsigned int k=0; k<A.n(); ++k)
+          for (size_type k=0; k<A.n(); ++k)
             ADij += A(i,k)*D(j,k);
         else
-          for (unsigned int k=0; k<A.n(); ++k)
+          for (size_type k=0; k<A.n(); ++k)
             ADij += A(i,k)*D(k,j);
         // And add it to this after
         // multiplying with the right
         // factor from B
         if (transpose_B)
-          for (unsigned int k=0; k<m(); ++k)
+          for (size_type k=0; k<m(); ++k)
             this->operator()(k,j) += scaling * ADij * B(i,k);
         else
-          for (unsigned int k=0; k<m(); ++k)
+          for (size_type k=0; k<m(); ++k)
             this->operator()(k,j) += scaling * ADij * B(k,i);
       }
 }
@@ -948,11 +948,11 @@ FullMatrix<number>::matrix_norm_square (const Vector<number2> &v) const
   Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
 
   number2 sum = 0.;
-  const unsigned int n_rows = m();
+  const size_type n_rows = m();
   const number *val_ptr = &this->values[0];
   const number2 *v_ptr;
 
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     {
       number s = 0.;
       const number *const val_end_of_row = val_ptr+n_rows;
@@ -979,12 +979,12 @@ FullMatrix<number>::matrix_scalar_product (const Vector<number2> &u,
   Assert(n() == v.size(), ExcDimensionMismatch(n(),v.size()));
 
   number2 sum = 0.;
-  const unsigned int n_rows = m();
-  const unsigned int n_cols = n();
+  const size_type n_rows = m();
+  const size_type n_cols = n();
   const number *val_ptr = &this->values[0];
   const number2 *v_ptr;
 
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     {
       number s = 0.;
       const number *const val_end_of_row = val_ptr+n_cols;
@@ -1006,9 +1006,9 @@ FullMatrix<number>::symmetrize ()
 {
   Assert (m() == n(), ExcNotQuadratic());
 
-  const unsigned int N = m();
-  for (unsigned int i=0; i<N; ++i)
-    for (unsigned int j=i+1; j<N; ++j)
+  const size_type N = m();
+  for (size_type i=0; i<N; ++i)
+    for (size_type j=i+1; j<N; ++j)
       {
         const number t = ((*this)(i,j) + (*this)(j,i)) / number(2.);
         (*this)(i,j) = (*this)(j,i) = t;
@@ -1023,12 +1023,12 @@ FullMatrix<number>::l1_norm () const
   Assert (!this->empty(), ExcEmptyMatrix());
 
   real_type sum=0, max=0;
-  const unsigned int n_rows = m(), n_cols = n();
+  const size_type n_rows = m(), n_cols = n();
 
-  for (unsigned int col=0; col<n_cols; ++col)
+  for (size_type col=0; col<n_cols; ++col)
     {
       sum=0;
-      for (unsigned int row=0; row<n_rows; ++row)
+      for (size_type row=0; row<n_rows; ++row)
         sum += std::abs((*this)(row,col));
       if (sum > max)
         max = sum;
@@ -1045,12 +1045,12 @@ FullMatrix<number>::linfty_norm () const
   Assert (!this->empty(), ExcEmptyMatrix());
 
   real_type sum=0, max=0;
-  const unsigned int n_rows = m(), n_cols = n();
+  const size_type n_rows = m(), n_cols = n();
 
-  for (unsigned int row=0; row<n_rows; ++row)
+  for (size_type row=0; row<n_rows; ++row)
     {
       sum=0;
-      for (unsigned int col=0; col<n_cols; ++col)
+      for (size_type col=0; col<n_cols; ++col)
         sum += std::abs((*this)(row,col));
       if (sum > max)
         max = sum;
@@ -1071,8 +1071,8 @@ FullMatrix<number>::add (const number               a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j));
 }
 
@@ -1092,8 +1092,8 @@ FullMatrix<number>::add (const number               a,
   Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
   Assert (n() == B.n(), ExcDimensionMismatch(n(), B.n()));
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j)) + b * number(B(i,j));
 }
 
@@ -1119,8 +1119,8 @@ FullMatrix<number>::add (const number               a,
   Assert (n() == C.n(), ExcDimensionMismatch(n(), C.n()));
 
 
-  for (unsigned int i=0; i<m(); ++i)
-    for (unsigned int j=0; j<n(); ++j)
+  for (size_type i=0; i<m(); ++i)
+    for (size_type j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j)) +
                       b * number(B(i,j)) +
                       c * number(C(i,j));
@@ -1132,10 +1132,10 @@ template <typename number>
 template <typename number2>
 void FullMatrix<number>::add (const FullMatrix<number2> &src,
                               const number factor,
-                              const unsigned int dst_offset_i,
-                              const unsigned int dst_offset_j,
-                              const unsigned int src_offset_i,
-                              const unsigned int src_offset_j)
+                              const size_type dst_offset_i,
+                              const size_type dst_offset_j,
+                              const size_type src_offset_i,
+                              const size_type src_offset_j)
 {
   Assert (dst_offset_i < m(),
           ExcIndexRange (dst_offset_i, 0, m()));
@@ -1147,13 +1147,11 @@ void FullMatrix<number>::add (const FullMatrix<number2> &src,
           ExcIndexRange (src_offset_j, 0, src.n()));
 
   // Compute maximal size of copied block
-  const unsigned int rows = std::min (m() - dst_offset_i,
-                                      src.m() - src_offset_i);
-  const unsigned int cols = std::min (n() - dst_offset_j,
-                                      src.n() - src_offset_j);
+  const size_type rows = std::min (m() - dst_offset_i, src.m() - src_offset_i);
+  const size_type cols = std::min (n() - dst_offset_j, src.n() - src_offset_j);
 
-  for (unsigned int i=0; i<rows ; ++i)
-    for (unsigned int j=0; j<cols ; ++j)
+  for (size_type i=0; i<rows ; ++i)
+    for (size_type j=0; j<cols ; ++j)
       (*this)(dst_offset_i+i,dst_offset_j+j)
       += factor * number(src(src_offset_i+i,src_offset_j+j));
 }
@@ -1164,10 +1162,10 @@ template <typename number>
 template <typename number2>
 void FullMatrix<number>::Tadd (const FullMatrix<number2> &src,
                                const number factor,
-                               const unsigned int dst_offset_i,
-                               const unsigned int dst_offset_j,
-                               const unsigned int src_offset_i,
-                               const unsigned int src_offset_j)
+                               const size_type dst_offset_i,
+                               const size_type dst_offset_j,
+                               const size_type src_offset_i,
+                               const size_type src_offset_j)
 {
   Assert (dst_offset_i < m(),
           ExcIndexRange (dst_offset_i, 0, m()));
@@ -1179,14 +1177,13 @@ void FullMatrix<number>::Tadd (const FullMatrix<number2> &src,
           ExcIndexRange (src_offset_j, 0, src.m()));
 
   // Compute maximal size of copied block
-  const unsigned int rows = std::min (m() - dst_offset_i,
-                                      src.n() - src_offset_j);
-  const unsigned int cols = std::min (n() - dst_offset_j,
+  const size_type rows = std::min (m() - dst_offset_i, src.n() - src_offset_j);
+  const size_type cols = std::min (n() - dst_offset_j,
                                       src.m() - src_offset_i);
 
 
-  for (unsigned int i=0; i<rows ; ++i)
-    for (unsigned int j=0; j<cols ; ++j)
+  for (size_type i=0; i<rows ; ++i)
+    for (size_type j=0; j<cols ; ++j)
       (*this)(dst_offset_i+i,dst_offset_j+j)
       += factor * number(src(src_offset_i+j,src_offset_j+i));
 }
@@ -1205,8 +1202,8 @@ FullMatrix<number>::Tadd (const number a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (size_type i=0; i<n(); ++i)
+    for (size_type j=0; j<m(); ++j)
       (*this)(i,j) += a * number(A(j,i));
 }
 
@@ -1260,7 +1257,7 @@ FullMatrix<number>::trace () const
           ExcDimensionMismatch(this->n_cols(), this->n_rows()));
 
   number tr = 0;
-  for (unsigned int i=0; i<this->n_rows(); ++i)
+  for (size_type i=0; i<this->n_rows(); ++i)
     tr += (*this)(i,i);
 
   return tr;
@@ -1275,7 +1272,7 @@ FullMatrix<number>::frobenius_norm () const
   Assert (!this->empty(), ExcEmptyMatrix());
 
   real_type s = 0.;
-  for (unsigned int i=0; i<this->n_rows()*this->n_cols(); ++i)
+  for (size_type i=0; i<this->n_rows()*this->n_cols(); ++i)
     s += numbers::NumberTraits<number>::abs_square(this->values[i]);
   return std::sqrt(s);
 }
@@ -1290,8 +1287,8 @@ FullMatrix<number>::relative_symmetry_norm2 () const
 
   real_type s = 0.;
   real_type a = 0.;
-  for (unsigned int i=0; i<this->n_rows(); ++i)
-    for (unsigned int j=0; j<this->n_cols(); ++j)
+  for (size_type i=0; i<this->n_rows(); ++i)
+    for (size_type j=0; j<this->n_cols(); ++j)
       {
         const number x_ij = (*this)(i,j);
         const number x_ji = (*this)(j,i);
@@ -1505,13 +1502,13 @@ FullMatrix<number>::cholesky (const FullMatrix<number2> &A)
       this->reinit(A.m(), A.n());
 
       double SLik2 = 0.0, SLikLjk = 0.0;
-      for (unsigned int i=0; i< this->n_cols(); i++)
+      for (size_type i=0; i< this->n_cols(); i++)
         {
           SLik2 = 0.0;
-          for (unsigned int j = 0; j < i; j++)
+          for (size_type j = 0; j < i; j++)
             {
               SLikLjk = 0.0;
-              for (unsigned int k =0; k<j; k++)
+              for (size_type k =0; k<j; k++)
                 {
                   SLikLjk += (*this)(i,k)*(*this)(j,k);
                 };
@@ -1536,9 +1533,9 @@ FullMatrix<number>::outer_product (const Vector<number2> &V,
   Assert (V.size() == W.size(), ExcMessage("Vectors V, W must be the same size."));
   this->reinit(V.size(), V.size());
 
-  for (unsigned int i = 0; i<this->n(); i++)
+  for (size_type i = 0; i<this->n(); i++)
     {
-      for (unsigned int j = 0; j< this->n(); j++)
+      for (size_type j = 0; j< this->n(); j++)
         {
           (*this)(i,j) = V(i)*W(j);
         }
@@ -1607,12 +1604,12 @@ template <typename number>
 template <int dim>
 void
 FullMatrix<number>::copy_from (const Tensor<2,dim> &T,
-                               const unsigned int src_r_i,
-                               const unsigned int src_r_j,
-                               const unsigned int src_c_i,
-                               const unsigned int src_c_j,
-                               const unsigned int dst_r,
-                               const unsigned int dst_c)
+                               const size_type src_r_i,
+                               const size_type src_r_j,
+                               const size_type src_c_i,
+                               const size_type src_c_j,
+                               const size_type dst_r,
+                               const size_type dst_c)
 {
 
   Assert (!this->empty(), ExcEmptyMatrix());
@@ -1625,8 +1622,8 @@ FullMatrix<number>::copy_from (const Tensor<2,dim> &T,
   Assert(src_r_j>=src_r_i, ExcIndexRange(src_r_j,0,src_r_i));
   Assert(src_c_j>=src_c_i, ExcIndexRange(src_r_j,0,src_r_i));
 
-  for (unsigned int i=0; i<src_r_j-src_r_i+1; i++)
-    for (unsigned int j=0; j<src_c_j-src_c_i+1; j++)
+  for (size_type i=0; i<src_r_j-src_r_i+1; i++)
+    for (size_type j=0; j<src_c_j-src_c_i+1; j++)
       (*this)(i+dst_r,j+dst_c) = number(T[i+src_r_i][j+src_c_i]);
 
 }
@@ -1636,12 +1633,12 @@ template <typename number>
 template <int dim>
 void
 FullMatrix<number>::copy_to (Tensor<2,dim> &T,
-                             const unsigned int src_r_i,
-                             const unsigned int src_r_j,
-                             const unsigned int src_c_i,
-                             const unsigned int src_c_j,
-                             const unsigned int dst_r,
-                             const unsigned int dst_c) const
+                             const size_type src_r_i,
+                             const size_type src_r_j,
+                             const size_type src_c_i,
+                             const size_type src_c_j,
+                             const size_type dst_r,
+                             const size_type dst_c) const
 {
   Assert (!this->empty(), ExcEmptyMatrix());
   Assert(dim-dst_r>src_r_j-src_r_i,
@@ -1654,8 +1651,8 @@ FullMatrix<number>::copy_to (Tensor<2,dim> &T,
   Assert(src_c_j>=src_c_i, ExcIndexRange(src_r_j,0,src_r_i));
 
 
-  for (unsigned int i=0; i<src_r_j-src_r_i+1; i++)
-    for (unsigned int j=0; j<src_c_j-src_c_i+1; j++)
+  for (size_type i=0; i<src_r_j-src_r_i+1; i++)
+    for (size_type j=0; j<src_c_j-src_c_i+1; j++)
       T[i+dst_r][j+dst_c] = double ((*this)(i+src_r_i,j+src_c_i));
 }
 
@@ -1672,11 +1669,11 @@ FullMatrix<number>::precondition_Jacobi (Vector<somenumber>       &dst,
   Assert (dst.size() == n(), ExcDimensionMismatch (dst.size(), n()));
   Assert (src.size() == n(), ExcDimensionMismatch (src.size(), n()));
 
-  const unsigned int n = src.size();
-  somenumber              *dst_ptr = dst.begin();
-  const somenumber        *src_ptr = src.begin();
+  const size_t n = src.size();
+  somenumber       *dst_ptr = dst.begin();
+  const somenumber *src_ptr = src.begin();
 
-  for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr)
+  for (size_type i=0; i<n; ++i, ++dst_ptr, ++src_ptr)
     *dst_ptr = somenumber(om) * *src_ptr / somenumber((*this)(i,i));
 }
 
@@ -1716,9 +1713,9 @@ FullMatrix<number>::print_formatted (
         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 (std::abs((*this)(i,j)) > threshold)
           out << std::setw(width)
               << (*this)(i,j) * number(denominator) << ' ';
@@ -1805,7 +1802,7 @@ FullMatrix<number>::gauss_jordan ()
   // Gauss-Jordan-Algorithmus from
   // Stoer & Bulirsch I (4th Edition)
   // p. 153
-  const unsigned int N = n();
+  const size_type N = n();
 
   // first get an estimate of the
   // size of the elements of this
@@ -1815,26 +1812,26 @@ FullMatrix<number>::gauss_jordan ()
   // fear that the matrix is not
   // regular
   double diagonal_sum = 0;
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     diagonal_sum += std::abs((*this)(i,i));
   const double typical_diagonal_element = diagonal_sum/N;
 
   // initialize the array that holds
   // the permutations that we find
   // during pivot search
-  std::vector<unsigned int> p(N);
-  for (unsigned int i=0; i<N; ++i)
+  std::vector<size_type> p(N);
+  for (size_type i=0; i<N; ++i)
     p[i] = i;
 
-  for (unsigned int j=0; j<N; ++j)
+  for (size_type j=0; j<N; ++j)
     {
       // pivot search: search that
       // part of the line on and
       // right of the diagonal for
       // the largest element
       real_type max = std::abs((*this)(j,j));
-      unsigned int r   = j;
-      for (unsigned int i=j+1; i<N; ++i)
+      size_type r   = j;
+      for (size_type i=j+1; i<N; ++i)
         {
           if (std::abs((*this)(i,j)) > max)
             {
@@ -1850,7 +1847,7 @@ FullMatrix<number>::gauss_jordan ()
       // row interchange
       if (r>j)
         {
-          for (unsigned int k=0; k<N; ++k)
+          for (size_type k=0; k<N; ++k)
             std::swap ((*this)(j,k), (*this)(r,k));
 
           std::swap (p[j], p[r]);
@@ -1859,16 +1856,16 @@ FullMatrix<number>::gauss_jordan ()
       // transformation
       const number hr = number(1.)/(*this)(j,j);
       (*this)(j,j) = hr;
-      for (unsigned int k=0; k<N; ++k)
+      for (size_type k=0; k<N; ++k)
         {
           if (k==j) continue;
-          for (unsigned int i=0; i<N; ++i)
+          for (size_type i=0; i<N; ++i)
             {
               if (i==j) continue;
               (*this)(i,k) -= (*this)(i,j)*(*this)(j,k)*hr;
             }
         }
-      for (unsigned int i=0; i<N; ++i)
+      for (size_type i=0; i<N; ++i)
         {
           (*this)(i,j) *= hr;
           (*this)(j,i) *= -hr;
@@ -1877,11 +1874,11 @@ FullMatrix<number>::gauss_jordan ()
     }
   // column interchange
   std::vector<number> hv(N);
-  for (unsigned int i=0; i<N; ++i)
+  for (size_type i=0; i<N; ++i)
     {
-      for (unsigned int k=0; k<N; ++k)
+      for (size_type k=0; k<N; ++k)
         hv[p[k]] = (*this)(i,k);
-      for (unsigned int k=0; k<N; ++k)
+      for (size_type k=0; k<N; ++k)
         (*this)(i,k) = hv[k];
     }
 }
index 22a531b95c59f914689d504a071b117d73cd7423..fc1155c95e11ded926eca632d8ba729249adfddc 100644 (file)
@@ -51,6 +51,11 @@ template<typename number>
 class Householder : private FullMatrix<number>
 {
 public:
+  /**
+   * Declare type of container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Create an empty object.
    */
@@ -139,7 +144,7 @@ template <typename number2>
 void
 Householder<number>::initialize(const FullMatrix<number2> &M)
 {
-  const unsigned int m = M.n_rows(), n = M.n_cols();
+  const size_type m = M.n_rows(), n = M.n_cols();
   this->reinit(m, n);
   this->fill(M);
   Assert (!this->empty(), typename FullMatrix<number2>::ExcEmptyMatrix());
@@ -149,10 +154,10 @@ Householder<number>::initialize(const FullMatrix<number2> &M)
   Assert (this->n_cols() <= this->n_rows(),
           ExcDimensionMismatch(this->n_cols(), this->n_rows()));
 
-  for (unsigned int j=0 ; j<n ; ++j)
+  for (size_type j=0 ; j<n ; ++j)
     {
       number2 sigma = 0;
-      unsigned int i;
+      size_type i;
       // sigma = ||v||^2
       for (i=j ; i<m ; ++i)
         sigma += this->el(i,j)*this->el(i,j);
@@ -176,7 +181,7 @@ Householder<number>::initialize(const FullMatrix<number2> &M)
 
       // For all subsequent columns do
       // the Householder reflexion
-      for (unsigned int k=j+1 ; k<n ; ++k)
+      for (size_type k=j+1 ; k<n ; ++k)
         {
           number2 sum = diagonal[j]*this->el(j,k);
           for (i=j+1 ; i<m ; ++i)
@@ -208,7 +213,7 @@ Householder<number>::least_squares (Vector<number2> &dst,
   AssertDimension(dst.size(), this->n());
   AssertDimension(src.size(), this->m());
 
-  const unsigned int m = this->m(), n = this->n();
+  const size_type m = this->m(), n = this->n();
 
   GrowingVectorMemory<Vector<number2> > mem;
   Vector<number2> *aux = mem.alloc();
@@ -218,20 +223,20 @@ Householder<number>::least_squares (Vector<number2> &dst,
 
   // Multiply Q_n ... Q_2 Q_1 src
   // Where Q_i = I-v_i v_i^T
-  for (unsigned int j=0; j<n; ++j)
+  for (size_type j=0; j<n; ++j)
     {
       // sum = v_i^T dst
       number2 sum = diagonal[j]* (*aux)(j);
-      for (unsigned int i=j+1 ; i<m ; ++i)
+      for (size_type i=j+1 ; i<m ; ++i)
         sum += this->el(i,j)*(*aux)(i);
       // dst -= v * sum
       (*aux)(j) -= sum*diagonal[j];
-      for (unsigned int i=j+1 ; i<m ; ++i)
+      for (size_type i=j+1 ; i<m ; ++i)
         (*aux)(i) -= sum*this->el(i,j);
     }
   // Compute norm of residual
   number2 sum = 0.;
-  for (unsigned int i=n ; i<m ; ++i)
+  for (size_type i=n ; i<m ; ++i)
     sum += (*aux)(i) * (*aux)(i);
   Assert(numbers::is_finite(sum), ExcNumberNotFinite());
 
@@ -253,7 +258,7 @@ Householder<number>::least_squares (BlockVector<number2> &dst,
   AssertDimension(dst.size(), this->n());
   AssertDimension(src.size(), this->m());
 
-  const unsigned int m = this->m(), n = this->n();
+  const size_type m = this->m(), n = this->n();
 
   GrowingVectorMemory<BlockVector<number2> > mem;
   BlockVector<number2> *aux = mem.alloc();
@@ -263,20 +268,20 @@ Householder<number>::least_squares (BlockVector<number2> &dst,
 
   // Multiply Q_n ... Q_2 Q_1 src
   // Where Q_i = I-v_i v_i^T
-  for (unsigned int j=0; j<n; ++j)
+  for (size_type j=0; j<n; ++j)
     {
       // sum = v_i^T dst
       number2 sum = diagonal[j]* (*aux)(j);
-      for (unsigned int i=j+1 ; i<m ; ++i)
+      for (size_type i=j+1 ; i<m ; ++i)
         sum += this->el(i,j)*(*aux)(i);
       // dst -= v * sum
       (*aux)(j) -= sum*diagonal[j];
-      for (unsigned int i=j+1 ; i<m ; ++i)
+      for (size_type i=j+1 ; i<m ; ++i)
         (*aux)(i) -= sum*this->el(i,j);
     }
   // Compute norm of residual
   number2 sum = 0.;
-  for (unsigned int i=n ; i<m ; ++i)
+  for (size_type i=n ; i<m ; ++i)
     sum += (*aux)(i) * (*aux)(i);
   Assert(numbers::is_finite(sum), ExcNumberNotFinite());
 
index a29e08c486c9b4cf9476e989e596c41eaf8a5e9e..718f0846839cf3cd6d232f5402e8dd683b3ca5d3 100644 (file)
@@ -69,6 +69,11 @@ DEAL_II_NAMESPACE_OPEN
 class IdentityMatrix
 {
 public:
+  /**
+   * Declate type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor. Creates a
    * zero-sized matrix that should
@@ -81,13 +86,13 @@ public:
    * Constructor. Creates a
    * identity matrix of size #n.
    */
-  IdentityMatrix (const unsigned int n);
+  IdentityMatrix (const size_type n);
 
   /**
    * Resize the matrix to be of
    * size #n by #n.
    */
-  void reinit (const unsigned int n);
+  void reinit (const size_type n);
 
   /**
    * Number of rows of this
@@ -95,7 +100,7 @@ public:
    * matrix, the number of rows and
    * columns are equal, of course.
    */
-  unsigned int m () const;
+  size_type m () const;
 
   /**
    * Number of columns of this
@@ -103,7 +108,7 @@ public:
    * matrix, the number of rows and
    * columns are equal, of course.
    */
-  unsigned int n () const;
+  size_type n () const;
 
   /**
    * Matrix-vector
@@ -160,7 +165,7 @@ private:
    * Number of rows and columns of
    * this matrix.
    */
-  unsigned int size;
+  size_type size;
 };
 
 
@@ -179,7 +184,7 @@ IdentityMatrix::IdentityMatrix ()
 
 
 inline
-IdentityMatrix::IdentityMatrix (const unsigned int n)
+IdentityMatrix::IdentityMatrix (const size_type n)
   :
   size (n)
 {}
@@ -188,7 +193,7 @@ IdentityMatrix::IdentityMatrix (const unsigned int n)
 
 inline
 void
-IdentityMatrix::reinit (const unsigned int n)
+IdentityMatrix::reinit (const size_type n)
 {
   size = n;
 }
@@ -196,7 +201,7 @@ IdentityMatrix::reinit (const unsigned int n)
 
 
 inline
-unsigned int
+IdentityMatrix::size_type 
 IdentityMatrix::m () const
 {
   return size;
@@ -205,7 +210,7 @@ IdentityMatrix::m () const
 
 
 inline
-unsigned int
+IdentityMatrix::size_type 
 IdentityMatrix::n () const
 {
   return size;
index fa0598bfb46662df0f35f4e3ca31528df1ac0eeb..0ab8270c0fc4eb4ea731aea32e6968f97f8c5554 100644 (file)
@@ -49,6 +49,11 @@ template <typename number>
 class LAPACKFullMatrix : public TransposeTable<number>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor. Initialize the
    * matrix as a square matrix with
@@ -63,15 +68,15 @@ public:
    * By default, no memory is
    * allocated.
    */
-  explicit LAPACKFullMatrix (const unsigned int n = 0);
+  explicit LAPACKFullMatrix (const size_type n = 0);
 
   /**
    * Constructor. Initialize the
    * matrix as a rectangular
    * matrix.
    */
-  LAPACKFullMatrix (const unsigned int rows,
-                    const unsigned int cols);
+  LAPACKFullMatrix (const size_type rows,
+                    const size_type cols);
 
   /**
    * Copy constructor. This
@@ -158,10 +163,10 @@ public:
    */
   template<class MATRIX>
   void fill (const MATRIX &src,
-             const unsigned int dst_offset_i = 0,
-             const unsigned int dst_offset_j = 0,
-             const unsigned int src_offset_i = 0,
-             const unsigned int src_offset_j = 0,
+             const size_type dst_offset_i = 0,
+             const size_type dst_offset_j = 0,
+             const size_type src_offset_i = 0,
+             const size_type src_offset_j = 0,
              const number factor = 1.,
              const bool transpose = false);
 
@@ -526,7 +531,7 @@ public:
    * called.
    */
   std::complex<number>
-  eigenvalue (const unsigned int i) const;
+  eigenvalue (const size_type i) const;
 
   /**
    * Retrieve singular values after
@@ -535,7 +540,7 @@ public:
    * called.
    */
   number
-  singular_value (const unsigned int i) const;
+  singular_value (const size_type i) const;
 
   /**
    * Print the matrix and allow
@@ -709,7 +714,7 @@ LAPACKFullMatrix<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);
@@ -727,26 +732,26 @@ template <class MATRIX>
 inline void
 LAPACKFullMatrix<number>::fill (
   const MATRIX &M,
-  const unsigned int dst_offset_i,
-  const unsigned int dst_offset_j,
-  const unsigned int src_offset_i,
-  const unsigned int src_offset_j,
+  const size_type dst_offset_i,
+  const size_type dst_offset_j,
+  const size_type src_offset_i,
+  const size_type src_offset_j,
   const number factor,
   const bool transpose)
 {
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class
-  for (unsigned int row = src_offset_i; row < M.m(); ++row)
+  for (size_type row = src_offset_i; row < M.m(); ++row)
     {
       const typename MATRIX::const_iterator end_row = M.end(row);
       for (typename MATRIX::const_iterator entry = M.begin(row);
           entry != end_row; ++entry)
         {
-          const unsigned int i = transpose ? entry->column() : row;
-          const unsigned int j = transpose ? row : entry->column();
+          const size_type i = transpose ? entry->column() : row;
+          const size_type j = transpose ? row : entry->column();
 
-          const unsigned int dst_i=dst_offset_i+i-src_offset_i;
-          const unsigned int dst_j=dst_offset_j+j-src_offset_j;
+          const size_type dst_i=dst_offset_i+i-src_offset_i;
+          const size_type dst_j=dst_offset_j+j-src_offset_j;
           if (dst_i<this->n_rows() && dst_j<this->n_cols())
             (*this)(dst_i, dst_j) = factor * entry->value();
         }
@@ -794,7 +799,7 @@ LAPACKFullMatrix<number>::Tvmult_add(VECTOR &, const VECTOR &) const
 
 template <typename number>
 inline std::complex<number>
-LAPACKFullMatrix<number>::eigenvalue (const unsigned int i) const
+LAPACKFullMatrix<number>::eigenvalue (const size_type i) const
 {
   Assert (state & LAPACKSupport::eigenvalues, ExcInvalidState());
   Assert (wr.size() == this->n_rows(), ExcInternalError());
@@ -807,7 +812,7 @@ LAPACKFullMatrix<number>::eigenvalue (const unsigned int i) const
 
 template <typename number>
 inline number
-LAPACKFullMatrix<number>::singular_value (const unsigned int i) const
+LAPACKFullMatrix<number>::singular_value (const size_type i) const
 {
   Assert (state == LAPACKSupport::svd || state == LAPACKSupport::inverse_svd, LAPACKSupport::ExcState(state));
   AssertIndexRange(i,wr.size());
index eb447518662cc56a09642bf4eb1e3c04e67331f8..b039686734ae23259d5ea113e2450ee1a046b1ed 100644 (file)
@@ -77,7 +77,7 @@ namespace internal
  *
  * BlockMatrixArray matrix (n_blocks, n_blocks);
  *
- * for (unsigned int i=0;i<blocks.size;++i)
+ * for (size_type i=0;i<blocks.size;++i)
  *   matrix.enter(blocks.block(i).row, blocks.block(i).column, blocks.matrix(i));
  * @endcode
  *
@@ -101,6 +101,11 @@ class MatrixBlock
   : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor rendering an
    * uninitialized object.
@@ -118,7 +123,7 @@ public:
    * initializing the matrix.
    */
 
-  MatrixBlock(unsigned int i, unsigned int j);
+  MatrixBlock(size_type i, size_type j);
 
   /**
    * Reinitialize the matrix for a
@@ -143,8 +148,8 @@ public:
    * exist or if it is in a
    * different block.
    */
-  void add (const unsigned int i,
-            const unsigned int j,
+  void add (const size_type i,
+            const size_type j,
             const typename MATRIX::value_type value);
 
   /**
@@ -178,9 +183,9 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const std::vector<unsigned int> &indices,
-            const FullMatrix<number>        &full_matrix,
-            const bool                       elide_zero_values = true);
+  void add (const std::vector<size_type> &indices,
+            const FullMatrix<number>     &full_matrix,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add all elements in a
@@ -212,8 +217,8 @@ public:
    * into the matrix.
    */
   template <typename number>
-  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<number>        &full_matrix,
             const bool                       elide_zero_values = true);
 
@@ -252,10 +257,10 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const unsigned int               row_index,
-            const std::vector<unsigned int> &col_indices,
-            const std::vector<number>       &values,
-            const bool                       elide_zero_values = true);
+  void add (const size_type               row_index,
+            const std::vector<size_type> &col_indices,
+            const std::vector<number>    &values,
+            const bool                    elide_zero_values = true);
 
   /**
    * Add an array of values given by
@@ -275,12 +280,12 @@ public:
    * into the matrix.
    */
   template <typename number>
-  void add (const unsigned int  row,
-            const unsigned int  n_cols,
-            const unsigned int *col_indices,
-            const number       *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 number    *values,
+            const bool       elide_zero_values = true,
+            const bool       col_indices_are_sorted = false);
 
   /**
    * Matrix-vector-multiplication,
@@ -338,7 +343,7 @@ public:
    * the block coordinates stored
    * in this object.
    */
-  DeclException2(ExcBlockIndexMismatch, unsigned int, unsigned int,
+  DeclException2(ExcBlockIndexMismatch, size_type, size_type,
                  << "Block index " << arg1 << " does not match " << arg2);
 
   /**
@@ -346,14 +351,14 @@ public:
    * position of the data member
    * matrix on the global matrix.
    */
-  unsigned int row;
+  size_type row;
   /**
    * Column coordinate.  This is
    * the position of the data
    * member matrix on the global
    * matrix.
    */
-  unsigned int column;
+  size_type column;
 
   /**
    * The matrix itself
@@ -397,6 +402,11 @@ class MatrixBlockVector
   private NamedData<std_cxx1x::shared_ptr<MatrixBlock<MATRIX> > >
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * The type of object stored.
    */
@@ -407,7 +417,7 @@ public:
    * position <tt>(row,column)</tt>
    * in the block system.
    */
-  void add(unsigned int row, unsigned int column, const std::string &name);
+  void add(size_type row, size_type column, const std::string &name);
 
   /**
    * For matrices using a
@@ -446,20 +456,20 @@ public:
    * Access a constant reference to
    * the block at position <i>i</i>.
    */
-  const value_type &block(unsigned int i) const;
+  const value_type &block(size_type i) const;
 
   /**
    * Access a reference to
    * the block at position <i>i</i>.
    */
-  value_type &block(unsigned int i);
+  value_type &block(size_type i);
 
   /**
    * Access the matrix at position
    * <i>i</i> for read and write
    * access.
    */
-  MATRIX &matrix(unsigned int i);
+  MATRIX &matrix(size_type i);
 
   /**
    * import functions from private base class
@@ -485,6 +495,11 @@ class MGMatrixBlockVector
   : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * The type of object stored.
    */
@@ -520,8 +535,7 @@ public:
    * matrix a name for later
    * identification.
    */
-  void add(unsigned int row, unsigned int column,
-           const std::string &name);
+  void add(size_type row, size_type column, const std::string &name);
 
   /**
    * For matrices using a
@@ -582,61 +596,61 @@ public:
    * Access a constant reference to
    * the matrix block at position <i>i</i>.
    */
-  const value_type &block(unsigned int i) const;
+  const value_type &block(size_type i) const;
 
   /**
    * Access a reference to
    * the matrix block at position <i>i</i>.
    */
-  value_type &block(unsigned int i);
+  value_type &block(size_type i);
 
   /**
    * Access a constant reference to
    * the edge matrix block at position <i>i</i>.
    */
-  const value_type &block_in(unsigned int i) const;
+  const value_type &block_in(size_type i) const;
 
   /**
    * Access a reference to
    * the edge matrix block at position <i>i</i>.
    */
-  value_type &block_in(unsigned int i);
+  value_type &block_in(size_type i);
 
   /**
    * Access a constant reference to
    * the edge matrix block at position <i>i</i>.
    */
-  const value_type &block_out(unsigned int i) const;
+  const value_type &block_out(size_type i) const;
 
   /**
    * Access a reference to
    * the edge matrix block at position <i>i</i>.
    */
-  value_type &block_out(unsigned int i);
+  value_type &block_out(size_type i);
 
   /**
    * Access a constant reference to
    * the  edge flux matrix block at position <i>i</i>.
    */
-  const value_type &block_up(unsigned int i) const;
+  const value_type &block_up(size_type i) const;
 
   /**
    * Access a reference to
    * the  edge flux matrix block at position <i>i</i>.
    */
-  value_type &block_up(unsigned int i);
+  value_type &block_up(size_type i);
 
   /**
    * Access a constant reference to
    * the  edge flux matrix block at position <i>i</i>.
    */
-  const value_type &block_down(unsigned int i) const;
+  const value_type &block_down(size_type i) const;
 
   /**
    * Access a reference to
    * the edge flux matrix block at position <i>i</i>.
    */
-  value_type &block_down(unsigned int i);
+  value_type &block_down(size_type i);
 
   /**
    * The memory used by this object.
@@ -713,7 +727,7 @@ MatrixBlock<MATRIX>::MatrixBlock(const MatrixBlock<MATRIX> &M)
 
 template <class MATRIX>
 inline
-MatrixBlock<MATRIX>::MatrixBlock(unsigned int i, unsigned int j)
+MatrixBlock<MATRIX>::MatrixBlock(size_type i, size_type j)
   :
   row(i), column(j)
 {}
@@ -747,16 +761,16 @@ MatrixBlock<MATRIX>::operator const MATRIX &() const
 template <class MATRIX>
 inline void
 MatrixBlock<MATRIX>::add (
-  const unsigned int gi,
-  const unsigned int gj,
+  const size_type gi,
+  const size_type gj,
   const typename MATRIX::value_type value)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
 
-  const std::pair<unsigned int, unsigned int> bi
+  const std::pair<unsigned int, size_type> bi
     = row_indices.global_to_local(gi);
-  const std::pair<unsigned int, unsigned int> bj
+  const std::pair<unsigned int, size_type> bj
     = column_indices.global_to_local(gj);
 
   Assert (bi.first == row, ExcBlockIndexMismatch(bi.first, row));
@@ -770,10 +784,10 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const std::vector<unsigned int>         &r_indices,
-                          const std::vector<unsigned int> &c_indices,
-                          const FullMatrix<number>        &values,
-                          const bool                       elide_zero_values)
+MatrixBlock<MATRIX>::add (const std::vector<size_type> &r_indices,
+                          const std::vector<size_type> &c_indices,
+                          const FullMatrix<number>     &values,
+                          const bool                    elide_zero_values)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
@@ -781,7 +795,7 @@ MatrixBlock<MATRIX>::add (const std::vector<unsigned int>         &r_indices,
   AssertDimension (r_indices.size(), values.m());
   AssertDimension (c_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 (r_indices[i], c_indices.size(), &c_indices[0], &values(i,0),
          elide_zero_values);
 }
@@ -791,17 +805,17 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const unsigned int   b_row,
-                          const unsigned int   n_cols,
-                          const unsigned int *col_indices,
-                          const number        *values,
+MatrixBlock<MATRIX>::add (const size_type  b_row,
+                          const size_type  n_cols,
+                          const size_type *col_indices,
+                          const number    *values,
                           const bool,
                           const bool)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
 
-  const std::pair<unsigned int, unsigned int> bi
+  const std::pair<unsigned int, size_type> bi
     = row_indices.global_to_local(b_row);
 
   // In debug mode, we check whether
@@ -815,9 +829,9 @@ MatrixBlock<MATRIX>::add (const unsigned int   b_row,
 //#ifdef DEBUG
   Assert(bi.first == row, ExcBlockIndexMismatch(bi.first, row));
 
-  for (unsigned int j=0; j<n_cols; ++j)
+  for (size_type j=0; j<n_cols; ++j)
     {
-      const std::pair<unsigned int, unsigned int> bj
+      const std::pair<unsigned int, size_type> bj
         = column_indices.global_to_local(col_indices[j]);
       Assert(bj.first == column, ExcBlockIndexMismatch(bj.first, column));
 
@@ -831,9 +845,9 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const std::vector<unsigned int> &indices,
-                          const FullMatrix<number>        &values,
-                          const bool                       elide_zero_values)
+MatrixBlock<MATRIX>::add (const std::vector<size_type> &indices,
+                          const FullMatrix<number>     &values,
+                          const bool                    elide_zero_values)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
@@ -841,7 +855,7 @@ MatrixBlock<MATRIX>::add (const std::vector<unsigned int> &indices,
   AssertDimension (indices.size(), values.m());
   Assert (values.n() == values.m(), 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);
 }
@@ -852,10 +866,10 @@ template <class MATRIX>
 template <typename number>
 inline
 void
-MatrixBlock<MATRIX>::add (const unsigned int               row,
-                          const std::vector<unsigned int> &col_indices,
-                          const std::vector<number>       &values,
-                          const bool                       elide_zero_values)
+MatrixBlock<MATRIX>::add (const size_type               row,
+                          const std::vector<size_type> &col_indices,
+                          const std::vector<number>    &values,
+                          const bool                    elide_zero_values)
 {
   Assert(row_indices.size() != 0, ExcNotInitialized());
   Assert(column_indices.size() != 0, ExcNotInitialized());
@@ -921,7 +935,7 @@ MatrixBlock<MATRIX>::memory_consumption () const
 template <class MATRIX>
 inline void
 MatrixBlockVector<MATRIX>::add(
-  unsigned int row, unsigned int column,
+  size_type row, size_type column,
   const std::string &name)
 {
   std_cxx1x::shared_ptr<value_type> p(new value_type(row, column));
@@ -933,7 +947,7 @@ template <class MATRIX>
 inline void
 MatrixBlockVector<MATRIX>::reinit(const BlockSparsityPattern &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       block(i).reinit(sparsity);
     }
@@ -950,7 +964,7 @@ MatrixBlockVector<MATRIX>::clear(bool really_clean)
     }
   else
     {
-      for (unsigned int i=0; i<this->size(); ++i)
+      for (size_type i=0; i<this->size(); ++i)
         matrix(i).clear();
     }
 }
@@ -959,7 +973,7 @@ MatrixBlockVector<MATRIX>::clear(bool really_clean)
 
 template <class MATRIX>
 inline const MatrixBlock<MATRIX> &
-MatrixBlockVector<MATRIX>::block(unsigned int i) const
+MatrixBlockVector<MATRIX>::block(size_type i) const
 {
   return *this->read(i);
 }
@@ -967,7 +981,7 @@ MatrixBlockVector<MATRIX>::block(unsigned int i) const
 
 template <class MATRIX>
 inline MatrixBlock<MATRIX> &
-MatrixBlockVector<MATRIX>::block(unsigned int i)
+MatrixBlockVector<MATRIX>::block(size_type i)
 {
   return *(*this)(i);
 }
@@ -975,7 +989,7 @@ MatrixBlockVector<MATRIX>::block(unsigned int i)
 
 template <class MATRIX>
 inline MATRIX &
-MatrixBlockVector<MATRIX>::matrix(unsigned int i)
+MatrixBlockVector<MATRIX>::matrix(size_type i)
 {
   return (*this)(i)->matrix;
 }
@@ -1006,7 +1020,7 @@ MGMatrixBlockVector<MATRIX>::size () const
 template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::add(
-  unsigned int row, unsigned int column,
+  size_type row, size_type column,
   const std::string &name)
 {
   MGLevelObject<MatrixBlock<MATRIX> > p(0, 1);
@@ -1029,7 +1043,7 @@ MGMatrixBlockVector<MATRIX>::add(
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block(size_type i) const
 {
   return matrices.read(i);
 }
@@ -1037,7 +1051,7 @@ MGMatrixBlockVector<MATRIX>::block(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block(size_type i)
 {
   return matrices(i);
 }
@@ -1045,7 +1059,7 @@ MGMatrixBlockVector<MATRIX>::block(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_in(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_in(size_type i) const
 {
   return matrices_in.read(i);
 }
@@ -1053,7 +1067,7 @@ MGMatrixBlockVector<MATRIX>::block_in(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_in(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_in(size_type i)
 {
   return matrices_in(i);
 }
@@ -1061,7 +1075,7 @@ MGMatrixBlockVector<MATRIX>::block_in(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_out(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_out(size_type i) const
 {
   return matrices_out.read(i);
 }
@@ -1069,7 +1083,7 @@ MGMatrixBlockVector<MATRIX>::block_out(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_out(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_out(size_type i)
 {
   return matrices_out(i);
 }
@@ -1077,7 +1091,7 @@ MGMatrixBlockVector<MATRIX>::block_out(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_up(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_up(size_type i) const
 {
   return flux_matrices_up.read(i);
 }
@@ -1085,7 +1099,7 @@ MGMatrixBlockVector<MATRIX>::block_up(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_up(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_up(size_type i)
 {
   return flux_matrices_up(i);
 }
@@ -1093,7 +1107,7 @@ MGMatrixBlockVector<MATRIX>::block_up(unsigned int i)
 
 template <class MATRIX>
 inline const MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_down(unsigned int i) const
+MGMatrixBlockVector<MATRIX>::block_down(size_type i) const
 {
   return flux_matrices_down.read(i);
 }
@@ -1101,7 +1115,7 @@ MGMatrixBlockVector<MATRIX>::block_down(unsigned int i) const
 
 template <class MATRIX>
 inline MGLevelObject<MatrixBlock<MATRIX> > &
-MGMatrixBlockVector<MATRIX>::block_down(unsigned int i)
+MGMatrixBlockVector<MATRIX>::block_down(size_type i)
 {
   return flux_matrices_down(i);
 }
@@ -1111,14 +1125,14 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::reinit_matrix(const MGLevelObject<BlockSparsityPattern> &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
-      const unsigned int row = o[o.min_level()].row;
-      const unsigned int col = o[o.min_level()].column;
+      const size_type row = o[o.min_level()].row;
+      const size_type col = o[o.min_level()].column;
 
       o.resize(sparsity.min_level(), sparsity.max_level());
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         {
           o[level].row = row;
           o[level].column = col;
@@ -1132,15 +1146,15 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::reinit_edge(const MGLevelObject<BlockSparsityPattern> &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
-      const unsigned int row = o[o.min_level()].row;
-      const unsigned int col = o[o.min_level()].column;
+      const size_type row = o[o.min_level()].row;
+      const size_type col = o[o.min_level()].column;
 
       block_in(i).resize(sparsity.min_level(), sparsity.max_level());
       block_out(i).resize(sparsity.min_level(), sparsity.max_level());
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         {
           block_in(i)[level].row = row;
           block_in(i)[level].column = col;
@@ -1157,15 +1171,15 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::reinit_edge_flux(const MGLevelObject<BlockSparsityPattern> &sparsity)
 {
-  for (unsigned int i=0; i<this->size(); ++i)
+  for (size_type i=0; i<this->size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = block(i);
-      const unsigned int row = o[o.min_level()].row;
-      const unsigned int col = o[o.min_level()].column;
+      const size_type row = o[o.min_level()].row;
+      const size_type col = o[o.min_level()].column;
 
       block_up(i).resize(sparsity.min_level(), sparsity.max_level());
       block_down(i).resize(sparsity.min_level(), sparsity.max_level());
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         {
           block_up(i)[level].row = row;
           block_up(i)[level].column = col;
@@ -1183,10 +1197,10 @@ template <class MATRIX>
 inline void
 MGMatrixBlockVector<MATRIX>::clear_object(NamedData<MGLevelObject<MatrixBlock<MATRIX> > > &mo)
 {
-  for (unsigned int i=0; i<mo.size(); ++i)
+  for (size_type i=0; i<mo.size(); ++i)
     {
       MGLevelObject<MatrixBlock<MATRIX> > &o = mo(i);
-      for (unsigned int level = o.min_level(); level <= o.max_level(); ++level)
+      for (size_type level = o.min_level(); level <= o.max_level(); ++level)
         o[level].matrix.clear();
     }
 }
index 03e67432cdafbb29be2d66f29b7df155db15c864..6b56b79580afe2c80a0d15d3ee27edddeb7cdb6c 100644 (file)
@@ -33,6 +33,11 @@ template <class ACCESSOR>
 class MatrixIterator
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Typedef for the matrix type
    * (including constness) we are to
@@ -47,9 +52,9 @@ public:
    * <tt>row</tt> and the
    * <tt>index</tt> within it.
    */
-  MatrixIterator (MatrixType        *matrix,
-                  const unsigned int row = 0,
-                  const unsigned int index = 0);
+  MatrixIterator (MatrixType      *matrix,
+                  const size_type  row = 0,
+                  const size_type  index = 0);
 
   /**
    * Copy from another matrix
@@ -136,9 +141,9 @@ private:
 template <class ACCESSOR>
 inline
 MatrixIterator<ACCESSOR>::
-MatrixIterator (MatrixType        *matrix,
-                const unsigned int r,
-                const unsigned int i)
+MatrixIterator (MatrixType      *matrix,
+                const size_type  r,
+                const size_type  i)
   :
   accessor(matrix, r, i)
 {}
index 06b1df2e1a03f4562f8f6335cf5bb1e36c4e78df..2a430b31b7bb3baec3a7c0d2c5f4b9c70f3c764c 100644 (file)
@@ -326,11 +326,16 @@ private:
 class MeanValueFilter : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Constructor, optionally
    * selecting a component.
    */
-  MeanValueFilter(unsigned int component = numbers::invalid_unsigned_int);
+  MeanValueFilter(size_type component = numbers::invalid_size_type);
 
   /**
    * Subtract mean value from @p v.
@@ -395,7 +400,7 @@ private:
   /**
    * Component for filtering block vectors.
    */
-  unsigned int component;
+  size_type component;
 };
 
 
index 63fd1d83c826a3d30a35404ea72c4408b17f8368..71c37a67c19f126e29dc238586acd78b98bbaacb 100644 (file)
@@ -24,7 +24,7 @@ MeanValueFilter::filter(Vector<number> &v) const
 {
   number mean = v.mean_value();
 
-  for (unsigned int i=0; i<v.size(); ++i)
+  for (size_type i=0; i<v.size(); ++i)
     v(i) -= mean;
 }
 
@@ -40,7 +40,7 @@ MeanValueFilter::vmult(Vector<number> &dst,
 
   number mean = src.mean_value();
 
-  for (unsigned int i=0; i<dst.size(); ++i)
+  for (size_type i=0; i<dst.size(); ++i)
     dst(i) = src(i) - mean;
 }
 
@@ -56,7 +56,7 @@ MeanValueFilter::vmult_add(Vector<number> &dst,
 
   number mean = src.mean_value();
 
-  for (unsigned int i=0; i<dst.size(); ++i)
+  for (size_type i=0; i<dst.size(); ++i)
     dst(i) += src(i) - mean;
 }
 
index 7284f9b0f1b46bff19a2ad639b43985938eb1c5d..392b16c3be6475a7b071f936a052edafe8394808 100644 (file)
@@ -88,6 +88,11 @@ DEAL_II_NAMESPACE_OPEN
 class MatrixOut : public DataOutInterface<2,2>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Class holding various
    * variables which are used to
@@ -124,7 +129,7 @@ public:
      *
      * Default value is one.
      */
-    unsigned int block_size;
+    size_type block_size;
 
     /**
      * If true, plot
@@ -139,9 +144,9 @@ public:
      * structure to their default
      * values.
      */
-    Options (const bool         show_absolute_values = false,
-             const unsigned int block_size           = 1,
-             const bool         discontinuous        = false);
+    Options (const bool      show_absolute_values = false,
+             const size_type block_size           = 1,
+             const bool      discontinuous        = false);
   };
 
   /**
@@ -250,8 +255,8 @@ private:
    */
   template <typename number>
   static double get_element (const SparseMatrix<number> &matrix,
-                             const unsigned int          i,
-                             const unsigned int          j);
+                             const size_type             i,
+                             const size_type             j);
 
   /**
    * Return the element with given
@@ -260,8 +265,8 @@ private:
    */
   template <typename number>
   static double get_element (const BlockSparseMatrix<number> &matrix,
-                             const unsigned int               i,
-                             const unsigned int               j);
+                             const size_type                  i,
+                             const size_type                  j);
 
   /**
    * Return the element with given
@@ -273,8 +278,8 @@ private:
    */
   template <class Matrix>
   static double get_element (const Matrix       &matrix,
-                             const unsigned int  i,
-                             const unsigned int  j);
+                             const size_type     i,
+                             const size_type     j);
 
   /**
    * Get the value of the matrix at
@@ -291,8 +296,8 @@ private:
    */
   template <class Matrix>
   static double get_gridpoint_value (const Matrix       &matrix,
-                                     const unsigned int  i,
-                                     const unsigned int  j,
+                                     const size_type     i,
+                                     const size_type     j,
                                      const Options      &options);
 };
 
@@ -304,8 +309,8 @@ template <typename number>
 inline
 double
 MatrixOut::get_element (const SparseMatrix<number> &matrix,
-                        const unsigned int          i,
-                        const unsigned int          j)
+                        const size_type             i,
+                        const size_type             j)
 {
   return matrix.el(i,j);
 }
@@ -317,8 +322,8 @@ template <typename number>
 inline
 double
 MatrixOut::get_element (const BlockSparseMatrix<number> &matrix,
-                        const unsigned int               i,
-                        const unsigned int               j)
+                        const size_type                  i,
+                        const size_type                  j)
 {
   return matrix.el(i,j);
 }
@@ -329,9 +334,9 @@ MatrixOut::get_element (const BlockSparseMatrix<number> &matrix,
 template <class Matrix>
 inline
 double
-MatrixOut::get_element (const Matrix       &matrix,
-                        const unsigned int  i,
-                        const unsigned int  j)
+MatrixOut::get_element (const Matrix   &matrix,
+                        const size_type i,
+                        const size_type j)
 {
   return matrix(i,j);
 }
@@ -341,10 +346,10 @@ MatrixOut::get_element (const Matrix       &matrix,
 template <class Matrix>
 inline
 double
-MatrixOut::get_gridpoint_value (const Matrix       &matrix,
-                                const unsigned int  i,
-                                const unsigned int  j,
-                                const Options      &options)
+MatrixOut::get_gridpoint_value (const Matrix   &matrix,
+                                const size_type i,
+                                const size_type j,
+                                const Options  &options)
 {
   // special case if block size is
   // one since we then don't need all
@@ -360,10 +365,10 @@ MatrixOut::get_gridpoint_value (const Matrix       &matrix,
   // if blocksize greater than one,
   // then compute average of elements
   double average = 0;
-  unsigned int n_elements = 0;
-  for (unsigned int row=i*options.block_size;
+  size_type n_elements = 0;
+  for (size_type row=i*options.block_size;
        row < std::min(matrix.m(), (i+1)*options.block_size); ++row)
-    for (unsigned int col=j*options.block_size;
+    for (size_type col=j*options.block_size;
          col < std::min(matrix.m(), (j+1)*options.block_size); ++col, ++n_elements)
       if (options.show_absolute_values == true)
         average += std::fabs(get_element (matrix, row, col));
@@ -381,7 +386,7 @@ MatrixOut::build_patches (const Matrix      &matrix,
                           const std::string &name,
                           const Options      options)
 {
-  unsigned int
+  size_type 
   gridpoints_x = (matrix.n() / options.block_size
                   +
                   (matrix.n() % options.block_size != 0 ? 1 : 0)),
@@ -403,9 +408,9 @@ MatrixOut::build_patches (const Matrix      &matrix,
   patches.resize ((gridpoints_x) * (gridpoints_y));
 
   // now build the patches
-  unsigned int index=0;
-  for (unsigned int i=0; i<gridpoints_y; ++i)
-    for (unsigned int j=0; j<gridpoints_x; ++j, ++index)
+  size_type index=0;
+  for (size_type i=0; i<gridpoints_y; ++i)
+    for (size_type j=0; j<gridpoints_x; ++j, ++index)
       {
         // within each patch, order
         // the points in such a way
index 35d21d195116caa4540853b51455cf01d8d63382..e6d17d6890cb59131c281f2ccae79b1ce8ec3ee0 100644 (file)
@@ -166,8 +166,8 @@ namespace PETScWrappers
      * user call whatever function
      * she desires.
      */
-    void reinit (const unsigned int n_block_rows,
-                 const unsigned int n_block_columns);
+    void reinit (const size_type n_block_rows,
+                 const size_type n_block_columns);
 
     /**
      * This function collects the
@@ -302,8 +302,8 @@ namespace PETScWrappers
   {
     Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         this->block(r,c) = d;
 
     return *this;
index 07ea7dd923e8d08c5939a4470c759dc54e911384..0e50ffc97c3077298af07ca475abfdc4a7ec6200 100644 (file)
@@ -91,7 +91,7 @@ namespace PETScWrappers
      *  sizes.
      */
     explicit BlockVector (const unsigned int num_blocks = 0,
-                          const unsigned int block_size = 0);
+                          const size_type    block_size = 0);
 
     /**
      * Copy-Constructor. Dimension set to
@@ -192,7 +192,7 @@ namespace PETScWrappers
      * is filled with zeros.
      */
     void reinit (const unsigned int num_blocks,
-                 const unsigned int block_size,
+                 const size_type    block_size,
                  const bool fast = false);
 
     /**
@@ -227,8 +227,8 @@ namespace PETScWrappers
      * since they may be routed to
      * the wrong block.
      */
-    void reinit (const std::vector<unsigned int> &N,
-                 const bool                       fast=false);
+    void reinit (const std::vector<size_type> &N,
+                 const bool                   fast=false);
 
     /**
      * Change the dimension to that
@@ -317,7 +317,7 @@ namespace PETScWrappers
 
   inline
   BlockVector::BlockVector (const unsigned int n_blocks,
-                            const unsigned int block_size)
+                            const size_type    block_size)
   {
     reinit (n_blocks, block_size);
   }
@@ -325,7 +325,7 @@ namespace PETScWrappers
 
 
   inline
-  BlockVector::BlockVector (const std::vector<unsigned int> &n)
+  BlockVector::BlockVector (const std::vector<size_type> &n)
   {
     reinit (n, false);
   }
@@ -360,9 +360,9 @@ namespace PETScWrappers
 
 
   template <typename InputIterator>
-  BlockVector::BlockVector (const std::vector<unsigned int> &n,
-                            const InputIterator              first,
-                            const InputIterator              end)
+  BlockVector::BlockVector (const std::vector<size_type> &n,
+                            const InputIterator           first,
+                            const InputIterator           end)
   {
     // first set sizes of blocks, but
     // don't initialize them as we will
@@ -374,7 +374,7 @@ namespace PETScWrappers
         InputIterator end = start;
         std::advance (end, static_cast<signed int>(n[b]));
 
-        for (unsigned int i=0; i<n[b]; ++i, ++start)
+        for (size_type i=0; i<n[b]; ++i, ++start)
           this->block(b)(i) = *start;
       }
     Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize());
@@ -420,10 +420,10 @@ namespace PETScWrappers
   inline
   void
   BlockVector::reinit (const unsigned int n_bl,
-                       const unsigned int bl_sz,
+                       const size_type    bl_sz,
                        const bool         fast)
   {
-    std::vector<unsigned int> n(n_bl, bl_sz);
+    std::vector<size_type> n(n_bl, bl_sz);
     reinit(n, fast);
   }
 
@@ -431,8 +431,8 @@ namespace PETScWrappers
 
   inline
   void
-  BlockVector::reinit (const std::vector<unsigned int> &n,
-                       const bool                       fast)
+  BlockVector::reinit (const std::vector<size_type> &n,
+                       const bool                    fast)
   {
     block_indices.reinit (n);
     if (this->components.size() != this->n_blocks())
index b9575a75dc363bd0bbd01084d5cfb1fdae2c8233..e15a5c20c65d520f621411c27dd796e3a2fcd7f3 100644 (file)
@@ -45,12 +45,17 @@ namespace PETScWrappers
   class FullMatrix : public MatrixBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Create a full matrix of dimensions
      * @p m times @p n.
      */
-    FullMatrix (const unsigned int m,
-                const unsigned int n);
+    FullMatrix (const size_type m,
+                const size_type n);
 
     /**
      * Return a reference to the MPI
index a8f137b8460dc5be4f8dbdf8c7f16a59b1f7c7cf..2b08f13812708d103a37b6244342f5bf9f39a40e 100644 (file)
@@ -70,30 +70,30 @@ namespace PETScWrappers
          * access, a const matrix
          * pointer is sufficient.
          */
-        Accessor (const MatrixBase    *matrix,
-                  const unsigned int   row,
-                  const unsigned int   index);
+        Accessor (const MatrixBase *matrix,
+                  const size_type   row,
+                  const size_type   index);
 
         /**
          * Row number of the element
          * represented by this
          * object.
          */
-        unsigned int row() const;
+        size_type row() const;
 
         /**
          * Index in row of the element
          * represented by this
          * object.
          */
-        unsigned int index() const;
+        size_type index() const;
 
         /**
          * Column number of the
          * element represented by
          * this object.
          */
-        unsigned int column() const;
+        size_type column() const;
 
         /**
          * Value of this matrix entry.
@@ -123,12 +123,12 @@ namespace PETScWrappers
         /**
          * Current row number.
          */
-        unsigned int a_row;
+        size_type a_row;
 
         /**
          * Current index in row.
          */
-        unsigned int a_index;
+        size_type a_index;
 
         /**
          * Cache where we store the
@@ -154,7 +154,7 @@ namespace PETScWrappers
          * accessor can access this data
          * if necessary.
          */
-        std_cxx1x::shared_ptr<const std::vector<unsigned int> > colnum_cache;
+        std_cxx1x::shared_ptr<const std::vector<size_type> > colnum_cache;
 
         /**
          * Similar cache for the values
@@ -179,15 +179,19 @@ namespace PETScWrappers
       };
 
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
 
       /**
        * Constructor. Create an iterator
        * into the matrix @p matrix for the
        * given row and the index within it.
        */
-      const_iterator (const MatrixBase   *matrix,
-                      const unsigned int  row,
-                      const unsigned int  index);
+      const_iterator (const MatrixBase *matrix,
+                      const size_type   row,
+                      const size_type   index);
 
       /**
        * Prefix increment.
@@ -350,8 +354,8 @@ namespace PETScWrappers
      * If <tt>value</tt> is not a 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 PetscScalar value);
 
     /**
@@ -389,9 +393,9 @@ namespace PETScWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const std::vector<unsigned int> &indices,
-              const FullMatrix<PetscScalar>   &full_matrix,
-              const bool                       elide_zero_values = false);
+    void set (const std::vector<size_type>  &indices,
+              const FullMatrix<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = false);
 
     /**
      * Same function as before, but now
@@ -400,10 +404,10 @@ namespace PETScWrappers
      * different local-to-global indexing
      * on rows and columns, respectively.
      */
-    void set (const std::vector<unsigned int> &row_indices,
-              const std::vector<unsigned int> &col_indices,
-              const FullMatrix<PetscScalar>   &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<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = false);
 
     /**
      * Set several elements in the
@@ -431,10 +435,10 @@ namespace PETScWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const unsigned int               row,
-              const std::vector<unsigned int> &col_indices,
+    void set (const size_type                 row,
+              const std::vector<size_type >  &col_indices,
               const std::vector<PetscScalar> &values,
-              const bool                       elide_zero_values = false);
+              const bool                      elide_zero_values = false);
 
     /**
      * Set several elements to values
@@ -462,11 +466,11 @@ namespace PETScWrappers
      * <tt>false</tt>, i.e., even zero
      * values are inserted/replaced.
      */
-    void set (const unsigned int  row,
-              const unsigned int  n_cols,
-              const unsigned int *col_indices,
+    void set (const size_type    row,
+              const size_type    n_cols,
+              const size_type   *col_indices,
               const PetscScalar *values,
-              const bool          elide_zero_values = false);
+              const bool         elide_zero_values = false);
 
     /**
      * Add @p value to the element
@@ -483,8 +487,8 @@ namespace PETScWrappers
      * If <tt>value</tt> is not a 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 PetscScalar value);
 
     /**
@@ -524,9 +528,9 @@ namespace PETScWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const std::vector<unsigned int> &indices,
-              const FullMatrix<PetscScalar>   &full_matrix,
-              const bool                       elide_zero_values = true);
+    void add (const std::vector<size_type>  &indices,
+              const FullMatrix<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = true);
 
     /**
      * Same function as before, but now
@@ -535,10 +539,10 @@ namespace PETScWrappers
      * different local-to-global indexing
      * on rows and columns, respectively.
      */
-    void add (const std::vector<unsigned int> &row_indices,
-              const std::vector<unsigned int> &col_indices,
-              const FullMatrix<PetscScalar>   &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<PetscScalar> &full_matrix,
+              const bool                     elide_zero_values = true);
 
     /**
      * Set several elements in the
@@ -567,10 +571,10 @@ namespace PETScWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const unsigned int               row,
-              const std::vector<unsigned int> &col_indices,
+    void add (const size_type                 row,
+              const std::vector<size_type>   &col_indices,
               const std::vector<PetscScalar> &values,
-              const bool                       elide_zero_values = true);
+              const bool                      elide_zero_values = true);
 
     /**
      * Add an array of values given by
@@ -599,12 +603,12 @@ namespace PETScWrappers
      * i.e., zero values won't be added
      * into the matrix.
      */
-    void add (const unsigned int  row,
-              const unsigned int  n_cols,
-              const unsigned int *col_indices,
+    void add (const size_type    row,
+              const size_type    n_cols,
+              const size_type   *col_indices,
               const PetscScalar *values,
-              const bool          elide_zero_values = true,
-              const bool          col_indices_are_sorted = false);
+              const bool         elide_zero_values = true,
+              const bool         col_indices_are_sorted = false);
 
     /**
      * Remove all elements from
@@ -636,8 +640,8 @@ namespace PETScWrappers
      * to a value different from zero. The
      * default is to set it to zero.
      */
-    void clear_row (const unsigned int row,
-                    const PetscScalar  new_diag_value = 0);
+    void clear_row (const size_type   row,
+                    const PetscScalar new_diag_value = 0);
 
     /**
      * Same as clear_row(), except that it
@@ -652,8 +656,8 @@ namespace PETScWrappers
      * the diagonal entries, you have to
      * set them by hand.
      */
-    void clear_rows (const std::vector<unsigned int> &rows,
-                     const PetscScalar                new_diag_value = 0);
+    void clear_rows (const std::vector<size_type> &rows,
+                     const PetscScalar             new_diag_value = 0);
 
     /**
      * PETSc matrices store their own
@@ -690,8 +694,8 @@ namespace PETScWrappers
      * This function is therefore exactly
      * equivalent to the <tt>el()</tt> function.
      */
-    PetscScalar operator () (const unsigned int i,
-                             const unsigned int j) const;
+    PetscScalar operator () (const size_type i,
+                             const size_type j) const;
 
     /**
      * Return the value of the matrix entry
@@ -704,8 +708,8 @@ namespace PETScWrappers
      * solution, since the sparsity of the
      * matrix is not used.
      */
-    PetscScalar el (const unsigned int i,
-                    const unsigned int j) const;
+    PetscScalar el (const size_type i,
+                    const size_type j) const;
 
     /**
      * Return the main diagonal
@@ -722,19 +726,19 @@ namespace PETScWrappers
      * function for compatibility with the
      * SparseMatrix class.
      */
-    PetscScalar diag_element (const unsigned int i) const;
+    PetscScalar diag_element (const size_type i) const;
 
     /**
      * Return the number of rows in this
      * matrix.
      */
-    unsigned int m () const;
+    size_type m () const;
 
     /**
      * Return the number of columns in this
      * matrix.
      */
-    unsigned int n () const;
+    size_type n () const;
 
     /**
      * Return the local dimension of the
@@ -749,7 +753,7 @@ namespace PETScWrappers
      * exactly are stored locally,
      * use local_range().
      */
-    unsigned int local_size () const;
+    size_type local_size () const;
 
     /**
      * Return a pair of indices
@@ -767,7 +771,7 @@ namespace PETScWrappers
      * a pair (i,i+n), where
      * <tt>n=local_size()</tt>.
      */
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range () const;
 
     /**
@@ -775,7 +779,7 @@ namespace PETScWrappers
      * in the local range or not,
      * see also local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return a reference to the MPI
@@ -794,12 +798,12 @@ namespace PETScWrappers
      * the entries should happen to
      * be zero, it is counted anyway.
      */
-    unsigned int n_nonzero_elements () const;
+    size_type n_nonzero_elements () 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;
 
     /**
      * Return the l1-norm of the matrix, that is
@@ -1072,7 +1076,7 @@ namespace PETScWrappers
      * iterator may not be dereferencable in
      * that case.
      */
-    const_iterator begin (const unsigned int r) const;
+    const_iterator begin (const size_type r) const;
 
     /**
      * Final iterator of row <tt>r</tt>. It
@@ -1085,7 +1089,7 @@ namespace PETScWrappers
      * 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;
 
     /**
      * Conversion operator to gain access
@@ -1308,9 +1312,9 @@ namespace PETScWrappers
 
     inline
     const_iterator::Accessor::
-    Accessor (const MatrixBase   *matrix,
-              const unsigned int  row,
-              const unsigned int  index)
+    Accessor (const MatrixBase *matrix,
+              const size_type   row,
+              const size_type   index)
       :
       matrix(const_cast<MatrixBase *>(matrix)),
       a_row(row),
@@ -1321,7 +1325,7 @@ namespace PETScWrappers
 
 
     inline
-    unsigned int
+    size_type 
     const_iterator::Accessor::row() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -1330,7 +1334,7 @@ namespace PETScWrappers
 
 
     inline
-    unsigned int
+    size_type 
     const_iterator::Accessor::column() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -1339,7 +1343,7 @@ namespace PETScWrappers
 
 
     inline
-    unsigned int
+    size_type 
     const_iterator::Accessor::index() const
     {
       Assert (a_row < matrix->m(), ExcBeyondEndOfMatrix());
@@ -1358,9 +1362,9 @@ namespace PETScWrappers
 
     inline
     const_iterator::
-    const_iterator(const MatrixBase   *matrix,
-                   const unsigned int  row,
-                   const unsigned int  index)
+    const_iterator(const MatrixBase *matrix,
+                   const size_type   row,
+                   const size_type   index)
       :
       accessor(matrix, row, index)
     {}
@@ -1462,9 +1466,9 @@ namespace PETScWrappers
   // compile time.
   inline
   void
-  MatrixBase::set (const unsigned int i,
-                   const unsigned int j,
-                   const PetscScalar  value)
+  MatrixBase::set (const size_type   i,
+                   const size_type   j,
+                   const PetscScalar value)
   {
     Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
@@ -1475,15 +1479,15 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const std::vector<unsigned int> &indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::set (const std::vector<size_type>  &indices,
+                   const FullMatrix<PetscScalar> &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);
   }
@@ -1492,17 +1496,17 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const std::vector<unsigned int> &row_indices,
-                   const std::vector<unsigned int> &col_indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::set (const std::vector<size_type>  &row_indices,
+                   const std::vector<size_type>  &col_indices,
+                   const FullMatrix<PetscScalar> &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);
   }
@@ -1511,10 +1515,10 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const unsigned int               row,
-                   const std::vector<unsigned int> &col_indices,
+  MatrixBase::set (const size_type                 row,
+                   const std::vector<size_type>   &col_indices,
                    const std::vector<PetscScalar> &values,
-                   const bool                       elide_zero_values)
+                   const bool                      elide_zero_values)
   {
     Assert (col_indices.size() == values.size(),
             ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1527,11 +1531,11 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::set (const unsigned int  row,
-                   const unsigned int  n_cols,
-                   const unsigned int *col_indices,
+  MatrixBase::set (const size_type    row,
+                   const size_type    n_cols,
+                   const size_type   *col_indices,
                    const PetscScalar *values,
-                   const bool          elide_zero_values)
+                   const bool         elide_zero_values)
   {
     prepare_action(LastAction::insert);
 
@@ -1566,7 +1570,7 @@ namespace PETScWrappers
           }
 
         n_columns = 0;
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           {
             const PetscScalar value = values[j];
             Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -1593,9 +1597,9 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const unsigned int i,
-                   const unsigned int j,
-                   const PetscScalar  value)
+  MatrixBase::add (const size_type   i,
+                   const size_type   j,
+                   const PetscScalar value)
   {
 
     Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -1624,15 +1628,15 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const std::vector<unsigned int> &indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::add (const std::vector<size_type>  &indices,
+                   const FullMatrix<PetscScalar> &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);
   }
@@ -1641,17 +1645,17 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const std::vector<unsigned int> &row_indices,
-                   const std::vector<unsigned int> &col_indices,
-                   const FullMatrix<PetscScalar>   &values,
-                   const bool                       elide_zero_values)
+  MatrixBase::add (const std::vector<size_type>  &row_indices,
+                   const std::vector<size_type>  &col_indices,
+                   const FullMatrix<PetscScalar> &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);
   }
@@ -1660,10 +1664,10 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const unsigned int               row,
-                   const std::vector<unsigned int> &col_indices,
+  MatrixBase::add (const size_type                 row,
+                   const std::vector<size_type>   &col_indices,
                    const std::vector<PetscScalar> &values,
-                   const bool                       elide_zero_values)
+                   const bool                      elide_zero_values)
   {
     Assert (col_indices.size() == values.size(),
             ExcDimensionMismatch(col_indices.size(), values.size()));
@@ -1676,11 +1680,11 @@ namespace PETScWrappers
 
   inline
   void
-  MatrixBase::add (const unsigned int  row,
-                   const unsigned int  n_cols,
-                   const unsigned int *col_indices,
+  MatrixBase::add (const size_type    row,
+                   const size_type    n_cols,
+                   const size_type   *col_indices,
                    const PetscScalar *values,
-                   const bool          elide_zero_values,
+                   const bool         elide_zero_values,
                    const bool          /*col_indices_are_sorted*/)
   {
     prepare_action(LastAction::add);
@@ -1716,7 +1720,7 @@ namespace PETScWrappers
           }
 
         n_columns = 0;
-        for (unsigned int j=0; j<n_cols; ++j)
+        for (size_type j=0; j<n_cols; ++j)
           {
             const PetscScalar value = values[j];
             Assert (numbers::is_finite(value), ExcNumberNotFinite());
@@ -1746,8 +1750,8 @@ namespace PETScWrappers
 
   inline
   PetscScalar
-  MatrixBase::operator() (const unsigned int i,
-                          const unsigned int j) const
+  MatrixBase::operator() (const size_type i,
+                          const size_type j) const
   {
     return el(i,j);
   }
@@ -1772,7 +1776,7 @@ namespace PETScWrappers
 
   inline
   MatrixBase::const_iterator
-  MatrixBase::begin(const unsigned int r) const
+  MatrixBase::begin(const size_type r) const
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
     if (row_length(r) > 0)
@@ -1784,14 +1788,14 @@ namespace PETScWrappers
 
   inline
   MatrixBase::const_iterator
-  MatrixBase::end(const unsigned int r) const
+  MatrixBase::end(const size_type r) const
   {
     Assert (r < m(), ExcIndexRange(r, 0, m()));
 
     // place the iterator on the first entry
     // past this line, or at the end of the
     // matrix
-    for (unsigned int i=r+1; i<m(); ++i)
+    for (size_type i=r+1; i<m(); ++i)
       if (row_length(i) > 0)
         return const_iterator(this, i, 0);
 
@@ -1804,7 +1808,7 @@ namespace PETScWrappers
 
   inline
   bool
-  MatrixBase::in_local_range (const unsigned int index) const
+  MatrixBase::in_local_range (const size_type index) const
   {
 #ifdef PETSC_USE_64BIT_INDICES
     PetscInt begin, end;
@@ -1815,8 +1819,8 @@ namespace PETScWrappers
                                            &begin, &end);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-    return ((index >= static_cast<unsigned int>(begin)) &&
-            (index < static_cast<unsigned int>(end)));
+    return ((index >= static_cast<size_type>(begin)) &&
+            (index < static_cast<size_type>(end)));
   }
 
 
index 92bb6151c42e602ad0b6d3bd3ceb6d2a1928e158..4e50f1735e52a01caa77ed09d43b03fa13b2448c 100644 (file)
@@ -62,6 +62,11 @@ namespace PETScWrappers
     class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix>
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
+
       /**
        * Typedef the base class for simpler
        * access to its own typedefs.
@@ -169,8 +174,8 @@ namespace PETScWrappers
        * user call whatever function
        * she desires.
        */
-      void reinit (const unsigned int n_block_rows,
-                   const unsigned int n_block_columns);
+      void reinit (const size_type n_block_rows,
+                   const size_type n_block_columns);
 
       /**
        * Matrix-vector multiplication:
@@ -292,8 +297,8 @@ namespace PETScWrappers
     {
       Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-      for (unsigned int r=0; r<this->n_block_rows(); ++r)
-        for (unsigned int c=0; c<this->n_block_cols(); ++c)
+      for (size_type r=0; r<this->n_block_rows(); ++r)
+        for (size_type c=0; c<this->n_block_cols(); ++c)
           this->block(r,c) = d;
 
       return *this;
index e17ce5b48479965076524ef38b0f71f3a07c84cd..88192e1ae707b51caf77396f6c1a606f0e8145b4 100644 (file)
@@ -99,8 +99,8 @@ namespace PETScWrappers
        */
       explicit BlockVector (const unsigned int  n_blocks,
                             const MPI_Comm     &communicator,
-                            const unsigned int  block_size,
-                            const unsigned int  local_size);
+                            const size_type     block_size,
+                            const size_type     local_size);
 
       /**
        * Copy-Constructor. Set all the
@@ -122,9 +122,9 @@ namespace PETScWrappers
        * <tt>local_elements[i]</tt>
        * elements on the present process.
        */
-      BlockVector (const std::vector<unsigned int> &block_sizes,
-                   const MPI_Comm                  &communicator,
-                   const std::vector<unsigned int> &local_elements);
+      BlockVector (const std::vector<size_type> &block_sizes,
+                   const MPI_Comm               &communicator,
+                   const std::vector<size_type> &local_elements);
 
       /**
        * Destructor. Clears memory
@@ -192,8 +192,8 @@ namespace PETScWrappers
        */
       void reinit (const unsigned int  n_blocks,
                    const MPI_Comm     &communicator,
-                   const unsigned int  block_size,
-                   const unsigned int  local_size,
+                   const size_type     block_size,
+                   const size_type     local_size,
                    const bool fast = false);
 
       /**
@@ -231,10 +231,10 @@ namespace PETScWrappers
        * since they may be routed to
        * the wrong block.
        */
-      void reinit (const std::vector<unsigned int> &block_sizes,
-                   const MPI_Comm                  &communicator,
-                   const std::vector<unsigned int> &local_sizes,
-                   const bool                       fast=false);
+      void reinit (const std::vector<size_type> &block_sizes,
+                   const MPI_Comm               &communicator,
+                   const std::vector<size_type> &local_sizes,
+                   const bool                    fast=false);
 
       /**
        * Change the dimension to that
@@ -334,10 +334,10 @@ namespace PETScWrappers
 
 
     inline
-    BlockVector::BlockVector (const unsigned int  n_blocks,
-                              const MPI_Comm     &communicator,
-                              const unsigned int  block_size,
-                              const unsigned int  local_size)
+    BlockVector::BlockVector (const size_type  n_blocks,
+                              const MPI_Comm  &communicator,
+                              const size_type  block_size,
+                              const size_type  local_size)
     {
       reinit (n_blocks, communicator, block_size, local_size);
     }
@@ -345,9 +345,9 @@ namespace PETScWrappers
 
 
     inline
-    BlockVector::BlockVector (const std::vector<unsigned int> &block_sizes,
+    BlockVector::BlockVector (const std::vector<size_type> &block_sizes,
                               const MPI_Comm     &communicator,
-                              const std::vector<unsigned int> &local_elements)
+                              const std::vector<size_type> &local_elements)
     {
       reinit (block_sizes, communicator, local_elements, false);
     }
@@ -394,15 +394,15 @@ namespace PETScWrappers
 
     inline
     void
-    BlockVector::reinit (const unsigned int  n_blocks,
-                         const MPI_Comm     &communicator,
-                         const unsigned int  block_size,
-                         const unsigned int  local_size,
+    BlockVector::reinit (const size_type  n_blocks,
+                         const MPI_Comm  &communicator,
+                         const size_type  block_size,
+                         const size_type  local_size,
                          const bool fast)
     {
-      reinit(std::vector<unsigned int>(n_blocks, block_size),
+      reinit(std::vector<size_type>(n_blocks, block_size),
              communicator,
-             std::vector<unsigned int>(n_blocks, local_size),
+             std::vector<size_type>(n_blocks, local_size),
              fast);
     }
 
@@ -410,10 +410,10 @@ namespace PETScWrappers
 
     inline
     void
-    BlockVector::reinit (const std::vector<unsigned int> &block_sizes,
-                         const MPI_Comm                  &communicator,
-                         const std::vector<unsigned int> &local_sizes,
-                         const bool                       fast)
+    BlockVector::reinit (const std::vector<size_type> &block_sizes,
+                         const MPI_Comm               &communicator,
+                         const std::vector<size_type> &local_sizes,
+                         const bool                    fast)
     {
       this->block_indices.reinit (block_sizes);
       if (this->components.size() != this->n_blocks())
index d3eb3a5780e37cfb7cab8b9e6a3897ad7c0cc6b3..16f13c96eb9eabbb4c3bea57490bca00bba9a0bf 100644 (file)
@@ -112,6 +112,10 @@ namespace PETScWrappers
     class SparseMatrix : public MatrixBase
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
 
       /**
        * A structure that describes some of
@@ -179,13 +183,13 @@ namespace PETScWrappers
        * ICC. The default value of this flag
        * is @p false.
        */
-      SparseMatrix (const MPI_Comm     &communicator,
-                    const unsigned int  m,
-                    const unsigned int  n,
-                    const unsigned int  local_rows,
-                    const unsigned int  local_columns,
-                    const unsigned int  n_nonzero_per_row,
-                    const bool          is_symmetric = false);
+      SparseMatrix (const MPI_Comm  &communicator,
+                    const size_type  m,
+                    const size_type  n,
+                    const size_type  local_rows,
+                    const size_type  local_columns,
+                    const size_type  n_nonzero_per_row,
+                    const bool       is_symmetric = false);
 
       /**
        * Initialize a rectangular matrix
@@ -220,13 +224,13 @@ namespace PETScWrappers
        * true, only an ICC. The default
        * value of this flag is @p false.
        */
-      SparseMatrix (const MPI_Comm                  &communicator,
-                    const unsigned int               m,
-                    const unsigned int               n,
-                    const unsigned int               local_rows,
-                    const unsigned int               local_columns,
-                    const std::vector<unsigned int> &row_lengths,
-                    const bool                       is_symmetric = false);
+      SparseMatrix (const MPI_Comm               &communicator,
+                    const size_type               m,
+                    const size_type               n,
+                    const size_type               local_rows,
+                    const size_type               local_columns,
+                    const std::vector<size_type> &row_lengths,
+                    const bool                    is_symmetric = false);
 
       /**
        * Initialize using the given
@@ -269,12 +273,12 @@ namespace PETScWrappers
        * the start.
        */
       template <typename SparsityType>
-      SparseMatrix (const MPI_Comm                  &communicator,
-                    const SparsityType              &sparsity_pattern,
-                    const std::vector<unsigned int> &local_rows_per_process,
-                    const std::vector<unsigned int> &local_columns_per_process,
-                    const unsigned int               this_process,
-                    const bool                       preset_nonzero_locations = true);
+      SparseMatrix (const MPI_Comm               &communicator,
+                    const SparsityType           &sparsity_pattern,
+                    const std::vector<size_type> &local_rows_per_process,
+                    const std::vector<size_type> &local_columns_per_process,
+                    const size_type               this_process,
+                    const bool                    preset_nonzero_locations = true);
 
       /**
        * This operator assigns a scalar to
@@ -303,12 +307,12 @@ namespace PETScWrappers
        * present function.
        */
       void reinit (const MPI_Comm     &communicator,
-                   const unsigned int  m,
-                   const unsigned int  n,
-                   const unsigned int  local_rows,
-                   const unsigned int  local_columns,
-                   const unsigned int  n_nonzero_per_row,
-                   const bool          is_symmetric = false);
+                   const size_type m,
+                   const size_type n,
+                   const size_type local_rows,
+                   const size_type local_columns,
+                   const size_type n_nonzero_per_row,
+                   const bool      is_symmetric = false);
 
       /**
        * Throw away the present matrix and
@@ -318,13 +322,13 @@ namespace PETScWrappers
        * the same argument list as the
        * present function.
        */
-      void reinit (const MPI_Comm                  &communicator,
-                   const unsigned int               m,
-                   const unsigned int               n,
-                   const unsigned int               local_rows,
-                   const unsigned int               local_columns,
-                   const std::vector<unsigned int> &row_lengths,
-                   const bool                       is_symmetric = false);
+      void reinit (const MPI_Comm               &communicator,
+                   const size_type               m,
+                   const size_type               n,
+                   const size_type               local_rows,
+                   const size_type               local_columns,
+                   const std::vector<size_type> &row_lengths,
+                   const bool                    is_symmetric = false);
 
       /**
        * Initialize using the given
@@ -361,12 +365,12 @@ namespace PETScWrappers
        * the start.
        */
       template <typename SparsityType>
-      void reinit (const MPI_Comm                  &communicator,
-                   const SparsityType              &sparsity_pattern,
-                   const std::vector<unsigned int> &local_rows_per_process,
-                   const std::vector<unsigned int> &local_columns_per_process,
-                   const unsigned int               this_process,
-                   const bool                       preset_nonzero_locations = true);
+      void reinit (const MPI_Comm               &communicator,
+                   const SparsityType           &sparsity_pattern,
+                   const std::vector<size_type> &local_rows_per_process,
+                   const std::vector<size_type> &local_columns_per_process,
+                   const unsigned int            this_process,
+                   const bool                    preset_nonzero_locations = true);
 
       /**
        * Return a reference to the MPI
@@ -445,32 +449,32 @@ namespace PETScWrappers
        * of the previous matrix is left to
        * the caller.
        */
-      void do_reinit (const unsigned int m,
-                      const unsigned int n,
-                      const unsigned int local_rows,
-                      const unsigned int local_columns,
-                      const unsigned int n_nonzero_per_row,
-                      const bool         is_symmetric = false);
+      void do_reinit (const size_type m,
+                      const size_type n,
+                      const size_type local_rows,
+                      const size_type local_columns,
+                      const size_type n_nonzero_per_row,
+                      const bool      is_symmetric = false);
 
       /**
        * Same as previous function.
        */
-      void do_reinit (const unsigned int               m,
-                      const unsigned int               n,
-                      const unsigned int               local_rows,
-                      const unsigned int               local_columns,
-                      const std::vector<unsigned int> &row_lengths,
-                      const bool                       is_symmetric = false);
+      void do_reinit (const size_type               m,
+                      const size_type               n,
+                      const size_type               local_rows,
+                      const size_type               local_columns,
+                      const std::vector<size_type> &row_lengths,
+                      const bool                    is_symmetric = false);
 
       /**
        * Same as previous functions.
        */
       template <typename SparsityType>
-      void do_reinit (const SparsityType              &sparsity_pattern,
-                      const std::vector<unsigned int> &local_rows_per_process,
-                      const std::vector<unsigned int> &local_columns_per_process,
-                      const unsigned int               this_process,
-                      const bool                       preset_nonzero_locations);
+      void do_reinit (const SparsityType           &sparsity_pattern,
+                      const std::vector<size_type> &local_rows_per_process,
+                      const std::vector<size_type> &local_columns_per_process,
+                      const unsigned int            this_process,
+                      const bool                    preset_nonzero_locations);
 
       /**
        *  To allow calling protected
index ed195adf15e3e768f7b92d63faf312d612c2054b..2214cb504fd3f28c92a6246b7465beb8b726aac3 100644 (file)
@@ -153,6 +153,11 @@ namespace PETScWrappers
     class Vector : public VectorBase
     {
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
+
       /**
        * Default constructor. Initialize the
        * vector as empty.
@@ -183,9 +188,9 @@ namespace PETScWrappers
        * vector is replaced by one of
        * length zero.
        */
-      explicit Vector (const MPI_Comm     &communicator,
-                       const unsigned int  n,
-                       const unsigned int  local_size);
+      explicit Vector (const MPI_Comm  &communicator,
+                       const size_type  n,
+                       const size_type  local_size);
 
 
       /**
@@ -204,9 +209,9 @@ namespace PETScWrappers
        * shall communicate
        */
       template <typename Number>
-      explicit Vector (const MPI_Comm         &communicator,
+      explicit Vector (const MPI_Comm               &communicator,
                        const dealii::Vector<Number> &v,
-                       const unsigned int      local_size);
+                       const size_type               local_size);
 
 
       /**
@@ -225,7 +230,7 @@ namespace PETScWrappers
        */
       explicit Vector (const MPI_Comm     &communicator,
                        const VectorBase   &v,
-                       const unsigned int  local_size);
+                       const size_type     local_size);
 
 
       /**
@@ -362,10 +367,10 @@ namespace PETScWrappers
        * elements are left an unspecified
        * state.
        */
-      void reinit (const MPI_Comm     &communicator,
-                   const unsigned int  N,
-                   const unsigned int  local_size,
-                   const bool          fast = false);
+      void reinit (const MPI_Comm  &communicator,
+                   const size_type  N,
+                   const size_type  local_size,
+                   const bool       fast = false);
 
       /**
        * Change the dimension to that of
@@ -442,8 +447,8 @@ namespace PETScWrappers
        * how many of these elements shall
        * be stored locally.
        */
-      virtual void create_vector (const unsigned int n,
-                                  const unsigned int local_size);
+      virtual void create_vector (const size_type n,
+                                  const size_type local_size);
 
 
 
@@ -455,8 +460,8 @@ namespace PETScWrappers
        * call update_ghost_values() before
        * accessing those.
        */
-      virtual void create_vector (const unsigned int  n,
-                                  const unsigned int  local_size,
+      virtual void create_vector (const size_type n,
+                                  const size_type local_size,
                                   const IndexSet &ghostnodes);
 
 
@@ -492,7 +497,7 @@ namespace PETScWrappers
     template <typename number>
     Vector::Vector (const MPI_Comm         &communicator,
                     const dealii::Vector<number> &v,
-                    const unsigned int      local_size)
+                    const size_type         local_size)
       :
       communicator (communicator)
     {
@@ -583,7 +588,7 @@ namespace PETScWrappers
       // that would take a pointer to an array
       // of PetscScalar values and simply copy
       // n elements verbatim into the vector...
-      for (unsigned int i=0; i<v.size(); ++i)
+      for (size_type i=0; i<v.size(); ++i)
         (*this)(i) = v(i);
 
       compress (::dealii::VectorOperation::insert);
index 402608ee224e3ea7a1743e4baf9480217afc439b..3ce8094043acadfb897287afc882d6e9d7de0222 100644 (file)
@@ -899,13 +899,8 @@ namespace PETScWrappers
       unsigned int symmetric;
 
       /**
-       * Patterns of powers of sparsified
-       * matrices can be approximate the
-       * pattern of large entries in the
-       * inverse of a matrix. Powers of a
-       *
        * The sparsity pattern used for the
-       * apprximate inverse is the pattern
+       * approximate inverse is the pattern
        * of a power <tt>B^m</tt> where <tt>B</tt>
        * has been sparsified from the given
        * matrix <tt>A</tt>, <tt>n_level</tt>
index ebd378ae7502b5f9b125da2c70b05db599e9db72..e6ee2292c4b7638c637b94727e97c63508b5aa27 100644 (file)
@@ -97,10 +97,10 @@ namespace PETScWrappers
      * ICC. The default value of this flag
      * is @p false.
      */
-    SparseMatrix (const unsigned int m,
-                  const unsigned int n,
-                  const unsigned int n_nonzero_per_row,
-                  const bool         is_symmetric = false);
+    SparseMatrix (const size_type m,
+                  const size_type n,
+                  const size_type n_nonzero_per_row,
+                  const bool      is_symmetric = false);
 
     /**
      * Initialize a rectangular matrix with
@@ -130,10 +130,10 @@ namespace PETScWrappers
      * ICC. The default value of this flag
      * is @p false.
      */
-    SparseMatrix (const unsigned int               m,
-                  const unsigned int               n,
-                  const std::vector<unsigned int> &row_lengths,
-                  const bool                       is_symmetric = false);
+    SparseMatrix (const size_type               m,
+                  const size_type               n,
+                  const std::vector<size_type> &row_lengths,
+                  const bool                    is_symmetric = false);
 
     /**
      * Initialize a sparse matrix using the
@@ -197,10 +197,10 @@ namespace PETScWrappers
      * the same argument list as the
      * present function.
      */
-    void reinit (const unsigned int m,
-                 const unsigned int n,
-                 const unsigned int n_nonzero_per_row,
-                 const bool         is_symmetric = false);
+    void reinit (const size_type m,
+                 const size_type n,
+                 const size_type n_nonzero_per_row,
+                 const bool      is_symmetric = false);
 
     /**
      * Throw away the present matrix and
@@ -209,11 +209,11 @@ namespace PETScWrappers
      * the constructor of this class with
      * the same argument list as the
      * present function.
-     */
-    void reinit (const unsigned int               m,
-                 const unsigned int               n,
-                 const std::vector<unsigned int> &row_lengths,
-                 const bool                       is_symmetric = false);
+     */                           
+    void reinit (const size_type               m,
+                 const size_type               n,
+                 const std::vector<size_type> &row_lengths,
+                 const bool                    is_symmetric = false);
 
     /**
      * Initialize a sparse matrix using the
@@ -285,18 +285,18 @@ namespace PETScWrappers
      * matrix. Getting rid of the previous
      * matrix is left to the caller.
      */
-    void do_reinit (const unsigned int m,
-                    const unsigned int n,
-                    const unsigned int n_nonzero_per_row,
-                    const bool         is_symmetric = false);
+    void do_reinit (const size_type m,
+                    const size_type n,
+                    const size_type n_nonzero_per_row,
+                    const bool      is_symmetric = false);
 
     /**
      * Same as previous function.
      */
-    void do_reinit (const unsigned int               m,
-                    const unsigned int               n,
-                    const std::vector<unsigned int> &row_lengths,
-                    const bool                       is_symmetric = false);
+    void do_reinit (const size_type               m,
+                    const size_type               n,
+                    const std::vector<size_type> &row_lengths,
+                    const bool                    is_symmetric = false);
 
     /**
      * Same as previous function.
index 3d1f9984a7135f8b22b945de6102f4b552538272..eb80eee641166fa460b88f781431ba4e15589a0b 100644 (file)
@@ -47,6 +47,11 @@ namespace PETScWrappers
   class Vector : public VectorBase
   {
   public:
+    /**
+     * Declare type for container size.
+     */
+    typedef types::global_dof_index size_type;
+
     /**
      * Default constructor. Initialize the
      * vector as empty.
@@ -67,7 +72,7 @@ namespace PETScWrappers
      * i.e. the vector is replaced by one of
      * length zero.
      */
-    explicit Vector (const unsigned int n);
+    explicit Vector (const size_type n);
 
     /**
      * Copy-constructor from deal.II
@@ -180,8 +185,8 @@ namespace PETScWrappers
      * elements are left an unspecified
      * state.
      */
-    void reinit (const unsigned int N,
-                 const bool         fast = false);
+    void reinit (const size_type N,
+                 const bool      fast = false);
 
     /**
      * Change the dimension to that of the
@@ -204,7 +209,7 @@ namespace PETScWrappers
      * size of the vector to be
      * created.
      */
-    void create_vector (const unsigned int n);
+    void create_vector (const size_type n);
   };
 
   /*@}*/
@@ -396,7 +401,7 @@ namespace PETScWrappers
     // that would take a pointer to an array
     // of PetscScalar values and simply copy
     // n elements verbatim into the vector...
-    for (unsigned int i=0; i<v.size(); ++i)
+    for (size_type i=0; i<v.size(); ++i)
       (*this)(i) = v(i);
 
     compress (::dealii::VectorOperation::insert);
index fed7aafe65c10a9a68abcff11cc714f06e6849fe..75faedb34906d86fb7abcad4006d5fc3806e074f 100644 (file)
@@ -84,9 +84,14 @@ namespace PETScWrappers
        * class to create it.
        */
       VectorReference (const VectorBase &vector,
-                       const unsigned int index);
+                       const size_type   index);
 
     public:
+      /**
+       * Declare type for container size.
+       */
+      typedef types::global_dof_index size_type;
+
       /**
        * This looks like a copy operator,
        * but does something different than
@@ -201,7 +206,7 @@ namespace PETScWrappers
        * Index of the referenced element of
        * the vector.
        */
-      const unsigned int  index;
+      const size_type index;
 
       /**
        * Make the vector class a friend, so
@@ -349,7 +354,7 @@ namespace PETScWrappers
      * Return the global dimension of the
      * vector.
      */
-    unsigned int size () const;
+    size_type size () const;
 
     /**
      * Return the local dimension of the
@@ -364,7 +369,7 @@ namespace PETScWrappers
      * exactly are stored locally,
      * use local_range().
      */
-    unsigned int local_size () const;
+    size_type local_size () const;
 
     /**
      * Return a pair of indices
@@ -382,7 +387,7 @@ namespace PETScWrappers
      * a pair (i,i+n), where
      * <tt>n=local_size()</tt>.
      */
-    std::pair<unsigned int, unsigned int>
+    std::pair<size_type, size_type>
     local_range () const;
 
     /**
@@ -390,7 +395,7 @@ namespace PETScWrappers
      * in the local range or not,
      * see also local_range().
      */
-    bool in_local_range (const unsigned int index) const;
+    bool in_local_range (const size_type index) const;
 
     /**
      * Return if the vector contains ghost
@@ -403,14 +408,14 @@ namespace PETScWrappers
      * both read and write.
      */
     reference
-    operator () (const unsigned int index);
+    operator () (const size_type index);
 
     /**
      * Provide read-only access to an
      * element.
      */
     PetscScalar
-    operator () (const unsigned int index) const;
+    operator () (const size_type index) const;
 
     /**
      * Provide access to a given
@@ -419,7 +424,7 @@ namespace PETScWrappers
      * Exactly the same as operator().
      */
     reference
-    operator [] (const unsigned int index);
+    operator [] (const size_type index);
 
     /**
      * Provide read-only access to an
@@ -429,7 +434,7 @@ namespace PETScWrappers
      * Exactly the same as operator().
      */
     PetscScalar
-    operator [] (const unsigned int index) const;
+    operator [] (const size_type index) const;
 
     /**
      * A collective set operation: instead
@@ -441,7 +446,7 @@ namespace PETScWrappers
      * the corresponding values in the
      * second.
      */
-    void set (const std::vector<unsigned int> &indices,
+    void set (const std::vector<size_type>   &indices,
               const std::vector<PetscScalar> &values);
 
     /**
@@ -450,7 +455,7 @@ namespace PETScWrappers
      * stored in @p values to the vector
      * components specified by @p indices.
      */
-    void add (const std::vector<unsigned int> &indices,
+    void add (const std::vector<size_type> &indices,
               const std::vector<PetscScalar> &values);
 
     /**
@@ -460,7 +465,7 @@ namespace PETScWrappers
      * takes a deal.II vector of
      * values.
      */
-    void add (const std::vector<unsigned int>     &indices,
+    void add (const std::vector<size_type>        &indices,
               const ::dealii::Vector<PetscScalar> &values);
 
     /**
@@ -472,8 +477,8 @@ namespace PETScWrappers
      * other two <tt>add()</tt>
      * functions above.
      */
-    void add (const unsigned int  n_elements,
-              const unsigned int *indices,
+    void add (const size_type    n_elements,
+              const size_type   *indices,
               const PetscScalar *values);
 
     /**
@@ -879,10 +884,10 @@ namespace PETScWrappers
      * @p add_values flag set to the
      * corresponding value.
      */
-    void do_set_add_operation (const unsigned int  n_elements,
-                               const unsigned int *indices,
+    void do_set_add_operation (const size_type    n_elements,
+                               const size_type   *indices,
                                const PetscScalar *values,
-                               const bool add_values);
+                               const bool         add_values);
 
 
   };
@@ -910,7 +915,7 @@ namespace PETScWrappers
   {
     inline
     VectorReference::VectorReference (const VectorBase &vector,
-                                      const unsigned int index)
+                                      const size_type   index)
       :
       vector (vector),
       index (index)
@@ -1144,7 +1149,7 @@ namespace PETScWrappers
 
   inline
   bool
-  VectorBase::in_local_range (const unsigned int index) const
+  VectorBase::in_local_range (const size_type index) const
   {
 #ifdef PETSC_USE_64BIT_INDICES
     PetscInt begin, end;
@@ -1156,8 +1161,8 @@ namespace PETScWrappers
                                            &begin, &end);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-    return ((index >= static_cast<unsigned int>(begin)) &&
-            (index < static_cast<unsigned int>(end)));
+    return ((index >= static_cast<size_type>(begin)) &&
+            (index < static_cast<size_type>(end)));
   }
 
   inline
@@ -1171,7 +1176,7 @@ namespace PETScWrappers
 
   inline
   internal::VectorReference
-  VectorBase::operator () (const unsigned int index)
+  VectorBase::operator () (const size_type index)
   {
     return internal::VectorReference (*this, index);
   }
@@ -1180,7 +1185,7 @@ namespace PETScWrappers
 
   inline
   PetscScalar
-  VectorBase::operator () (const unsigned int index) const
+  VectorBase::operator () (const size_type index) const
   {
     return static_cast<PetscScalar>(internal::VectorReference (*this, index));
   }
@@ -1189,7 +1194,7 @@ namespace PETScWrappers
 
   inline
   internal::VectorReference
-  VectorBase::operator [] (const unsigned int index)
+  VectorBase::operator [] (const size_type index)
   {
     return operator()(index);
   }
@@ -1198,7 +1203,7 @@ namespace PETScWrappers
 
   inline
   PetscScalar
-  VectorBase::operator [] (const unsigned int index) const
+  VectorBase::operator [] (const size_type index) const
   {
     return operator()(index);
   }
index a2603c8498d75302781be79a1901fd2fe08dfe19..deaf2e8604487c20b087664fc8970c23e9285e6a 100644 (file)
@@ -63,7 +63,6 @@ namespace parallel
 class PreconditionIdentity : public Subscriptor
 {
 public:
-
   /**
    * This function is only
    * present to
@@ -568,6 +567,10 @@ template <class MATRIX = SparseMatrix<double> >
 class PreconditionSSOR : public PreconditionRelaxation<MATRIX>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
 
   /**
    * A typedef to the base class.
@@ -666,6 +669,11 @@ template <class MATRIX = SparseMatrix<double> >
 class PreconditionPSOR : public PreconditionRelaxation<MATRIX>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Initialize matrix and
    * relaxation parameter. The
@@ -686,8 +694,8 @@ public:
    * reasons. It defaults to 1.
    */
   void initialize (const MATRIX &A,
-                   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 typename PreconditionRelaxation<MATRIX>::AdditionalData &
                    parameters = typename PreconditionRelaxation<MATRIX>::AdditionalData());
 
@@ -707,12 +715,12 @@ private:
   /**
    * Storage for the permutation vector.
    */
-  const std::vector<unsigned int> *permutation;
+  const std::vector<size_type> *permutation;
   /**
    * Storage for the inverse
    * permutation vector.
    */
-  const std::vector<unsigned int> *inverse_permutation;
+  const std::vector<size_type> *inverse_permutation;
 };
 
 
@@ -892,6 +900,11 @@ template <class MATRIX=SparseMatrix<double>, class VECTOR=Vector<double> >
 class PreconditionChebyshev : public Subscriptor
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Standardized data struct to
    * pipe additional parameters
@@ -1327,9 +1340,9 @@ PreconditionSSOR<MATRIX>::initialize (const MATRIX &rA,
   // calculate the positions first after the diagonal.
   if (mat != 0)
     {
-      const unsigned int n = this->A->n();
+      const size_type n = this->A->n();
       pos_right_of_diagonal.resize(n, static_cast<std::size_t>(-1));
-      for (unsigned int row=0; row<n; ++row)
+      for (size_type row=0; row<n; ++row)
         {
           // find the first element in this line which is on the right of the
           // diagonal.  we need to precondition with the elements on the left
@@ -1395,8 +1408,8 @@ template <class MATRIX>
 inline void
 PreconditionPSOR<MATRIX>::initialize (
   const MATRIX &rA,
-  const std::vector<unsigned int> &p,
-  const std::vector<unsigned int> &ip,
+  const std::vector<size_type> &p,
+  const std::vector<size_type> &ip,
   const typename PreconditionRelaxation<MATRIX>::AdditionalData &parameters)
 {
   permutation = &p;
@@ -1599,7 +1612,7 @@ PreconditionChebyshev<MATRIX,VECTOR>::initialize (const MATRIX &matrix,
   if (data.matrix_diagonal_inverse.size() != matrix.m())
     {
       data.matrix_diagonal_inverse.reinit(matrix.m());
-      for (unsigned int i=0; i<matrix.m(); ++i)
+      for (size_type i=0; i<matrix.m(); ++i)
         data.matrix_diagonal_inverse(i) = 1./matrix.el(i,i);
     }
   update1.reinit (data.matrix_diagonal_inverse, true);
@@ -1668,7 +1681,7 @@ PreconditionChebyshev<MATRIX,VECTOR>::initialize (const MATRIX &matrix,
     else
       {
         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)
@@ -1740,6 +1753,8 @@ namespace internal
     template <typename Number>
     struct VectorUpdatesRange : public parallel::ParallelForInteger
     {
+      typedef types::global_dof_index size_type;
+
       VectorUpdatesRange (const size_t  size,
                           const Number *src,
                           const Number *matrix_diagonal_inverse,
@@ -1776,13 +1791,13 @@ namespace internal
         if (factor1 == Number())
           {
             if (start_zero)
-              for (unsigned int i=begin; i<end; ++i)
+              for (size_type i=begin; i<end; ++i)
                 {
                   dst[i] = factor2 * src[i] * matrix_diagonal_inverse[i];
                   update1[i] = -dst[i];
                 }
             else
-              for (unsigned int i=begin; i<end; ++i)
+              for (size_type i=begin; i<end; ++i)
                 {
                   update1[i] = ((update2[i]-src[i]) *
                                 factor2*matrix_diagonal_inverse[i]);
@@ -1790,7 +1805,7 @@ namespace internal
                 }
           }
         else
-          for (unsigned int i=begin; i<end; ++i)
+          for (size_type i=begin; i<end; ++i)
             {
               const Number update2i = ((update2[i] - src[i]) *
                                        matrix_diagonal_inverse[i]);
index d3d7feb3edf4bbf9ffb4f9920617ea4bd3123923..4685d476a9e4f6653cc4767ee410aa71241e80a8 100644 (file)
@@ -95,6 +95,11 @@ private:
   typedef inverse_type value_type;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Parameters for block preconditioners.
    */
@@ -107,7 +112,7 @@ public:
      * is no reasonable default
      * parameter.
      */
-    AdditionalData (const unsigned int block_size,
+    AdditionalData (const size_type block_size,
                     const double relaxation = 1.,
                     const bool invert_diagonal = true,
                     const bool same_diagonal = false);
@@ -120,7 +125,7 @@ public:
     /**
      * Block size.
      */
-    unsigned int block_size;
+    size_type block_size;
 
     /**
      * Invert diagonal during initialization.
@@ -200,8 +205,8 @@ protected:
    * may be provided.
    */
   void initialize (const MATRIX &A,
-                   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 AdditionalData parameters);
 
   /**
@@ -250,8 +255,8 @@ protected:
    * order is only admissible for
    * block permutation.
    */
-  void set_permutation(const std::vector<unsigned int> &permutation,
-                       const std::vector<unsigned int> &inverse_permutation);
+  void set_permutation(const std::vector<size_type> &permutation,
+                       const std::vector<size_type> &inverse_permutation);
 
   /**
    * Replacement of
@@ -259,8 +264,8 @@ protected:
    * permuted preconditioning.
    */
   void invert_permuted_diagblocks(
-    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);
 public:
   /**
    * Deletes the inverse diagonal
@@ -283,8 +288,8 @@ public:
    * if the inverse diagonal blocks
    * are stored.
    */
-  value_type el(unsigned int i,
-                unsigned int j) const;
+  value_type el(size_type i,
+                size_type j) const;
 
   /**
    * Stores the inverse of the
@@ -367,7 +372,7 @@ public:
   /**
    * Return the size of the blocks.
    */
-  unsigned int block_size () const;
+  size_type block_size () const;
 
   /**
    * @deprecated Use size()
@@ -414,7 +419,7 @@ protected:
    * diagonal block is assumed to
    * be of the same size.
    */
-  unsigned int blocksize;
+  size_type blocksize;
 
   /**
    * Pointer to the matrix. Make
@@ -438,12 +443,12 @@ protected:
   /**
    * The permutation vector
    */
-  std::vector<unsigned int> permutation;
+  std::vector<size_type> permutation;
 
   /**
    * The inverse permutation vector
    */
-  std::vector<unsigned int> inverse_permutation;
+  std::vector<size_type> inverse_permutation;
 
   /**
    * Flag for diagonal compression.
@@ -474,6 +479,11 @@ private:
   typedef typename MATRIX::value_type number;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * STL conforming iterator.
    */
@@ -493,21 +503,21 @@ public:
        * pointer is sufficient.
        */
       Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-                const unsigned int row);
+                const size_type row);
 
       /**
        * Row number of the element
        * represented by this
        * object.
        */
-      unsigned int row() const;
+      size_type row() const;
 
       /**
        * Column number of the
        * element represented by
        * this object.
        */
-      unsigned int column() const;
+      size_type column() const;
 
       /**
        * Value of this matrix entry.
@@ -524,12 +534,12 @@ public:
        * Save block size here
        * for further reference.
        */
-      unsigned int bs;
+      size_type bs;
 
       /**
        * Current block number.
        */
-      unsigned int a_block;
+      size_type a_block;
 
       /**
        * Iterator inside block.
@@ -553,7 +563,7 @@ public:
      * Constructor.
      */
     const_iterator(const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-                   const unsigned int row);
+                   const size_type row);
 
     /**
      * Prefix increment.
@@ -698,12 +708,12 @@ public:
    * STL-like iterator with the
    * first entry of 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.
    */
-  const_iterator end (const unsigned int r) const;
+  const_iterator end (const size_type r) const;
 
 
 private:
@@ -767,6 +777,11 @@ class PreconditionBlockSOR : public virtual Subscriptor,
   protected PreconditionBlock<MATRIX, inverse_type>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Default constructor.
    */
@@ -955,6 +970,11 @@ class PreconditionBlockSSOR : public virtual Subscriptor,
   private PreconditionBlockSOR<MATRIX, inverse_type>
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Define number type of matrix.
    */
@@ -1051,16 +1071,16 @@ PreconditionBlock<MATRIX, inverse_type>::n_blocks () const
 template<class MATRIX, typename inverse_type>
 inline inverse_type
 PreconditionBlock<MATRIX, inverse_type>::el (
-  unsigned int i,
-  unsigned int j) const
+  size_type i,
+  size_type j) const
 {
-  const unsigned int bs = blocksize;
+  const size_type bs = blocksize;
   const unsigned int nb = i/bs;
 
   const FullMatrix<inverse_type> &B = this->inverse(nb);
 
-  const unsigned int ib = i % bs;
-  const unsigned int jb = j % bs;
+  const size_type ib = i % bs;
+  const size_type jb = j % bs;
 
   if (jb + nb*bs != j)
     {
@@ -1076,7 +1096,7 @@ template<class MATRIX, typename inverse_type>
 inline
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::
 Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-          const unsigned int row)
+          const size_type row)
   :
   matrix(matrix),
   b_iterator(&matrix->inverse(0), 0, 0),
@@ -1090,7 +1110,7 @@ Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
   if (a_block == matrix->size())
     return;
 
-  const unsigned int r = row % bs;
+  const size_type r = row % bs;
 
   b_iterator = matrix->inverse(a_block).begin(r);
   b_end = matrix->inverse(a_block).end();
@@ -1102,7 +1122,7 @@ Accessor (const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
 
 template<class MATRIX, typename inverse_type>
 inline
-unsigned int
+typename PreconditionBlockJacobi<MATRIX, inverse_type>::size_type 
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::row() const
 {
   Assert (a_block < matrix->size(),
@@ -1114,7 +1134,7 @@ PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::row() c
 
 template<class MATRIX, typename inverse_type>
 inline
-unsigned int
+typename PreconditionBlockJacobi<MATRIX, inverse_type>::size_type
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::column() const
 {
   Assert (a_block < matrix->size(),
@@ -1140,7 +1160,7 @@ template<class MATRIX, typename inverse_type>
 inline
 PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::
 const_iterator(const PreconditionBlockJacobi<MATRIX, inverse_type> *matrix,
-               const unsigned int row)
+               const size_type row)
   :
   accessor(matrix, row)
 {}
@@ -1248,7 +1268,7 @@ template<class MATRIX, typename inverse_type>
 inline
 typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
 PreconditionBlockJacobi<MATRIX, inverse_type>::begin (
-  const unsigned int r) const
+  const size_type r) const
 {
   Assert (r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
   return const_iterator(this, r);
@@ -1260,7 +1280,7 @@ template<class MATRIX, typename inverse_type>
 inline
 typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
 PreconditionBlockJacobi<MATRIX, inverse_type>::end (
-  const unsigned int r) const
+  const size_type r) const
 {
   Assert (r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
   return const_iterator(this, r+1);
index 41fc24ad955b791abc6a3db75c9c282effae7145..fd784c46280f35aa991a646079ae30e82ab3fe6c 100644 (file)
@@ -27,7 +27,7 @@ DEAL_II_NAMESPACE_OPEN
 
 template<class MATRIX, typename inverse_type>
 PreconditionBlock<MATRIX, inverse_type>::AdditionalData::
-AdditionalData (const unsigned int block_size,
+AdditionalData (const size_type block_size,
                 const double relaxation,
                 const bool invert_diagonal,
                 const bool same_diagonal)
@@ -73,7 +73,7 @@ void PreconditionBlock<MATRIX,inverse_type>::initialize (
   const MATRIX &M,
   const AdditionalData parameters)
 {
-  const unsigned int bsize = parameters.block_size;
+  const size_type bsize = parameters.block_size;
 
   clear();
   Assert (M.m() == M.n(), ExcNotQuadratic());
@@ -99,8 +99,8 @@ void PreconditionBlock<MATRIX,inverse_type>::initialize (
 template <class MATRIX, typename inverse_type>
 void PreconditionBlock<MATRIX,inverse_type>::initialize (
   const MATRIX &M,
-  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 AdditionalData parameters)
 {
   set_permutation(permutation, inverse_permutation);
@@ -109,8 +109,8 @@ void PreconditionBlock<MATRIX,inverse_type>::initialize (
 
 template <class MATRIX, typename inverse_type>
 void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
-  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)
 {
   Assert (A!=0, ExcNotInitialized());
   Assert (blocksize!=0, ExcNotInitialized());
@@ -126,7 +126,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
     {
       deallog << "PreconditionBlock uses only one diagonal block" << std::endl;
 
-      for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
         {
           typename MATRIX::const_iterator entry = M.begin(row_cell);
           const typename MATRIX::const_iterator row_end = M.end(row_cell);
@@ -169,12 +169,12 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
 
       for (unsigned int cell=0; cell<this->size(); ++cell)
         {
-          const unsigned int cell_start = cell*blocksize;
-          for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+          const size_type cell_start = cell*blocksize;
+          for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
             {
-              const unsigned int urow = row_cell + cell_start;
+              const size_type urow = row_cell + cell_start;
 
-              const unsigned int row = permutation[urow];
+              const size_type row = permutation[urow];
 
               typename MATRIX::const_iterator entry = M.begin(row);
               const typename MATRIX::const_iterator row_end = M.end(row);
@@ -185,7 +185,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_permuted_diagblocks(
                   if (inverse_permutation[entry->column()]<cell_start)
                     continue;
 
-                  const unsigned int column_cell = inverse_permutation[entry->column()]-cell_start;
+                  const size_type column_cell = inverse_permutation[entry->column()]-cell_start;
                   if (column_cell >= blocksize)
                     continue;
                   M_cell(row_cell, column_cell) = entry->value();
@@ -250,7 +250,7 @@ void PreconditionBlock<MATRIX,inverse_type>::forward_step (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell;
+  size_type row, row_cell;
   number2 b_cell_row;
   // The diagonal block if the
   // inverses were not precomputed
@@ -260,10 +260,10 @@ void PreconditionBlock<MATRIX,inverse_type>::forward_step (
   for (unsigned int rawcell=0; rawcell < this->size(); ++rawcell)
     {
       const unsigned int cell = cell_permuted ? permutation[rawcell] : rawcell;
-      const unsigned int block_start = cell*this->blocksize;
-      const unsigned int permuted_block_start = permuted
-                                                ? permutation[block_start]
-                                                : block_start;
+      const size_type block_start = cell*this->blocksize;
+      const size_type permuted_block_start = permuted
+                                             ? permutation[block_start]
+                                             : block_start;
 
 //       deallog << std::endl << cell << '-' << block_start
 //            << '-' << permuted_block_start << (permuted ? 't' : 'f') << '\t';
@@ -279,17 +279,17 @@ void PreconditionBlock<MATRIX,inverse_type>::forward_step (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? inverse_permutation[column]
+                                                        : column;
               b_cell_row -= entry->value() * prev(column);
 //TODO:[GK] Find out if this is really once column and once permuted
               if (!this->inverses_ready()
                   && inverse_permuted_column >= block_start
                   && inverse_permuted_column < block_start + this->blocksize)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   if (transpose_diagonal)
                     M_cell(column_cell, row_cell) = entry->value();
                   else
@@ -348,7 +348,7 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell;
+  size_type row, row_cell;
   number2 b_cell_row;
 
   FullMatrix<number> M_cell(this->blocksize);
@@ -356,11 +356,11 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
     {
       --rawcell;
       const unsigned int cell = cell_permuted ? permutation[rawcell] : rawcell;
-      const unsigned int block_start = cell*this->blocksize;
-      const unsigned int block_end = block_start + this->blocksize;
-      const unsigned int permuted_block_start = permuted
-                                                ? permutation[block_start]
-                                                : block_start;
+      const size_type block_start = cell*this->blocksize;
+      const size_type block_end = block_start + this->blocksize;
+      const size_type permuted_block_start = permuted
+                                             ? permutation[block_start]
+                                             : block_start;
       for (row = permuted_block_start, row_cell = 0;
            row_cell<this->blocksize;
            ++row_cell, ++row)
@@ -371,16 +371,16 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? inverse_permutation[column]
+                                                        : column;
               b_cell_row -= entry->value() * prev(column);
               if (!this->inverses_ready()
                   && inverse_permuted_column < block_end
                   && column >= block_start)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   // We need the
                   // transpose of the
                   // diagonal block,
@@ -419,7 +419,8 @@ void PreconditionBlock<MATRIX,inverse_type>::backward_step (
 
 
 template <class MATRIX, typename inverse_type>
-unsigned int PreconditionBlock<MATRIX,inverse_type>::block_size() const
+typename PreconditionBlock<MATRIX,inverse_type>::size_type
+PreconditionBlock<MATRIX,inverse_type>::block_size() const
 {
   return blocksize;
 }
@@ -439,7 +440,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
   if (this->same_diagonal())
     {
       deallog << "PreconditionBlock uses only one diagonal block" << std::endl;
-      for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
         {
           typename MATRIX::const_iterator entry = M.begin(row_cell);
           const typename MATRIX::const_iterator row_end = M.end(row_cell);
@@ -474,10 +475,10 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
 
       for (unsigned int cell=0; cell<this->size(); ++cell)
         {
-          const unsigned int cell_start = cell*blocksize;
-          for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+          const size_type cell_start = cell*blocksize;
+          for (size_type row_cell=0; row_cell<blocksize; ++row_cell)
             {
-              const unsigned int row = row_cell + cell_start;
+              const size_type row = row_cell + cell_start;
               typename MATRIX::const_iterator entry = M.begin(row);
               const typename MATRIX::const_iterator row_end = M.end(row);
 
@@ -486,7 +487,7 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
                   if (entry->column()<cell_start)
                     continue;
 
-                  const unsigned int column_cell = entry->column()-cell_start;
+                  const size_type column_cell = entry->column()-cell_start;
                   if (column_cell >= blocksize)
                     continue;
                   M_cell(row_cell, column_cell) = entry->value();
@@ -519,8 +520,8 @@ void PreconditionBlock<MATRIX,inverse_type>::invert_diagblocks()
 
 template <class MATRIX, typename inverse_type>
 void PreconditionBlock<MATRIX,inverse_type>::set_permutation (
-  const std::vector<unsigned int> &p,
-  const std::vector<unsigned int> &i)
+  const std::vector<size_type> &p,
+  const std::vector<size_type> &i)
 {
   Assert (p.size() == i.size(), ExcDimensionMismatch(p.size(), i.size()));
 
@@ -574,7 +575,7 @@ void PreconditionBlockJacobi<MATRIX,inverse_type>
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell, begin_diag_block=0;
+  size_type row, row_cell, begin_diag_block=0;
 
   if (!this->inverses_ready())
     {
@@ -586,7 +587,7 @@ void PreconditionBlockJacobi<MATRIX,inverse_type>
                ++row_cell, ++row)
             {
               b_cell(row_cell)=src(row);
-              for (unsigned int column_cell=0, column=cell*this->blocksize;
+              for (size_type column_cell=0, column=cell*this->blocksize;
                    column_cell<this->blocksize; ++column_cell, ++column)
                 M_cell(row_cell,column_cell)=M(row,column);
             }
@@ -742,7 +743,7 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell, block_start=0;
+  size_type row, row_cell, block_start=0;
   number2 b_cell_row;
   // The diagonal block if the
   // inverses were not precomputed
@@ -750,9 +751,9 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
 
   for (unsigned int cell=0; cell < this->size(); ++cell)
     {
-      const unsigned int permuted_block_start = permuted
-                                                ? this->permutation[block_start]
-                                                :block_start;
+      const size_type permuted_block_start = permuted
+                                             ? this->permutation[block_start]
+                                             :block_start;
 
       for (row = permuted_block_start, row_cell = 0;
            row_cell < this->blocksize;
@@ -764,16 +765,16 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::forward (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
-                                                           ? this->inverse_permutation[column]
-                                                           : column;
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
+                                                        ? this->inverse_permutation[column]
+                                                        : column;
 
               if (inverse_permuted_column < block_start)
                 b_cell_row -= entry->value() * dst(column);
               else if (!this->inverses_ready() && column < block_start + this->blocksize)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   if (transpose_diagonal)
                     M_cell(column_cell, row_cell) = entry->value();
                   else
@@ -832,19 +833,19 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::backward (
   // blocks.
   // row, column are the global numbering
   // of the unkowns.
-  unsigned int row, row_cell;
-  unsigned int block_end=this->blocksize * this->size();
+  size_type row, row_cell;
+  size_type block_end=this->blocksize * this->size();
   number2 b_cell_row;
 
   FullMatrix<number> M_cell(this->blocksize);
   for (unsigned int cell=this->size(); cell!=0 ;)
     {
       --cell;
-      const unsigned int block_start = block_end - this->blocksize;
+      const size_type block_start = block_end - this->blocksize;
       // Collect upper triangle
-      const unsigned int permuted_block_start = (this->permutation.size() != 0)
-                                                ? this->permutation[block_start]
-                                                :block_start;
+      const size_type permuted_block_start = (this->permutation.size() != 0)
+                                             ? this->permutation[block_start]
+                                             block_start;
       for (row = permuted_block_start, row_cell = 0;
            row_cell<this->blocksize;
            ++row_cell, ++row)
@@ -855,15 +856,15 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::backward (
           b_cell_row=src(row);
           for (; entry != row_end; ++entry)
             {
-              const unsigned int column = entry->column();
-              const unsigned int inverse_permuted_column = permuted
+              const size_type column = entry->column();
+              const size_type inverse_permuted_column = permuted
                                                            ? this->inverse_permutation[column]
                                                            : column;
               if (inverse_permuted_column >= block_end)
                 b_cell_row -= entry->value() * dst(column);
               else if (!this->inverses_ready() && column >= block_start)
                 {
-                  const unsigned int column_cell = column - block_start;
+                  const size_type column_cell = column - block_start;
                   // We need the
                   // transpose of the
                   // diagonal block,
@@ -993,14 +994,14 @@ void PreconditionBlockSSOR<MATRIX,inverse_type>::vmult (Vector<number2>       &d
   // Multiply with diagonal blocks
   for (unsigned int cell=0; cell < this->size(); ++cell)
     {
-      unsigned int row = cell*this->blocksize;
+      size_type row = cell*this->blocksize;
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         cell_src(row_cell)=help(row+row_cell);
 
       this->diagonal(cell).vmult(cell_dst, cell_src);
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         help(row+row_cell) = scaling * cell_dst(row_cell);
     }
 
@@ -1024,14 +1025,14 @@ void PreconditionBlockSSOR<MATRIX,inverse_type>::Tvmult (Vector<number2>       &
   // Multiply with diagonal blocks
   for (unsigned int cell=0; cell < this->size(); ++cell)
     {
-      unsigned int row = cell*this->blocksize;
+      size_type row = cell*this->blocksize;
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         cell_src(row_cell)=help(row+row_cell);
 
       this->diagonal(cell).Tvmult(cell_dst, cell_src);
 
-      for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+      for (size_type row_cell=0; row_cell<this->blocksize; ++row_cell)
         help(row+row_cell) = scaling * cell_dst(row_cell);
     }
 
index be37ffdd527c2098d67cd38f823cbff8e51e9684..ed33f34c22f5c0edb165ae99513963756aa72da8 100644 (file)
@@ -51,6 +51,11 @@ template <typename number>
 class PreconditionBlockBase
 {
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Choose a method for inverting
    * the blocks, and thus the data
@@ -105,7 +110,7 @@ public:
    * then only one block will be
    * stored.
    */
-  void reinit(unsigned int nblocks, unsigned int blocksize, bool compress,
+  void reinit(unsigned int nblocks, size_type blocksize, bool compress,
               Inversion method = gauss_jordan);
 
   /**
@@ -164,69 +169,69 @@ public:
    * if the inverse diagonal blocks
    * are stored.
    */
-  number el(unsigned int i, unsigned int j) const;
+  number el(size_type i, size_type j) const;
 
   /**
    * Multiply with the inverse
    * block at position <tt>i</tt>.
    */
   template <typename number2>
-  void inverse_vmult(unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const;
+  void inverse_vmult(size_type i, Vector<number2> &dst, const Vector<number2> &src) const;
 
   /**
    * Multiply with the transposed inverse
    * block at position <tt>i</tt>.
    */
   template <typename number2>
-  void inverse_Tvmult(unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const;
+  void inverse_Tvmult(size_type i, Vector<number2> &dst, const Vector<number2> &src) const;
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #gauss_jordan.
    */
-  FullMatrix<number> &inverse (unsigned int i);
+  FullMatrix<number> &inverse (size_type i);
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  Householder<number> &inverse_householder (unsigned int i);
+  Householder<number> &inverse_householder (size_type i);
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  LAPACKFullMatrix<number> &inverse_svd (unsigned int i);
+  LAPACKFullMatrix<number> &inverse_svd (size_type i);
 
   /**
    * Access to the inverse diagonal
    * blocks.
    */
-  const FullMatrix<number> &inverse (unsigned int i) const;
+  const FullMatrix<number> &inverse (size_type i) const;
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  const Householder<number> &inverse_householder (unsigned int i) const;
+  const Householder<number> &inverse_householder (size_type i) const;
 
   /**
    * Access to the inverse diagonal
    * blocks if Inversion is #householder.
    */
-  const LAPACKFullMatrix<number> &inverse_svd (unsigned int i) const;
+  const LAPACKFullMatrix<number> &inverse_svd (size_type i) const;
 
   /**
    * Access to the diagonal
    * blocks.
    */
-  FullMatrix<number> &diagonal (unsigned int i);
+  FullMatrix<number> &diagonal (size_type i);
 
   /**
    * Access to the diagonal
    * blocks.
    */
-  const FullMatrix<number> &diagonal (unsigned int i) const;
+  const FullMatrix<number> &diagonal (size_type i) const;
 
   /**
    * Print some statistics about
@@ -383,7 +388,7 @@ PreconditionBlockBase<number>::clear()
 template <typename number>
 inline
 void
-PreconditionBlockBase<number>::reinit(unsigned int n, unsigned int b, bool compress,
+PreconditionBlockBase<number>::reinit(unsigned int n, size_type b, bool compress,
                                       Inversion method)
 {
   inversion = method;
@@ -472,9 +477,9 @@ template <typename number2>
 inline
 void
 PreconditionBlockBase<number>::inverse_vmult(
-  unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const
+  size_type i, Vector<number2> &dst, const Vector<number2> &src) const
 {
-  const unsigned int ii = same_diagonal() ? 0U : i;
+  const size_type ii = same_diagonal() ? 0U : i;
 
   switch (inversion)
     {
@@ -501,9 +506,9 @@ template <typename number2>
 inline
 void
 PreconditionBlockBase<number>::inverse_Tvmult(
-  unsigned int i, Vector<number2> &dst, const Vector<number2> &src) const
+  size_type i, Vector<number2> &dst, const Vector<number2> &src) const
 {
-  const unsigned int ii = same_diagonal() ? 0U : i;
+  const size_type ii = same_diagonal() ? 0U : i;
 
   switch (inversion)
     {
@@ -528,7 +533,7 @@ PreconditionBlockBase<number>::inverse_Tvmult(
 template <typename number>
 inline
 const FullMatrix<number> &
-PreconditionBlockBase<number>::inverse(unsigned int i) const
+PreconditionBlockBase<number>::inverse(size_type i) const
 {
   if (same_diagonal())
     return var_inverse_full[0];
@@ -541,7 +546,7 @@ PreconditionBlockBase<number>::inverse(unsigned int i) const
 template <typename number>
 inline
 const Householder<number> &
-PreconditionBlockBase<number>::inverse_householder(unsigned int i) const
+PreconditionBlockBase<number>::inverse_householder(size_type i) const
 {
   if (same_diagonal())
     return var_inverse_householder[0];
@@ -554,7 +559,7 @@ PreconditionBlockBase<number>::inverse_householder(unsigned int i) const
 template <typename number>
 inline
 const LAPACKFullMatrix<number> &
-PreconditionBlockBase<number>::inverse_svd(unsigned int i) const
+PreconditionBlockBase<number>::inverse_svd(size_type i) const
 {
   if (same_diagonal())
     return var_inverse_svd[0];
@@ -567,7 +572,7 @@ PreconditionBlockBase<number>::inverse_svd(unsigned int i) const
 template <typename number>
 inline
 const FullMatrix<number> &
-PreconditionBlockBase<number>::diagonal(unsigned int i) const
+PreconditionBlockBase<number>::diagonal(size_type i) const
 {
   Assert(store_diagonals(), ExcDiagonalsNotStored());
 
@@ -582,7 +587,7 @@ PreconditionBlockBase<number>::diagonal(unsigned int i) const
 template <typename number>
 inline
 FullMatrix<number> &
-PreconditionBlockBase<number>::inverse(unsigned int i)
+PreconditionBlockBase<number>::inverse(size_type i)
 {
   Assert(var_inverse_full.size() != 0, ExcInverseNotAvailable());
 
@@ -597,7 +602,7 @@ PreconditionBlockBase<number>::inverse(unsigned int i)
 template <typename number>
 inline
 Householder<number> &
-PreconditionBlockBase<number>::inverse_householder(unsigned int i)
+PreconditionBlockBase<number>::inverse_householder(size_type i)
 {
   Assert(var_inverse_householder.size() != 0, ExcInverseNotAvailable());
 
@@ -612,7 +617,7 @@ PreconditionBlockBase<number>::inverse_householder(unsigned int i)
 template <typename number>
 inline
 LAPACKFullMatrix<number> &
-PreconditionBlockBase<number>::inverse_svd(unsigned int i)
+PreconditionBlockBase<number>::inverse_svd(size_type i)
 {
   Assert(var_inverse_svd.size() != 0, ExcInverseNotAvailable());
 
@@ -627,7 +632,7 @@ PreconditionBlockBase<number>::inverse_svd(unsigned int i)
 template <typename number>
 inline
 FullMatrix<number> &
-PreconditionBlockBase<number>::diagonal(unsigned int i)
+PreconditionBlockBase<number>::diagonal(size_type i)
 {
   Assert(store_diagonals(), ExcDiagonalsNotStored());
 
@@ -683,10 +688,10 @@ PreconditionBlockBase<number>::log_statistics () const
       double sigmin = 1.e300, sigmax= -1.e300;
       double kappamin = 1.e300, kappamax= -1.e300;
 
-      for (unsigned int b=0; b<size(); ++b)
+      for (size_type b=0; b<size(); ++b)
         {
           const LAPACKFullMatrix<number> &matrix = inverse_svd(b);
-          unsigned int k=1;
+          size_type k=1;
           while (k <= matrix.n_cols() && matrix.singular_value(matrix.n_cols()-k) == 0)
             ++k;
           const double s0 = matrix.singular_value(0);
@@ -724,9 +729,9 @@ std::size_t
 PreconditionBlockBase<number>::memory_consumption () const
 {
   std::size_t mem = sizeof(*this);
-  for (unsigned int i=0; i<var_inverse_full.size(); ++i)
+  for (size_type i=0; i<var_inverse_full.size(); ++i)
     mem += MemoryConsumption::memory_consumption(var_inverse_full[i]);
-  for (unsigned int i=0; i<var_diagonal.size(); ++i)
+  for (size_type i=0; i<var_diagonal.size(); ++i)
     mem += MemoryConsumption::memory_consumption(var_diagonal[i]);
   return mem;
 }
index c4414385d8ab87bcb619840240f70e5904ff0fe8..18f80023927bc504f747e415ddedeb6db9cbb329 100644 (file)
@@ -63,6 +63,11 @@ private:
   typedef inverse_type value_type;
 
 public:
+  /**
+   * Declare type for container size.
+   */
+  typedef types::global_dof_index size_type;
+
   /**
    * Parameters for block relaxation methods.
    */
@@ -176,8 +181,8 @@ public:
    * Read-only access to entries.  This function is only possible if
    * the inverse diagonal blocks are stored.
    */
-  value_type el(unsigned int i,
-                unsigned int j) const;
+  value_type el(size_type i,
+                size_type j) const;
 
   /**
    * Stores the inverse of the diagonal blocks in @p inverse. This
index 0d4f2f903aa2a2e424091a63fd4a646ee0500ac8..83fa7e42ca7f1f9eff2737e324ffc4c9bcda07d8 100644 (file)
@@ -111,9 +111,9 @@ RelaxationBlock<MATRIX,inverse_type>::invert_diagblocks ()
     }
   else
     {
-      for (unsigned int block=0; block<additional_data->block_list.n_rows(); ++block)
+      for (size_type block=0; block<additional_data->block_list.n_rows(); ++block)
         {
-          const unsigned int bs = additional_data->block_list.row_length(block);
+          const size_type bs = additional_data->block_list.row_length(block);
           M_cell.reinit(bs, bs);
 
           // Copy rows for this block
@@ -121,14 +121,14 @@ RelaxationBlock<MATRIX,inverse_type>::invert_diagblocks ()
           // diagonal block
           SparsityPattern::iterator row
             = additional_data->block_list.begin(block);
-          for (unsigned int row_cell=0; row_cell<bs; ++row_cell, ++row)
+          for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
             {
 //TODO:[GK] Optimize here
               for (typename MATRIX::const_iterator entry = M.begin(row->column());
                    entry != M.end(row->column()); ++entry)
                 {
-                  const unsigned int column = entry->column();
-                  const unsigned int col_cell = additional_data->block_list.row_position(block, column);
+                  const size_type column = entry->column();
+                  const size_type col_cell = additional_data->block_list.row_position(block, column);
                   if (col_cell != numbers::invalid_unsigned_int)
                     M_cell(row_cell, col_cell) = entry->value();
                 }
@@ -183,7 +183,7 @@ RelaxationBlock<MATRIX,inverse_type>::do_step (
   const bool permutation_empty = additional_data->order.size() == 0;
   const unsigned int n_permutations = (permutation_empty)
                                       ? 1U : additional_data->order.size();
-  const unsigned int n_blocks = additional_data->block_list.n_rows();
+  const size_type n_blocks = additional_data->block_list.n_rows();
 
   if (!permutation_empty)
     for (unsigned int i=0; i<additional_data->order.size(); ++i)
@@ -200,13 +200,13 @@ RelaxationBlock<MATRIX,inverse_type>::do_step (
                                         ? (additional_data->order[n_permutations-1-perm][raw_block])
                                         : (additional_data->order[perm][raw_block]));
 
-          const unsigned int bs = additional_data->block_list.row_length(block);
+          const size_type bs = additional_data->block_list.row_length(block);
 
           b_cell.reinit(bs);
           x_cell.reinit(bs);
           // Collect off-diagonal parts
           SparsityPattern::iterator row = additional_data->block_list.begin(block);
-          for (unsigned int row_cell=0; row_cell<bs; ++row_cell, ++row)
+          for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
             {
               b_cell(row_cell) = src(row->column());
               for (typename MATRIX::const_iterator entry = M.begin(row->column());
@@ -217,7 +217,7 @@ RelaxationBlock<MATRIX,inverse_type>::do_step (
           this->inverse_vmult(block, x_cell, b_cell);
           // Store in result vector
           row=additional_data->block_list.begin(block);
-          for (unsigned int row_cell=0; row_cell<bs; ++row_cell, ++row)
+          for (size_type row_cell=0; row_cell<bs; ++row_cell, ++row)
             dst(row->column()) = prev(row->column()) + additional_data->relaxation * x_cell(row_cell);
         }
     }
index 5582ef2b5a83c2e4b062c781f954e7b44ce0e90b..024afcf99d428f6d3a92e3057e7636185ff77e4d 100644 (file)
@@ -26,7 +26,7 @@ DEAL_II_NAMESPACE_OPEN
 using namespace LAPACKSupport;
 
 template <typename number>
-LAPACKFullMatrix<number>::LAPACKFullMatrix(const unsigned int n)
+LAPACKFullMatrix<number>::LAPACKFullMatrix(const size_type n)
   :
   TransposeTable<number> (n,n),
   state(matrix)
@@ -35,8 +35,8 @@ LAPACKFullMatrix<number>::LAPACKFullMatrix(const unsigned int n)
 
 template <typename number>
 LAPACKFullMatrix<number>::LAPACKFullMatrix(
-  const unsigned int m,
-  const unsigned int n)
+  const size_type m,
+  const size_type n)
   :
   TransposeTable<number> (m,n),
   state(matrix)
@@ -68,8 +68,8 @@ LAPACKFullMatrix<number>::operator = (const FullMatrix<number2> &M)
 {
   Assert (this->n_rows() == M.m(), ExcDimensionMismatch(this->n_rows(), M.m()));
   Assert (this->n_cols() == M.n(), ExcDimensionMismatch(this->n_cols(), M.n()));
-  for (unsigned int i=0; i<this->n_rows(); ++i)
-    for (unsigned int j=0; j<this->n_cols(); ++j)
+  for (size_type i=0; i<this->n_rows(); ++i)
+    for (size_type j=0; j<this->n_cols(); ++j)
       (*this)(i,j) = M(i,j);
 
   state = LAPACKSupport::matrix;
@@ -123,7 +123,7 @@ LAPACKFullMatrix<number>::vmult (
       work.resize(std::max(mm,nn));
       gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, &work[0], &one);
       // Multiply by singular values
-      for (unsigned int i=0; i<wr.size(); ++i)
+      for (size_type i=0; i<wr.size(); ++i)
         work[i] *= wr[i];
       // Multiply with U
       gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, &work[0], &one, &beta, w.val, &one);
@@ -137,7 +137,7 @@ LAPACKFullMatrix<number>::vmult (
       work.resize(std::max(mm,nn));
       gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, &work[0], &one);
       // Multiply by singular values
-      for (unsigned int i=0; i<wr.size(); ++i)
+      for (size_type i=0; i<wr.size(); ++i)
         work[i] *= wr[i];
       // Multiply with V
       gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, &work[0], &one, &beta, w.val, &one);
@@ -182,7 +182,7 @@ LAPACKFullMatrix<number>::Tvmult (
       work.resize(std::max(mm,nn));
       gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, &work[0], &one);
       // Multiply by singular values
-      for (unsigned int i=0; i<wr.size(); ++i)
+      for (size_type i=0; i<wr.size(); ++i)
         work[i] *= wr[i];
       // Multiply with V
       gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, &work[0], &one, &beta, w.val, &one);
@@ -196,7 +196,7 @@ LAPACKFullMatrix<number>::Tvmult (
         work.resize(std::max(mm,nn));
         gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, &work[0], &one);
         // Multiply by singular values
-        for (unsigned int i=0; i<wr.size(); ++i)
+        for (size_type i=0; i<wr.size(); ++i)
           work[i] *= wr[i];
         // Multiply with U
         gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, &work[0], &one, &beta, w.val, &one);
@@ -290,7 +290,7 @@ LAPACKFullMatrix<number>::compute_inverse_svd(const double threshold)
   Assert (state==LAPACKSupport::svd, ExcState(state));
 
   const double lim = wr[0]*threshold;
-  for (unsigned int i=0; i<wr.size(); ++i)
+  for (size_type i=0; i<wr.size(); ++i)
     {
       if (wr[i] > lim)
         wr[i] = 1./wr[i];
@@ -414,7 +414,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues(
   lwork = 4*nn;                    // no query mode
 #endif
   // resize workspace array
-  work.resize((unsigned int) lwork);
+  work.resize((size_type ) lwork);
 
   // Finally compute the eigenvalues.
   geev(jobvl, jobvr, &nn, values, &nn,
@@ -445,7 +445,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
 {
   Assert(state == matrix, ExcState(state));
   const int nn = (this->n_cols() > 0 ? this->n_cols() : 1);
-  Assert(static_cast<unsigned int>(nn) == this->n_rows(), ExcNotQuadratic());
+  Assert(static_cast<size_type>(nn) == this->n_rows(), ExcNotQuadratic());
 
   wr.resize(nn);
   LAPACKFullMatrix<number> matrix_eigenvectors(nn, nn);
@@ -460,8 +460,8 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
   const char *const uplo(&U);
   const char *const range(&V);
   const int *const  dummy(&one);
-  std::vector<int> iwork(static_cast<unsigned int> (5*nn));
-  std::vector<int> ifail(static_cast<unsigned int> (nn));
+  std::vector<int> iwork(static_cast<size_type> (5*nn));
+  std::vector<int> ifail(static_cast<size_type> (nn));
 
 
   // Optimal workspace query:
@@ -507,7 +507,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
   lwork = 8*nn > 1 ? 8*nn : 1; // no query mode
 #endif
   // resize workspace arrays
-  work.resize(static_cast<unsigned int> (lwork));
+  work.resize(static_cast<size_type> (lwork));
 
   // Finally compute the eigenvalues.
   syevx (jobz, range,
@@ -527,11 +527,11 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(
 
   eigenvalues.reinit(n_eigenpairs);
   eigenvectors.reinit(nn, n_eigenpairs, true);
-  for (unsigned int i=0; i < static_cast<unsigned int> (n_eigenpairs); ++i)
+  for (size_type i=0; i < static_cast<size_type> (n_eigenpairs); ++i)
     {
       eigenvalues(i) = wr[i];
-      unsigned int col_begin(i*nn);
-      for (unsigned int j=0; j < static_cast<unsigned int> (nn); ++j)
+      size_type col_begin(i*nn);
+      for (size_type j=0; j < static_cast<size_type> (nn); ++j)
         {
           eigenvectors(j,i) = values_eigenvectors[col_begin+j];
         }
@@ -554,9 +554,9 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
 {
   Assert(state == matrix, ExcState(state));
   const int nn = (this->n_cols() > 0 ? this->n_cols() : 1);
-  Assert(static_cast<unsigned int>(nn) == this->n_rows(), ExcNotQuadratic());
+  Assert(static_cast<size_type>(nn) == this->n_rows(), ExcNotQuadratic());
   Assert(B.n_rows() == B.n_cols(), ExcNotQuadratic());
-  Assert(static_cast<unsigned int>(nn) == B.n_cols(),
+  Assert(static_cast<size_type>(nn) == B.n_cols(),
          ExcDimensionMismatch (nn, B.n_cols()));
 
   wr.resize(nn);
@@ -573,8 +573,8 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
   const char *const uplo(&U);
   const char *const range(&V);
   const int *const  dummy(&one);
-  std::vector<int> iwork(static_cast<unsigned int> (5*nn));
-  std::vector<int> ifail(static_cast<unsigned int> (nn));
+  std::vector<int> iwork(static_cast<size_type> (5*nn));
+  std::vector<int> ifail(static_cast<size_type> (nn));
 
 
   // Optimal workspace query:
@@ -618,7 +618,7 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
   lwork = 8*nn > 1 ? 8*nn : 1; // no query mode
 #endif
   // resize workspace arrays
-  work.resize(static_cast<unsigned int> (lwork));
+  work.resize(static_cast<size_type> (lwork));
 
   // Finally compute the generalized
   // eigenvalues.
@@ -637,12 +637,12 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric(
 
   eigenvalues.reinit(n_eigenpairs);
   eigenvectors.resize(n_eigenpairs);
-  for (unsigned int i=0; i < static_cast<unsigned int> (n_eigenpairs); ++i)
+  for (size_type i=0; i < static_cast<size_type> (n_eigenpairs); ++i)
     {
       eigenvalues(i) = wr[i];
-      unsigned int col_begin(i*nn);
+      size_type col_begin(i*nn);
       eigenvectors[i].reinit(nn, true);
-      for (unsigned int j=0; j < static_cast<unsigned int> (nn); ++j)
+      for (size_type j=0; j < static_cast<size_type> (nn); ++j)
         {
           eigenvectors[i](j) = values_eigenvectors[col_begin+j];
         }
@@ -661,11 +661,11 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric (
 {
   Assert(state == matrix, ExcState(state));
   const int nn = this->n_cols();
-  Assert(static_cast<unsigned int>(nn) == this->n_rows(), ExcNotQuadratic());
+  Assert(static_cast<size_type>(nn) == this->n_rows(), ExcNotQuadratic());
   Assert(B.n_rows() == B.n_cols(), ExcNotQuadratic());
-  Assert(static_cast<unsigned int>(nn) == B.n_cols(),
+  Assert(static_cast<size_type>(nn) == B.n_cols(),
          ExcDimensionMismatch (nn, B.n_cols()));
-  Assert(eigenvectors.size() <= static_cast<unsigned int>(nn),
+  Assert(eigenvectors.size() <= static_cast<size_type>(nn),
          ExcMessage ("eigenvectors.size() > matrix.n_cols()"));
 
   wr.resize(nn);
@@ -719,7 +719,7 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric (
   lwork = 3*nn-1 > 1 ? 3*nn-1 : 1; // no query mode
 #endif
   // resize workspace array
-  work.resize((unsigned int) lwork);
+  work.resize((size_type) lwork);
 
   // Finally compute the generalized
   // eigenvalues.
@@ -734,11 +734,11 @@ LAPACKFullMatrix<number>::compute_generalized_eigenvalues_symmetric (
   if (info != 0)
     std::cerr << "LAPACK error in sygv" << std::endl;
 
-  for (unsigned int i=0; i < eigenvectors.size(); ++i)
+  for (size_type i=0; i < eigenvectors.size(); ++i)
     {
-      unsigned int col_begin(i*nn);
+      size_type col_begin(i*nn);
       eigenvectors[i].reinit(nn, true);
-      for (unsigned int j=0; j < static_cast<unsigned int>(nn); ++j)
+      for (size_type j=0; j < static_cast<size_type>(nn); ++j)
         {
           eigenvectors[i](j) = values_A[col_begin+j];
         }
@@ -805,9 +805,9 @@ LAPACKFullMatrix<number>::print_formatted (
         width = precision+2;
     }
 
-  for (unsigned int i=0; i<this->n_rows(); ++i)
+  for (size_type i=0; i<this->n_rows(); ++i)
     {
-      for (unsigned int j=0; j<this->n_cols(); ++j)
+      for (size_type j=0; j<this->n_cols(); ++j)
         if (std::fabs(this->el(i,j)) > threshold)
           out << std::setw(width)
               << this->el(i,j) * denominator << ' ';
index 174d6c3b82a4a35d6d44a54c650d32af31695093..3a42ff1a4db7b60d16d29719098ef4f27ee80d08 100644 (file)
@@ -17,7 +17,7 @@
 
 DEAL_II_NAMESPACE_OPEN
 
-MeanValueFilter::MeanValueFilter(unsigned int component)
+MeanValueFilter::MeanValueFilter(size_type component)
   :
   component(component)
 {}
index 95a74f15d2108d33ae9b7a0348d48456d144f96a..bb0790c3edeb079db1f5f3daaa39830d23af333f 100644 (file)
@@ -17,9 +17,9 @@
 DEAL_II_NAMESPACE_OPEN
 
 
-MatrixOut::Options::Options (const bool         show_absolute_values,
-                             const unsigned int block_size,
-                             const bool         discontinuous)
+MatrixOut::Options::Options (const bool      show_absolute_values,
+                             const size_type block_size,
+                             const bool      discontinuous)
   :
   show_absolute_values (show_absolute_values),
   block_size (block_size),
index b05b5fd4d718b1d2d0915d7c0a9aa43e025f8132..29cf44c234efdf1db6e9598d3e5b5fc1cc69ccb6 100644 (file)
@@ -41,8 +41,8 @@ namespace PETScWrappers
 
   void
   BlockSparseMatrix::
-  reinit (const unsigned int n_block_rows,
-          const unsigned int n_block_columns)
+  reinit (const size_type n_block_rows,
+          const size_type n_block_columns)
   {
     // first delete previous content of
     // the subobjects array
@@ -57,8 +57,8 @@ namespace PETScWrappers
     this->column_block_indices.reinit (n_block_columns, 0);
 
     // and reinitialize the blocks
-    for (unsigned int r=0; r<this->n_block_rows(); ++r)
-      for (unsigned int c=0; c<this->n_block_cols(); ++c)
+    for (size_type r=0; r<this->n_block_rows(); ++r)
+      for (size_type c=0; c<this->n_block_cols(); ++c)
         {
           BlockType *p = new BlockType();
           this->sub_objects[r][c] = p;
index 50a1da2298798f8e9c9d52a90b69a8860e3156cc..81746030d13941568cc88335138fdbec376da154 100644 (file)
@@ -22,8 +22,8 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace PETScWrappers
 {
-  FullMatrix::FullMatrix (const unsigned int m,
-                          const unsigned int n)
+  FullMatrix::FullMatrix (const size_type m,
+                          const size_type n)
   {
     const int ierr
       = MatCreateSeqDense(PETSC_COMM_SELF, m, n, PETSC_NULL,
index c8a3d456c1a2a2d0687ab7521a8a9b302ec2cb68..0a6144e6d5a25fb9bcc200a52b3a737292586a6b 100644 (file)
@@ -63,8 +63,7 @@ namespace PETScWrappers
       // iterator for an empty line (what
       // would it point to?)
       Assert (ncols != 0, ExcInternalError());
-      colnum_cache.reset (new std::vector<unsigned int> (colnums,
-                                                         colnums+ncols));
+      colnum_cache.reset (new std::vector<size_type> (colnums, colnums+ncols));
       value_cache.reset (new std::vector<PetscScalar> (values, values+ncols));
 
       // and finally restore the matrix
@@ -134,8 +133,8 @@ namespace PETScWrappers
 
 
   void
-  MatrixBase::clear_row (const unsigned int row,
-                         const PetscScalar  new_diag_value)
+  MatrixBase::clear_row (const size_type   row,
+                         const PetscScalar new_diag_value)
   {
     compress ();
 
@@ -171,8 +170,8 @@ namespace PETScWrappers
 
 
   void
-  MatrixBase::clear_rows (const std::vector<unsigned int> &rows,
-                          const PetscScalar                new_diag_value)
+  MatrixBase::clear_rows (const std::vector<size_type> &rows,
+                          const PetscScalar             new_diag_value)
   {
     compress ();
 
@@ -214,8 +213,8 @@ namespace PETScWrappers
 
 
   PetscScalar
-  MatrixBase::el (const unsigned int i,
-                  const unsigned int j) const
+  MatrixBase::el (const size_type i,
+                  const size_type j) const
   {
 #ifdef PETSC_USE_64BIT_INDICES
     PetscInt
@@ -236,7 +235,7 @@ namespace PETScWrappers
 
 
   PetscScalar
-  MatrixBase::diag_element (const unsigned int i) const
+  MatrixBase::diag_element (const size_type i) const
   {
     Assert (m() == n(), ExcNotQuadratic());
 
@@ -263,7 +262,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  size_type 
   MatrixBase::m () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -280,7 +279,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  size_type 
   MatrixBase::n () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -297,7 +296,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  size_type 
   MatrixBase::local_size () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -314,7 +313,7 @@ namespace PETScWrappers
 
 
 
-  std::pair<unsigned int, unsigned int>
+  std::pair<size_type, size_type>
   MatrixBase::local_range () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -332,7 +331,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  size_type 
   MatrixBase::n_nonzero_elements () const
   {
     MatInfo mat_info;
@@ -340,14 +339,14 @@ namespace PETScWrappers
       = MatGetInfo (matrix, MAT_GLOBAL_SUM, &mat_info);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-    return static_cast<unsigned int>(mat_info.nz_used);
+    return static_cast<size_type>(mat_info.nz_used);
   }
 
 
 
-  unsigned int
+  size_type 
   MatrixBase::
-  row_length (const unsigned int row) const
+  row_length (const size_type row) const
   {
 //TODO: this function will probably only work if compress() was called on the
 //matrix previously. however, we can't do this here, since it would impose
@@ -616,7 +615,7 @@ namespace PETScWrappers
     MatInfo info;
     MatGetInfo(matrix, MAT_LOCAL, &info);
 
-    return sizeof(*this) + static_cast<unsigned int>(info.memory);
+    return sizeof(*this) + static_cast<size_type>(info.memory);
   }
 
 }
index 5b46603bdb9f63afd520e664912dba0a31c6457e..7bbb59c1841ed8fbe9e8963bee5c22c2de6a5644 100644 (file)
@@ -42,8 +42,8 @@ namespace PETScWrappers
 
     void
     BlockSparseMatrix::
-    reinit (const unsigned int n_block_rows,
-            const unsigned int n_block_columns)
+    reinit (const size_type n_block_rows,
+            const size_type n_block_columns)
     {
       // first delete previous content of
       // the subobjects array
@@ -58,8 +58,8 @@ namespace PETScWrappers
       this->column_block_indices.reinit (n_block_columns, 0);
 
       // and reinitialize the blocks
-      for (unsigned int r=0; r<this->n_block_rows(); ++r)
-        for (unsigned int c=0; c<this->n_block_cols(); ++c)
+      for (size_type r=0; r<this->n_block_rows(); ++r)
+        for (size_type c=0; c<this->n_block_cols(); ++c)
           {
             BlockType *p = new BlockType();
             this->sub_objects[r][c] = p;
index 6fc035b56c284d56b52734dd7bc5ad6df6a956b5..a1fa31752a6332e81576c7e7349fac7e8177ca7d 100644 (file)
@@ -42,13 +42,13 @@ namespace PETScWrappers
 
 
 
-    SparseMatrix::SparseMatrix (const MPI_Comm    &communicator,
-                                const unsigned int m,
-                                const unsigned int n,
-                                const unsigned int local_rows,
-                                const unsigned int local_columns,
-                                const unsigned int n_nonzero_per_row,
-                                const bool         is_symmetric)
+    SparseMatrix::SparseMatrix (const MPI_Comm  &communicator,
+                                const size_type  m,
+                                const size_type  n,
+                                const size_type  local_rows,
+                                const size_type  local_columns,
+                                const size_type  n_nonzero_per_row,
+                                const bool       is_symmetric)
       :
       communicator (communicator)
     {
@@ -58,13 +58,13 @@ namespace PETScWrappers
 
 
 
-    SparseMatrix::SparseMatrix (const MPI_Comm    &communicator,
-                                const unsigned int m,
-                                const unsigned int n,
-                                const unsigned int local_rows,
-                                const unsigned int local_columns,
-                                const std::vector<unsigned int> &row_lengths,
-                                const bool         is_symmetric)
+    SparseMatrix::SparseMatrix (const MPI_Comm               &communicator,
+                                const size_type               m,
+                                const size_type               n,
+                                const size_type               local_rows,
+                                const size_type               local_columns,
+                                const std::vector<size_type> &row_lengths,
+                                const bool                    is_symmetric)
       :
       communicator (communicator)
     {
@@ -76,12 +76,12 @@ namespace PETScWrappers
 
     template <typename SparsityType>
     SparseMatrix::
-    SparseMatrix (const MPI_Comm                  &communicator,
-                  const SparsityType              &sparsity_pattern,
-                  const std::vector<unsigned int> &local_rows_per_process,
-                  const std::vector<unsigned int> &local_columns_per_process,
-                  const unsigned int               this_process,
-                  const bool                       preset_nonzero_locations)
+    SparseMatrix (const MPI_Comm               &communicator,
+                  const SparsityType           &sparsity_pattern,
+                  const std::vector<size_type> &local_rows_per_process,
+                  const std::vector<size_type> &local_columns_per_process,
+                  const unsigned int            this_process,
+                  const bool                    preset_nonzero_locations)
       :
       communicator (communicator)
     {
@@ -102,13 +102,13 @@ namespace PETScWrappers
 
 
     void
-    SparseMatrix::reinit (const MPI_Comm    &communicator,
-                          const unsigned int m,
-                          const unsigned int n,
-                          const unsigned int local_rows,
-                          const unsigned int local_columns,
-                          const unsigned int n_nonzero_per_row,
-                          const bool         is_symmetric)
+    SparseMatrix::reinit (const MPI_Comm  &communicator,
+                          const size_type  m,
+                          const size_type  n,
+                          const size_type  local_rows,
+                          const size_type  local_columns,
+                          const size_type  n_nonzero_per_row,
+                          const bool       is_symmetric)
     {
       this->communicator = communicator;
 
@@ -128,13 +128,13 @@ namespace PETScWrappers
 
 
     void
-    SparseMatrix::reinit (const MPI_Comm    &communicator,
-                          const unsigned int m,
-                          const unsigned int n,
-                          const unsigned int local_rows,
-                          const unsigned int local_columns,
-                          const std::vector<unsigned int> &row_lengths,
-                          const bool         is_symmetric)
+    SparseMatrix::reinit (const MPI_Comm               &communicator,
+                          const size_type               m,
+                          const size_type               n,
+                          const size_type               local_rows,
+                          const size_type               local_columns,
+                          const std::vector<size_type> &row_lengths,
+                          const bool                    is_symmetric)
     {
       this->communicator = communicator;
 
@@ -155,12 +155,12 @@ namespace PETScWrappers
     template <typename SparsityType>
     void
     SparseMatrix::
-    reinit (const MPI_Comm                  &communicator,
-            const SparsityType              &sparsity_pattern,
-            const std::vector<unsigned int> &local_rows_per_process,
-            const std::vector<unsigned int> &local_columns_per_process,
-            const unsigned int               this_process,
-            const bool                       preset_nonzero_locations)
+    reinit (const MPI_Comm               &communicator,
+            const SparsityType           &sparsity_pattern,
+            const std::vector<size_type> &local_rows_per_process,
+            const std::vector<size_type> &local_columns_per_process,
+            const unsigned int            this_process,
+            const bool                    preset_nonzero_locations)
     {
       this->communicator = communicator;
 
@@ -181,12 +181,12 @@ namespace PETScWrappers
 
 
     void
-    SparseMatrix::do_reinit (const unsigned int m,
-                             const unsigned int n,
-                             const unsigned int local_rows,
-                             const unsigned int local_columns,
-                             const unsigned int n_nonzero_per_row,
-                             const bool         is_symmetric)
+    SparseMatrix::do_reinit (const size_type m,
+                             const size_type n,
+                             const size_type local_rows,
+                             const size_type local_columns,
+                             const size_type n_nonzero_per_row,
+                             const bool      is_symmetric)
     {
       Assert (local_rows <= m, ExcLocalRowsTooLarge (local_rows, m));
 
@@ -233,12 +233,12 @@ namespace PETScWrappers
 
 
     void
-    SparseMatrix::do_reinit (const unsigned int m,
-                             const unsigned int n,
-                             const unsigned int local_rows,
-                             const unsigned int local_columns,
-                             const std::vector<unsigned int> &row_lengths,
-                             const bool         is_symmetric)
+    SparseMatrix::do_reinit (const size_type m,
+                             const size_type n,
+                             const size_type local_rows,
+                             const size_type local_columns,
+                             const std::vector<size_type> &row_lengths,
+                             const bool      is_symmetric)
     {
       Assert (local_rows <= m, ExcLocalRowsTooLarge (local_rows, m));
 
@@ -251,7 +251,7 @@ namespace PETScWrappers
       // MatCreateMPIAIJ throws an
       // error. In this case use a
       // PETScWrappers::SparseMatrix
-      for (unsigned int i=0; i<row_lengths.size(); ++i)
+      for (size_type i=0; i<row_lengths.size(); ++i)
         Assert(row_lengths[i]<=local_columns,
                ExcIndexRange(row_lengths[i], 1, local_columns+1));
 
@@ -317,11 +317,11 @@ namespace PETScWrappers
     template <typename SparsityType>
     void
     SparseMatrix::
-    do_reinit (const SparsityType              &sparsity_pattern,
-               const std::vector<unsigned int> &local_rows_per_process,
-               const std::vector<unsigned int> &local_columns_per_process,
-               const unsigned int               this_process,
-               const bool                       preset_nonzero_locations)
+    do_reinit (const SparsityType           &sparsity_pattern,
+               const std::vector<size_type> &local_rows_per_process,
+               const std::vector<size_type> &local_columns_per_process,
+               const unsigned int            this_process,
+               const bool                    preset_nonzero_locations)
     {
       Assert (local_rows_per_process.size() == local_columns_per_process.size(),
               ExcDimensionMismatch (local_rows_per_process.size(),
@@ -335,14 +335,14 @@ namespace PETScWrappers
       // and how many arent. for this, we
       // first have to know which areas are
       // ours
-      unsigned int local_row_start = 0;
-      unsigned int local_col_start = 0;
+      size_type local_row_start = 0;
+      size_type local_col_start = 0;
       for (unsigned int p=0; p<this_process; ++p)
         {
           local_row_start += local_rows_per_process[p];
           local_col_start += local_columns_per_process[p];
         }
-      const unsigned int
+      const size_type 
       local_row_end = local_row_start + local_rows_per_process[this_process];
 
 #if DEAL_II_PETSC_VERSION_LT(2,3,3)
@@ -351,7 +351,7 @@ namespace PETScWrappers
       //at least starting from 2.3.3 (tested,
       //see below)
 
-      const unsigned int
+      const size_type 
       local_col_end = local_col_start + local_columns_per_process[this_process];
 
       // then count the elements in- and
@@ -363,10 +363,10 @@ namespace PETScWrappers
 #endif
       row_lengths_in_window (local_row_end - local_row_start),
                             row_lengths_out_of_window (local_row_end - local_row_start);
-      for (unsigned int row = local_row_start; row<local_row_end; ++row)
-        for (unsigned int c=0; c<sparsity_pattern.row_length(row); ++c)
+      for (size_type row = local_row_start; row<local_row_end; ++row)
+        for (size_type c=0; c<sparsity_pattern.row_length(row); ++c)
           {
-            const unsigned int column = sparsity_pattern.column_number(row,c);
+            const size_type column = sparsity_pattern.column_number(row,c);
 
             if ((column >= local_col_start) &&
                 (column < local_col_end))
@@ -447,11 +447,11 @@ namespace PETScWrappers
 #endif
           row_entries;
           std::vector<PetscScalar> row_values;
-          for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
+          for (size_type i=0; i<sparsity_pattern.n_rows(); ++i)
             {
               row_entries.resize (sparsity_pattern.row_length(i));
               row_values.resize (sparsity_pattern.row_length(i), 0.0);
-              for (unsigned int j=0; j<sparsity_pattern.row_length(i); ++j)
+              for (size_type j=0; j<sparsity_pattern.row_length(i); ++j)
                 row_entries[j] = sparsity_pattern.column_number (i,j);
 
               const int int_row = i;
@@ -478,10 +478,10 @@ namespace PETScWrappers
           rowstart_in_window (local_row_end - local_row_start + 1, 0),
                              colnums_in_window;
           {
-            unsigned int n_cols = 0;
-            for (unsigned int i=local_row_start; i<local_row_end; ++i)
+            size_type n_cols = 0;
+            for (size_type i=local_row_start; i<local_row_end; ++i)
               {
-                const unsigned int row_length = sparsity_pattern.row_length(i);
+                const size_type row_length = sparsity_pattern.row_length(i);
                 rowstart_in_window[i+1-local_row_start]
                   = rowstart_in_window[i-local_row_start] + row_length;
                 n_cols += row_length;
@@ -499,7 +499,7 @@ namespace PETScWrappers
 #endif
             * ptr = & colnums_in_window[0];
 
-            for (unsigned int i=local_row_start; i<local_row_end; ++i)
+            for (size_type i=local_row_start; i<local_row_end; ++i)
               {
                 typename SparsityType::row_iterator
                 row_start = sparsity_pattern.row_begin(i),
@@ -544,7 +544,7 @@ namespace PETScWrappers
             values (sparsity_pattern.max_entries_per_row(),
                     1.);
 
-            for (unsigned int i=local_row_start; i<local_row_end; ++i)
+            for (size_type i=local_row_start; i<local_row_end; ++i)
               {
 #ifdef PETSC_USE_64BIT_INDICES
                 PetscInt
@@ -618,63 +618,63 @@ namespace PETScWrappers
     template
     SparseMatrix::SparseMatrix (const MPI_Comm &,
                                 const SparsityPattern &,
-                                const std::vector<unsigned int> &,
-                                const std::vector<unsigned int> &,
+                                const std::vector<size_type &,
+                                const std::vector<size_type> &,
                                 const unsigned int,
                                 const bool);
     template
     SparseMatrix::SparseMatrix (const MPI_Comm &,
                                 const CompressedSparsityPattern &,
-                                const std::vector<unsigned int> &,
-                                const std::vector<unsigned int> &,
+                                const std::vector<size_type> &,
+                                const std::vector<size_type> &,
                                 const unsigned int,
                                 const bool);
     template
     SparseMatrix::SparseMatrix (const MPI_Comm &,
                                 const CompressedSimpleSparsityPattern &,
-                                const std::vector<unsigned int> &,
-                                const std::vector<unsigned int> &,
+                                const std::vector<size_type> &,
+                                const std::vector<size_type> &,
                                 const unsigned int,
                                 const bool);
 
     template void
     SparseMatrix::reinit (const MPI_Comm &,
                           const SparsityPattern &,
-                          const std::vector<unsigned int> &,
-                          const std::vector<unsigned int> &,
+                          const std::vector<size_type> &,
+                          const std::vector<size_type> &,
                           const unsigned int,
                           const bool);
     template void
     SparseMatrix::reinit (const MPI_Comm &,
                           const CompressedSparsityPattern &,
-                          const std::vector<unsigned int> &,
-                          const std::vector<unsigned int> &,
+                          const std::vector<size_type> &,
+                          const std::vector<size_type> &,
                           const unsigned int,
                           const bool);
     template void
     SparseMatrix::reinit (const MPI_Comm &,
                           const CompressedSimpleSparsityPattern &,
-                          const std::vector<unsigned int> &,
-                          const std::vector<unsigned int> &,
+                          const std::vector<size_type> &,
+                          const std::vector<size_type> &,
                           const unsigned int,
                           const bool);
 
     template void
     SparseMatrix::do_reinit (const SparsityPattern &,
-                             const std::vector<unsigned int> &,
-                             const std::vector<unsigned int> &,
+                             const std::vector<size_type> &,
+                             const std::vector<size_type> &,
                              const unsigned int ,
                              const bool);
     template void
     SparseMatrix::do_reinit (const CompressedSparsityPattern &,
-                             const std::vector<unsigned int> &,
-                             const std::vector<unsigned int> &,
+                             const std::vector<size_type> &,
+                             const std::vector<size_type> &,
                              const unsigned int ,
                              const bool);
     template void
     SparseMatrix::do_reinit (const CompressedSimpleSparsityPattern &,
-                             const std::vector<unsigned int> &,
-                             const std::vector<unsigned int> &,
+                             const std::vector<size_type> &,
+                             const std::vector<size_type> &,
                              const unsigned int ,
                              const bool);
 
index d790c406135abc7261c489d546e05c4864e47d15..5f8bc77c80aba141b3d02ab87440028c059f12af 100644 (file)
@@ -41,9 +41,9 @@ namespace PETScWrappers
 
 
 
-    Vector::Vector (const MPI_Comm    &communicator,
-                    const unsigned int n,
-                    const unsigned int local_size)
+    Vector::Vector (const MPI_Comm &communicator,
+                    const size_type n,
+                    const size_type local_size)
       :
       communicator (communicator)
     {
@@ -52,9 +52,9 @@ namespace PETScWrappers
 
 
 
-    Vector::Vector (const MPI_Comm    &communicator,
+    Vector::Vector (const MPI_Comm   &communicator,
                     const VectorBase &v,
-                    const unsigned int local_size)
+                    const size_type   local_size)
       :
       communicator (communicator)
     {
@@ -89,10 +89,10 @@ namespace PETScWrappers
     }
 
     void
-    Vector::reinit (const MPI_Comm    &comm,
-                    const unsigned int n,
-                    const unsigned int local_sz,
-                    const bool         fast)
+    Vector::reinit (const MPI_Comm  &comm,
+                    const size_type  n,
+                    const size_type  local_sz,
+                    const bool       fast)
     {
       communicator = comm;
 
@@ -194,7 +194,7 @@ namespace PETScWrappers
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       // then copy:
-      const std::pair<unsigned int, unsigned int>
+      const std::pair<size_type, size_type>
       local_elements = local_range ();
       std::copy (src_array + local_elements.first,
                  src_array + local_elements.second,
@@ -214,8 +214,8 @@ namespace PETScWrappers
 
 
     void
-    Vector::create_vector (const unsigned int  n,
-                           const unsigned int  local_size)
+    Vector::create_vector (const size_type n,
+                           const size_type local_size)
     {
       Assert (local_size <= n, ExcIndexRange (local_size, 0, n));
       ghosted = false;
@@ -232,19 +232,15 @@ namespace PETScWrappers
 
 
     void
-    Vector::create_vector (const unsigned int  n,
-                           const unsigned int  local_size,
+    Vector::create_vector (const size_type n,
+                           const size_type local_size,
                            const IndexSet &ghostnodes)
     {
       Assert (local_size <= n, ExcIndexRange (local_size, 0, n));
       ghosted = true;
       ghost_indices = ghostnodes;
 
-      //64bit indices won't work yet:
-      Assert (sizeof(unsigned int)==sizeof(PetscInt), ExcInternalError());
-
-
-      std::vector<unsigned int> ghostindices;
+      std::vector<size_type> ghostindices;
       ghostnodes.fill_index_vector(ghostindices);
 
       const PetscInt *ptr
@@ -279,7 +275,7 @@ namespace PETScWrappers
 
       ierr = VecGetOwnershipRange (vector, &begin, &end);
 
-      Assert(local_size==(unsigned int)(end-begin), ExcInternalError());
+      Assert(local_size==(size_type)(end-begin), ExcInternalError());
 
       Vec l;
       ierr = VecGhostGetLocalForm(vector, &l);
index 53b734e816000aefade210086b5c6e986aefdb74..e2662618f1490994aa1fa891ab06dbe347349215 100644 (file)
@@ -37,20 +37,20 @@ namespace PETScWrappers
 
 
 
-  SparseMatrix::SparseMatrix (const unsigned int m,
-                              const unsigned int n,
-                              const unsigned int n_nonzero_per_row,
-                              const bool         is_symmetric)
+  SparseMatrix::SparseMatrix (const size_type m,
+                              const size_type n,
+                              const size_type n_nonzero_per_row,
+                              const bool      is_symmetric)
   {
     do_reinit (m, n, n_nonzero_per_row, is_symmetric);
   }
 
 
 
-  SparseMatrix::SparseMatrix (const unsigned int m,
-                              const unsigned int n,
-                              const std::vector<unsigned int> &row_lengths,
-                              const bool         is_symmetric)
+  SparseMatrix::SparseMatrix (const size_type               m,
+                              const size_type               n,
+                              const std::vector<size_type> &row_lengths,
+                              const bool                    is_symmetric)
   {
     do_reinit (m, n, row_lengths, is_symmetric);
   }
@@ -77,10 +77,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::reinit (const unsigned int m,
-                        const unsigned int n,
-                        const unsigned int n_nonzero_per_row,
-                        const bool         is_symmetric)
+  SparseMatrix::reinit (const size_type m,
+                        const size_type n,
+                        const size_type n_nonzero_per_row,
+                        const bool      is_symmetric)
   {
     // get rid of old matrix and generate a
     // new one
@@ -97,10 +97,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::reinit (const unsigned int m,
-                        const unsigned int n,
-                        const std::vector<unsigned int> &row_lengths,
-                        const bool         is_symmetric)
+  SparseMatrix::reinit (const size_type               m,
+                        const size_type               n,
+                        const std::vector<size_type> &row_lengths,
+                        const bool                    is_symmetric)
   {
     // get rid of old matrix and generate a
     // new one
@@ -147,10 +147,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::do_reinit (const unsigned int m,
-                           const unsigned int n,
-                           const unsigned int n_nonzero_per_row,
-                           const bool         is_symmetric)
+  SparseMatrix::do_reinit (const size_type m,
+                           const size_type n,
+                           const size_type n_nonzero_per_row,
+                           const bool      is_symmetric)
   {
     // use the call sequence indicating only
     // a maximal number of elements per row
@@ -178,10 +178,10 @@ namespace PETScWrappers
 
 
   void
-  SparseMatrix::do_reinit (const unsigned int m,
-                           const unsigned int n,
-                           const std::vector<unsigned int> &row_lengths,
-                           const bool         is_symmetric)
+  SparseMatrix::do_reinit (const size_type               m,
+                           const size_type               n,
+                           const std::vector<size_type> &row_lengths,
+                           const bool                    is_symmetric)
   {
     Assert (row_lengths.size() == m,
             ExcDimensionMismatch (row_lengths.size(), m));
@@ -227,8 +227,8 @@ namespace PETScWrappers
   SparseMatrix::do_reinit (const SparsityType &sparsity_pattern,
                            const bool          preset_nonzero_locations)
   {
-    std::vector<unsigned int> row_lengths (sparsity_pattern.n_rows());
-    for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
+    std::vector<size_type> row_lengths (sparsity_pattern.n_rows());
+    for (size_type i=0; i<sparsity_pattern.n_rows(); ++i)
       row_lengths[i] = sparsity_pattern.row_length (i);
 
     do_reinit (sparsity_pattern.n_rows(),
@@ -257,11 +257,11 @@ namespace PETScWrappers
 #endif
         row_entries;
         std::vector<PetscScalar> row_values;
-        for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
+        for (size_type i=0; i<sparsity_pattern.n_rows(); ++i)
           {
             row_entries.resize (row_lengths[i]);
             row_values.resize (row_lengths[i], 0.0);
-            for (unsigned int j=0; j<row_lengths[i]; ++j)
+            for (size_type j=0; j<row_lengths[i]; ++j)
               row_entries[j] = sparsity_pattern.column_number (i,j);
 
 #ifdef PETSC_USE_64BIT_INDICES
index 47e116bb5c1ad736d2d62b7fad97f29e9b77ab2c..d76248c9b7bd6c005dd7180e507562deb96162d5 100644 (file)
@@ -31,7 +31,7 @@ namespace PETScWrappers
 
 
 
-  Vector::Vector (const unsigned int n)
+  Vector::Vector (const size_type n)
   {
     Vector::create_vector (n);
   }
@@ -61,8 +61,8 @@ namespace PETScWrappers
 
 
   void
-  Vector::reinit (const unsigned int n,
-                  const bool         fast)
+  Vector::reinit (const size_type n,
+                  const bool      fast)
   {
     // only do something if the sizes
     // mismatch
@@ -107,7 +107,7 @@ namespace PETScWrappers
 
 
   void
-  Vector::create_vector (const unsigned int n)
+  Vector::create_vector (const size_type n)
   {
     const int ierr
       = VecCreateSeq (PETSC_COMM_SELF, n, &vector);
index c34a6138eb0d8ca123cc96e4aaf3627f454fbd6c..ef58923090ab830c8ccaa8a54ca7b9af57277f38 100644 (file)
@@ -90,8 +90,8 @@ namespace PETScWrappers
 
               PetscScalar value;
 
-              if ( index>=static_cast<unsigned int>(begin)
-                   && index<static_cast<unsigned int>(end) )
+              if ( index>=static_cast<size_type>(begin)
+                   && index<static_cast<size_type>(end) )
                 {
                   //local entry
                   value = *(ptr+index-begin);
@@ -99,10 +99,10 @@ namespace PETScWrappers
               else
                 {
                   //ghost entry
-                  const unsigned int ghostidx
+                  const size_type ghostidx
                     = vector.ghost_indices.index_within_set(index);
 
-                  Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError());
+                  Assert(ghostidx+end-begin<(size_type)lsize, ExcInternalError());
                   value = *(ptr+ghostidx+end-begin);
                 }
 
@@ -131,8 +131,8 @@ namespace PETScWrappers
 
 
 
-          AssertThrow ((index >= static_cast<unsigned int>(begin)) &&
-                       (index < static_cast<unsigned int>(end)),
+          AssertThrow ((index >= static_cast<size_type>(begin)) &&
+                       (index < static_cast<size_type>(end)),
                        ExcAccessToNonlocalElement (index, begin, end-1));
 
           // old version which only work with
@@ -263,7 +263,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  size_type 
   VectorBase::size () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -280,7 +280,7 @@ namespace PETScWrappers
 
 
 
-  unsigned int
+  size_type 
   VectorBase::local_size () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -297,7 +297,7 @@ namespace PETScWrappers
 
 
 
-  std::pair<unsigned int, unsigned int>
+  std::pair<size_type, size_type>
   VectorBase::local_range () const
   {
 #ifdef PETSC_USE_64BIT_INDICES
@@ -316,7 +316,7 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::set (const std::vector<unsigned int> &indices,
+  VectorBase::set (const std::vector<size_type> &indices,
                    const std::vector<PetscScalar> &values)
   {
     Assert (indices.size() == values.size(),
@@ -327,7 +327,7 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::add (const std::vector<unsigned int> &indices,
+  VectorBase::add (const std::vector<size_type> &indices,
                    const std::vector<PetscScalar> &values)
   {
     Assert (indices.size() == values.size(),
@@ -338,7 +338,7 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::add (const std::vector<unsigned int>    &indices,
+  VectorBase::add (const std::vector<size_type>    &indices,
                    const ::dealii::Vector<PetscScalar> &values)
   {
     Assert (indices.size() == values.size(),
@@ -349,9 +349,9 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::add (const unsigned int  n_elements,
-                   const unsigned int *indices,
-                   const PetscScalar  *values)
+  VectorBase::add (const size_type    n_elements,
+                   const size_type   *indices,
+                   const PetscScalar *values)
   {
     do_set_add_operation(n_elements, indices, values, true);
   }
@@ -1040,10 +1040,10 @@ namespace PETScWrappers
       out.setf (std::ios::fixed, std::ios::floatfield);
 
     if (across)
-      for (unsigned int i=0; i<size(); ++i)
+      for (size_type i=0; i<size(); ++i)
         out << val[i] << ' ';
     else
-      for (unsigned int i=0; i<size(); ++i)
+      for (size_type i=0; i<size(); ++i)
         out << val[i] << std::endl;
     out << std::endl;
 
@@ -1095,10 +1095,10 @@ namespace PETScWrappers
 
 
   void
-  VectorBase::do_set_add_operation (const unsigned int  n_elements,
-                                    const unsigned int *indices,
-                                    const PetscScalar  *values,
-                                    const bool          add_values)
+  VectorBase::do_set_add_operation (const size_type    n_elements,
+                                    const size_type   *indices,
+                                    const PetscScalar *values,
+                                    const bool         add_values)
   {
     ::dealii::VectorOperation::values action = (add_values ?
                                                 ::dealii::VectorOperation::add :
@@ -1119,7 +1119,7 @@ namespace PETScWrappers
       {
 #ifdef PETSC_USE_64BIT_INDICES
         std::vector<PetscInt> petsc_ind (n_elements);
-        for (unsigned int i=0; i<n_elements; ++i)
+        for (size_type i=0; i<n_elements; ++i)
           petsc_ind[i] = indices[i];
         const PetscInt *petsc_indices = &petsc_ind[0];
 #else

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.