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

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

#include <StrictlyUpperProxy.h>

Inherits blaze::Proxy< StrictlyUpperProxy< MT >, ElementType_t< MT > >.

Public Types

using RepresentedType = ElementType_t< MT >
 Type of the represented matrix element.
 
using RawReference = AddReference_t< ReferenceType >
 Reference-to-non-const to the represented element.
 
using ConstReference = const RepresentedType &
 Reference-to-const to the represented element.
 

Public Member Functions

template<typename T >
const StrictlyUpperProxy< MT > & operator= (initializer_list< T > list) const
 Initializer list assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator= (initializer_list< initializer_list< T > > list) const
 Initializer list assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator= (const T &value) const
 Assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator+= (const T &value) const
 Addition assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator-= (const T &value) const
 Subtraction assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator*= (const T &value) const
 Multiplication assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator/= (const T &value) const
 Division assignment to the accessed matrix element. More...
 
template<typename T >
const StrictlyUpperProxy< MT > & operator%= (const T &value) const
 Modulo assignment to the accessed matrix element. More...
 
Constructors
 StrictlyUpperProxy (MT &matrix, size_t row, size_t column)
 Initialization constructor for a StrictlyUpperProxy. More...
 
 StrictlyUpperProxy (const StrictlyUpperProxy &uup)
 The copy constructor for StrictlyUpperProxy. More...
 
Destructor
 ~StrictlyUpperProxy ()=default
 
Assignment operators
const StrictlyUpperProxyoperator= (const StrictlyUpperProxy &uup) const
 Copy assignment operator for StrictlyUpperProxy. More...
 
template<typename T >
const StrictlyUpperProxyoperator= (initializer_list< T > list) const
 
template<typename T >
const StrictlyUpperProxyoperator= (initializer_list< initializer_list< T > > list) const
 
template<typename T >
const StrictlyUpperProxyoperator= (const T &value) const
 
template<typename T >
const StrictlyUpperProxyoperator+= (const T &value) const
 
template<typename T >
const StrictlyUpperProxyoperator-= (const T &value) const
 
template<typename T >
const StrictlyUpperProxyoperator*= (const T &value) const
 
template<typename T >
const StrictlyUpperProxyoperator/= (const T &value) const
 
template<typename T >
const StrictlyUpperProxyoperator%= (const T &value) const
 
Access operators
const StrictlyUpperProxyoperator-> () const noexcept
 Direct access to the accessed matrix element. More...
 
Utility functions
RawReference get () const noexcept
 Returning the value of the accessed matrix element. More...
 
bool isRestricted () const noexcept
 Returns whether the proxy represents a restricted matrix element.. More...
 
Conversion operator
 operator ConstReference () const noexcept
 Conversion to the accessed matrix element. More...
 

Private Types

using ReferenceType = AddConst_t< Reference_t< MT > >
 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::StrictlyUpperProxy< MT >

Access proxy for strictly upper triangular matrices.

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

// Creating a 3x3 strictly upper triangular dense matrix
A(0,1) = -2; // ( 0 -2 3 )
A(0,2) = 3; // => A = ( 0 0 5 )
A(1,2) = 5; // ( 0 0 0 )
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

◆ StrictlyUpperProxy() [1/2]

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

Initialization constructor for a StrictlyUpperProxy.

Parameters
matrixReference to the adapted matrix.
rowThe row-index of the accessed matrix element.
columnThe column-index of the accessed matrix element.

◆ StrictlyUpperProxy() [2/2]

template<typename MT >
blaze::StrictlyUpperProxy< MT >::StrictlyUpperProxy ( const StrictlyUpperProxy< MT > &  uup)
inline

The copy constructor for StrictlyUpperProxy.

Parameters
uupProxy to be copied.

Member Function Documentation

◆ get()

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

Returning the value of the accessed matrix element.

Returns
Direct/raw reference to the accessed matrix element.

◆ isRestricted()

template<typename MT >
bool blaze::StrictlyUpperProxy< MT >::isRestricted ( ) const
inlinenoexcept

Returns whether the proxy represents a restricted matrix element..

Returns
true in case access to the matrix element is restricted, false if not.

◆ operator ConstReference()

template<typename MT >
blaze::StrictlyUpperProxy< MT >::operator ConstReference ( ) const
inlinenoexcept

Conversion to the accessed matrix element.

Returns
Reference-to-const to the accessed matrix element.

◆ operator%=()

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

Modulo assignment to the accessed matrix element.

Parameters
valueThe right-hand side value for the modulo operation.
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.

◆ operator*=()

template<typename MT>
template<typename T >
const StrictlyUpperProxy<MT>& blaze::StrictlyUpperProxy< 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.

◆ operator+=()

template<typename MT>
template<typename T >
const StrictlyUpperProxy<MT>& blaze::StrictlyUpperProxy< 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.

◆ operator-=()

template<typename MT>
template<typename T >
const StrictlyUpperProxy<MT>& blaze::StrictlyUpperProxy< 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.

◆ operator->()

template<typename MT >
const StrictlyUpperProxy< MT > * blaze::StrictlyUpperProxy< MT >::operator-> ( ) const
inlinenoexcept

Direct access to the accessed matrix element.

Returns
Pointer to the accessed matrix element.

◆ operator/=()

template<typename MT>
template<typename T >
const StrictlyUpperProxy<MT>& blaze::StrictlyUpperProxy< 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.

◆ operator=() [1/4]

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

Copy assignment operator for StrictlyUpperProxy.

Parameters
uupProxy to be copied.
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.

◆ operator=() [2/4]

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

Initializer list assignment to the accessed matrix element.

Parameters
listThe list to be assigned 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.

◆ operator=() [3/4]

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

Initializer list assignment to the accessed matrix element.

Parameters
listThe list to be assigned 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.

◆ operator=() [4/4]

template<typename MT>
template<typename T >
const StrictlyUpperProxy<MT>& blaze::StrictlyUpperProxy< 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.

Member Data Documentation

◆ restricted_

template<typename MT>
const bool blaze::StrictlyUpperProxy< 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 on the diagonal or in the lower part of the matrix.


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