![]() |
Reference documentation for deal.II version 8.1.0
|
#include <block_sparse_matrix_ez.h>
Public Types | |
typedef types::global_dof_index | size_type |
Public Member Functions | |
BlockSparseMatrixEZ () | |
BlockSparseMatrixEZ (const unsigned int block_rows, const unsigned int block_cols) | |
BlockSparseMatrixEZ (const BlockSparseMatrixEZ< Number > &) | |
BlockSparseMatrixEZ & | operator= (const BlockSparseMatrixEZ< Number > &) |
BlockSparseMatrixEZ & | operator= (const double d) |
void | clear () |
void | reinit (const unsigned int n_block_rows, const unsigned int n_block_cols) |
void | collect_sizes () |
SparseMatrixEZ< Number > & | block (const unsigned int row, const unsigned int column) |
const SparseMatrixEZ< Number > & | block (const unsigned int row, const unsigned int column) const |
unsigned int | n_block_rows () const |
unsigned int | n_block_cols () const |
bool | empty () const |
size_type | n_rows () const |
size_type | n_cols () const |
size_type | m () const |
size_type | n () const |
void | set (const size_type i, const size_type j, const Number value) |
void | add (const size_type i, const size_type j, const Number value) |
template<typename somenumber > | |
void | vmult (BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const |
template<typename somenumber > | |
void | Tvmult (BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const |
template<typename somenumber > | |
void | vmult_add (BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const |
template<typename somenumber > | |
void | Tvmult_add (BlockVector< somenumber > &dst, const BlockVector< somenumber > &src) const |
template<class STREAM > | |
void | print_statistics (STREAM &s, bool full=false) |
![]() | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
void | subscribe (const char *identifier=0) const |
void | unsubscribe (const char *identifier=0) const |
unsigned int | n_subscriptions () const |
void | list_subscribers () const |
DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.") | |
DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1) | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
BlockIndices | row_indices |
BlockIndices | column_indices |
Table< 2, SparseMatrixEZ< Number > > | blocks |
A block matrix consisting of blocks of type SparseMatrixEZ.
Like the other Block-objects, this matrix can be used like a SparseMatrixEZ, when it comes to access to entries. Then, there are functions for the multiplication with BlockVector and access to the individual blocks.
Definition at line 250 of file block_indices.h.
typedef types::global_dof_index BlockSparseMatrixEZ< Number >::size_type |
Declare type for container size.
Definition at line 58 of file block_sparse_matrix_ez.h.
DEAL_II_NAMESPACE_OPEN BlockSparseMatrixEZ< number >::BlockSparseMatrixEZ | ( | ) |
Default constructor. The result is an empty object with zero dimensions.
Definition at line 29 of file block_sparse_matrix_ez.templates.h.
BlockSparseMatrixEZ< number >::BlockSparseMatrixEZ | ( | const unsigned int | block_rows, |
const unsigned int | block_cols | ||
) |
Constructor setting up an object with given unmber of block rows and columns. The blocks themselves still have zero dimension.
Definition at line 36 of file block_sparse_matrix_ez.templates.h.
BlockSparseMatrixEZ< Number >::BlockSparseMatrixEZ | ( | const BlockSparseMatrixEZ< Number > & | ) |
Copy constructor. This is needed for some container classes. It creates an object of the same number of block rows and columns. Since it calls the copy constructor of SparseMatrixEZ, the block s must be empty.
BlockSparseMatrixEZ& BlockSparseMatrixEZ< Number >::operator= | ( | const BlockSparseMatrixEZ< Number > & | ) |
Copy operator. Like the copy constructor, this may be called for objects with empty blocks only.
BlockSparseMatrixEZ< number > & BlockSparseMatrixEZ< number >::operator= | ( | const double | d | ) |
This operator assigns a scalar to a matrix. Since this does usually not make much sense (should we set all matrix entries to this value? Only the nonzero entries of the sparsity pattern?), this operation is only allowed if the actual value to be assigned is zero. This operator only exists to allow for the obvious notation matrix=0
, which sets all elements of the matrix to zero, but keep the sparsity pattern previously used.
Definition at line 78 of file block_sparse_matrix_ez.templates.h.
void BlockSparseMatrixEZ< number >::clear | ( | ) |
Set matrix to zero dimensions and release memory.
Definition at line 117 of file block_sparse_matrix_ez.templates.h.
void BlockSparseMatrixEZ< number >::reinit | ( | const unsigned int | n_block_rows, |
const unsigned int | n_block_cols | ||
) |
Initialize to given block numbers. After this operation, the matrix will have the block dimensions provided. Each block will have zero dimensions and must be initialized subsequently. After setting the sizes of the blocks, collect_sizes() must be called to update internal data structures.
Definition at line 105 of file block_sparse_matrix_ez.templates.h.
void BlockSparseMatrixEZ< number >::collect_sizes | ( | ) |
This function collects the sizes of the sub-objects and stores them in internal arrays, in order to be able to relay global indices into the matrix to indices into the subobjects. You must call this function each time after you have changed the size of the sub-objects.
Definition at line 141 of file block_sparse_matrix_ez.templates.h.
|
inline |
Access the block with the given coordinates.
Definition at line 382 of file block_sparse_matrix_ez.h.
|
inline |
Access the block with the given coordinates. Version for constant objects.
Definition at line 396 of file block_sparse_matrix_ez.h.
|
inline |
Return the number of blocks in a column.
Definition at line 342 of file block_sparse_matrix_ez.h.
|
inline |
Return the number of blocks in a row.
Definition at line 362 of file block_sparse_matrix_ez.h.
bool BlockSparseMatrixEZ< number >::empty | ( | ) | const |
Return whether the object is empty. It is empty if no memory is allocated, which is the same as that both dimensions are zero. This function is just the concatenation of the respective call to all sub-matrices.
Definition at line 128 of file block_sparse_matrix_ez.templates.h.
|
inline |
Return number of rows of this matrix, which equals the dimension of the image space. It is the sum of rows of the rows of sub-matrices.
Definition at line 352 of file block_sparse_matrix_ez.h.
|
inline |
Return number of columns of this matrix, which equals the dimension of the range space. It is the sum of columns of the columns of sub-matrices.
Definition at line 372 of file block_sparse_matrix_ez.h.
|
inline |
Return the dimension of the image space. To remember: the matrix is of dimension .
Definition at line 410 of file block_sparse_matrix_ez.h.
|
inline |
Return the dimension of the range space. To remember: the matrix is of dimension .
Definition at line 420 of file block_sparse_matrix_ez.h.
|
inline |
Set the element (i,j)
to value
. Throws an error if the entry does not exist or if value
is not a finite number. Still, it is allowed to store zero values in non-existent fields.
Definition at line 430 of file block_sparse_matrix_ez.h.
|
inline |
Add value
to the element (i,j)
. Throws an error if the entry does not exist or if value
is not a finite number. Still, it is allowed to store zero values in non-existent fields.
Definition at line 450 of file block_sparse_matrix_ez.h.
void BlockSparseMatrixEZ< Number >::vmult | ( | BlockVector< somenumber > & | dst, |
const BlockVector< somenumber > & | src | ||
) | const |
Matrix-vector multiplication: let with
being this matrix.
Definition at line 469 of file block_sparse_matrix_ez.h.
void BlockSparseMatrixEZ< Number >::Tvmult | ( | BlockVector< somenumber > & | dst, |
const BlockVector< somenumber > & | src | ||
) | const |
Matrix-vector multiplication: let with
being this matrix. This function does the same as vmult() but takes the transposed matrix.
Definition at line 512 of file block_sparse_matrix_ez.h.
void BlockSparseMatrixEZ< Number >::vmult_add | ( | BlockVector< somenumber > & | dst, |
const BlockVector< somenumber > & | src | ||
) | const |
Adding Matrix-vector multiplication. Add on
with
being this matrix.
Definition at line 491 of file block_sparse_matrix_ez.h.
void BlockSparseMatrixEZ< Number >::Tvmult_add | ( | BlockVector< somenumber > & | dst, |
const BlockVector< somenumber > & | src | ||
) | const |
Adding Matrix-vector multiplication. Add to
with
being this matrix. This function does the same as vmult_add() but takes the transposed matrix.
Definition at line 534 of file block_sparse_matrix_ez.h.
|
inline |
Print statistics. If full
is true
, prints a histogram of all existing row lengths and allocated row lengths. Otherwise, just the relation of allocated and used entries is shown.
Definition at line 553 of file block_sparse_matrix_ez.h.
|
private |
Object storing and managing the transformation of row indices to indices of the sub-objects.
Definition at line 319 of file block_sparse_matrix_ez.h.
|
private |
Object storing and managing the transformation of column indices to indices of the sub-objects.
Definition at line 327 of file block_sparse_matrix_ez.h.
|
private |
The actual matrices
Definition at line 332 of file block_sparse_matrix_ez.h.