Dune Core Modules (2.3.1)
bcrsmatrix.hh
Go to the documentation of this file.
169 DUNE_THROW(BCRSMatrixError,"You can only create an ImplicitBuilder for a matrix in implicit build mode");
171 DUNE_THROW(BCRSMatrixError,"You can only create an ImplicitBuilder for a matrix with set size that has not been compressed() yet");
189 ImplicitMatrixBuilder(Matrix& m, size_type rows, size_type cols, size_type avg_cols_per_row, double overflow_fraction)
193 DUNE_THROW(BCRSMatrixError,"You can only set up a matrix for this ImplicitBuilder if it has no memory allocated yet");
457 };
494 };
503 DUNE_THROW(BCRSMatrixError,"You cannot use operator[] in implicit build mode before calling compress()");
516 DUNE_THROW(BCRSMatrixError,"You cannot use operator[] in implicit build mode before calling compress()");
762 DUNE_THROW(InvalidStateException,"BCRSMatrix can only be copy-constructed when source matrix is completely empty (size not set) or fully built)");
799 if (ready == building && (build_mode == unknown || build_mode == random || build_mode == row_wise) && (bm == row_wise || bm == random))
802 DUNE_THROW(InvalidStateException, "Matrix structure cannot be changed at this stage anymore (ready == "<<ready<<").");
828 DUNE_THROW(Dune::BCRSMatrixError,"number of non-zeroes may not be set in implicit mode, use setImplicitBuildModeParameters() instead");
859 DUNE_THROW(InvalidStateException,"You cannot modify build mode parameters at this stage anymore");
875 if (!((ready == notAllocated || ready == built) && (Mat.ready == notAllocated || Mat.ready == built)))
876 DUNE_THROW(InvalidStateException,"BCRSMatrix can only be copied when both target and source are empty or fully built)");
933 DUNE_THROW(BCRSMatrixError,"creation only allowed if row wise allocation was requested in the constructor");
1227 dwarn << "WARNING: size of row "<< i.index()<<" is "<<j.offset()<<". But was specified as being "<< (*i).end().offset()
1228 <<". This means you are wasting valuable space and creating additional cache misses!"<<std::endl;
1329 DUNE_THROW(InvalidStateException,"You may only call compress() at the end of the 'building' stage");
1448 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1476 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1509 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1531 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1556 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1576 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1598 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1617 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1636 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1655 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1670 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1706 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1725 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1744 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1763 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1784 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1810 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1830 DUNE_THROW(BCRSMatrixError,"You can only call arithmetic operations on fully built BCRSMatrix instances");
1911 size_type allocationSize; //allocated size of a and j arrays, except in implicit mode: nnz==allocationsSize
2097 void allocate(size_type rows, size_type columns, size_type allocationSize_, bool allocateRows, bool allocate_data)
2109 DUNE_THROW(InvalidStateException,"Rows have already been allocated, cannot allocate a second time");
2155 DUNE_THROW(InvalidStateException,"implicit_allocate() may only be called in implicit build mode");
2161 DUNE_THROW(InvalidStateException,"You have to set the implicit build mode parameters before starting to build the matrix");
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Iterator class for sequential creation of blocks
Definition: bcrsmatrix.hh:920
bool operator==(const CreateIterator &it) const
equality
Definition: bcrsmatrix.hh:1015
CreateIterator & operator++()
prefix increment
Definition: bcrsmatrix.hh:937
size_type index() const
dereferencing
Definition: bcrsmatrix.hh:1021
bool operator!=(const CreateIterator &it) const
inequality
Definition: bcrsmatrix.hh:1009
CreateIterator(BCRSMatrix &_Mat, size_type _i)
constructor
Definition: bcrsmatrix.hh:923
void insert(size_type j)
put column index in row
Definition: bcrsmatrix.hh:1027
bool contains(size_type j)
return true if column index is in row
Definition: bcrsmatrix.hh:1033
size_type size() const
Get the current row size.
Definition: bcrsmatrix.hh:1045
RealRowIterator()
empty constructor, use with care!
Definition: bcrsmatrix.hh:547
bool equals(const RealRowIterator< ValueType > &other) const
equality
Definition: bcrsmatrix.hh:575
bool equals(const RealRowIterator< const ValueType > &other) const
equality
Definition: bcrsmatrix.hh:582
RealRowIterator(row_type *_p, size_type _i)
constructor
Definition: bcrsmatrix.hh:542
size_type index() const
return index
Definition: bcrsmatrix.hh:557
remove_const< T >::type ValueType
The unqualified value type.
Definition: bcrsmatrix.hh:534
bool exists(size_type i, size_type j) const
return true if (i,j) is in pattern
Definition: bcrsmatrix.hh:1882
@ blocklevel
The number of blocklevels the matrix contains.
Definition: bcrsmatrix.hh:456
BuildStage buildStage() const
The current build stage of the matrix.
Definition: bcrsmatrix.hh:1868
friend class CreateIterator
allow CreateIterator to access internal data
Definition: bcrsmatrix.hh:1060
B & entry(size_type row, size_type col)
Returns reference to entry (row,col) of the matrix.
Definition: bcrsmatrix.hh:1256
void usmhv(const field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition: bcrsmatrix.hh:1759
RealRowIterator< const row_type > const_iterator
The const iterator over the matrix rows.
Definition: bcrsmatrix.hh:658
BCRSMatrix(size_type _n, size_type _m, size_type _avg, double _overflowsize, BuildMode bm)
construct matrix with a known average number of entries per row
Definition: bcrsmatrix.hh:735
B::field_type field_type
export the type representing the field
Definition: bcrsmatrix.hh:436
BCRSMatrix & axpy(field_type alpha, const BCRSMatrix &b)
Add the scaled entries of another matrix to this one.
Definition: bcrsmatrix.hh:1552
Iterator RowIterator
rename the iterators for easier access
Definition: bcrsmatrix.hh:652
row_type & operator[](size_type i)
random access to the rows
Definition: bcrsmatrix.hh:499
void endrowsizes()
indicate that size of all rows is defined
Definition: bcrsmatrix.hh:1110
void incrementrowsize(size_type i, size_type s=1)
increment size of row i by s (1 by default)
Definition: bcrsmatrix.hh:1099
size_type nonzeroes() const
number of blocks that are stored (the number of blocks that possibly are nonzero)
Definition: bcrsmatrix.hh:1862
ConstIterator ConstRowIterator
rename the const row iterator for easier access
Definition: bcrsmatrix.hh:689
void setrowsize(size_type i, size_type s)
set number of indices in row i to s
Definition: bcrsmatrix.hh:1078
BCRSMatrix & operator*=(const field_type &k)
vector space multiplication with scalar
Definition: bcrsmatrix.hh:1444
RealRowIterator< row_type > iterator
The iterator over the (mutable matrix rows.
Definition: bcrsmatrix.hh:622
void usmtv(const field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition: bcrsmatrix.hh:1702
@ implicit
Build entries randomly with an educated guess on entries per row.
Definition: bcrsmatrix.hh:489
BCRSMatrix(size_type _n, size_type _m, size_type _nnz, BuildMode bm)
matrix with known number of nonzeroes
Definition: bcrsmatrix.hh:707
void usmv(const field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition: bcrsmatrix.hh:1632
::Dune::CompressionStatistics< size_type > CompressionStatistics
The type for the statistics object returned by compress()
Definition: bcrsmatrix.hh:451
BCRSMatrix & operator-=(const BCRSMatrix &b)
Substract the entries of another matrix to this one.
Definition: bcrsmatrix.hh:1527
BCRSMatrix(const BCRSMatrix &Mat)
copy constructor
Definition: bcrsmatrix.hh:756
Iterator end()
Get iterator to one beyond last row.
Definition: bcrsmatrix.hh:632
void setIndices(size_type row, It begin, It end)
Set all column indices for row from the given iterator range.
Definition: bcrsmatrix.hh:1195
void addindex(size_type row, size_type col)
add index (row,col) to the matrix
Definition: bcrsmatrix.hh:1152
row_type::Iterator ColIterator
Iterator for the entries of each row.
Definition: bcrsmatrix.hh:655
FieldTraits< field_type >::real_type frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition: bcrsmatrix.hh:1801
A::size_type size_type
The type for the index access and the size.
Definition: bcrsmatrix.hh:448
BCRSMatrix & operator/=(const field_type &k)
vector space division by scalar
Definition: bcrsmatrix.hh:1472
BCRSMatrix & operator+=(const BCRSMatrix &b)
Add the entries of another matrix to this one.
Definition: bcrsmatrix.hh:1505
CreateIterator createend()
get create iterator pointing to one after the last block
Definition: bcrsmatrix.hh:1069
FieldTraits< field_type >::real_type frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition: bcrsmatrix.hh:1780
row_type::ConstIterator ConstColIterator
Const iterator to the entries of a row.
Definition: bcrsmatrix.hh:692
CompressedBlockVectorWindow< B, A > row_type
implement row_type with compressed vector
Definition: bcrsmatrix.hh:445
size_type getrowsize(size_type i) const
get current number of indices in row i
Definition: bcrsmatrix.hh:1089
size_type M() const
number of columns (counted in blocks)
Definition: bcrsmatrix.hh:1856
CreateIterator createbegin()
get initial create iterator
Definition: bcrsmatrix.hh:1063
@ rowSizesBuilt
The row sizes of the matrix are known.
Definition: bcrsmatrix.hh:428
@ notbuilt
Matrix is not built at all, no memory has been allocated, build mode and size can still be set.
Definition: bcrsmatrix.hh:419
@ notAllocated
Matrix is not built at all, no memory has been allocated, build mode and size can still be set.
Definition: bcrsmatrix.hh:421
@ building
Matrix is currently being built, some memory has been allocated, build mode and size are fixed.
Definition: bcrsmatrix.hh:423
BuildMode buildMode() const
The currently selected build mode of the matrix.
Definition: bcrsmatrix.hh:1874
FieldTraits< field_type >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition: bcrsmatrix.hh:1826
B block_type
export the type representing the components
Definition: bcrsmatrix.hh:439
BCRSMatrix(size_type _n, size_type _m, BuildMode bm)
matrix with unknown number of nonzeroes
Definition: bcrsmatrix.hh:716
void endindices()
indicate that all indices are defined, check consistency
Definition: bcrsmatrix.hh:1209
CompressionStatistics compress()
Finishes the buildstage in implicit mode.
Definition: bcrsmatrix.hh:1320
size_type N() const
number of rows (counted in blocks)
Definition: bcrsmatrix.hh:1850
void setBuildMode(BuildMode bm)
Sets the build mode of the matrix.
Definition: bcrsmatrix.hh:792
void setSize(size_type rows, size_type columns, size_type nnz=0)
Set the size of the matrix.
Definition: bcrsmatrix.hh:820
FieldTraits< field_type >::real_type infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition: bcrsmatrix.hh:1807
BCRSMatrix & operator=(const BCRSMatrix &Mat)
assignment
Definition: bcrsmatrix.hh:870
ConstIterator end() const
Get const iterator to one beyond last row.
Definition: bcrsmatrix.hh:669
ConstIterator begin() const
Get const iterator to first row.
Definition: bcrsmatrix.hh:663
void setImplicitBuildModeParameters(size_type _avg, double _overflow)
Set parameters needed for creation in implicit build mode.
Definition: bcrsmatrix.hh:848
A allocator_type
export the allocator type
Definition: bcrsmatrix.hh:442
compressed_block_vector_unmanaged< B, A >::ConstIterator ConstIterator
make iterators available as types
Definition: bvector.hh:953
void set(size_type _n, B *_p, size_type *_j)
set size and pointer
Definition: bvector.hh:1025
size_type * getindexptr()
get pointer
Definition: bvector.hh:1057
void setsize(size_type _n)
set size only
Definition: bvector.hh:1033
compressed_block_vector_unmanaged< B, A >::Iterator Iterator
make iterators available as types
Definition: bvector.hh:950
void setptr(B *_p)
set pointer only
Definition: bvector.hh:1039
size_type getsize() const
get size
Definition: bvector.hh:1074
void setindexptr(size_type *_j)
set pointer only
Definition: bvector.hh:1045
Proxy row object for entry access.
Definition: bcrsmatrix.hh:132
block_type & operator[](size_type j) const
Returns entry in column j.
Definition: bcrsmatrix.hh:137
A wrapper for uniform access to the BCRSMatrix during and after the build stage in implicit build mod...
Definition: bcrsmatrix.hh:112
Matrix::block_type block_type
The block_type of the underlying matrix.
Definition: bcrsmatrix.hh:120
ImplicitMatrixBuilder(Matrix &m)
Creates an ImplicitMatrixBuilder for matrix m.
Definition: bcrsmatrix.hh:165
ImplicitMatrixBuilder(Matrix &m, size_type rows, size_type cols, size_type avg_cols_per_row, double overflow_fraction)
Sets up matrix m for implicit construction using the given parameters and creates an ImplicitBmatrixu...
Definition: bcrsmatrix.hh:189
size_type M() const
The number of columns in the matrix.
Definition: bcrsmatrix.hh:212
Matrix::size_type size_type
The size_type of the underlying matrix.
Definition: bcrsmatrix.hh:123
row_object operator[](size_type i) const
Returns a proxy for entries in row i.
Definition: bcrsmatrix.hh:200
size_type N() const
The number of rows in the matrix.
Definition: bcrsmatrix.hh:206
The overflow error used during implicit BCRSMatrix construction was exhausted.
Definition: istlexception.hh:34
Default exception if a function was called while the object is not in a valid state for that function...
Definition: exceptions.hh:307
T block_type
Export the type representing the components.
Definition: matrix.hh:32
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:431
size_type size() const
number of blocks in the array (are of size 1 here)
Definition: basearray.hh:766
Type traits to determine the type of reals (when working with complex numbers)
void reset()
Decrease the reference count by one and free the memory if the reference count has reached 0.
Definition: shared_ptr.hh:354
DWarnType dwarn(std::cerr)
Stream for warnings indicating problems.
Definition: stdstreams.hh:160
This file implements iterator facade classes for writing stl conformant iterators.
Some handy generic functions for ISTL matrices.
Fallback implementation of the C++0x static_assert feature.
Standard Dune debug streams.
Statistics about compression achieved in implicit mode.
Definition: bcrsmatrix.hh:83
size_type overflow_total
total number of elements written to the overflow area during construction.
Definition: bcrsmatrix.hh:89
size_type maximum
maximum number of non-zeroes per row.
Definition: bcrsmatrix.hh:87
double avg
average number of non-zeroes per row.
Definition: bcrsmatrix.hh:85
double mem_ratio
fraction of wasted memory resulting from non-used overflow area.
Definition: bcrsmatrix.hh:94
Traits for type conversions and type information.
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 12, 23:30, 2024)