Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
blaze::DMatTransposer< MT, SO > Class Template Reference

Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper object for the temporary transposition of a dense matrix. More...

#include <DMatTransposer.h>

Inherits blaze::DenseMatrix< DMatTransposer< MT, SO >, SO >.

Public Types

using This = DMatTransposer< MT, SO >
 Type of this DMatTransposer instance.
 
using BaseType = DenseMatrix< This, SO >
 Base type of this DMatTransposer instance.
 
using ResultType = TransposeType_t< MT >
 Result type for expression template evaluations.
 
using OppositeType = OppositeType_t< MT >
 Result type with opposite storage order for expression template evaluations.
 
using TransposeType = ResultType_t< MT >
 Transpose type for expression template evaluations.
 
using ElementType = ElementType_t< MT >
 Type of the matrix elements.
 
using SIMDType = SIMDTrait_t< ElementType >
 SIMD type of the matrix elements.
 
using ReturnType = ReturnType_t< MT >
 Return type for expression template evaluations.
 
using CompositeType = const This &
 Data type for composite expression templates.
 
using Reference = Reference_t< MT >
 Reference to a non-constant matrix value.
 
using ConstReference = ConstReference_t< MT >
 Reference to a constant matrix value.
 
using Pointer = Pointer_t< MT >
 Pointer to a non-constant matrix value.
 
using ConstPointer = ConstPointer_t< MT >
 Pointer to a constant matrix value.
 
using Iterator = Iterator_t< MT >
 Iterator over non-constant elements.
 
using ConstIterator = ConstIterator_t< MT >
 Iterator over constant elements.
 
using MatrixType = MT
 Type of the matrix.
 

Public Member Functions

 DMatTransposer (MT &dm) noexcept
 Constructor for the DMatTransposer class. More...
 
Reference operator() (size_t i, size_t j)
 2D-access to the matrix elements. More...
 
ConstReference operator() (size_t i, size_t j) const
 2D-access to the matrix elements. More...
 
Reference at (size_t i, size_t j)
 Checked access to the matrix elements. More...
 
ConstReference at (size_t i, size_t j) const
 Checked access to the matrix elements. More...
 
Pointer data () noexcept
 Low-level data access to the matrix elements. More...
 
ConstPointer data () const noexcept
 Low-level data access to the matrix elements. More...
 
Iterator begin (size_t i)
 Returns an iterator to the first non-zero element of row/column i. More...
 
ConstIterator begin (size_t i) const
 Returns an iterator to the first non-zero element of row/column i. More...
 
ConstIterator cbegin (size_t i) const
 Returns an iterator to the first non-zero element of row/column i. More...
 
Iterator end (size_t i)
 Returns an iterator just past the last non-zero element of row/column i. More...
 
ConstIterator end (size_t i) const
 Returns an iterator just past the last non-zero element of row/column i. More...
 
ConstIterator cend (size_t i) const
 Returns an iterator just past the last non-zero element of row/column i. More...
 
size_t rows () const noexcept
 Returns the current number of rows of the matrix. More...
 
size_t columns () const noexcept
 Returns the current number of columns of the matrix. More...
 
size_t spacing () const noexcept
 Returns the spacing between the beginning of two rows. More...
 
void reset ()
 Resets the matrix elements. More...
 
bool isIntact () const noexcept
 Returns whether the invariants of the matrix are intact. More...
 
template<typename Other >
bool canAlias (const Other *alias) const noexcept
 Returns whether the matrix can alias with the given address alias. More...
 
template<typename Other >
bool isAliased (const Other *alias) const noexcept
 Returns whether the matrix is aliased with the given address alias. More...
 
bool isAligned () const noexcept
 Returns whether the matrix is properly aligned in memory. More...
 
bool canSMPAssign () const noexcept
 Returns whether the matrix can be used in SMP assignments. More...
 
BLAZE_ALWAYS_INLINE SIMDType load (size_t i, size_t j) const noexcept
 Load of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE SIMDType loada (size_t i, size_t j) const noexcept
 Aligned load of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE SIMDType loadu (size_t i, size_t j) const noexcept
 Unaligned load of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void store (size_t i, size_t j, const SIMDType &value) noexcept
 Store of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void storea (size_t i, size_t j, const SIMDType &value) noexcept
 Aligned store of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void storeu (size_t i, size_t j, const SIMDType &value) noexcept
 Unaligned store of a SIMD element of the matrix. More...
 
BLAZE_ALWAYS_INLINE void stream (size_t i, size_t j, const SIMDType &value) noexcept
 Aligned, non-temporal store of a SIMD element of the matrix. More...
 
template<typename MT2 , bool SO2>
void assign (const Matrix< MT2, SO2 > &rhs)
 Implementation of the transpose assignment of a matrix. More...
 
template<typename MT2 , bool SO2>
void addAssign (const Matrix< MT2, SO2 > &rhs)
 Implementation of the transpose addition assignment of a matrix. More...
 
template<typename MT2 , bool SO2>
void subAssign (const Matrix< MT2, SO2 > &rhs)
 Implementation of the transpose subtraction assignment of a matrix. More...
 
template<typename MT2 , bool SO2>
void schurAssign (const Matrix< MT2, SO2 > &rhs)
 Implementation of the transpose Schur product assignment of a matrix. More...
 
BLAZE_ALWAYS_INLINE constexpr MatrixTypeoperator~ () noexcept
 Conversion operator for non-constant matrices. More...
 
BLAZE_ALWAYS_INLINE constexpr const MatrixTypeoperator~ () const noexcept
 Conversion operator for constant matrices. More...
 

Static Public Attributes

static constexpr bool simdEnabled = MT::simdEnabled
 Compilation flag for SIMD optimization. More...
 
static constexpr bool smpAssignable = MT::smpAssignable
 Compilation flag for SMP assignments. More...
 
static constexpr bool storageOrder = SO
 Storage order of the matrix.
 

Private Attributes

MT & dm_
 The dense matrix operand.
 

Detailed Description

template<typename MT, bool SO>
class blaze::DMatTransposer< MT, SO >

Expression object for the transposition of a dense matrix.

The DMatTransposer class is a wrapper object for the temporary transposition of a dense matrix.

Constructor & Destructor Documentation

◆ DMatTransposer()

template<typename MT, bool SO>
blaze::DMatTransposer< MT, SO >::DMatTransposer ( MT &  dm)
inlineexplicitnoexcept

Constructor for the DMatTransposer class.

Parameters
dmThe dense matrix operand.

Member Function Documentation

◆ addAssign()

template<typename MT, bool SO>
template<typename MT2 , bool SO2>
void blaze::DMatTransposer< MT, SO >::addAssign ( const Matrix< MT2, SO2 > &  rhs)
inline

Implementation of the transpose addition assignment of a matrix.

Parameters
rhsThe right-hand side matrix to be added.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ assign()

template<typename MT, bool SO>
template<typename MT2 , bool SO2>
void blaze::DMatTransposer< MT, SO >::assign ( const Matrix< MT2, SO2 > &  rhs)
inline

Implementation of the transpose assignment of a matrix.

Parameters
rhsThe right-hand side matrix to be assigned.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ at() [1/2]

template<typename MT, bool SO>
Reference blaze::DMatTransposer< MT, SO >::at ( size_t  i,
size_t  j 
)
inline

Checked access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range $[0..M-1]$.
jAccess index for the column. The index has to be in the range $[0..N-1]$.
Returns
The resulting value.
Exceptions
std::out_of_rangeInvalid matrix access index.

◆ at() [2/2]

template<typename MT, bool SO>
ConstReference blaze::DMatTransposer< MT, SO >::at ( size_t  i,
size_t  j 
) const
inline

Checked access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range $[0..M-1]$.
jAccess index for the column. The index has to be in the range $[0..N-1]$.
Returns
The resulting value.
Exceptions
std::out_of_rangeInvalid matrix access index.

◆ begin() [1/2]

template<typename MT, bool SO>
Iterator blaze::DMatTransposer< MT, SO >::begin ( size_t  i)
inline

Returns an iterator to the first non-zero element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator to the first non-zero element of row/column i.

This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.

◆ begin() [2/2]

template<typename MT, bool SO>
ConstIterator blaze::DMatTransposer< MT, SO >::begin ( size_t  i) const
inline

Returns an iterator to the first non-zero element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator to the first non-zero element of row/column i.

This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.

◆ canAlias()

template<typename MT, bool SO>
template<typename Other >
bool blaze::DMatTransposer< MT, SO >::canAlias ( const Other *  alias) const
inlinenoexcept

Returns whether the matrix can alias with the given address alias.

Parameters
aliasThe alias to be checked.
Returns
true in case the alias corresponds to this matrix, false if not.

◆ canSMPAssign()

template<typename MT, bool SO>
bool blaze::DMatTransposer< MT, SO >::canSMPAssign ( ) const
inlinenoexcept

Returns whether the matrix can be used in SMP assignments.

Returns
true in case the matrix can be used in SMP assignments, false if not.

◆ cbegin()

template<typename MT, bool SO>
ConstIterator blaze::DMatTransposer< MT, SO >::cbegin ( size_t  i) const
inline

Returns an iterator to the first non-zero element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator to the first non-zero element of row/column i.

This function returns a row/column iterator to the first non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first non-zero element of column i.

◆ cend()

template<typename MT, bool SO>
ConstIterator blaze::DMatTransposer< MT, SO >::cend ( size_t  i) const
inline

Returns an iterator just past the last non-zero element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator just past the last non-zero element of row/column i.

This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.

◆ columns()

template<typename MT, bool SO>
size_t blaze::DMatTransposer< MT, SO >::columns ( ) const
inlinenoexcept

Returns the current number of columns of the matrix.

Returns
The number of columns of the matrix.

◆ data() [1/2]

template<typename MT, bool SO>
Pointer blaze::DMatTransposer< MT, SO >::data ( )
inlinenoexcept

Low-level data access to the matrix elements.

Returns
Pointer to the internal element storage.

◆ data() [2/2]

template<typename MT, bool SO>
ConstPointer blaze::DMatTransposer< MT, SO >::data ( ) const
inlinenoexcept

Low-level data access to the matrix elements.

Returns
Pointer to the internal element storage.

◆ end() [1/2]

template<typename MT, bool SO>
Iterator blaze::DMatTransposer< MT, SO >::end ( size_t  i)
inline

Returns an iterator just past the last non-zero element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator just past the last non-zero element of row/column i.

This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.

◆ end() [2/2]

template<typename MT, bool SO>
ConstIterator blaze::DMatTransposer< MT, SO >::end ( size_t  i) const
inline

Returns an iterator just past the last non-zero element of row/column i.

Parameters
iThe row/column index.
Returns
Iterator just past the last non-zero element of row/column i.

This function returns an row/column iterator just past the last non-zero element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last non-zero element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last non-zero element of column i.

◆ isAliased()

template<typename MT, bool SO>
template<typename Other >
bool blaze::DMatTransposer< MT, SO >::isAliased ( const Other *  alias) const
inlinenoexcept

Returns whether the matrix is aliased with the given address alias.

Parameters
aliasThe alias to be checked.
Returns
true in case the alias corresponds to this matrix, false if not.

◆ isAligned()

template<typename MT, bool SO>
bool blaze::DMatTransposer< MT, SO >::isAligned ( ) const
inlinenoexcept

Returns whether the matrix is properly aligned in memory.

Returns
true in case the matrix is aligned, false if not.

◆ isIntact()

template<typename MT, bool SO>
bool blaze::DMatTransposer< MT, SO >::isIntact ( ) const
inlinenoexcept

Returns whether the invariants of the matrix are intact.

Returns
true in case the matrix's invariants are intact, false otherwise.

◆ load()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE SIMDType blaze::DMatTransposer< MT, SO >::load ( size_t  i,
size_t  j 
) const
inlinenoexcept

Load of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
The loaded SIMD element.

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ loada()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE SIMDType blaze::DMatTransposer< MT, SO >::loada ( size_t  i,
size_t  j 
) const
inlinenoexcept

Aligned load of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
The loaded SIMD element.

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ loadu()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE SIMDType blaze::DMatTransposer< MT, SO >::loadu ( size_t  i,
size_t  j 
) const
inlinenoexcept

Unaligned load of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
Returns
The loaded SIMD element.

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ operator()() [1/2]

template<typename MT, bool SO>
Reference blaze::DMatTransposer< MT, SO >::operator() ( size_t  i,
size_t  j 
)
inline

2D-access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range $[0..M-1]$.
jAccess index for the column. The index has to be in the range $[0..N-1]$.
Returns
Reference to the accessed value.

◆ operator()() [2/2]

template<typename MT, bool SO>
ConstReference blaze::DMatTransposer< MT, SO >::operator() ( size_t  i,
size_t  j 
) const
inline

2D-access to the matrix elements.

Parameters
iAccess index for the row. The index has to be in the range $[0..M-1]$.
jAccess index for the column. The index has to be in the range $[0..N-1]$.
Returns
Reference to the accessed value.

◆ operator~() [1/2]

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE constexpr MatrixType& blaze::Matrix< MT, SO >::operator~ ( )
inlinenoexceptinherited

Conversion operator for non-constant matrices.

Returns
Reference of the actual type of the matrix.

◆ operator~() [2/2]

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE constexpr const MatrixType& blaze::Matrix< MT, SO >::operator~ ( ) const
inlinenoexceptinherited

Conversion operator for constant matrices.

Returns
Constant reference of the actual type of the matrix.

◆ reset()

template<typename MT, bool SO>
void blaze::DMatTransposer< MT, SO >::reset ( )
inline

Resets the matrix elements.

Returns
void

◆ rows()

template<typename MT, bool SO>
size_t blaze::DMatTransposer< MT, SO >::rows ( ) const
inlinenoexcept

Returns the current number of rows of the matrix.

Returns
The number of rows of the matrix.

◆ schurAssign()

template<typename MT, bool SO>
template<typename MT2 , bool SO2>
void blaze::DMatTransposer< MT, SO >::schurAssign ( const Matrix< MT2, SO2 > &  rhs)
inline

Implementation of the transpose Schur product assignment of a matrix.

Parameters
rhsThe right-hand side matrix for the Schur product.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

◆ spacing()

template<typename MT, bool SO>
size_t blaze::DMatTransposer< MT, SO >::spacing ( ) const
inlinenoexcept

Returns the spacing between the beginning of two rows.

Returns
The spacing between the beginning of two rows.

◆ store()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE void blaze::DMatTransposer< MT, SO >::store ( size_t  i,
size_t  j,
const SIMDType value 
)
inlinenoexcept

Store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ storea()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE void blaze::DMatTransposer< MT, SO >::storea ( size_t  i,
size_t  j,
const SIMDType value 
)
inlinenoexcept

Aligned store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ storeu()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE void blaze::DMatTransposer< MT, SO >::storeu ( size_t  i,
size_t  j,
const SIMDType value 
)
inlinenoexcept

Unaligned store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ stream()

template<typename MT, bool SO>
BLAZE_ALWAYS_INLINE void blaze::DMatTransposer< MT, SO >::stream ( size_t  i,
size_t  j,
const SIMDType value 
)
inlinenoexcept

Aligned, non-temporal store of a SIMD element of the matrix.

Parameters
iAccess index for the row. The index has to be in the range [0..M-1].
jAccess index for the column. The index has to be in the range [0..N-1].
valueThe SIMD element to be stored.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ subAssign()

template<typename MT, bool SO>
template<typename MT2 , bool SO2>
void blaze::DMatTransposer< MT, SO >::subAssign ( const Matrix< MT2, SO2 > &  rhs)
inline

Implementation of the transpose subtraction assignment of a matrix.

Parameters
rhsThe right-hand side matrix to be subtracted.
Returns
void

This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.

Member Data Documentation

◆ simdEnabled

template<typename MT, bool SO>
constexpr bool blaze::DMatTransposer< MT, SO >::simdEnabled = MT::simdEnabled
static

Compilation flag for SIMD optimization.

The simdEnabled compilation flag indicates whether expressions the matrix is involved in can be optimized via SIMD operations. In case the dense matrix operand is vectorizable, the simdEnabled compilation flag is set to true, otherwise it is set to false.

◆ smpAssignable

template<typename MT, bool SO>
constexpr bool blaze::DMatTransposer< MT, SO >::smpAssignable = MT::smpAssignable
static

Compilation flag for SMP assignments.

The smpAssignable compilation flag indicates whether the matrix can be used in SMP (shared memory parallel) assignments (both on the left-hand and right-hand side of the assignment).


The documentation for this class was generated from the following file: