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;
- #else
- int begin, end;
- #endif
+
const int ierr = MatGetOwnershipRange (static_cast<const Mat &>(matrix),
&begin, &end);
AssertThrow (ierr == 0, ExcPETScError(ierr));
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;
- #else
- int begin, end;
- #endif
-
const int ierr = VecGetOwnershipRange (static_cast<const Vec &>(vector),
&begin, &end);
AssertThrow (ierr == 0, ExcPETScError(ierr));
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
- #else
- int
- #endif
- petsc_i = i, petsc_j = j;
+ PetscInt petsc_i = i, petsc_j = j;
+
PetscScalar value;
const int ierr
- unsigned int
+ MatrixBase::size_type
MatrixBase::m () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- n_rows, n_cols;
+ PetscInt n_rows, n_cols;
+
int ierr = MatGetSize (matrix, &n_rows, &n_cols);
AssertThrow (ierr == 0, ExcPETScError(ierr));
- unsigned int
+ MatrixBase::size_type
MatrixBase::n () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- n_rows, n_cols;
+ PetscInt n_rows, n_cols;
+
int ierr = MatGetSize (matrix, &n_rows, &n_cols);
AssertThrow (ierr == 0, ExcPETScError(ierr));
- unsigned int
+ MatrixBase::size_type
MatrixBase::local_size () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- n_rows, n_cols;
+ PetscInt n_rows, n_cols;
+
int ierr = MatGetLocalSize (matrix, &n_rows, &n_cols);
AssertThrow (ierr == 0, ExcPETScError(ierr));
- std::pair<unsigned int, unsigned int>
+ std::pair<MatrixBase::size_type, MatrixBase::size_type>
MatrixBase::local_range () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- begin, end;
+ PetscInt begin, end;
+
const int ierr = MatGetOwnershipRange (static_cast<const Mat &>(matrix),
&begin, &end);
AssertThrow (ierr == 0, ExcPETScError(ierr));
// then count the elements in- and
// out-of-window for the rows we own
- #ifdef PETSC_USE_64BIT_INDICES
std::vector<PetscInt>
- #else
- std::vector<int>
- #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))
// have to somehow clumsily work around
// the whole thing:
#if DEAL_II_PETSC_VERSION_LT(2,2,1)
-
- #ifdef PETSC_USE_64BIT_INDICES
std::vector<PetscInt>
- #else
- std::vector<int>
- #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);
// now copy over the information
// from the sparsity pattern.
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- * ptr = & colnums_in_window[0];
+ PetscInt* 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),
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
- #else
- int
- #endif
- petsc_i = i;
+ PetscInt petsc_i = i;
MatSetValues (matrix, 1, &petsc_i,
sparsity_pattern.row_length(i),
&colnums_in_window[rowstart_in_window[i-local_row_start]],
- unsigned int
+ VectorBase::size_type
VectorBase::size () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- sz;
+ PetscInt sz;
const int ierr = VecGetSize (vector, &sz);
AssertThrow (ierr == 0, ExcPETScError(ierr));
- unsigned int
+ VectorBase::size_type
VectorBase::local_size () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- sz;
+ PetscInt sz;
const int ierr = VecGetLocalSize (vector, &sz);
AssertThrow (ierr == 0, ExcPETScError(ierr));
- std::pair<unsigned int, unsigned int>
+ std::pair<VectorBase::size_type, VectorBase::size_type>
VectorBase::local_range () const
{
- #ifdef PETSC_USE_64BIT_INDICES
- PetscInt
- #else
- int
- #endif
- begin, end;
+ PetscInt begin, end;
const int ierr = VecGetOwnershipRange (static_cast<const Vec &>(vector),
&begin, &end);
AssertThrow (ierr == 0, ExcPETScError(ierr));