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

Classes

class  blaze::CompressedMatrix< Type, SO >
 Efficient implementation of a $ M \times N $ compressed matrix.The CompressedMatrix class template is the representation of an arbitrary sized sparse matrix with $ M \cdot N $ dynamically allocated elements of arbitrary type. The type of the elements and the storage order of the matrix can be specified via the two template parameters: More...
 

Typedefs

typedef CompressedMatrix
< float, false > 
blaze::CMatMxNf
 MxN single precision matrix.
 
typedef CompressedMatrix
< double, false > 
blaze::CMatMxNd
 MxN double precision matrix.
 
typedef CompressedMatrix< real,
false > 
blaze::CMatMxN
 MxN matrix with system-specific precision.
 

CompressedMatrix operators

template<typename Type , bool SO>
void reset (CompressedMatrix< Type, SO > &m)
 Resetting the given sparse matrix. More...
 
template<typename Type , bool SO>
void clear (CompressedMatrix< Type, SO > &m)
 Clearing the given sparse matrix. More...
 
template<typename Type , bool SO>
bool isDefault (const CompressedMatrix< Type, SO > &m)
 Returns whether the given sparse matrix is in default state. More...
 
template<typename Type , bool SO>
void swap (CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
 Swapping the contents of two sparse matrices. More...
 

Detailed Description

Function Documentation

template<typename Type , bool SO>
void clear ( CompressedMatrix< Type, SO > &  m)
inline

Clearing the given sparse matrix.

Parameters
mThe sparse matrix to be cleared.
Returns
void
template<typename Type , bool SO>
bool isDefault ( const CompressedMatrix< Type, SO > &  m)
inline

Returns whether the given sparse matrix is in default state.

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

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

// ... Resizing and initialization
if( isDefault( A ) ) { ... }
template<typename Type , bool SO>
void reset ( CompressedMatrix< Type, SO > &  m)
inline

Resetting the given sparse matrix.

Parameters
mThe sparse matrix to be resetted.
Returns
void
template<typename Type , bool SO>
void swap ( CompressedMatrix< Type, SO > &  a,
CompressedMatrix< Type, SO > &  b 
)
inline

Swapping the contents of two sparse matrices.

Parameters
aThe first sparse matrix to be swapped.
bThe second sparse matrix to be swapped.
Returns
void
Exceptions
no-throwguarantee.