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

Access proxy for symmetric, square matrices with scalar element types. More...

#include <ScalarProxy.h>

Inherits blaze::Proxy< ScalarProxy< 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 = ScalarProxy *
 Pointer to the represented element.
 
using ConstPointer = const ScalarProxy *
 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 >
ScalarProxy< MT > & operator= (const T &value)
 Assignment to the accessed matrix element. More...
 
template<typename T >
ScalarProxy< MT > & operator+= (const T &value)
 Addition assignment to the accessed matrix element. More...
 
template<typename T >
ScalarProxy< MT > & operator-= (const T &value)
 Subtraction assignment to the accessed matrix element. More...
 
template<typename T >
ScalarProxy< MT > & operator*= (const T &value)
 Multiplication assignment to the accessed matrix element. More...
 
template<typename T >
ScalarProxy< MT > & operator/= (const T &value)
 Division assignment to the accessed matrix element. More...
 
template<typename T >
ScalarProxy< MT > & operator%= (const T &value)
 Modulo assignment to the accessed matrix element. More...
 
Constructors
 ScalarProxy (MT &matrix, size_t row, size_t column)
 Initialization constructor for a ScalarProxy. More...
 
 ScalarProxy (const ScalarProxy &)=default
 
Destructor
 ~ScalarProxy ()=default
 
Assignment operators
ScalarProxyoperator= (const ScalarProxy &sp)
 Copy assignment operator for ScalarProxy. More...
 
template<typename T >
ScalarProxyoperator= (const T &value)
 
template<typename T >
ScalarProxyoperator+= (const T &value)
 
template<typename T >
ScalarProxyoperator-= (const T &value)
 
template<typename T >
ScalarProxyoperator*= (const T &value)
 
template<typename T >
ScalarProxyoperator/= (const T &value)
 
template<typename T >
ScalarProxyoperator%= (const T &value)
 
Access operators
Pointer operator-> ()
 Direct access to the represented matrix element. More...
 
ConstPointer operator-> () const
 Direct access to the represented matrix element. More...
 
Utility functions
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
MT & matrix_
 Reference to the adapted matrix.
 
size_t row_
 Row index of the accessed matrix element.
 
size_t column_
 Column index of the accessed matrix element.
 

Detailed Description

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

Access proxy for symmetric, square matrices with scalar element types.

The ScalarProxy provides controlled access to the elements of a non-const symmetric matrix with scalar element type (e.g. integral values, floating point values, and complex values). 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 symmetric matrix:

// Creating a 3x3 symmetric dense matrix
A(0,2) = -2; // ( 0 0 -2 )
A(1,1) = 3; // => A = ( 0 3 5 )
A(1,2) = 5; // ( -2 5 0 )
Matrix adapter for symmetric matrices.
Definition: BaseTemplate.h:614

Constructor & Destructor Documentation

◆ ScalarProxy()

template<typename MT >
blaze::ScalarProxy< MT >::ScalarProxy ( MT &  matrix,
size_t  row,
size_t  column 
)
inline

Initialization constructor for a ScalarProxy.

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

Member Function Documentation

◆ get()

template<typename MT >
ScalarProxy< MT >::ConstReference blaze::ScalarProxy< MT >::get
inlinenoexcept

Returning the value of the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.

◆ imag() [1/2]

template<typename MT >
ScalarProxy< MT >::ValueType blaze::ScalarProxy< MT >::imag
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::ScalarProxy< 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

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

◆ invert()

template<typename MT >
void blaze::ScalarProxy< MT >::invert
inline

In-place inversion of the represented element.

Returns
void

◆ operator ConstReference()

template<typename MT >
blaze::ScalarProxy< MT >::operator ConstReference
inlinenoexcept

Conversion to the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.

◆ operator%=()

template<typename MT >
template<typename T >
ScalarProxy< MT > & blaze::ScalarProxy< 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.

◆ operator*=()

template<typename MT >
template<typename T >
ScalarProxy< MT > & blaze::ScalarProxy< 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.

◆ operator+=()

template<typename MT >
template<typename T >
ScalarProxy< MT > & blaze::ScalarProxy< 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.

◆ operator-=()

template<typename MT >
template<typename T >
ScalarProxy< MT > & blaze::ScalarProxy< 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.

◆ operator->() [1/2]

template<typename MT >
ScalarProxy< MT >::Pointer blaze::ScalarProxy< MT >::operator->
inline

Direct access to the represented matrix element.

Returns
Pointer to the represented matrix element.

◆ operator->() [2/2]

template<typename MT >
ScalarProxy< MT >::ConstPointer blaze::ScalarProxy< MT >::operator->
inline

Direct access to the represented matrix element.

Returns
Pointer to the represented matrix element.

◆ operator/=()

template<typename MT >
template<typename T >
ScalarProxy< MT > & blaze::ScalarProxy< 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.

◆ operator=() [1/2]

template<typename MT >
ScalarProxy< MT > & blaze::ScalarProxy< MT >::operator= ( const ScalarProxy< MT > &  sp)
inline

Copy assignment operator for ScalarProxy.

Parameters
spScalar proxy to be copied.
Returns
Reference to the assigned proxy.

◆ operator=() [2/2]

template<typename MT >
template<typename T >
ScalarProxy< MT > & blaze::ScalarProxy< 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.

◆ real() [1/2]

template<typename MT >
ScalarProxy< MT >::ValueType blaze::ScalarProxy< MT >::real
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::ScalarProxy< 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.


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