Classes
Subvector

Classes

class  blaze::Subvector< VT, AF, TF, DF >
 View on a specific subvector of a dense or sparse vector.The Subvector class template represents a view on a specific subvector of a dense or sparse vector primitive. The type of the vector is specified via the first template parameter: More...
 

Subvector operators

template<typename VT , bool AF, bool TF, bool DF>
void blaze::reset (Subvector< VT, AF, TF, DF > &sv)
 Resetting the given subvector. More...
 
template<typename VT , bool AF, bool TF, bool DF>
void blaze::clear (Subvector< VT, AF, TF, DF > &sv)
 Clearing the given subvector. More...
 
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isDefault (const Subvector< VT, AF, TF, DF > &sv)
 Returns whether the given subvector is in default state. More...
 
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isIntact (const Subvector< VT, AF, TF, DF > &sv) noexcept
 Returns whether the invariants of the given subvector vector are intact. More...
 
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isSame (const Subvector< VT, AF, TF, DF > &a, const Vector< VT, TF > &b) noexcept
 Returns whether the given vector and subvector represent the same observable state. More...
 
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isSame (const Vector< VT, TF > &a, const Subvector< VT, AF, TF, DF > &b) noexcept
 Returns whether the given vector and subvector represent the same observable state. More...
 
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isSame (const Subvector< VT, AF, TF, DF > &a, const Subvector< VT, AF, TF, DF > &b) noexcept
 Returns whether the two given subvectors represent the same observable state. More...
 

Detailed Description

Function Documentation

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

Clearing the given subvector.

Parameters
svThe subvector to be cleared.
Returns
void
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isDefault ( const Subvector< VT, AF, TF, DF > &  sv)
inline

Returns whether the given subvector is in default state.

Parameters
svThe 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 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 subvector 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 DF>
bool blaze::isIntact ( const Subvector< VT, AF, TF, DF > &  sv)
inlinenoexcept

Returns whether the invariants of the given subvector vector are intact.

Parameters
svThe subvector to be tested.
Returns
true in case the given subvector's invariants are intact, false otherwise.

This function checks whether the invariants of the subvector 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( subvector( v, 10UL, 20UL ) ) ) { ... }
template<typename VT , bool AF, bool TF, bool DF>
bool blaze::isSame ( const Subvector< VT, AF, TF, DF > &  a,
const Vector< VT, TF > &  b 
)
inlinenoexcept

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

Parameters
aThe subvector to be tested for its state.
bThe vector to be tested for its state.
Returns
true in case the 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 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 DF>
bool blaze::isSame ( const Vector< VT, TF > &  a,
const Subvector< VT, AF, TF, DF > &  b 
)
inlinenoexcept

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

Parameters
aThe vector to be tested for its state.
bThe subvector to be tested for its state.
Returns
true in case the 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 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 DF>
bool blaze::isSame ( const Subvector< VT, AF, TF, DF > &  a,
const Subvector< VT, AF, TF, DF > &  b 
)
inlinenoexcept

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

Parameters
aThe first subvector to be tested for its state.
bThe second 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 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, bool DF>
void blaze::reset ( Subvector< VT, AF, TF, DF > &  sv)
inline

Resetting the given subvector.

Parameters
svThe subvector to be resetted.
Returns
void