Classes | Enumerations
Dense Submatrix

Classes

class  blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >
 Iterator over the elements of the sparse submatrix. More...
 
class  blaze::DenseSubmatrix< MT, AF, SO >
 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...
 

Enumerations

enum  { useConst = IsConst<MT>::value }
 Compilation switch for the non-const reference and iterator types. More...
 
enum  { vectorizable = MT::vectorizable }
 Compilation switch for the expression template evaluation strategy.
 
enum  { smpAssignable = MT::smpAssignable }
 Compilation switch for the expression template assignment strategy.
 

DenseSubmatrix operators

template<typename MT , bool AF, bool SO>
void blaze::reset (DenseSubmatrix< MT, AF, SO > &dm)
 Resetting the given dense submatrix. More...
 
template<typename MT , bool AF, bool SO>
void blaze::reset (DenseSubmatrix< MT, AF, SO > &dm, size_t i)
 Reset the specified row/column of the given dense submatrix. More...
 
template<typename MT , bool AF, bool SO>
void blaze::clear (DenseSubmatrix< MT, AF, SO > &dm)
 Clearing the given dense matrix. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isDefault (const DenseSubmatrix< MT, AF, SO > &dm)
 Returns whether the given dense submatrix is in default state. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSymmetric (const DenseSubmatrix< MT, AF, SO > &dm)
 Checks if the given dense submatrix is symmetric. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isLower (const DenseSubmatrix< MT, AF, SO > &dm)
 Checks if the given dense submatrix is a lower triangular matrix. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isUpper (const DenseSubmatrix< MT, AF, SO > &dm)
 Checks if the given dense submatrix is an upper triangular matrix. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSame (const DenseSubmatrix< MT, AF, SO > &a, const DenseMatrix< MT, SO > &b)
 Returns whether the given dense matrix and submatrix represent the same observable state. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSame (const DenseMatrix< MT, SO > &a, const DenseSubmatrix< MT, AF, SO > &b)
 Returns whether the given dense matrix and submatrix represent the same observable state. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSame (const DenseSubmatrix< MT, AF, SO > &a, const DenseSubmatrix< MT, AF, SO > &b)
 Returns whether the two given submatrices represent the same observable state. More...
 

Detailed Description

Enumeration Type Documentation

template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
anonymous enum
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.

Function Documentation

template<typename MT , bool AF, bool SO>
void blaze::clear ( DenseSubmatrix< MT, AF, SO > &  dm)
inline

Clearing the given dense matrix.

Parameters
dmThe dense matrix to be cleared.
Returns
void

Clearing a dense submatrix is equivalent to resetting it via the reset() function.

template<typename MT , bool AF, bool SO>
bool blaze::isDefault ( const DenseSubmatrix< MT, AF, SO > &  dm)
inline

Returns whether the given dense submatrix is in default state.

Parameters
dmThe dense submatrix to be tested for its default state.
Returns
true in case the given submatrix is component-wise zero, false otherwise.

This function checks whether the submatrix is in default state. For instance, in case the submatrix is instantiated for a built-in integral or floating point data type, the function returns true in case all submatrix elements are 0 and false in case any submatrix element is not 0. The following example demonstrates the use of the isDefault function:

// ... Resizing and initialization
if( isDefault( submatrix( A, 12UL, 13UL, 22UL, 33UL ) ) ) { ... }
template<typename MT , bool AF, bool SO>
bool blaze::isLower ( const DenseSubmatrix< MT, AF, SO > &  dm)
inline

Checks if the given dense submatrix is a lower triangular matrix.

Parameters
dmThe dense submatrix to be checked.
Returns
true if the submatrix is a lower triangular matrix, false if not.

This function checks if the given dense submatrix is a lower triangular matrix. The matrix is considered to be lower triangular if it is a square matrix of the form

\[\left(\begin{array}{*{5}{c}} l_{0,0} & 0 & 0 & \cdots & 0 \\ l_{1,0} & l_{1,1} & 0 & \cdots & 0 \\ l_{2,0} & l_{2,1} & l_{2,2} & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ l_{N,0} & l_{N,1} & l_{N,2} & \cdots & l_{N,N} \\ \end{array}\right).\]

$ 0 \times 0 $ or $ 1 \times 1 $ matrices are considered as trivially lower triangular. The following code example demonstrates the use of the function:

Matrix A( 32UL, 16UL );
// ... Initialization
blaze::DenseSubmatrix<Matrix> sm( A, 8UL, 8UL, 16UL, 16UL );
if( isLower( sm ) ) { ... }
template<typename MT , bool AF, bool SO>
bool blaze::isSame ( const DenseSubmatrix< MT, AF, SO > &  a,
const DenseMatrix< MT, SO > &  b 
)
inline

Returns whether the given dense matrix and submatrix represent the same observable state.

Parameters
aThe dense submatrix to be tested for its state.
bThe dense matrix to be tested for its state.
Returns
true in case the dense submatrix and matrix share a state, false otherwise.

This overload of the isSame function tests if the given submatrix refers to the full given dense matrix and by that represents the same observable state. In this case, the function returns true, otherwise it returns false.

template<typename MT , bool AF, bool SO>
bool blaze::isSame ( const DenseMatrix< MT, SO > &  a,
const DenseSubmatrix< MT, AF, SO > &  b 
)
inline

Returns whether the given dense matrix and submatrix represent the same observable state.

Parameters
aThe dense matrix to be tested for its state.
bThe dense submatrix to be tested for its state.
Returns
true in case the dense matrix and submatrix share a state, false otherwise.

This overload of the isSame function tests if the given submatrix refers to the full given dense matrix and by that represents the same observable state. In this case, the function returns true, otherwise it returns false.

template<typename MT , bool AF, bool SO>
bool blaze::isSame ( const DenseSubmatrix< MT, AF, SO > &  a,
const DenseSubmatrix< MT, AF, SO > &  b 
)
inline

Returns whether the two given submatrices represent the same observable state.

Parameters
aThe first dense submatrix to be tested for its state.
bThe second dense submatrix to be tested for its state.
Returns
true in case the two submatrices share a state, false otherwise.

This overload of the isSame function tests if the two given submatrices refer to exactly the same part of the same dense matrix. In case both submatrices represent the same observable state, the function returns true, otherwise it returns false.

template<typename MT , bool AF, bool SO>
bool blaze::isSymmetric ( const DenseSubmatrix< MT, AF, SO > &  dm)
inline

Checks if the given dense submatrix is symmetric.

Parameters
dmThe dense submatrix to be checked.
Returns
true if the submatrix is symmetric, false if not.

This function checks if the given dense submatrix is symmetric. The submatrix is considered to be symmetric if it is a square matrix whose transpose is equal to itself ( $ A = A^T $). The following code example demonstrates the use of the function:

Matrix A( 32UL, 16UL );
// ... Initialization
blaze::DenseSubmatrix<Matrix> sm( A, 8UL, 8UL, 16UL, 16UL );
if( isSymmetric( sm ) ) { ... }
template<typename MT , bool AF, bool SO>
bool blaze::isUpper ( const DenseSubmatrix< MT, AF, SO > &  dm)
inline

Checks if the given dense submatrix is an upper triangular matrix.

Parameters
dmThe dense submatrix to be checked.
Returns
true if the submatrix is an upper triangular matrix, false if not.

This function checks if the given sparse submatrix is an upper triangular matrix. The matrix is considered to be upper triangular if it is a square matrix of the form

\[\left(\begin{array}{*{5}{c}} u_{0,0} & u_{0,1} & u_{0,2} & \cdots & u_{0,N} \\ 0 & u_{1,1} & u_{1,2} & \cdots & u_{1,N} \\ 0 & 0 & u_{2,2} & \cdots & u_{2,N} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & u_{N,N} \\ \end{array}\right).\]

$ 0 \times 0 $ or $ 1 \times 1 $ matrices are considered as trivially upper triangular. The following code example demonstrates the use of the function:

Matrix A( 32UL, 16UL );
// ... Initialization
blaze::DenseSubmatrix<Matrix> sm( A, 8UL, 8UL, 16UL, 16UL );
if( isUpper( sm ) ) { ... }
template<typename MT , bool AF, bool SO>
void blaze::reset ( DenseSubmatrix< MT, AF, SO > &  dm)
inline

Resetting the given dense submatrix.

Parameters
dmThe dense submatrix to be resetted.
Returns
void
template<typename MT , bool AF, bool SO>
void blaze::reset ( DenseSubmatrix< MT, AF, SO > &  dm,
size_t  i 
)
inline

Reset the specified row/column of the given dense submatrix.

Parameters
dmThe dense submatrix to be resetted.
iThe index of the row/column to be resetted.
Returns
void

This function resets the values in the specified row/column of the given dense submatrix to their default value. In case the given submatrix is a rowMajor matrix the function resets the values in row i, if it is a columnMajor matrix the function resets the values in column i. Note that the capacity of the row/column remains unchanged.