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 >, MT::ElementType::ValueType >.

Public Types

typedef ET::ValueType RepresentedType
 Type of the represented matrix element.
 
typedef ET::Reference RawReference
 Raw reference to the represented element.
 

Public Member Functions

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...
 
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= (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
 Returning a reference to the accessed matrix element. More...
 
Conversion operator
 operator RawReference () const
 Conversion to the represented matrix element. More...
 

Private Types

enum  { 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:

typedef StaticVector<int,3UL> Vector;
// 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

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.
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

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

Returning a reference to the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.
template<typename MT >
blaze::NonNumericProxy< MT >::operator RawReference ( ) const
inline

Conversion to the represented matrix element.

Returns
Direct/raw reference to the represented matrix element.
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.
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.
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.
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.
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.
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: