Classes | Enumerations
Sparse Subvector

Classes

class  blaze::SparseSubvector< VT, AF, TF >::SubvectorElement< VectorType, IteratorType >
 Access proxy for a specific element of the sparse subvector. More...
 
class  blaze::SparseSubvector< VT, AF, TF >::SubvectorIterator< VectorType, IteratorType >
 Iterator over the elements of the sparse subvector. More...
 
class  blaze::SparseSubvector< VT, AF, TF >
 View on a specific subvector of a sparse vector.The SparseSubvector template represents a view on a specific subvector of a sparse vector primitive. The type of the sparse vector is specified via the first template parameter: More...
 

Enumerations

enum  { useConst = IsConst<VT>::value }
 Compilation switch for the non-const reference and iterator types. More...
 
enum  { returnConst = IsConst<VectorType>::value }
 Compilation switch for the return type of the value member function. More...
 
enum  { smpAssignable = VT::smpAssignable }
 Compilation switch for the expression template assignment strategy.
 

SparseSubvector operators

template<typename VT , bool AF, bool TF>
void blaze::reset (SparseSubvector< VT, AF, TF > &sv)
 Resetting the given sparse subvector. More...
 
template<typename VT , bool AF, bool TF>
void blaze::clear (SparseSubvector< VT, AF, TF > &sv)
 Clearing the given sparse subvector. More...
 
template<typename VT , bool AF, bool TF>
bool blaze::isDefault (const SparseSubvector< VT, AF, TF > &sv)
 Returns whether the given sparse subvector is in default state. More...
 
template<typename VT , bool AF, bool TF>
bool blaze::isSame (const SparseSubvector< VT, AF, TF > &a, const SparseVector< VT, TF > &b)
 Returns whether the given sparse vector and subvector represent the same observable state. More...
 
template<typename VT , bool AF, bool TF>
bool blaze::isSame (const SparseVector< VT, TF > &a, const SparseSubvector< VT, AF, TF > &b)
 Returns whether the given sparse vector and subvector represent the same observable state. More...
 
template<typename VT , bool AF, bool TF>
bool blaze::isSame (const SparseSubvector< VT, AF, TF > &a, const SparseSubvector< VT, AF, TF > &b)
 Returns whether the two given subvectors represent the same observable state. More...
 

Detailed Description

Enumeration Type Documentation

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::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 sparse vector of type VT is const qualified, useConst will be set to 1 and the sparse subvector will return references and iterators to const. Otherwise useConst will be set to 0 and the sparse subvector will offer write access to the sparse vector elements both via the subscript operator and iterators.

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename VectorType , typename IteratorType >
anonymous enum
private

Compilation switch for the return type of the value member function.

The returnConst compile time constant expression represents a compilation switch for the return type of the value member function. In case the given vector type VectorType is const qualified, returnConst will be set to 1 and the value member function will return a reference to const. Otherwise returnConst will be set to 0 and the value member function will offer write access to the sparse vector elements.

Function Documentation

template<typename VT , bool AF, bool TF>
void blaze::clear ( SparseSubvector< VT, AF, TF > &  sv)
inline

Clearing the given sparse subvector.

Parameters
svThe sparse subvector to be cleared.
Returns
void

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

template<typename VT , bool AF, bool TF>
bool blaze::isDefault ( const SparseSubvector< VT, AF, TF > &  sv)
inline

Returns whether the given sparse subvector is in default state.

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

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

// ... Resizing and initialization
if( isDefault( subvector( v, 10UL, 20UL ) ) ) { ... }
template<typename VT , bool AF, bool TF>
bool blaze::isSame ( const SparseSubvector< VT, AF, TF > &  a,
const SparseVector< VT, TF > &  b 
)
inline

Returns whether the given sparse vector and subvector represent the same observable state.

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

This overload of the isSame function tests if the given subvector refers to the entire range of the given sparse vector and by that represents the same observable state. In this case, the function returns true, otherwise it returns false.

template<typename VT , bool AF, bool TF>
bool blaze::isSame ( const SparseVector< VT, TF > &  a,
const SparseSubvector< VT, AF, TF > &  b 
)
inline

Returns whether the given sparse vector and subvector represent the same observable state.

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

This overload of the isSame function tests if the given subvector refers to the entire range of the given sparse vector and by that represents the same observable state. In this case, the function returns true, otherwise it returns false.

template<typename VT , bool AF, bool TF>
bool blaze::isSame ( const SparseSubvector< VT, AF, TF > &  a,
const SparseSubvector< VT, AF, TF > &  b 
)
inline

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

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

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

template<typename VT , bool AF, bool TF>
void blaze::reset ( SparseSubvector< VT, AF, TF > &  sv)
inline

Resetting the given sparse subvector.

Parameters
svThe sparse subvector to be resetted.
Returns
void