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

Access proxy for lower unitriangular matrices.The UniLowerProxy provides controlled access to the elements of a non-const lower unitriangular matrix. It guarantees that the unilower matrix invariant is not violated, i.e. that elements in the upper 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 lower unitriangular matrix: More...

#include <UniLowerProxy.h>

Inherits blaze::Proxy< UniLowerProxy< MT > >.

Public Types

typedef MT::ElementType RepresentedType
 Type of the represented matrix element.
 
typedef If< IsComplex< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type::Type ValueType
 Value type of the represented complex element.
 
typedef ValueType value_type
 Value type of the represented complex element.
 

Public Member Functions

template<typename T >
const UniLowerProxy< MT > & operator= (const T &value) const
 Assignment to the accessed matrix element. More...
 
template<typename T >
const UniLowerProxy< MT > & operator+= (const T &value) const
 Addition assignment to the accessed matrix element. More...
 
template<typename T >
const UniLowerProxy< MT > & operator-= (const T &value) const
 Subtraction assignment to the accessed matrix element. More...
 
template<typename T >
const UniLowerProxy< MT > & operator*= (const T &value) const
 Multiplication assignment to the accessed matrix element. More...
 
template<typename T >
const UniLowerProxy< MT > & operator/= (const T &value) const
 Division assignment to the accessed matrix element. More...
 
Constructors
 UniLowerProxy (MT &matrix, size_t row, size_t column)
 Initialization constructor for an UniLowerProxy. More...
 
 UniLowerProxy (const UniLowerProxy &ulp)
 The copy constructor for LowerProxy. More...
 
Assignment operators
const UniLowerProxyoperator= (const UniLowerProxy &ulp) const
 Copy assignment operator for UniLowerProxy. More...
 
template<typename T >
const UniLowerProxyoperator= (const T &value) const
 
template<typename T >
const UniLowerProxyoperator+= (const T &value) const
 
template<typename T >
const UniLowerProxyoperator-= (const T &value) const
 
template<typename T >
const UniLowerProxyoperator*= (const T &value) const
 
template<typename T >
const UniLowerProxyoperator/= (const T &value) const
 
Utility functions
void reset () const
 Reset the represented element to its default initial value. More...
 
void clear () const
 Clearing the represented element. More...
 
void invert () const
 In-place inversion of the represented element. More...
 
RepresentedType 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 RepresentedType () const
 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 Types

typedef MT::Reference 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::UniLowerProxy< MT >

Access proxy for lower unitriangular matrices.

The UniLowerProxy provides controlled access to the elements of a non-const lower unitriangular matrix. It guarantees that the unilower matrix invariant is not violated, i.e. that elements in the upper 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 lower unitriangular matrix:

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

Constructor & Destructor Documentation

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

Initialization constructor for an UniLowerProxy.

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::UniLowerProxy< MT >::UniLowerProxy ( const UniLowerProxy< MT > &  ulp)
inline

The copy constructor for LowerProxy.

Parameters
ulpProxy to be copied.

Member Function Documentation

template<typename MT >
void blaze::UniLowerProxy< MT >::clear ( ) const
inline

Clearing the represented element.

Returns
void

This function clears the element represented by the proxy to its default initial state.

template<typename MT >
UniLowerProxy< MT >::RepresentedType blaze::UniLowerProxy< MT >::get ( ) const
inline

Returning the value of the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.
template<typename MT >
UniLowerProxy< MT >::ValueType blaze::UniLowerProxy< MT >::imag ( ) const
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.

template<typename MT >
void blaze::UniLowerProxy< 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
Exceptions
std::invalid_argumentInvalid setting for diagonal or upper matrix element.

In case the proxy represents a complex number, this function sets a new value to its imaginary part. In case the represented value is a diagonal element or an element in the upper part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT >
void blaze::UniLowerProxy< MT >::invert ( ) const
inline

In-place inversion of the represented element.

Returns
void
Exceptions
std::invalid_argumentInvalid inversion of upper matrix element.

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

template<typename MT >
bool blaze::UniLowerProxy< 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::UniLowerProxy< MT >::operator RepresentedType ( ) const
inline

Conversion to the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.
template<typename MT>
template<typename T >
const UniLowerProxy<MT>& blaze::UniLowerProxy< 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 upper matrix element.

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

template<typename MT>
template<typename T >
const UniLowerProxy<MT>& blaze::UniLowerProxy< 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 upper matrix element.

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

template<typename MT>
template<typename T >
const UniLowerProxy<MT>& blaze::UniLowerProxy< 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 upper matrix element.

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

template<typename MT>
template<typename T >
const UniLowerProxy<MT>& blaze::UniLowerProxy< 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 upper matrix element.

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

template<typename MT >
const UniLowerProxy< MT > & blaze::UniLowerProxy< MT >::operator= ( const UniLowerProxy< MT > &  ulp) const
inline

Copy assignment operator for UniLowerProxy.

Parameters
ulpProxy to be copied.
Returns
Reference to the assigned proxy.
Exceptions
std::invalid_argumentInvalid assignment to diagonal or upper matrix element.

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

template<typename MT>
template<typename T >
const UniLowerProxy<MT>& blaze::UniLowerProxy< 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 upper matrix element.

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

template<typename MT >
UniLowerProxy< MT >::ValueType blaze::UniLowerProxy< MT >::real ( ) const
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.

template<typename MT >
void blaze::UniLowerProxy< 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
Exceptions
std::invalid_argumentInvalid setting for diagonal or upper matrix element.

In case the proxy represents a complex number, this function sets a new value to its real part. In case the represented value is a diagonal element or an element in the upper part of the matrix, a std::invalid_argument exception is thrown.

template<typename MT >
void blaze::UniLowerProxy< MT >::reset ( ) const
inline

Reset the represented element to its default initial value.

Returns
void

This function resets the element represented by the proxy to its default initial value.


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