Classes | Functions

Classes

class  blaze::IdentityMatrix< Type, SO >
 Efficient implementation of an $ N \times N $ identity matrix.The IdentityMatrix class template is the representation of an immutable, arbitrary sized identity matrix with $ N \cdot N $ 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...
 

Functions

template<typename MT , bool SO>
IdentityMatrix< ElementType_< MT >, SO > blaze::declid (const Matrix< MT, SO > &m)
 Declares the given matrix expression m as identity matrix. More...
 

IdentityMatrix operators

template<typename Type , bool SO>
void blaze::reset (IdentityMatrix< Type, SO > &m)
 Resetting the given identity matrix. More...
 
template<typename Type , bool SO>
void blaze::reset (IdentityMatrix< Type, SO > &m, size_t i)
 Reset the specified row/column of the given identity matrix. More...
 
template<typename Type , bool SO>
void blaze::clear (IdentityMatrix< Type, SO > &m)
 Clearing the given identity matrix. More...
 
template<bool RF, typename Type , bool SO>
bool blaze::isDefault (const IdentityMatrix< Type, SO > &m)
 Returns whether the given identity matrix is in default state. More...
 
template<typename Type , bool SO>
bool blaze::isIntact (const IdentityMatrix< Type, SO > &m)
 Returns whether the invariants of the given identity matrix are intact. More...
 
template<typename Type , bool SO>
void blaze::swap (IdentityMatrix< Type, SO > &a, IdentityMatrix< Type, SO > &b) noexcept
 Swapping the contents of two identity matrices. More...
 

Detailed Description

Function Documentation

◆ clear()

template<typename Type , bool SO>
void blaze::clear ( IdentityMatrix< Type, SO > &  m)
inline

Clearing the given identity matrix.

Parameters
mThe matrix to be cleared.
Returns
void

◆ declid()

template<typename MT , bool SO>
IdentityMatrix<ElementType_<MT>,SO> blaze::declid ( const Matrix< MT, SO > &  m)
inline

Declares the given matrix expression m as identity matrix.

Parameters
mThe input matrix.
Returns
The redeclared matrix.
Exceptions
std::invalid_argumentInvalid identity matrix specification.

The declid function declares the given dense or sparse matrix expression m as identity matrix. In case the given matrix is not a square matrix, a std::invalid_argument exception is thrown.
The following example demonstrates the use of the declid function:

// ... Resizing and initialization
B = declid( A );

◆ isDefault()

template<bool RF, typename Type , bool SO>
bool blaze::isDefault ( const IdentityMatrix< Type, SO > &  m)
inline

Returns whether the given identity matrix is in default state.

Parameters
mThe matrix to be tested for its default state.
Returns
true in case the given matrix's rows and columns are zero, false otherwise.

This function checks whether the identity matrix is in default (constructed) state, i.e. if it's number of rows and columns is 0. In case it is in default state, the function returns true, else it will return false. The following example demonstrates the use of the isDefault() function:

// ... Resizing and initialization
if( isDefault( I ) ) { ... }

Optionally, it is possible to switch between strict semantics (blaze::strict) and relaxed semantics (blaze::relaxed):

if( isDefault<relaxed>( I ) ) { ... }

◆ isIntact()

template<typename Type , bool SO>
bool blaze::isIntact ( const IdentityMatrix< Type, SO > &  m)
inline

Returns whether the invariants of the given identity matrix are intact.

Parameters
mThe identity matrix to be tested.
Returns
true in case the given matrix's invariants are intact, false otherwise.

This function checks whether the invariants of the identity matrix 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( I ) ) { ... }

◆ reset() [1/2]

template<typename Type , bool SO>
void blaze::reset ( IdentityMatrix< Type, SO > &  m)
inline

Resetting the given identity matrix.

Parameters
mThe matrix to be resetted.
Returns
void

◆ reset() [2/2]

template<typename Type , bool SO>
void blaze::reset ( IdentityMatrix< Type, SO > &  m,
size_t  i 
)
inline

Reset the specified row/column of the given identity matrix.

Parameters
mThe matrix to be resetted.
iThe index of the row/column to be resetted.
Returns
void

This function resets the values in the specified row/column of the given identity matrix to their default value. In case the given matrix is a rowMajor matrix the function resets the values in row i, if it is a columnMajor matrix the function resets the values in column i.

◆ swap()

template<typename Type , bool SO>
void blaze::swap ( IdentityMatrix< Type, SO > &  a,
IdentityMatrix< Type, SO > &  b 
)
inlinenoexcept

Swapping the contents of two identity matrices.

Parameters
aThe first matrix to be swapped.
bThe second matrix to be swapped.
Returns
void