![]() |
Reference documentation for deal.II version 8.1.0
|
Public Types | |
typedef types::global_dof_index | size_type |
Public Member Functions | |
Accessor (const MatrixBase *matrix, const size_type row, const size_type index) | |
Accessor (const Accessor &a) | |
size_type | row () const |
size_type | index () const |
size_type | column () const |
PetscScalar | value () const |
DeclException0 (ExcBeyondEndOfMatrix) | |
DeclException3 (ExcAccessToNonlocalRow, int, int, int,<< "You tried to access row "<< arg1<< " of a distributed matrix, but only rows "<< arg2<< " through "<< arg3<< " are stored locally and can be accessed.") | |
Private Member Functions | |
void | visit_present_row () |
Private Attributes | |
MatrixBase * | matrix |
size_type | a_row |
size_type | a_index |
std_cxx1x::shared_ptr< const std::vector< size_type > > | colnum_cache |
std_cxx1x::shared_ptr< const std::vector< PetscScalar > > | value_cache |
Friends | |
class | const_iterator |
Accessor class for iterators
Definition at line 69 of file petsc_matrix_base.h.
Declare type for container size.
Definition at line 75 of file petsc_matrix_base.h.
PETScWrappers::MatrixIterators::const_iterator::Accessor::Accessor | ( | const MatrixBase * | matrix, |
const size_type | row, | ||
const size_type | index | ||
) |
Constructor. Since we use accessors only for read access, a const matrix pointer is sufficient.
PETScWrappers::MatrixIterators::const_iterator::Accessor::Accessor | ( | const Accessor & | a | ) |
Copy constructor.
size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::row | ( | ) | const |
Row number of the element represented by this object.
size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::index | ( | ) | const |
Index in row of the element represented by this object.
size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::column | ( | ) | const |
Column number of the element represented by this object.
PetscScalar PETScWrappers::MatrixIterators::const_iterator::Accessor::value | ( | ) | const |
Value of this matrix entry.
PETScWrappers::MatrixIterators::const_iterator::Accessor::DeclException0 | ( | ExcBeyondEndOfMatrix | ) |
Exception
PETScWrappers::MatrixIterators::const_iterator::Accessor::DeclException3 | ( | ExcAccessToNonlocalRow | , |
int | , | ||
int | , | ||
int | , | ||
<< "You tried to access row "<< arg1<< " of a distributed | matrix, | ||
but only rows"<< arg2<< "through"<< arg3<< "are stored locally and can be accessed." | |||
) |
Exception
|
private |
Discard the old row caches (they may still be used by other accessors) and generate new ones for the row pointed to presently by this accessor.
|
friend |
Make enclosing class a friend.
Definition at line 193 of file petsc_matrix_base.h.
|
mutableprivate |
The matrix accessed.
Definition at line 136 of file petsc_matrix_base.h.
|
private |
Current row number.
Definition at line 141 of file petsc_matrix_base.h.
|
private |
Current index in row.
Definition at line 146 of file petsc_matrix_base.h.
|
private |
Cache where we store the column indices of the present row. This is necessary, since PETSc makes access to the elements of its matrices rather hard, and it is much more efficient to copy all column entries of a row once when we enter it than repeatedly asking PETSc for individual ones. This also makes some sense since it is likely that we will access them sequentially anyway.
In order to make copying of iterators/accessor of acceptable performance, we keep a shared pointer to these entries so that more than one accessor can access this data if necessary.
Definition at line 172 of file petsc_matrix_base.h.
|
private |
Similar cache for the values of this row.
Definition at line 178 of file petsc_matrix_base.h.