![]() |
View on a specific submatrix of a dense matrix.The DenseSubmatrix template represents a view on a specific submatrix of a dense matrix primitive. The type of the dense matrix is specified via the first template parameter: More...
#include <DenseSubmatrix.h>
Inherits blaze::DenseMatrix< DenseSubmatrix< MT, AF, SO >, SO >, and blaze::Submatrix.
Classes | |
class | SubmatrixIterator |
Iterator over the elements of the sparse submatrix. More... | |
Public Types | |
enum | { vectorizable = MT::vectorizable } |
Compilation switch for the expression template evaluation strategy. | |
enum | { smpAssignable = MT::smpAssignable } |
Compilation switch for the expression template assignment strategy. | |
typedef DenseSubmatrix< MT, AF, SO > | This |
Type of this DenseSubmatrix instance. | |
typedef SubmatrixTrait< MT >::Type | ResultType |
Result type for expression template evaluations. | |
typedef ResultType::OppositeType | OppositeType |
Result type with opposite storage order for expression template evaluations. | |
typedef ResultType::TransposeType | TransposeType |
Transpose type for expression template evaluations. | |
typedef MT::ElementType | ElementType |
Type of the submatrix elements. | |
typedef IT::Type | IntrinsicType |
Intrinsic type of the submatrix elements. | |
typedef MT::ReturnType | ReturnType |
Return type for expression template evaluations. | |
typedef const DenseSubmatrix & | CompositeType |
Data type for composite expression templates. | |
typedef MT::ConstReference | ConstReference |
Reference to a constant submatrix value. | |
typedef SelectType< useConst, ConstReference, typename MT::Reference >::Type | Reference |
Reference to a non-constant submatrix value. | |
typedef const ElementType * | ConstPointer |
Pointer to a constant submatrix value. | |
typedef SelectType< useConst, ConstPointer, ElementType * > ::Type | Pointer |
Pointer to a non-constant submatrix value. | |
typedef SubmatrixIterator < typename MT::ConstIterator > | ConstIterator |
Iterator over constant elements. | |
typedef SelectType< useConst, ConstIterator, SubmatrixIterator< typename MT::Iterator > >::Type | Iterator |
Iterator over non-constant elements. | |
typedef MT | MatrixType |
Type of the matrix. | |
Public Member Functions | |
template<typename MT2 , bool SO2> | |
DenseSubmatrix< MT, AF, SO > & | operator= (const Matrix< MT2, SO2 > &rhs) |
Assignment operator for different matrices. More... | |
template<typename MT2 , bool SO2> | |
DenseSubmatrix< MT, AF, SO > & | operator+= (const Matrix< MT2, SO2 > &rhs) |
Addition assignment operator for the addition of a matrix ( ![]() | |
template<typename MT2 , bool SO2> | |
DenseSubmatrix< MT, AF, SO > & | operator-= (const Matrix< MT2, SO2 > &rhs) |
Subtraction assignment operator for the subtraction of a matrix ( ![]() | |
template<typename MT2 , bool SO2> | |
DenseSubmatrix< MT, AF, SO > & | operator*= (const Matrix< MT2, SO2 > &rhs) |
Multiplication assignment operator for the multiplication of a matrix ( ![]() | |
template<typename Other > | |
EnableIf< IsNumeric< Other > , DenseSubmatrix< MT, AF, SO > >::Type & | operator*= (Other rhs) |
Multiplication assignment operator for the multiplication between a dense submatrix and a scalar value ( ![]() | |
template<typename Other > | |
EnableIf< IsNumeric< Other > , DenseSubmatrix< MT, AF, SO > >::Type & | operator/= (Other rhs) |
Division assignment operator for the division of a dense submatrix by a scalar value ( ![]() | |
template<typename Other > | |
DenseSubmatrix< MT, AF, SO > & | scale (Other scalar) |
Scaling of the dense submatrix by the scalar value scalar ( ![]() | |
template<typename MT2 > | |
DisableIf< typename DenseSubmatrix< MT, AF, SO > ::BLAZE_TEMPLATE VectorizedAssign< MT2 > >::Type | assign (const DenseMatrix< MT2, SO > &rhs) |
Default implementation of the assignment of a row-major dense matrix. More... | |
template<typename MT2 > | |
EnableIf< typename DenseSubmatrix< MT, AF, SO > ::BLAZE_TEMPLATE VectorizedAssign< MT2 > >::Type | assign (const DenseMatrix< MT2, SO > &rhs) |
Intrinsic optimized implementation of the assignment of a row-major dense matrix. More... | |
template<typename MT2 > | |
DisableIf< typename DenseSubmatrix< MT, AF, SO > ::BLAZE_TEMPLATE VectorizedAddAssign< MT2 > >::Type | addAssign (const DenseMatrix< MT2, SO > &rhs) |
Default implementation of the addition assignment of a row-major dense matrix. More... | |
template<typename MT2 > | |
EnableIf< typename DenseSubmatrix< MT, AF, SO > ::BLAZE_TEMPLATE VectorizedAddAssign< MT2 > >::Type | addAssign (const DenseMatrix< MT2, SO > &rhs) |
Intrinsic optimized implementation of the addition assignment of a row-major dense matrix. More... | |
template<typename MT2 > | |
DisableIf< typename DenseSubmatrix< MT, AF, SO > ::BLAZE_TEMPLATE VectorizedSubAssign< MT2 > >::Type | subAssign (const DenseMatrix< MT2, SO > &rhs) |
Default implementation of the subtraction assignment of a row-major dense matrix. More... | |
template<typename MT2 > | |
EnableIf< typename DenseSubmatrix< MT, AF, SO > ::BLAZE_TEMPLATE VectorizedSubAssign< MT2 > >::Type | subAssign (const DenseMatrix< MT2, SO > &rhs) |
Intrinsic optimized implementation of the subtraction assignment of a row-major dense matrix. More... | |
MatrixType & | operator~ () |
Conversion operator for non-constant matrices. More... | |
const MatrixType & | operator~ () const |
Conversion operator for constant matrices. More... | |
Constructors | |
DenseSubmatrix (Operand matrix, size_t row, size_t column, size_t m, size_t n) | |
The constructor for DenseSubmatrix. More... | |
Data access functions | |
Reference | operator() (size_t i, size_t j) |
2D-access to the dense submatrix elements. More... | |
ConstReference | operator() (size_t i, size_t j) const |
2D-access to the dense submatrix elements. More... | |
Pointer | data () |
Low-level data access to the submatrix elements. More... | |
ConstPointer | data () const |
Low-level data access to the submatrix elements. More... | |
Iterator | begin (size_t i) |
Returns an iterator to the first non-zero element of row/column i. More... | |
ConstIterator | begin (size_t i) const |
Returns an iterator to the first non-zero element of row/column i. More... | |
ConstIterator | cbegin (size_t i) const |
Returns an iterator to the first non-zero element of row/column i. More... | |
Iterator | end (size_t i) |
Returns an iterator just past the last non-zero element of row/column i. More... | |
ConstIterator | end (size_t i) const |
Returns an iterator just past the last non-zero element of row/column i. More... | |
ConstIterator | cend (size_t i) const |
Returns an iterator just past the last non-zero element of row/column i. More... | |
Assignment operators | |
DenseSubmatrix & | operator= (const ElementType &rhs) |
Homogenous assignment to all submatrix elements. More... | |
DenseSubmatrix & | operator= (const DenseSubmatrix &rhs) |
Copy assignment operator for DenseSubmatrix. More... | |
template<typename MT2 , bool SO2> | |
DenseSubmatrix & | operator= (const Matrix< MT2, SO2 > &rhs) |
template<typename MT2 , bool SO2> | |
DenseSubmatrix & | operator+= (const Matrix< MT2, SO2 > &rhs) |
template<typename MT2 , bool SO2> | |
DenseSubmatrix & | operator-= (const Matrix< MT2, SO2 > &rhs) |
template<typename MT2 , bool SO2> | |
DenseSubmatrix & | operator*= (const Matrix< MT2, SO2 > &rhs) |
template<typename Other > | |
EnableIf< IsNumeric< Other > , DenseSubmatrix >::Type & | operator*= (Other rhs) |
template<typename Other > | |
EnableIf< IsNumeric< Other > , DenseSubmatrix >::Type & | operator/= (Other rhs) |
Utility functions | |
size_t | rows () const |
Returns the number of rows of the dense submatrix. More... | |
size_t | columns () const |
Returns the number of columns of the dense submatrix. More... | |
size_t | spacing () const |
Returns the spacing between the beginning of two rows/columns. More... | |
size_t | capacity () const |
Returns the maximum capacity of the dense submatrix. More... | |
size_t | capacity (size_t i) const |
Returns the current capacity of the specified row/column. More... | |
size_t | nonZeros () const |
Returns the number of non-zero elements in the dense submatrix. More... | |
size_t | nonZeros (size_t i) const |
Returns the number of non-zero elements in the specified row/column. More... | |
void | reset () |
Reset to the default initial values. More... | |
void | reset (size_t i) |
Reset the specified row/column to the default initial values. More... | |
DenseSubmatrix & | transpose () |
Transposing the submatrix. More... | |
template<typename Other > | |
DenseSubmatrix & | scale (Other scalar) |
Expression template evaluation functions | |
template<typename Other > | |
bool | canAlias (const Other *alias) const |
Returns whether the submatrix can alias with the given address alias. More... | |
template<typename MT2 , bool AF2, bool SO2> | |
bool | canAlias (const DenseSubmatrix< MT2, AF2, SO2 > *alias) const |
Returns whether the submatrix can alias with the given dense submatrix alias. More... | |
template<typename Other > | |
bool | isAliased (const Other *alias) const |
Returns whether the submatrix is aliased with the given address alias. More... | |
template<typename MT2 , bool AF2, bool SO2> | |
bool | isAliased (const DenseSubmatrix< MT2, AF2, SO2 > *alias) const |
Returns whether the submatrix is aliased with the given dense submatrix alias. More... | |
bool | isAligned () const |
Returns whether the submatrix is properly aligned in memory. More... | |
bool | canSMPAssign () const |
Returns whether the submatrix can be used in SMP assignments. More... | |
IntrinsicType | load (size_t i, size_t j) const |
Aligned load of an intrinsic element of the submatrix. More... | |
IntrinsicType | loadu (size_t i, size_t j) const |
Unaligned load of an intrinsic element of the submatrix. More... | |
void | store (size_t i, size_t j, const IntrinsicType &value) |
Aligned store of an intrinsic element of the submatrix. More... | |
void | storeu (size_t i, size_t j, const IntrinsicType &value) |
Unaligned store of an intrinsic element of the submatrix. More... | |
void | stream (size_t i, size_t j, const IntrinsicType &value) |
Aligned, non-temporal store of an intrinsic element of the submatrix. More... | |
template<typename MT2 > | |
DisableIf< VectorizedAssign < MT2 > >::Type | assign (const DenseMatrix< MT2, SO > &rhs) |
template<typename MT2 > | |
EnableIf< VectorizedAssign < MT2 > >::Type | assign (const DenseMatrix< MT2, SO > &rhs) |
template<typename MT2 > | |
void | assign (const DenseMatrix< MT2,!SO > &rhs) |
Default implementation of the assignment of a column-major dense matrix. More... | |
template<typename MT2 > | |
void | assign (const SparseMatrix< MT2, SO > &rhs) |
Default implementation of the assignment of a row-major sparse matrix. More... | |
template<typename MT2 > | |
void | assign (const SparseMatrix< MT2,!SO > &rhs) |
Default implementation of the assignment of a column-major sparse matrix. More... | |
template<typename MT2 > | |
DisableIf< VectorizedAddAssign < MT2 > >::Type | addAssign (const DenseMatrix< MT2, SO > &rhs) |
template<typename MT2 > | |
EnableIf< VectorizedAddAssign < MT2 > >::Type | addAssign (const DenseMatrix< MT2, SO > &rhs) |
template<typename MT2 > | |
void | addAssign (const DenseMatrix< MT2,!SO > &rhs) |
Default implementation of the addition assignment of a column-major dense matrix. More... | |
template<typename MT2 > | |
void | addAssign (const SparseMatrix< MT2, SO > &rhs) |
Default implementation of the addition assignment of a row-major sparse matrix. More... | |
template<typename MT2 > | |
void | addAssign (const SparseMatrix< MT2,!SO > &rhs) |
Default implementation of the addition assignment of a column-major sparse matrix. More... | |
template<typename MT2 > | |
DisableIf< VectorizedSubAssign < MT2 > >::Type | subAssign (const DenseMatrix< MT2, SO > &rhs) |
template<typename MT2 > | |
EnableIf< VectorizedSubAssign < MT2 > >::Type | subAssign (const DenseMatrix< MT2, SO > &rhs) |
template<typename MT2 > | |
void | subAssign (const DenseMatrix< MT2,!SO > &rhs) |
Default implementation of the subtraction assignment of a column-major dense matrix. More... | |
template<typename MT2 > | |
void | subAssign (const SparseMatrix< MT2, SO > &rhs) |
Default implementation of the subtraction assignment of a row-major sparse matrix. More... | |
template<typename MT2 > | |
void | subAssign (const SparseMatrix< MT2,!SO > &rhs) |
Default implementation of the subtraction assignment of a column-major sparse matrix. More... | |
Private Types | |
enum | { useConst = IsConst<MT>::value } |
Compilation switch for the non-const reference and iterator types. More... | |
typedef SelectType < IsExpression< MT >::value, MT, MT & >::Type | Operand |
Composite data type of the dense matrix expression. | |
typedef IntrinsicTrait < typename MT::ElementType > | IT |
Intrinsic trait for the matrix element type. | |
Private Attributes | |
Member variables | |
Operand | matrix_ |
The dense matrix containing the submatrix. | |
const size_t | row_ |
The first row of the submatrix. | |
const size_t | column_ |
The first column of the submatrix. | |
const size_t | m_ |
The number of rows of the submatrix. | |
const size_t | n_ |
The number of columns of the submatrix. | |
const size_t | rest_ |
The number of remaining elements in an unaligned intrinsic operation. | |
const size_t | final_ |
The final index for unaligned intrinsic operations. More... | |
const bool | isAligned_ |
Memory alignment flag. More... | |
View on a specific submatrix of a dense matrix.
The DenseSubmatrix template represents a view on a specific submatrix of a dense matrix primitive. The type of the dense matrix is specified via the first template parameter:
A view on a dense submatrix can be created very conveniently via the submatrix()
function:
This view can be treated as any other dense matrix, i.e. it can be assigned to, it can be copied from, and it can be used in arithmetic operations. The view can also be used on both sides of an assignment: The submatrix can either be used as an alias to grant write access to a specific submatrix of a dense matrix primitive on the left-hand side of an assignment or to grant read-access to a specific submatrix of a dense matrix primitive or expression on the right-hand side of an assignment. The following example demonstrates this in detail:
A dense submatrix can be used like any other dense matrix. For instance, the elements of the dense submatrix can be directly accessed with the function call operator:
Alternatively, the elements of a submatrix can be traversed via (const) iterators. Just as with matrices, in case of non-const submatrices, begin()
and end()
return an Iterator, which allows a manipulation of the non-zero values, in case of constant submatrices a ConstIterator is returned:
The current size of the matrix, i.e. the number of rows or columns can be obtained via the rows()
and columns()
functions, the current total capacity via the capacity()
function, and the number of non-zero elements via the nonZeros()
function. However, since submatrices are views on a specific submatrix of a matrix, several operations are not possible on views, such as resizing and swapping:
The following example gives an impression of the use of DenseSubmatrix within arithmetic operations. All operations (addition, subtraction, multiplication, scaling, ...) can be performed on all possible combinations of dense and sparse matrices with fitting element types:
Usually submatrices can be defined anywhere within a matrix. They may start at any position and may have an arbitrary extension (only restricted by the extension of the underlying matrix). However, in contrast to matrices themselves, which are always properly aligned in memory and therefore can provide maximum performance, this means that submatrices in general have to be considered to be unaligned. This can be made explicit by the blaze::unaligned flag:
All of these calls to the submatrix()
function are identical. Whether the alignment flag is explicitly specified or not, it always returns an unaligned submatrix. Whereas this may provide full flexibility in the creation of submatrices, this might result in performance restrictions (even in case the specified submatrix could be aligned). However, it is also possible to create aligned submatrices. Aligned submatrices are identical to unaligned submatrices in all aspects, except that they may pose additional alignment restrictions and therefore have less flexibility during creation, but don't suffer from performance penalties and provide the same performance as the underlying matrix. Aligned submatrices are created by explicitly specifying the blaze::aligned flag:
The alignment restrictions refer to system dependent address restrictions for the used element type and the available vectorization mode (SSE, AVX, ...). The following source code gives some examples for a double precision dense matrix, assuming that AVX is available, which packs 4 double
values into an intrinsic vector:
It is also possible to create a submatrix view on another submatrix. In this context it is important to remember that the type returned by the submatrix()
function is the same type as the type of the given submatrix, since the view on a submatrix is just another view on the underlying dense matrix:
|
private |
Compilation switch for the non-const reference and iterator types.
The useConst compile time constant expression represents a compilation switch for the non-const reference and iterator types. In case the given dense matrix of type MT is const qualified, useConst will be set to 1 and the dense submatrix will return references and iterators to const. Otherwise useConst will be set to 0 and the dense submatrix will offer write access to the dense matrix elements both via the function call operator and iterators.
|
inlineexplicit |
The constructor for DenseSubmatrix.
matrix | The dense matrix containing the submatrix. |
row | The index of the first row of the submatrix in the given dense matrix. |
column | The index of the first column of the submatrix in the given dense matrix. |
m | The number of rows of the submatrix. |
n | The number of columns of the submatrix. |
std::invalid_argument | Invalid submatrix specification. |
In case the submatrix is not properly specified (i.e. if the specified submatrix is not contained in the given dense matrix) a std::invalid_argument exception is thrown.
|
inline |
Default implementation of the addition assignment of a column-major dense matrix.
rhs | The right-hand side dense matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the addition assignment of a row-major sparse matrix.
rhs | The right-hand side sparse matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the addition assignment of a column-major sparse matrix.
rhs | The right-hand side sparse matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the addition assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Intrinsic optimized implementation of the addition assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a column-major dense matrix.
rhs | The right-hand side dense matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a row-major sparse matrix.
rhs | The right-hand side sparse matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a column-major sparse matrix.
rhs | The right-hand side sparse matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Intrinsic optimized implementation of the assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Returns an iterator to the first non-zero element of row/column i.
i | The row/column index. |
This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.
|
inline |
Returns an iterator to the first non-zero element of row/column i.
i | The row/column index. |
This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.
|
inline |
Returns whether the submatrix can alias with the given address alias.
alias | The alias to be checked. |
This function returns whether the given address can alias with the submatrix. In contrast to the isAliased() function this function is allowed to use compile time expressions to optimize the evaluation.
|
inline |
Returns whether the submatrix can alias with the given dense submatrix alias.
alias | The alias to be checked. |
This function returns whether the given address can alias with the submatrix. In contrast to the isAliased() function this function is allowed to use compile time expressions to optimize the evaluation.
|
inline |
Returns whether the submatrix can be used in SMP assignments.
This function returns whether the submatrix can be used in SMP assignments. In contrast to the smpAssignable member enumeration, which is based solely on compile time information, this function additionally provides runtime information (as for instance the current number of rows and/or columns of the submatrix).
|
inline |
Returns the maximum capacity of the dense submatrix.
|
inline |
Returns the current capacity of the specified row/column.
i | The index of the row/column. |
This function returns the current capacity of the specified row/column. In case the storage order is set to rowMajor the function returns the capacity of row i, in case the storage flag is set to columnMajor the function returns the capacity of column i.
|
inline |
Returns an iterator to the first non-zero element of row/column i.
i | The row/column index. |
This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.
|
inline |
Returns an iterator just past the last non-zero element of row/column i.
i | The row/column index. |
This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.
|
inline |
Returns the number of columns of the dense submatrix.
|
inline |
Low-level data access to the submatrix elements.
This function returns a pointer to the internal storage of the dense submatrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The dense submatrix may use techniques such as padding to improve the alignment of the data.
|
inline |
Low-level data access to the submatrix elements.
This function returns a pointer to the internal storage of the dense submatrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The dense submatrix may use techniques such as padding to improve the alignment of the data.
|
inline |
Returns an iterator just past the last non-zero element of row/column i.
i | The row/column index. |
This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.
|
inline |
Returns an iterator just past the last non-zero element of row/column i.
i | The row/column index. |
This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.
|
inline |
Returns whether the submatrix is aliased with the given address alias.
alias | The alias to be checked. |
This function returns whether the given address is aliased with the submatrix. In contrast to the conAlias() function this function is not allowed to use compile time expressions to optimize the evaluation.
|
inline |
Returns whether the submatrix is aliased with the given dense submatrix alias.
alias | The alias to be checked. |
This function returns whether the given address is aliased with the submatrix. In contrast to the conAlias() function this function is not allowed to use compile time expressions to optimize the evaluation.
|
inline |
Returns whether the submatrix is properly aligned in memory.
This function returns whether the submatrix is guaranteed to be properly aligned in memory, i.e. whether the beginning and the end of each row/column of the submatrix are guaranteed to conform to the alignment restrictions of the underlying element type.
|
inline |
Aligned load of an intrinsic element of the submatrix.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
This function performs an aligned load of a specific intrinsic element of the dense submatrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the intrinsic element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Unaligned load of an intrinsic element of the submatrix.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
This function performs an unaligned load of a specific intrinsic element of the dense submatrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the intrinsic element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Returns the number of non-zero elements in the dense submatrix.
|
inline |
Returns the number of non-zero elements in the specified row/column.
i | The index of the row/column. |
This function returns the current number of non-zero elements in the specified row/column. In case the storage order is set to rowMajor the function returns the number of non-zero elements in row i, in case the storage flag is set to columnMajor the function returns the number of non-zero elements in column i.
|
inline |
2D-access to the dense submatrix elements.
i | Access index for the row. The index has to be in the range ![]() |
j | Access index for the column. The index has to be in the range ![]() |
|
inline |
2D-access to the dense submatrix elements.
i | Access index for the row. The index has to be in the range ![]() |
j | Access index for the column. The index has to be in the range ![]() |
|
inline |
Multiplication assignment operator for the multiplication of a matrix ( ).
rhs | The right-hand side matrix for the multiplication. |
std::invalid_argument | Matrix sizes do not match. |
In case the current sizes of the two given matrices don't match, a std::invalid_argument is thrown.
|
inline |
Multiplication assignment operator for the multiplication between a dense submatrix and a scalar value ( ).
rhs | The right-hand side scalar value for the multiplication. |
|
inline |
Addition assignment operator for the addition of a matrix ( ).
rhs | The right-hand side matrix to be added to the submatrix. |
std::invalid_argument | Matrix sizes do not match. |
In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.
|
inline |
Subtraction assignment operator for the subtraction of a matrix ( ).
rhs | The right-hand side matrix to be subtracted from the submatrix. |
std::invalid_argument | Matrix sizes do not match. |
In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.
|
inline |
Division assignment operator for the division of a dense submatrix by a scalar value ( ).
rhs | The right-hand side scalar value for the division. |
|
inline |
Homogenous assignment to all submatrix elements.
rhs | Scalar value to be assigned to all submatrix elements. |
|
inline |
Copy assignment operator for DenseSubmatrix.
rhs | Sparse submatrix to be copied. |
std::invalid_argument | Submatrix sizes do not match. |
The dense submatrix is initialized as a copy of the given dense submatrix. In case the current sizes of the two submatrices don't match, a std::invalid_argument exception is thrown.
|
inline |
Assignment operator for different matrices.
rhs | Matrix to be assigned. |
std::invalid_argument | Matrix sizes do not match. |
The dense submatrix is initialized as a copy of the given matrix. In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.
|
inlineinherited |
Conversion operator for non-constant matrices.
|
inlineinherited |
Conversion operator for constant matrices.
|
inline |
Reset to the default initial values.
|
inline |
Reset the specified row/column to the default initial values.
i | The index of the row/column. |
This function resets the values in the specified row/column to their default value. In case the storage order is set to rowMajor the function resets the values in row i, in case the storage order is set to columnMajor the function resets the values in column i. Note that the capacity of the row/column remains unchanged.
|
inline |
Returns the number of rows of the dense submatrix.
|
inline |
Scaling of the dense submatrix by the scalar value scalar ( ).
scalar | The scalar value for the submatrix scaling. |
|
inline |
Returns the spacing between the beginning of two rows/columns.
This function returns the spacing between the beginning of two rows/columns, i.e. the total number of elements of a row/column. In case the storage order is set to rowMajor the function returns the spacing between two rows, in case the storage flag is set to columnMajor the function returns the spacing between two columns.
|
inline |
Aligned store of an intrinsic element of the submatrix.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
value | The intrinsic element to be stored. |
This function performs an aligned store of a specific intrinsic element of the dense submatrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the intrinsic element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Unaligned store of an intrinsic element of the submatrix.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
value | The intrinsic element to be stored. |
This function performs an unaligned store of a specific intrinsic element of the dense submatrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the intrinsic element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Aligned, non-temporal store of an intrinsic element of the submatrix.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
value | The intrinsic element to be stored. |
This function performs an aligned, non-temporal store of a specific intrinsic element of the dense submatrix. The row index must be smaller than the number of rows and the column index must be smaller than the number of columns. Additionally, the column index (in case of a row-major matrix) or the row index (in case of a column-major matrix) must be a multiple of the number of values inside the intrinsic element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Default implementation of the subtraction assignment of a column-major dense matrix.
rhs | The right-hand side dense matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the subtraction assignment of a row-major sparse matrix.
rhs | The right-hand side sparse matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the subtraction assignment of a column-major sparse matrix.
rhs | The right-hand side sparse matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the subtraction assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Intrinsic optimized implementation of the subtraction assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Transposing the submatrix.
std::runtime_error | Invalid transpose of a non-quadratic submatrix. |
This function transposes the dense submatrix in-place. Note that this function can only be used for quadratic submatrices, i.e. if the number of rows is equal to the number of columns. The attempt to transpose a non-quadratic submatrix results in a std::runtime_error exception.
|
private |
The final index for unaligned intrinsic operations.
In case the submatrix is not fully aligned and the submatrix is involved in a vectorized operation, the final index indicates at which index a special treatment for the remaining elements is required.
|
private |
Memory alignment flag.
The alignment flag indicates whether the submatrix is fully aligned. In case the submatrix is fully aligned, no special handling has to be used for the last elements of the submatrix in a vectorized operation. In order to be aligned, the following conditions must hold for the submatrix: