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

Access proxy for lower triangular matrices.The LowerProxy provides controlled access to the elements of a non-const lower triangular matrix. It guarantees that the lower matrix invariant is not violated, i.e. that elements in the upper part of the matrix remain default values. The following example illustrates this by means of a $ 3 \times 3 $ dense lower matrix: More...

#include <LowerProxy.h>

Inherits blaze::Proxy< LowerProxy< MT >, MT::ElementType >.

Public Types

typedef MT::ElementType RepresentedType
 Type of the represented matrix element.
 
typedef AddReference< ReferenceType >::Type RawReference
 Reference to the represented element.
 

Public Member Functions

template<typename T >
const LowerProxy< MT > & operator= (const T &value) const
 Assignment to the accessed matrix element. More...
 
template<typename T >
const LowerProxy< MT > & operator+= (const T &value) const
 Addition assignment to the accessed matrix element. More...
 
template<typename T >
const LowerProxy< MT > & operator-= (const T &value) const
 Subtraction assignment to the accessed matrix element. More...
 
template<typename T >
const LowerProxy< MT > & operator*= (const T &value) const
 Multiplication assignment to the accessed matrix element. More...
 
template<typename T >
const LowerProxy< MT > & operator/= (const T &value) const
 Division assignment to the accessed matrix element. More...
 
Constructors
 LowerProxy (MT &matrix, size_t row, size_t column)
 Initialization constructor for a LowerProxy. More...
 
 LowerProxy (const LowerProxy &lp)
 The copy constructor for LowerProxy. More...
 
Assignment operators
const LowerProxyoperator= (const LowerProxy &lp) const
 Copy assignment operator for LowerProxy. More...
 
template<typename T >
const LowerProxyoperator= (const T &value) const
 
template<typename T >
const LowerProxyoperator+= (const T &value) const
 
template<typename T >
const LowerProxyoperator-= (const T &value) const
 
template<typename T >
const LowerProxyoperator*= (const T &value) const
 
template<typename T >
const LowerProxyoperator/= (const T &value) const
 
Utility functions
RawReference get () const
 Returning the value of the accessed matrix element. More...
 
bool isRestricted () const
 Returns whether the proxy represents a restricted matrix element.. More...
 
Conversion operator
 operator RawReference () const
 Conversion to the accessed matrix element. More...
 

Private Types

typedef AddConst< typename MT::Reference >::Type ReferenceType
 Reference type of the underlying matrix type.
 

Private Attributes

Member variables
ReferenceType value_
 Reference to the accessed matrix element.
 
const bool restricted_
 Access flag for the accessed matrix element. More...
 

Detailed Description

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

Access proxy for lower triangular matrices.

The LowerProxy provides controlled access to the elements of a non-const lower triangular matrix. It guarantees that the lower matrix invariant is not violated, i.e. that elements in the upper part of the matrix remain default values. The following example illustrates this by means of a $ 3 \times 3 $ dense lower matrix:

// Creating a 3x3 lower dense matrix
A(0,0) = -2; // ( -2 0 0 )
A(1,0) = 3; // => A = ( 3 0 0 )
A(2,1) = 5; // ( 0 5 0 )
A(0,2) = 7; // Invalid assignment to upper matrix element; results in an exception!

Constructor & Destructor Documentation

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

Initialization constructor for a LowerProxy.

Parameters
matrixReference to the adapted matrix.
rowThe row-index of the accessed matrix element.
columnThe column-index of the accessed matrix element.
template<typename MT >
blaze::LowerProxy< MT >::LowerProxy ( const LowerProxy< MT > &  lp)
inline

The copy constructor for LowerProxy.

Parameters
lpLower proxy to be copied.

Member Function Documentation

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

Returning the value of the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.
template<typename MT >
bool blaze::LowerProxy< MT >::isRestricted ( ) const
inline

Returns whether the proxy represents a restricted matrix element..

Returns
true in case access to the matrix element is restricted, false if not.
template<typename MT >
blaze::LowerProxy< MT >::operator RawReference ( ) const
inline

Conversion to the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.
template<typename MT>
template<typename T >
const LowerProxy<MT>& blaze::LowerProxy< MT >::operator*= ( const T &  value) const
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 upper matrix element.

In case the proxy represents an element in the upper matrix, a std::invalid_argument exception is thrown.

template<typename MT>
template<typename T >
const LowerProxy<MT>& blaze::LowerProxy< MT >::operator+= ( const T &  value) const
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 upper matrix element.

In case the proxy represents an element in the upper matrix, a std::invalid_argument exception is thrown.

template<typename MT>
template<typename T >
const LowerProxy<MT>& blaze::LowerProxy< MT >::operator-= ( const T &  value) const
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 upper matrix element.

In case the proxy represents an element in the upper matrix, a std::invalid_argument exception is thrown.

template<typename MT>
template<typename T >
const LowerProxy<MT>& blaze::LowerProxy< MT >::operator/= ( const T &  value) const
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 upper matrix element.

In case the proxy represents an element in the upper matrix, a std::invalid_argument exception is thrown.

template<typename MT >
const LowerProxy< MT > & blaze::LowerProxy< MT >::operator= ( const LowerProxy< MT > &  lp) const
inline

Copy assignment operator for LowerProxy.

Parameters
lpLower proxy to be copied.
Returns
Reference to the assigned proxy.
template<typename MT>
template<typename T >
const LowerProxy<MT>& blaze::LowerProxy< MT >::operator= ( const T &  value) const
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 upper matrix element.

In case the proxy represents an element in the upper matrix, a std::invalid_argument exception is thrown.

Member Data Documentation

template<typename MT>
const bool blaze::LowerProxy< MT >::restricted_
private

Access flag for the accessed matrix element.

The flag indicates if access to the matrix element is restricted. It is true in case the proxy represents an element in the upper part of the matrix.


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