Blaze  3.6
Public Types | Public Member Functions | List of all members
blaze::HermitianProxy< MT > Class Template Reference

Access proxy for Hermitian matrices.The HermitianProxy provides controlled access to the elements of a non-const Hermitian matrix. It guarantees that a modification of element $ a_{ij} $ of the accessed matrix is also applied to element $ a_{ji} $. The following example illustrates this by means of a $ 3 \times 3 $ dense Hermitian matrix: More...

#include <HermitianProxy.h>

Inherits blaze::Proxy< HermitianProxy< MT > >.

Public Types

using RepresentedType = ElementType_t< MT >
 Type of the represented matrix element.
 
using Reference = Reference_t< MT >
 Reference to the represented element.
 
using ConstReference = ConstReference_t< MT >
 Reference-to-const to the represented element.
 
using Pointer = HermitianProxy *
 Pointer to the represented element.
 
using ConstPointer = const HermitianProxy *
 Pointer-to-const to the represented element.
 
using ValueType = typename If_t< IsComplex_v< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type
 Value type of the represented complex element.
 

Public Member Functions

template<typename T >
HermitianProxy< MT > & operator= (const T &value)
 Assignment to the accessed matrix element. More...
 
template<typename T >
HermitianProxy< MT > & operator+= (const T &value)
 Addition assignment to the accessed matrix element. More...
 
template<typename T >
HermitianProxy< MT > & operator-= (const T &value)
 Subtraction assignment to the accessed matrix element. More...
 
template<typename T >
HermitianProxy< MT > & operator *= (const T &value)
 Multiplication assignment to the accessed matrix element. More...
 
template<typename T >
HermitianProxy< MT > & operator/= (const T &value)
 Division assignment to the accessed matrix element. More...
 
template<typename T >
HermitianProxy< MT > & operator%= (const T &value)
 Modulo assignment to the accessed matrix element. More...
 
Constructors
 HermitianProxy (MT &matrix, size_t row, size_t column)
 Initialization constructor for a HermitianProxy. More...
 
 HermitianProxy (const HermitianProxy &hp)
 The copy constructor for HermitianProxy. More...
 
Destructor
 ~HermitianProxy ()=default
 
Assignment operators
HermitianProxyoperator= (const HermitianProxy &hp)
 Copy assignment operator for HermitianProxy. More...
 
template<typename T >
HermitianProxyoperator= (const T &value)
 
template<typename T >
HermitianProxyoperator+= (const T &value)
 
template<typename T >
HermitianProxyoperator-= (const T &value)
 
template<typename T >
HermitianProxyoperator *= (const T &value)
 
template<typename T >
HermitianProxyoperator/= (const T &value)
 
template<typename T >
HermitianProxyoperator%= (const T &value)
 
Access operators
Pointer operator-> () noexcept
 Direct access to the represented matrix element. More...
 
ConstPointer operator-> () const noexcept
 Direct access to the represented matrix element. More...
 
Utility functions
void reset () const
 Reset the represented element to its default initial value. More...
 
void clear () const
 Clearing the represented element. More...
 
void invert () const
 In-place inversion of the represented element. More...
 
ConstReference get () const noexcept
 Returning the value of the accessed matrix element. More...
 
Conversion operator
 operator ConstReference () const noexcept
 Conversion to the accessed matrix element. More...
 
Complex data access functions
ValueType real () const
 Returns the real part of the represented complex number. More...
 
void real (ValueType value) const
 Setting the real part of the represented complex number. More...
 
ValueType imag () const
 Returns the imaginary part of the represented complex number. More...
 
void imag (ValueType value) const
 Setting the imaginary part of the represented complex number. More...
 

Private Attributes

Member variables
Reference value1_
 Reference to the first accessed matrix element.
 
Reference value2_
 Reference to the second accessed matrix element.
 
const bool diagonal_
 Flag for the accessed matrix element. More...
 

Detailed Description

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

Access proxy for Hermitian matrices.

The HermitianProxy provides controlled access to the elements of a non-const Hermitian matrix. It guarantees that a modification of element $ a_{ij} $ of the accessed matrix 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 Hermitian dense matrix
A(0,2) = -2; // ( 0 0 -2 )
A(1,1) = 3; // => A = ( 0 3 5 )
A(1,2) = 5; // ( -2 5 0 )

Constructor & Destructor Documentation

◆ HermitianProxy() [1/2]

template<typename MT >
blaze::HermitianProxy< MT >::HermitianProxy ( MT &  matrix,
size_t  row,
size_t  column 
)
inlineexplicit

Initialization constructor for a HermitianProxy.

Parameters
matrixReference to the adapted matrix.
rowThe row-index of the accessed matrix element.
columnThe column-index of the accessed matrix element.

◆ HermitianProxy() [2/2]

template<typename MT >
blaze::HermitianProxy< MT >::HermitianProxy ( const HermitianProxy< MT > &  hp)
inline

The copy constructor for HermitianProxy.

Parameters
hpNumeric proxy to be copied.

Member Function Documentation

◆ clear()

template<typename MT >
void blaze::HermitianProxy< MT >::clear ( ) const
inline

Clearing the represented element.

Returns
void

This function clears the element represented by the proxy to its default initial state.

◆ get()

template<typename MT >
HermitianProxy< MT >::ConstReference blaze::HermitianProxy< MT >::get ( ) const
inlinenoexcept

Returning the value of the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.

◆ imag() [1/2]

template<typename MT >
HermitianProxy< MT >::ValueType blaze::HermitianProxy< MT >::imag ( ) const
inline

Returns the imaginary part of the represented complex number.

Returns
The current imaginary part of the represented complex number.

In case the proxy represents a complex number, this function returns the current value of its imaginary part.

◆ imag() [2/2]

template<typename MT >
void blaze::HermitianProxy< MT >::imag ( ValueType  value) const
inline

Setting the imaginary part of the represented complex number.

Parameters
valueThe new value for the imaginary part.
Returns
void
Exceptions
std::invalid_argumentInvalid setting for diagonal matrix element.

In case the proxy represents a complex number, this function sets a new value to its imaginary part. In case the proxy represents a diagonal element and the given value is not zero, a std::invalid_argument exception is thrown.

◆ invert()

template<typename MT >
void blaze::HermitianProxy< MT >::invert ( ) const
inline

In-place inversion of the represented element.

Returns
void

◆ operator *=()

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

Multiplication assignment to the accessed matrix element.

Parameters
valueThe right-hand side value for the multiplication.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ operator ConstReference()

template<typename MT >
blaze::HermitianProxy< MT >::operator ConstReference ( ) const
inlinenoexcept

Conversion to the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.

◆ operator%=()

template<typename MT>
template<typename T >
HermitianProxy<MT>& blaze::HermitianProxy< MT >::operator%= ( const T &  value)
inline

Modulo assignment to the accessed matrix element.

Parameters
valueThe right-hand side value for the modulo operation.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ operator+=()

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

Addition assignment to the accessed matrix element.

Parameters
valueThe right-hand side value to be added to the matrix element.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ operator-=()

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

Subtraction assignment to the accessed matrix element.

Parameters
valueThe right-hand side value to be subtracted from the matrix element.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ operator->() [1/2]

template<typename MT >
HermitianProxy< MT >::Pointer blaze::HermitianProxy< MT >::operator-> ( )
inlinenoexcept

Direct access to the represented matrix element.

Returns
Pointer to the represented matrix element.

◆ operator->() [2/2]

template<typename MT >
HermitianProxy< MT >::ConstPointer blaze::HermitianProxy< MT >::operator-> ( ) const
inlinenoexcept

Direct access to the represented matrix element.

Returns
Pointer to the represented matrix element.

◆ operator/=()

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

Division assignment to the accessed matrix element.

Parameters
valueThe right-hand side value for the division.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ operator=() [1/2]

template<typename MT >
HermitianProxy< MT > & blaze::HermitianProxy< MT >::operator= ( const HermitianProxy< MT > &  hp)
inline

Copy assignment operator for HermitianProxy.

Parameters
hpNumeric proxy to be copied.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ operator=() [2/2]

template<typename MT>
template<typename T >
HermitianProxy<MT>& blaze::HermitianProxy< MT >::operator= ( const T &  value)
inline

Assignment to the accessed matrix element.

Parameters
valueThe new value of the matrix element.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

In case the proxy represents a diagonal element and the assigned value does not represent a real number, a std::invalid_argument exception is thrown.

◆ real() [1/2]

template<typename MT >
HermitianProxy< MT >::ValueType blaze::HermitianProxy< MT >::real ( ) const
inline

Returns the real part of the represented complex number.

Returns
The current real part of the represented complex number.

In case the proxy represents a complex number, this function returns the current value of its real part.

◆ real() [2/2]

template<typename MT >
void blaze::HermitianProxy< MT >::real ( ValueType  value) const
inline

Setting the real part of the represented complex number.

Parameters
valueThe new value for the real part.
Returns
void

In case the proxy represents a complex number, this function sets a new value to its real part.

◆ reset()

template<typename MT >
void blaze::HermitianProxy< MT >::reset ( ) const
inline

Reset the represented element to its default initial value.

Returns
void

This function resets the element represented by the proxy to its default initial value.

Member Data Documentation

◆ diagonal_

template<typename MT>
const bool blaze::HermitianProxy< MT >::diagonal_
private

Flag for the accessed matrix element.

The flag indicates if the accessed element is a diagonal element. It is true in case the proxy represents an element on the diagonal.


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