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

Representation of an element within a sparse lower unitriangular matrix.The UniLowerElement class represents an element (i.e. value/index pair) within a sparse 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 $ sparse lower unitriangular matrix: More...

#include <UniLowerElement.h>

Inherits blaze::SparseElement.

Public Types

using ValueType = UniLowerValue< MT >
 The value type of the value-index-pair.
 
using IndexType = size_t
 The index type of the value-index-pair.
 
using Reference = UniLowerValue< MT >
 Reference return type.
 
using ConstReference = const UniLowerValue< MT >
 Reference-to-const return type.
 
using Pointer = UniLowerElement *
 Pointer return type.
 

Public Member Functions

template<typename T >
UniLowerElement< MT > & operator= (const T &v)
 Assignment to the unilower element. More...
 
template<typename T >
UniLowerElement< MT > & operator+= (const T &v)
 Addition assignment to the unilower element. More...
 
template<typename T >
UniLowerElement< MT > & operator-= (const T &v)
 Subtraction assignment to the unilower element. More...
 
template<typename T >
UniLowerElement< MT > & operator*= (const T &v)
 Multiplication assignment to the unilower element. More...
 
template<typename T >
UniLowerElement< MT > & operator/= (const T &v)
 Division assignment to the unilower element. More...
 
Constructors
 UniLowerElement (IteratorType pos, bool diagonal)
 Constructor for the UniLowerElement class. More...
 
Assignment operators
template<typename T >
UniLowerElementoperator= (const T &v)
 
template<typename T >
UniLowerElementoperator+= (const T &v)
 
template<typename T >
UniLowerElementoperator-= (const T &v)
 
template<typename T >
UniLowerElementoperator*= (const T &v)
 
template<typename T >
UniLowerElementoperator/= (const T &v)
 
Access operators
Pointer operator-> () noexcept
 Direct access to the unilower element. More...
 
Utility functions
Reference value () const
 Access to the current value of the unilower element. More...
 
IndexType index () const
 Access to the current index of the unilower element. More...
 

Private Types

using ElementType = ElementType_< MT >
 Type of the represented matrix element.
 
using IteratorType = Iterator_< MT >
 Type of the underlying sparse matrix iterators.
 

Private Attributes

IteratorType pos_
 Iterator to the current lower unitriangular matrix element.
 
bool diagonal_
 true in case the element is on the diagonal, false if not.
 

Detailed Description

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

Representation of an element within a sparse lower unitriangular matrix.

The UniLowerElement class represents an element (i.e. value/index pair) within a sparse 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 $ sparse lower unitriangular matrix:

// Creating a 3x3 lower unitriangular sparse matrix
UniLower A( 3UL );
A(1,0) = -2; // ( 1 0 0 )
A(2,0) = 3; // => A = ( -2 1 0 )
A(2,1) = 5; // ( 3 5 1 )
UniLower::Iterator it = A.begin( 1UL );
*it = 4; // Modification of matrix element (1,0)
++it;
*it = 9; // Invalid assignment to diagonal matrix element; results in an exception!

Constructor & Destructor Documentation

◆ UniLowerElement()

template<typename MT >
blaze::UniLowerElement< MT >::UniLowerElement ( IteratorType  pos,
bool  diagonal 
)
inline

Constructor for the UniLowerElement class.

Parameters
posIterator to the current position with the sparse lower unitriangular matrix.
diagonaltrue in case the element is on the diagonal, false if not.

Member Function Documentation

◆ index()

template<typename MT >
UniLowerElement< MT >::IndexType blaze::UniLowerElement< MT >::index ( ) const
inline

Access to the current index of the unilower element.

Returns
The current index of the unilower element.

◆ operator*=()

template<typename MT >
template<typename T >
UniLowerElement<MT>& blaze::UniLowerElement< MT >::operator*= ( const T &  v)
inline

Multiplication assignment to the unilower element.

Parameters
vThe right-hand side value for the multiplication.
Returns
Reference to the assigned unilower element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator+=()

template<typename MT >
template<typename T >
UniLowerElement<MT>& blaze::UniLowerElement< MT >::operator+= ( const T &  v)
inline

Addition assignment to the unilower element.

Parameters
vThe right-hand side value for the addition.
Returns
Reference to the assigned unilower element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator-=()

template<typename MT >
template<typename T >
UniLowerElement<MT>& blaze::UniLowerElement< MT >::operator-= ( const T &  v)
inline

Subtraction assignment to the unilower element.

Parameters
vThe right-hand side value for the subtraction.
Returns
Reference to the assigned unilower element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator->()

template<typename MT >
UniLowerElement< MT >::Pointer blaze::UniLowerElement< MT >::operator-> ( )
inlinenoexcept

Direct access to the unilower element.

Returns
Reference to the value of the unilower element.

◆ operator/=()

template<typename MT >
template<typename T >
UniLowerElement<MT>& blaze::UniLowerElement< MT >::operator/= ( const T &  v)
inline

Division assignment to the unilower element.

Parameters
vThe right-hand side value for the division.
Returns
Reference to the assigned unilower element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator=()

template<typename MT >
template<typename T >
UniLowerElement<MT>& blaze::UniLowerElement< MT >::operator= ( const T &  v)
inline

Assignment to the unilower element.

Parameters
vThe new value of the unilower element.
Returns
Reference to the assigned unilower element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ value()

template<typename MT >
UniLowerElement< MT >::Reference blaze::UniLowerElement< MT >::value ( ) const
inline

Access to the current value of the unilower element.

Returns
The current value of the unilower element.

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