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

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

#include <UniUpperProxy.h>

Inherits blaze::Proxy< UniUpperProxy< 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 UniUpperProxy< MT > & operator= (const T &value) const
 Assignment to the accessed matrix element. More...
 
template<typename T >
const UniUpperProxy< MT > & operator+= (const T &value) const
 Addition assignment to the accessed matrix element. More...
 
template<typename T >
const UniUpperProxy< MT > & operator-= (const T &value) const
 Subtraction assignment to the accessed matrix element. More...
 
template<typename T >
const UniUpperProxy< MT > & operator*= (const T &value) const
 Multiplication assignment to the accessed matrix element. More...
 
template<typename T >
const UniUpperProxy< MT > & operator/= (const T &value) const
 Division assignment to the accessed matrix element. More...
 
Constructors
 UniUpperProxy (MT &matrix, size_t row, size_t column)
 Initialization constructor for a UniUpperProxy. More...
 
 UniUpperProxy (const UniUpperProxy &uup)
 The copy constructor for UniUpperProxy. More...
 
Assignment operators
const UniUpperProxyoperator= (const UniUpperProxy &uup) const
 Copy assignment operator for UniUpperProxy. More...
 
template<typename T >
const UniUpperProxyoperator= (const T &value) const
 
template<typename T >
const UniUpperProxyoperator+= (const T &value) const
 
template<typename T >
const UniUpperProxyoperator-= (const T &value) const
 
template<typename T >
const UniUpperProxyoperator*= (const T &value) const
 
template<typename T >
const UniUpperProxyoperator/= (const T &value) const
 
Utility functions
size_t rowIndex () const
 Returns the row index of the represented matrix element. More...
 
size_t columnIndex () const
 Returns the column index of the represented matrix element. More...
 
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.
 
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::UniUpperProxy< MT >

Access proxy for upper unitriangular matrices.

The UniUpperProxy provides controlled access to the elements of a non-const upper unitriangular matrix. It guarantees that the uniupper matrix invariant is not violated, i.e. that elements in the lower part of the matrix remain 0 and the diagonal elements remain 1. The following example illustrates this by means of a $ 3 \times 3 $ dense upper unitriangular matrix:

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

Constructor & Destructor Documentation

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

Initialization constructor for a UniUpperProxy.

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::UniUpperProxy< MT >::UniUpperProxy ( const UniUpperProxy< MT > &  uup)
inline

The copy constructor for UniUpperProxy.

Parameters
uupProxy to be copied.

Member Function Documentation

template<typename MT >
size_t blaze::UniUpperProxy< MT >::columnIndex ( ) const
inline

Returns the column index of the represented matrix element.

Returns
The column index of the represented matrix element.
template<typename MT >
UniUpperProxy< MT >::RawReference blaze::UniUpperProxy< 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::UniUpperProxy< 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::UniUpperProxy< 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 UniUpperProxy<MT>& blaze::UniUpperProxy< 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 diagonal or lower matrix element.

In case the proxy represents an element on the diagonal or in the lower part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT>
template<typename T >
const UniUpperProxy<MT>& blaze::UniUpperProxy< 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 diagonal or lower matrix element.

In case the proxy represents an element on the diagonal or in the lower part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT>
template<typename T >
const UniUpperProxy<MT>& blaze::UniUpperProxy< 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 diagonal or lower matrix element.

In case the proxy represents an element on the diagonal or in the lower part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT>
template<typename T >
const UniUpperProxy<MT>& blaze::UniUpperProxy< 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 diagonal or lower matrix element.

In case the proxy represents an element on the diagonal or in the lower part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT >
const UniUpperProxy< MT > & blaze::UniUpperProxy< MT >::operator= ( const UniUpperProxy< MT > &  uup) const
inline

Copy assignment operator for UniUpperProxy.

Parameters
uupProxy to be copied.
Returns
Reference to the assigned proxy.
template<typename MT>
template<typename T >
const UniUpperProxy<MT>& blaze::UniUpperProxy< 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 diagonal or lower matrix element.

In case the proxy represents an element on the diagonal or in the lower part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT >
size_t blaze::UniUpperProxy< MT >::rowIndex ( ) const
inline

Returns the row index of the represented matrix element.

Returns
The row index of the represented matrix element.

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