All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs
CompressedVector

Classes

class  blaze::CompressedVector< Type, TF >
 Efficient implementation of an arbitrary sized sparse vector.The CompressedVector class is the representation of an arbitrarily sized sparse vector, which stores only non-zero elements of arbitrary type. The type of the elements and the transpose flag of the vector can be specified via the two template parameters: More...
 

Typedefs

typedef CompressedVector
< float, false > 
blaze::CVecNf
 Compressed single precision vector.
 
typedef CompressedVector
< double, false > 
blaze::CVecNd
 Compressed double precision vector.
 
typedef CompressedVector< real,
false > 
blaze::CVecN
 Compressed vector with system-specific precision.
 

CompressedVector operators

template<typename Type , bool TF>
void blaze::reset (CompressedVector< Type, TF > &v)
 Resetting the given compressed vector. More...
 
template<typename Type , bool TF>
void blaze::clear (CompressedVector< Type, TF > &v)
 Clearing the given compressed vector. More...
 
template<typename Type , bool TF>
bool blaze::isnan (const CompressedVector< Type, TF > &v)
 Checks the given compressed vector for not-a-number elements. More...
 
template<typename Type , bool TF>
bool blaze::isDefault (const CompressedVector< Type, TF > &v)
 Returns whether the given compressed vector is in default state. More...
 
template<typename Type , bool TF>
void blaze::swap (CompressedVector< Type, TF > &a, CompressedVector< Type, TF > &b)
 Swapping the contents of two compressed vectors. More...
 

Detailed Description

Function Documentation

template<typename Type , bool TF>
void blaze::clear ( CompressedVector< Type, TF > &  v)
inline

Clearing the given compressed vector.

Parameters
vThe compressed vector to be cleared.
Returns
void
template<typename Type , bool TF>
bool blaze::isDefault ( const CompressedVector< Type, TF > &  v)
inline

Returns whether the given compressed vector is in default state.

Parameters
vThe compressed vector to be tested for its default state.
Returns
true in case the given vector is component-wise zero, false otherwise.

This function checks whether the N-dimensional compressed vector is in default state. For instance, in case the vector is instantiated for a built-in integral or floating point data type, the function returns true in case all vector 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( a ) ) { ... }
template<typename Type , bool TF>
bool blaze::isnan ( const CompressedVector< Type, TF > &  v)
inline

Checks the given compressed vector for not-a-number elements.

Parameters
vThe compressed vector to be checked for not-a-number elements.
Returns
true if at least one element of the vector is not-a-number, false otherwise.

This function checks the N-dimensional compressed vector for not-a-number (NaN) elements. If at least one element of the vector is not-a-number, the function returns true, otherwise it returns false.

// ... Resizing and initialization
if( isnan( a ) ) { ... }
template<typename Type , bool TF>
void blaze::reset ( CompressedVector< Type, TF > &  v)
inline

Resetting the given compressed vector.

Parameters
vThe compressed vector to be resetted.
Returns
void
template<typename Type , bool TF>
void blaze::swap ( CompressedVector< Type, TF > &  a,
CompressedVector< Type, TF > &  b 
)
inline

Swapping the contents of two compressed vectors.

Parameters
aThe first compressed vector to be swapped.
bThe second compressed vector to be swapped.
Returns
void
Exceptions
no-throwguarantee.