From d44ba2f7407740c234e2debf082addf1d15b8408 Mon Sep 17 00:00:00 2001 From: turcksin Date: Mon, 15 Apr 2013 16:56:14 +0000 Subject: [PATCH] Fix some conversion warnings. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29289 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/dofs/dof_accessor.templates.h | 5 +- deal.II/include/deal.II/dofs/number_cache.h | 2 +- .../include/deal.II/lac/block_matrix_base.h | 68 +++++++++---------- .../deal.II/lac/block_sparse_matrix_ez.h | 44 ++++++------ .../lac/block_sparse_matrix_ez.templates.h | 36 +++++----- deal.II/include/deal.II/lac/matrix_block.h | 4 +- 6 files changed, 80 insertions(+), 79 deletions(-) diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index 8f6a07ae0b..f08bd965a8 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -2289,7 +2289,7 @@ DoFAccessor<0,DH<1,spacedim>, lda>::get_dof_indices ( std::vector &dof_indices, const unsigned int fe_index) const { - for (types::global_dof_index i=0; i inline - typename AccessorBase::size_type + unsigned int AccessorBase::block_row() const { - Assert (row_block != numbers::invalid_size_type, + Assert (row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); return row_block; @@ -1305,10 +1305,10 @@ namespace BlockMatrixIterators template inline - typename AccessorBase::size_type + unsigned int AccessorBase::block_column() const { - Assert (col_block != numbers::invalid_size_type, + Assert (col_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); return col_block; @@ -1319,8 +1319,8 @@ namespace BlockMatrixIterators inline Accessor::Accessor ( const BlockMatrix *matrix, - const size_type row, - const size_type col) + const size_type row, + const size_type col) : matrix(matrix), base_iterator(matrix->block(0,0).begin()) @@ -1331,7 +1331,7 @@ namespace BlockMatrixIterators // the end of the matrix if (row < matrix->m()) { - const std::pair indices + const std::pair indices = matrix->row_block_indices.global_to_local(row); // find the first block that does @@ -1361,8 +1361,8 @@ namespace BlockMatrixIterators { // we were asked to create the end // iterator for this matrix - this->row_block = numbers::invalid_size_type; - this->col_block = numbers::invalid_size_type; + this->row_block = numbers::invalid_unsigned_int; + this->col_block = numbers::invalid_unsigned_int; } } @@ -1396,7 +1396,7 @@ namespace BlockMatrixIterators typename Accessor::size_type Accessor::row() const { - Assert (this->row_block != numbers::invalid_size_type, + Assert (this->row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); return (matrix->row_block_indices.local_to_global(this->row_block, 0) + @@ -1409,7 +1409,7 @@ namespace BlockMatrixIterators typename Accessor::size_type Accessor::column() const { - Assert (this->col_block != numbers::invalid_size_type, + Assert (this->col_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); return (matrix->column_block_indices.local_to_global(this->col_block,0) + @@ -1422,9 +1422,9 @@ namespace BlockMatrixIterators typename Accessor::value_type Accessor::value () const { - Assert (this->row_block != numbers::invalid_size_type, + Assert (this->row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); - Assert (this->col_block != numbers::invalid_size_type, + Assert (this->col_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); return base_iterator->value(); @@ -1437,9 +1437,9 @@ namespace BlockMatrixIterators void Accessor::advance () { - Assert (this->row_block != numbers::invalid_size_type, + Assert (this->row_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); - Assert (this->col_block != numbers::invalid_size_type, + Assert (this->col_block != numbers::invalid_unsigned_int, ExcIteratorPastEnd()); // Remember current row inside block @@ -1485,8 +1485,8 @@ namespace BlockMatrixIterators ++this->row_block; if (this->row_block == matrix->n_block_rows()) { - this->row_block = numbers::invalid_size_type; - this->col_block = numbers::invalid_size_type; + this->row_block = numbers::invalid_unsigned_int; + this->col_block = numbers::invalid_unsigned_int; return; } } @@ -1512,9 +1512,9 @@ namespace BlockMatrixIterators // have to have the same // base_iterator representation, but // valid iterators have to - return (((this->row_block == numbers::invalid_size_type) + return (((this->row_block == numbers::invalid_unsigned_int) && - (this->col_block == numbers::invalid_size_type)) + (this->col_block == numbers::invalid_unsigned_int)) || (base_iterator == a.base_iterator)); @@ -1539,7 +1539,7 @@ namespace BlockMatrixIterators // the end of the matrix if (row < matrix->m()) { - const std::pair indices + const std::pair indices = matrix->row_block_indices.global_to_local(row); // find the first block that does @@ -1877,7 +1877,7 @@ BlockMatrixBase::set (const size_type i, Assert (numbers::is_finite(value), ExcNumberNotFinite()); - const std::pair + const std::pair row_index = row_block_indices.global_to_local (i), col_index = column_block_indices.global_to_local (j); block(row_index.first,col_index.first).set (row_index.second, @@ -2008,7 +2008,7 @@ BlockMatrixBase::set (const size_type row, if (value == 0 && elide_zero_values == true) continue; - const std::pair + const std::pair col_index = this->column_block_indices.global_to_local(col_indices[j]); const size_type local_index = counter_within_block[col_index.first]++; @@ -2031,7 +2031,7 @@ BlockMatrixBase::set (const size_type row, // where we should start reading out // data. Now let's write the data into // the individual blocks! - const std::pair + const std::pair row_index = this->row_block_indices.global_to_local (row); for (unsigned int block_col=0; block_col::add (const size_type i, (value == value_type())) return; - const std::pair + const std::pair row_index = row_block_indices.global_to_local (i), col_index = column_block_indices.global_to_local (j); block(row_index.first,col_index.first).add (row_index.second, @@ -2170,7 +2170,7 @@ BlockMatrixBase::add (const size_type row, else before = col_indices[i]; #endif - const std::pair + const std::pair row_index = this->row_block_indices.global_to_local (row); if (this->n_block_cols() > 1) @@ -2253,7 +2253,7 @@ BlockMatrixBase::add (const size_type row, if (value == 0 && elide_zero_values == true) continue; - const std::pair + const std::pair col_index = this->column_block_indices.global_to_local(col_indices[j]); const size_type local_index = counter_within_block[col_index.first]++; @@ -2276,7 +2276,7 @@ BlockMatrixBase::add (const size_type row, // where we should start reading out // data. Now let's write the data into // the individual blocks! - const std::pair + const std::pair row_index = this->row_block_indices.global_to_local (row); for (unsigned int block_col=0; block_col::value_type BlockMatrixBase::operator () (const size_type i, const size_type j) const { - const std::pair + const std::pair row_index = row_block_indices.global_to_local (i), col_index = column_block_indices.global_to_local (j); return block(row_index.first,col_index.first) (row_index.second, @@ -2344,7 +2344,7 @@ typename BlockMatrixBase::value_type BlockMatrixBase::el (const size_type i, const size_type j) const { - const std::pair + const std::pair row_index = row_block_indices.global_to_local (i), col_index = column_block_indices.global_to_local (j); return block(row_index.first,col_index.first).el (row_index.second, @@ -2361,7 +2361,7 @@ BlockMatrixBase::diag_element (const size_type i) const Assert (n_block_rows() == n_block_cols(), ExcNotQuadratic()); - const std::pair + const std::pair index = row_block_indices.global_to_local (i); return block(index.first,index.first).diag_element(index.second); } diff --git a/deal.II/include/deal.II/lac/block_sparse_matrix_ez.h b/deal.II/include/deal.II/lac/block_sparse_matrix_ez.h index 70d4898819..79db7b54b1 100644 --- a/deal.II/include/deal.II/lac/block_sparse_matrix_ez.h +++ b/deal.II/include/deal.II/lac/block_sparse_matrix_ez.h @@ -66,8 +66,8 @@ public: * blocks themselves still have * zero dimension. */ - BlockSparseMatrixEZ (const size_type block_rows, - const size_type block_cols); + BlockSparseMatrixEZ (const unsigned int block_rows, + const unsigned int block_cols); /** * Copy constructor. This is @@ -128,8 +128,8 @@ public: * called to update internal data * structures. */ - void reinit (const size_type n_block_rows, - const size_type n_block_cols); + void reinit (const unsigned int n_block_rows, + const unsigned int n_block_cols); /** * This function collects the * sizes of the sub-objects and @@ -149,8 +149,8 @@ public: * given coordinates. */ SparseMatrixEZ & - block (const size_type row, - const size_type column); + block (const unsigned int row, + const unsigned int column); /** @@ -159,20 +159,20 @@ public: * constant objects. */ const SparseMatrixEZ & - block (const size_type row, - const size_type column) const; + block (const unsigned int row, + const unsigned int column) const; /** * Return the number of blocks in a * column. */ - size_type n_block_rows () const; + unsigned int n_block_rows () const; /** * Return the number of blocks in a * row. */ - size_type n_block_cols () const; + unsigned int n_block_cols () const; /** * Return whether the object is @@ -333,7 +333,7 @@ private: template inline -typename BlockSparseMatrixEZ::size_type +unsigned int BlockSparseMatrixEZ::n_block_rows () const { return row_indices.size(); @@ -353,7 +353,7 @@ BlockSparseMatrixEZ::n_rows () const template inline -typename BlockSparseMatrixEZ::size_type +unsigned int BlockSparseMatrixEZ::n_block_cols () const { return column_indices.size(); @@ -374,8 +374,8 @@ BlockSparseMatrixEZ::n_cols () const template inline SparseMatrixEZ & -BlockSparseMatrixEZ::block (const size_type row, - const size_type column) +BlockSparseMatrixEZ::block (const unsigned int row, + const unsigned int column) { Assert (row::block (const size_type row, template inline const SparseMatrixEZ & -BlockSparseMatrixEZ::block (const size_type row, - const size_type column) const +BlockSparseMatrixEZ::block (const unsigned int row, + const unsigned int column) const { Assert (row::add (const size_type i, Assert (numbers::is_finite(value), ExcNumberNotFinite()); - const std::pair + const std::pair row_index = row_indices.global_to_local (i), col_index = column_indices.global_to_local (j); block(row_index.first,col_index.first).add (row_index.second, @@ -514,8 +514,8 @@ Tvmult (BlockVector &dst, dst = 0.; - for (size_type row=0; row &dst, Assert (src.n_blocks() == n_block_rows(), ExcDimensionMismatch(src.n_blocks(), n_block_rows())); - for (size_type row=0; row::BlockSparseMatrixEZ () template BlockSparseMatrixEZ:: -BlockSparseMatrixEZ (const size_type rows, - const size_type cols) +BlockSparseMatrixEZ (const unsigned int rows, + const unsigned int cols) : row_indices (rows, 0), column_indices (cols, 0) @@ -60,8 +60,8 @@ operator = (const BlockSparseMatrixEZ &m) // anything except than checking // whether the base objects want to // do something - for (size_type r=0; r::operator = (const double d) { Assert (d==0, ExcScalarAssignmentOnlyForZeroValue()); - for (size_type r=0; r::BlockSparseMatrixEZ ( template void -BlockSparseMatrixEZ::reinit (const size_type rows, - const size_type cols) +BlockSparseMatrixEZ::reinit (const unsigned int rows, + const unsigned int cols) { row_indices.reinit(rows, 0); column_indices.reinit(cols, 0); @@ -122,8 +122,8 @@ template bool BlockSparseMatrixEZ::empty () const { - for (size_type r=0; r void BlockSparseMatrixEZ::collect_sizes () { - const size_type rows = n_block_rows(); - const size_type columns = n_block_cols(); + const unsigned int rows = n_block_rows(); + const unsigned int columns = n_block_cols(); std::vector row_sizes (rows); std::vector col_sizes (columns); // first find out the row sizes // from the first block column - for (size_type r=0; r::collect_sizes () // then do the same with the columns - for (size_type c=0; c inline MatrixBlock::MatrixBlock() : - row(deal_II_numbers::invalid_size_type), - column(deal_II_numbers::invalid_size_type) + row(deal_II_numbers::invalid_unsigned_int), + column(deal_II_numbers::invalid_unsigned_int) {} -- 2.39.5