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

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

#include <UniUpperElement.h>

Inherits blaze::SparseElement.

Public Types

typedef UniUpperValue< MT > ValueType
 The value type of the value-index-pair.
 
typedef size_t IndexType
 The index type of the value-index-pair.
 
typedef UniUpperValue< MT > Reference
 Reference return type.
 
typedef const UniUpperValue< MT > ConstReference
 Reference-to-const return type.
 
typedef UniUpperElementPointer
 Pointer return type.
 

Public Member Functions

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

Private Types

typedef MT::ElementType ElementType
 Type of the represented matrix element.
 
typedef MT::Iterator IteratorType
 Type of the underlying sparse matrix iterators.
 

Private Attributes

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

Detailed Description

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

Representation of an element within a sparse upper unitriangular matrix.

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

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

Constructor & Destructor Documentation

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

Constructor for the UniUpperElement class.

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

Member Function Documentation

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

Access to the current index of the uniupper element.

Returns
The current index of the uniupper element.
template<typename MT >
template<typename T >
UniUpperElement<MT>& blaze::UniUpperElement< MT >::operator*= ( const T &  v)
inline

Multiplication assignment to the uniupper element.

Parameters
vThe right-hand side value for the multiplication.
Returns
Reference to the assigned uniupper element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.
template<typename MT >
template<typename T >
UniUpperElement<MT>& blaze::UniUpperElement< MT >::operator+= ( const T &  v)
inline

Addition assignment to the uniupper element.

Parameters
vThe right-hand side value for the addition.
Returns
Reference to the assigned uniupper element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.
template<typename MT >
template<typename T >
UniUpperElement<MT>& blaze::UniUpperElement< MT >::operator-= ( const T &  v)
inline

Subtraction assignment to the uniupper element.

Parameters
vThe right-hand side value for the subtraction.
Returns
Reference to the assigned uniupper element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.
template<typename MT >
UniUpperElement< MT >::Pointer blaze::UniUpperElement< MT >::operator-> ( )
inline

Direct access to the uniupper element.

Returns
Reference to the value of the uniupper element.
template<typename MT >
template<typename T >
UniUpperElement<MT>& blaze::UniUpperElement< MT >::operator/= ( const T &  v)
inline

Division assignment to the uniupper element.

Parameters
vThe right-hand side value for the division.
Returns
Reference to the assigned uniupper element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.
template<typename MT >
template<typename T >
UniUpperElement<MT>& blaze::UniUpperElement< MT >::operator= ( const T &  v)
inline

Assignment to the uniupper element.

Parameters
vThe new value of the uniupper element.
Returns
Reference to the assigned uniupper element.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.
template<typename MT >
UniUpperElement< MT >::Reference blaze::UniUpperElement< MT >::value ( ) const
inline

Access to the current value of the uniupper element.

Returns
The current value of the uniupper element.

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