All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes
Sparse Submatrix

Classes

class  blaze::SparseSubmatrix< typename, bool, bool >
 View on a specific submatrix of a sparse matrix.The SparseSubmatrix template represents a view on a specific submatrix of a sparse matrix primitive. The type of the sparse matrix is specified via the first template parameter: More...
 

SparseSubmatrix operators

template<typename MT , bool AF, bool SO>
void blaze::reset (SparseSubmatrix< MT, AF, SO > &sm)
 Resetting the given sparse submatrix. More...
 
template<typename MT , bool AF, bool SO>
void blaze::reset (SparseSubmatrix< MT, AF, SO > &sm, size_t i)
 Reset the specified row/column of the given sparse submatrix. More...
 
template<typename MT , bool AF, bool SO>
void blaze::clear (SparseSubmatrix< MT, AF, SO > &sm)
 Clearing the given sparse matrix. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isDefault (const SparseSubmatrix< MT, AF, SO > &sm)
 Returns whether the given sparse submatrix is in default state. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSame (const SparseSubmatrix< MT, AF, SO > &a, const SparseMatrix< MT, SO > &b)
 Returns whether the given sparse matrix and submatrix represent the same observable state. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSame (const SparseMatrix< MT, SO > &a, const SparseSubmatrix< MT, AF, SO > &b)
 Returns whether the given sparse matrix and submatrix represent the same observable state. More...
 
template<typename MT , bool AF, bool SO>
bool blaze::isSame (const SparseSubmatrix< MT, AF, SO > &a, const SparseSubmatrix< MT, AF, SO > &b)
 Returns whether the two given submatrices represent the same observable state. More...
 

Detailed Description

Function Documentation

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

Clearing the given sparse matrix.

Parameters
smThe sparse matrix to be cleared.
Returns
void

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

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

Returns whether the given sparse submatrix is in default state.

Parameters
smThe sparse 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::isSame ( const SparseSubmatrix< MT, AF, SO > &  a,
const SparseMatrix< MT, SO > &  b 
)
inline

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

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

This overload of the isSame function tests if the given submatrix refers to the full given sparse 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 SparseMatrix< MT, SO > &  a,
const SparseSubmatrix< MT, AF, SO > &  b 
)
inline

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

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

This overload of the isSame function tests if the given submatrix refers to the full given sparse 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 SparseSubmatrix< MT, AF, SO > &  a,
const SparseSubmatrix< MT, AF, SO > &  b 
)
inline

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

Parameters
aThe first sparse submatrix to be tested for its state.
bThe second sparse 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 sparse 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>
void blaze::reset ( SparseSubmatrix< MT, AF, SO > &  sm)
inline

Resetting the given sparse submatrix.

Parameters
smThe sparse submatrix to be resetted.
Returns
void
template<typename MT , bool AF, bool SO>
void blaze::reset ( SparseSubmatrix< MT, AF, SO > &  sm,
size_t  i 
)
inline

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

Parameters
smThe sparse 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 sparse 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.