Classes
SparseRow

Classes

class  blaze::SparseRow< MT, SO, SF >
 Reference to a specific row of a sparse matrix.The SparseRow template represents a reference to a specific row of a sparse matrix primitive. The type of the sparse matrix is specified via the first template parameter: More...
 

SparseRow operators

template<typename MT , bool SO, bool SF>
void blaze::reset (SparseRow< MT, SO, SF > &row)
 Resetting the given sparse row. More...
 
template<typename MT , bool SO, bool SF>
void blaze::clear (SparseRow< MT, SO, SF > &row)
 Clearing the given sparse row. More...
 
template<typename MT , bool SO, bool SF>
bool blaze::isDefault (const SparseRow< MT, SO, SF > &row)
 Returns whether the given sparse row is in default state. More...
 
template<typename MT , bool SO, bool SF>
bool blaze::isIntact (const SparseRow< MT, SO, SF > &row)
 Returns whether the invariants of the given sparse row are intact. More...
 
template<typename MT , bool SO, bool SF>
bool blaze::isSame (const SparseRow< MT, SO, SF > &a, const SparseRow< MT, SO, SF > &b)
 Returns whether the two given sparse rows represent the same observable state. More...
 

Detailed Description

Function Documentation

template<typename MT , bool SO, bool SF>
void blaze::clear ( SparseRow< MT, SO, SF > &  row)
inline

Clearing the given sparse row.

Parameters
rowThe sparse row to be cleared.
Returns
void

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

template<typename MT , bool SO, bool SF>
bool blaze::isDefault ( const SparseRow< MT, SO, SF > &  row)
inline

Returns whether the given sparse row is in default state.

Parameters
rowThe sparse row to be tested for its default state.
Returns
true in case the given row is component-wise zero, false otherwise.

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

// ... Resizing and initialization
if( isDefault( row( A, 0UL ) ) ) { ... }
template<typename MT , bool SO, bool SF>
bool blaze::isIntact ( const SparseRow< MT, SO, SF > &  row)
inline

Returns whether the invariants of the given sparse row are intact.

Parameters
rowThe sparse row to be tested.
Returns
true in case the given row's invariants are intact, false otherwise.

This function checks whether the invariants of the sparse row are intact, i.e. if its state is valid. In case the invariants are intact, the function returns true, else it will return false. The following example demonstrates the use of the isIntact() function:

// ... Resizing and initialization
if( isIntact( row( A, 0UL ) ) ) { ... }
template<typename MT , bool SO, bool SF>
bool blaze::isSame ( const SparseRow< MT, SO, SF > &  a,
const SparseRow< MT, SO, SF > &  b 
)
inline

Returns whether the two given sparse rows represent the same observable state.

Parameters
aThe first sparse row to be tested for its state.
bThe second sparse row to be tested for its state.
Returns
true in case the two rows share a state, false otherwise.

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

template<typename MT , bool SO, bool SF>
void blaze::reset ( SparseRow< MT, SO, SF > &  row)
inline

Resetting the given sparse row.

Parameters
rowThe sparse row to be resetted.
Returns
void