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

Representation of a value within a sparse lower unitriangular matrix.The UniLowerValue class represents a single value 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 <UniLowerValue.h>

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

Public Types

using RepresentedType = ElementType_< MT >
 Type of the represented matrix element.
 
using ValueType = typename If_< IsComplex< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type
 Value type of the represented complex element.
 
using value_type = ValueType
 Value type of the represented complex element.
 

Public Member Functions

template<typename T >
UniLowerValue< MT > & operator= (const T &value)
 Assignment to the unilower value. More...
 
template<typename T >
UniLowerValue< MT > & operator+= (const T &value)
 Addition assignment to the unilower value. More...
 
template<typename T >
UniLowerValue< MT > & operator-= (const T &value)
 Subtraction assignment to the unilower value. More...
 
template<typename T >
UniLowerValue< MT > & operator*= (const T &value)
 Multiplication assignment to the unilower value. More...
 
template<typename T >
UniLowerValue< MT > & operator/= (const T &value)
 Division assignment to the unilower value. More...
 
Constructors
 UniLowerValue (RepresentedType &value, bool diagonal)
 Constructor for the UniLowerValue class. More...
 
Assignment operators
UniLowerValueoperator= (const UniLowerValue &ulv)
 Copy assignment operator for UniLowerValue. More...
 
template<typename T >
UniLowerValueoperator= (const T &value)
 
template<typename T >
UniLowerValueoperator+= (const T &value)
 
template<typename T >
UniLowerValueoperator-= (const T &value)
 
template<typename T >
UniLowerValueoperator*= (const T &value)
 
template<typename T >
UniLowerValueoperator/= (const T &value)
 
Utility functions
void reset () const
 Reset the unilower value to its default initial value. More...
 
void clear () const
 Clearing the unilower value. More...
 
void invert () const
 In-place inversion of the unilower value. More...
 
RepresentedType get () const noexcept
 Access to the represented value. More...
 
bool isRestricted () const noexcept
 Returns whether the value represents a restricted matrix element.. More...
 
Conversion operator
 operator RepresentedType () const noexcept
 Conversion to the represented value. 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 Attributes

RepresentedTypevalue_
 The represented value.
 
bool diagonal_
 true in case the element is on the diagonal, false if not.
 

Detailed Description

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

Representation of a value within a sparse lower unitriangular matrix.

The UniLowerValue class represents a single value 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->value() = 4; // Modification of matrix element (1,0)
++it;
it->value() = 9; // Invalid assignment to diagonal matrix element; results in an exception!

Constructor & Destructor Documentation

◆ UniLowerValue()

template<typename MT >
blaze::UniLowerValue< MT >::UniLowerValue ( RepresentedType value,
bool  diagonal 
)
inline

Constructor for the UniLowerValue class.

Parameters
valueReference to the represented value.
diagonaltrue in case the element is on the diagonal, false if not.

Member Function Documentation

◆ clear()

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

Clearing the unilower value.

Returns
void

This function clears the unilower value to its default initial state.

◆ get()

template<typename MT >
UniLowerValue< MT >::RepresentedType blaze::UniLowerValue< MT >::get ( ) const
inlinenoexcept

Access to the represented value.

Returns
Copy of the represented value.

◆ imag() [1/2]

template<typename MT >
UniLowerValue< MT >::ValueType blaze::UniLowerValue< 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.

◆ imag() [2/2]

template<typename MT >
void blaze::UniLowerValue< 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 matrix element.

In case the proxy represents a complex number, this function sets a new value to its imaginary part. In case the proxy represents a diagonal element and the given value is not zero, a std::invalid_argument exception is thrown.

◆ invert()

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

In-place inversion of the unilower value.

Returns
void

◆ isRestricted()

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

Returns whether the value represents a restricted matrix element..

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

◆ operator RepresentedType()

template<typename MT >
blaze::UniLowerValue< MT >::operator RepresentedType ( ) const
inlinenoexcept

Conversion to the represented value.

Returns
Copy of the represented value.

◆ operator*=()

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

Multiplication assignment to the unilower value.

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

◆ operator+=()

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

Addition assignment to the unilower value.

Parameters
valueThe right-hand side value to be added to the unilower value.
Returns
Reference to the assigned unilower value.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator-=()

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

Subtraction assignment to the unilower value.

Parameters
valueThe right-hand side value to be subtracted from the unilower value.
Returns
Reference to the assigned unilower value.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator/=()

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

Division assignment to the unilower value.

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

◆ operator=() [1/2]

template<typename MT >
UniLowerValue< MT > & blaze::UniLowerValue< MT >::operator= ( const UniLowerValue< MT > &  ulv)
inline

Copy assignment operator for UniLowerValue.

Parameters
ulvThe unilower value to be copied.
Returns
Reference to the assigned unilower value.
Exceptions
std::invalid_argumentInvalid assignment to diagonal matrix element.

◆ operator=() [2/2]

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

Assignment to the unilower value.

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

◆ real() [1/2]

template<typename MT >
UniLowerValue< MT >::ValueType blaze::UniLowerValue< 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.

◆ real() [2/2]

template<typename MT >
void blaze::UniLowerValue< 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 matrix element.

In case the proxy represents a complex number, this function sets a new value to its real part.

◆ reset()

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

Reset the unilower value to its default initial value.

Returns
void

This function resets the unilower value to its default initial value.


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