Blaze 3.9
Public Types | Public Member Functions | Private Types | List of all members
blaze::SymmetricElement< MT > Class Template Reference

Representation of two synchronized elements within the sparse symmetric matrix. More...

#include <SymmetricElement.h>

Inherits blaze::SparseElement.

Public Types

using ValueType = SymmetricValue< MT >
 The value type of the value-index-pair.
 
using IndexType = size_t
 The index type of the value-index-pair.
 
using Reference = SymmetricValue< MT >
 Reference return type.
 
using ConstReference = const SymmetricValue< MT >
 Reference-to-const return type.
 
using Pointer = SymmetricElement *
 Pointer return type.
 

Public Member Functions

template<typename T >
SymmetricElement< MT > & operator= (const T &v)
 Assignment to the symmetric element. More...
 
template<typename T >
SymmetricElement< MT > & operator+= (const T &v)
 Addition assignment to the Hermitian element. More...
 
template<typename T >
SymmetricElement< MT > & operator-= (const T &v)
 Subtraction assignment to the Hermitian element. More...
 
template<typename T >
SymmetricElement< MT > & operator*= (const T &v)
 Multiplication assignment to the Hermitian element. More...
 
template<typename T >
SymmetricElement< MT > & operator/= (const T &v)
 Division assignment to the Hermitian element. More...
 
Constructors
 SymmetricElement (IteratorType pos, MT *matrix, size_t idx)
 Constructor for the SymmetricElement class. More...
 
Assignment operators
template<typename T >
SymmetricElementoperator= (const T &v)
 
template<typename T >
SymmetricElementoperator+= (const T &v)
 
template<typename T >
SymmetricElementoperator-= (const T &v)
 
template<typename T >
SymmetricElementoperator*= (const T &v)
 
template<typename T >
SymmetricElementoperator/= (const T &v)
 
Access operators
Pointer operator-> () noexcept
 Direct access to the Hermitian element. More...
 

Private Types

using ElementType = ElementType_t< MT >
 Type of the represented matrix element.
 
using IteratorType = Iterator_t< MT >
 Type of the underlying sparse matrix iterators.
 

Utility functions

IteratorType pos_
 Iterator to the current sparse Hermitian matrix element.
 
MT * matrix_
 The sparse matrix containing the iterator.
 
size_t index_
 The row/column index of the iterator.
 
Reference value () const
 Access to the current value of the Hermitian element. More...
 
IndexType index () const
 Access to the current index of the Hermitian element. More...
 
void sync ()
 Synchronization of the current sparse element to the according paired element. More...
 
bool isSynced () const
 Checking if the current sparse element is in sync. More...
 

Detailed Description

template<typename MT>
class blaze::SymmetricElement< MT >

Representation of two synchronized elements within the sparse symmetric matrix.

The SymmetricElement class represents two synchronized elements (i.e. two value/index pairs) within a sparse symmetric matrix. It guarantees that a modification of element $ a_{ij} $ via iterator is also applied to element $ a_{ji} $. The following example illustrates this by means of a $ 3 \times 3 $ dense Hermitian matrix:

// Creating a 3x3 symmetric sparse matrix
//
// ( 0 0 -2 )
// ( 0 3 5 )
// ( -2 5 0 )
//
Symmetric A( 3UL );
A(0,2) = -2;
A(1,1) = 3;
A(1,2) = 5;
// Modification of the values at position (2,0) and (0,2)
//
// ( 0 0 4 )
// ( 0 3 5 )
// ( 4 5 0 )
//
Symmetric::Iterator it = A.begin( 2UL );
*it = 4;
Matrix adapter for symmetric matrices.
Definition: BaseTemplate.h:614

Constructor & Destructor Documentation

◆ SymmetricElement()

template<typename MT >
blaze::SymmetricElement< MT >::SymmetricElement ( IteratorType  pos,
MT *  matrix,
size_t  idx 
)
inline

Constructor for the SymmetricElement class.

Parameters
posThe initial position of the iterator.
matrixThe sparse matrix containing the iterator.
idxThe row/column index of the iterator.

Member Function Documentation

◆ index()

template<typename MT >
SymmetricElement< MT >::IndexType blaze::SymmetricElement< MT >::index
inline

Access to the current index of the Hermitian element.

Returns
The current index of the Hermitian element.

◆ isSynced()

template<typename MT >
bool blaze::SymmetricElement< MT >::isSynced
inlineprivate

Checking if the current sparse element is in sync.

Returns
true if the current sparse element is in sync, false if not.

◆ operator*=()

template<typename MT >
template<typename T >
SymmetricElement< MT > & blaze::SymmetricElement< MT >::operator*= ( const T &  v)
inline

Multiplication assignment to the Hermitian element.

Parameters
vThe right-hand side value for the multiplication.
Returns
Reference to the assigned Hermitian element.

◆ operator+=()

template<typename MT >
template<typename T >
SymmetricElement< MT > & blaze::SymmetricElement< MT >::operator+= ( const T &  v)
inline

Addition assignment to the Hermitian element.

Parameters
vThe right-hand side value for the addition.
Returns
Reference to the assigned Hermitian element.

◆ operator-=()

template<typename MT >
template<typename T >
SymmetricElement< MT > & blaze::SymmetricElement< MT >::operator-= ( const T &  v)
inline

Subtraction assignment to the Hermitian element.

Parameters
vThe right-hand side value for the subtraction.
Returns
Reference to the assigned Hermitian element.

◆ operator->()

template<typename MT >
SymmetricElement< MT >::Pointer blaze::SymmetricElement< MT >::operator->
inlinenoexcept

Direct access to the Hermitian element.

Returns
Reference to the value of the Hermitian element.

◆ operator/=()

template<typename MT >
template<typename T >
SymmetricElement< MT > & blaze::SymmetricElement< MT >::operator/= ( const T &  v)
inline

Division assignment to the Hermitian element.

Parameters
vThe right-hand side value for the division.
Returns
Reference to the assigned Hermitian element.

◆ operator=()

template<typename MT >
template<typename T >
SymmetricElement< MT > & blaze::SymmetricElement< MT >::operator= ( const T &  v)
inline

Assignment to the symmetric element.

Parameters
vThe new value of the symmetric element.
Returns
Reference to the assigned Hermitian element.

◆ sync()

template<typename MT >
void blaze::SymmetricElement< MT >::sync
inlineprivate

Synchronization of the current sparse element to the according paired element.

Returns
void

◆ value()

template<typename MT >
SymmetricElement< MT >::Reference blaze::SymmetricElement< MT >::value
inline

Access to the current value of the Hermitian element.

Returns
The current value of the Hermitian element.

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