Reference documentation for deal.II version 9.4.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Classes | Public Types | List of all members
ChunkSparseMatrix< number > Class Template Reference

#include <deal.II/lac/chunk_sparse_matrix.h>

Inheritance diagram for ChunkSparseMatrix< number >:
[legend]

Classes

struct  Traits
 

Public Types

using size_type = types::global_dof_index
 
using value_type = number
 
using real_type = typename numbers::NumberTraits< number >::real_type
 
using const_iterator = ChunkSparseMatrixIterators::Iterator< number, true >
 
using iterator = ChunkSparseMatrixIterators::Iterator< number, false >
 

Public Member Functions

Constructors and initialization.
 ChunkSparseMatrix ()
 
 ChunkSparseMatrix (const ChunkSparseMatrix &)
 
 ChunkSparseMatrix (const ChunkSparsityPattern &sparsity)
 
 ChunkSparseMatrix (const ChunkSparsityPattern &sparsity, const IdentityMatrix &id)
 
virtual ~ChunkSparseMatrix () override
 
ChunkSparseMatrix< number > & operator= (const ChunkSparseMatrix< number > &)
 
ChunkSparseMatrix< number > & operator= (const IdentityMatrix &id)
 
ChunkSparseMatrixoperator= (const double d)
 
virtual void reinit (const ChunkSparsityPattern &sparsity)
 
virtual void clear ()
 
Information on the matrix
bool empty () const
 
size_type m () const
 
size_type n () const
 
size_type n_nonzero_elements () const
 
size_type n_actually_nonzero_elements () const
 
const ChunkSparsityPatternget_sparsity_pattern () const
 
std::size_t memory_consumption () const
 
Modifying entries
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 number2 >
void add (const size_type row, const size_type n_cols, const size_type *col_indices, const number2 *values, const bool elide_zero_values=true, const bool col_indices_are_sorted=false)
 
ChunkSparseMatrixoperator*= (const number factor)
 
ChunkSparseMatrixoperator/= (const number factor)
 
void symmetrize ()
 
template<typename somenumber >
ChunkSparseMatrix< number > & copy_from (const ChunkSparseMatrix< somenumber > &source)
 
template<typename ForwardIterator >
void copy_from (const ForwardIterator begin, const ForwardIterator end)
 
template<typename somenumber >
void copy_from (const FullMatrix< somenumber > &matrix)
 
template<typename somenumber >
void add (const number factor, const ChunkSparseMatrix< somenumber > &matrix)
 
Entry Access
number operator() (const size_type i, const size_type j) const
 
number el (const size_type i, const size_type j) const
 
number diag_element (const size_type i) const
 
void extract_row_copy (const size_type row, const size_type array_length, size_type &row_length, size_type *column_indices, number *values) const
 
Matrix vector multiplications
template<class OutVector , class InVector >
void vmult (OutVector &dst, const InVector &src) const
 
template<class OutVector , class InVector >
void Tvmult (OutVector &dst, const InVector &src) const
 
template<class OutVector , class InVector >
void vmult_add (OutVector &dst, const InVector &src) const
 
template<class OutVector , class InVector >
void Tvmult_add (OutVector &dst, const InVector &src) const
 
template<typename somenumber >
somenumber matrix_norm_square (const Vector< somenumber > &v) const
 
template<typename somenumber >
somenumber matrix_scalar_product (const Vector< somenumber > &u, const Vector< somenumber > &v) const
 
template<typename somenumber >
somenumber residual (Vector< somenumber > &dst, const Vector< somenumber > &x, const Vector< somenumber > &b) const
 
Matrix norms
real_type l1_norm () const
 
real_type linfty_norm () const
 
real_type frobenius_norm () const
 
Preconditioning methods
template<typename somenumber >
void precondition_Jacobi (Vector< somenumber > &dst, const Vector< somenumber > &src, const number omega=1.) const
 
template<typename somenumber >
void precondition_SSOR (Vector< somenumber > &dst, const Vector< somenumber > &src, const number om=1.) const
 
template<typename somenumber >
void precondition_SOR (Vector< somenumber > &dst, const Vector< somenumber > &src, const number om=1.) const
 
template<typename somenumber >
void precondition_TSOR (Vector< somenumber > &dst, const Vector< somenumber > &src, const number om=1.) const
 
template<typename somenumber >
void SSOR (Vector< somenumber > &v, const number omega=1.) const
 
template<typename somenumber >
void SOR (Vector< somenumber > &v, const number om=1.) const
 
template<typename somenumber >
void TSOR (Vector< somenumber > &v, const number om=1.) const
 
template<typename somenumber >
void PSOR (Vector< somenumber > &v, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const number om=1.) const
 
template<typename somenumber >
void TPSOR (Vector< somenumber > &v, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const number om=1.) const
 
template<typename somenumber >
void SOR_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
template<typename somenumber >
void TSOR_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
template<typename somenumber >
void SSOR_step (Vector< somenumber > &v, const Vector< somenumber > &b, const number om=1.) const
 
Iterators
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin (const unsigned int r) const
 
const_iterator end (const unsigned int r) const
 
iterator begin (const unsigned int r)
 
iterator end (const unsigned int r)
 

Input/Output

SmartPointer< const ChunkSparsityPattern, ChunkSparseMatrix< number > > cols
 
std::unique_ptr< number[]> val
 
size_type max_len
 
template<typename somenumber >
class ChunkSparseMatrix
 
template<typename , bool >
class ChunkSparseMatrixIterators::Iterator
 
template<typename , bool >
class ChunkSparseMatrixIterators::Accessor
 
void print (std::ostream &out) const
 
void print_formatted (std::ostream &out, const unsigned int precision=3, const bool scientific=true, const unsigned int width=0, const char *zero_string=" ", const double denominator=1.) const
 
void print_pattern (std::ostream &out, const double threshold=0.) const
 
void block_write (std::ostream &out) const
 
void block_read (std::istream &in)
 
static ::ExceptionBaseExcInvalidIndex (int arg1, int arg2)
 
static ::ExceptionBaseExcDifferentChunkSparsityPatterns ()
 
static ::ExceptionBaseExcIteratorRange (int arg1, int arg2)
 
static ::ExceptionBaseExcSourceEqualsDestination ()
 
size_type compute_location (const size_type i, const size_type j) const
 

Subscriptor functionality

Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class.

std::atomic< unsigned intcounter
 
std::map< std::string, unsigned intcounter_map
 
std::vector< std::atomic< bool > * > validity_pointers
 
const std::type_info * object_info
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
void check_no_subscribers () const noexcept
 
using map_value_type = decltype(counter_map)::value_type
 
using map_iterator = decltype(counter_map)::iterator
 
static std::mutex mutex
 

Detailed Description

template<typename number>
class ChunkSparseMatrix< number >

Sparse matrix. This class implements the function to store values in the locations of a sparse matrix denoted by a SparsityPattern. The separation of sparsity pattern and values is done since one can store data elements of different type in these locations without the SparsityPattern having to know this, and more importantly one can associate more than one matrix with the same sparsity pattern.

The use of this class is demonstrated in step-51.

Note
Instantiations for this template are provided for <float> and <double>; others can be generated in application programs (see the section on Template instantiations in the manual).

Definition at line 448 of file chunk_sparse_matrix.h.


The documentation for this class was generated from the following file: