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

Access proxy for symmetric, square matrices with non-numeric element types.The NonNumericProxy provides controlled access to the elements of a non-const symmetric matrix with non-numeric element type (e.g. vectors or matrices). 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 $ sparse symmetric matrix with StaticVector elements: More...

#include <NonNumericProxy.h>

Inherits blaze::Proxy< NonNumericProxy< MT >, ValueType_< ElementType_< MT > > >.

Public Types

using RepresentedType = ValueType_< ET >
 Type of the represented matrix element.
 
using RawReference = Reference_< ET >
 Raw reference to the represented element.
 

Public Member Functions

template<typename T >
NonNumericProxy< MT > & operator= (initializer_list< T > list)
 Initializer list assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator= (initializer_list< initializer_list< T > > list)
 Initializer list assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator= (const T &value)
 Assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator+= (const T &value)
 Addition assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator-= (const T &value)
 Subtraction assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator*= (const T &value)
 Multiplication assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator/= (const T &value)
 Division assignment to the represented matrix element. More...
 
template<typename T >
NonNumericProxy< MT > & operator%= (const T &value)
 Modulo assignment to the represented matrix element. More...
 
Constructors
 NonNumericProxy (MT &sm, size_t i, size_t j)
 Initialization constructor for a NonNumericProxy. More...
 
 NonNumericProxy (const NonNumericProxy &nnp)
 The copy constructor for NonNumericProxy. More...
 
Destructor
 ~NonNumericProxy ()
 The destructor for NonNumericProxy.
 
Operators
NonNumericProxyoperator= (const NonNumericProxy &nnp)
 Copy assignment operator for NonNumericProxy. More...
 
template<typename T >
NonNumericProxyoperator= (initializer_list< T > list)
 
template<typename T >
NonNumericProxyoperator= (initializer_list< initializer_list< T > > list)
 
template<typename T >
NonNumericProxyoperator= (const T &value)
 
template<typename T >
NonNumericProxyoperator+= (const T &value)
 
template<typename T >
NonNumericProxyoperator-= (const T &value)
 
template<typename T >
NonNumericProxyoperator*= (const T &value)
 
template<typename T >
NonNumericProxyoperator/= (const T &value)
 
template<typename T >
NonNumericProxyoperator%= (const T &value)
 
Utility functions
RawReference get () const noexcept
 Returning a reference to the accessed matrix element. More...
 
Conversion operator
 operator RawReference () const noexcept
 Conversion to the represented matrix element. More...
 

Private Types

enum  : bool { rmm = IsRowMajorMatrix<MT>::value }
 Compile time flag indicating whether the given matrix type is a row-major matrix.
 

Private Member Functions

Forbidden operations
void * operator & () const
 Address operator (private & undefined)
 

Private Attributes

Member variables
MT & matrix_
 Reference to the adapted matrix.
 
size_t i_
 Row-index of the accessed matrix element.
 
size_t j_
 Column-index of the accessed matrix element.
 

Detailed Description

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

Access proxy for symmetric, square matrices with non-numeric element types.

The NonNumericProxy provides controlled access to the elements of a non-const symmetric matrix with non-numeric element type (e.g. vectors or matrices). 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 $ sparse symmetric matrix with StaticVector elements:

using Vector = StaticVector<int,3UL>;
// Creating a 3x3 symmetric sparses matrix
SymmetricMatrix< CompressedMatrix< Vector > > A( 3UL );
A(0,2) = Vector( -2, 1 ); // ( ( 0 0 ) ( 0 0 ) ( -2 1 ) )
A(1,1) = Vector( 3, 4 ); // => A = ( ( 0 0 ) ( 3 4 ) ( 5 -1 ) )
A(1,2) = Vector( 5, -1 ); // ( ( -2 1 ) ( 5 -1 ) ( 0 0 ) )

Constructor & Destructor Documentation

◆ NonNumericProxy() [1/2]

template<typename MT >
blaze::NonNumericProxy< MT >::NonNumericProxy ( MT &  matrix,
size_t  i,
size_t  j 
)
inlineexplicit

Initialization constructor for a NonNumericProxy.

Parameters
matrixReference to the adapted matrix.
iThe row-index of the accessed matrix element.
jThe column-index of the accessed matrix element.

◆ NonNumericProxy() [2/2]

template<typename MT >
blaze::NonNumericProxy< MT >::NonNumericProxy ( const NonNumericProxy< MT > &  nnp)
inline

The copy constructor for NonNumericProxy.

Parameters
nnpNon-numeric access proxy to be copied.

Member Function Documentation

◆ get()

template<typename MT >
NonNumericProxy< MT >::RawReference blaze::NonNumericProxy< MT >::get ( ) const
inlinenoexcept

Returning a reference to the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.

◆ operator RawReference()

template<typename MT >
blaze::NonNumericProxy< MT >::operator RawReference ( ) const
inlinenoexcept

Conversion to the represented matrix element.

Returns
Direct/raw reference to the represented matrix element.

◆ operator%=()

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

Modulo assignment to the represented matrix element.

Parameters
valueThe right-hand side value for the modulo operation.
Returns
Reference to the assigned access proxy.

◆ operator*=()

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

Multiplication assignment to the represented matrix element.

Parameters
valueThe right-hand side value for the multiplication.
Returns
Reference to the assigned access proxy.

◆ operator+=()

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

Addition assignment to the represented matrix element.

Parameters
valueThe right-hand side value to be added to the matrix element.
Returns
Reference to the assigned access proxy.

◆ operator-=()

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

Subtraction assignment to the represented matrix element.

Parameters
valueThe right-hand side value to be subtracted from the matrix element.
Returns
Reference to the assigned access proxy.

◆ operator/=()

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

Division assignment to the represented matrix element.

Parameters
valueThe right-hand side value for the division.
Returns
Reference to the assigned access proxy.

◆ operator=() [1/4]

template<typename MT >
NonNumericProxy< MT > & blaze::NonNumericProxy< MT >::operator= ( const NonNumericProxy< MT > &  nnp)
inline

Copy assignment operator for NonNumericProxy.

Parameters
nnpNon-numeric access proxy to be copied.
Returns
Reference to the assigned access proxy.

◆ operator=() [2/4]

template<typename MT>
template<typename T >
NonNumericProxy<MT>& blaze::NonNumericProxy< MT >::operator= ( initializer_list< T >  list)
inline

Initializer list assignment to the represented matrix element.

Parameters
listThe list to be assigned to the matrix element.
Returns
Reference to the assigned proxy.

◆ operator=() [3/4]

template<typename MT>
template<typename T >
NonNumericProxy<MT>& blaze::NonNumericProxy< MT >::operator= ( initializer_list< initializer_list< T > >  list)
inline

Initializer list assignment to the represented matrix element.

Parameters
listThe list to be assigned to the matrix element.
Returns
Reference to the assigned proxy.

◆ operator=() [4/4]

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

Assignment to the represented matrix element.

Parameters
valueThe new value of the matrix element.
Returns
Reference to the assigned access proxy.

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