Blaze 3.9
Public Types | Public Member Functions | List of all members
blaze::ValueIndexPair< Type > Class Template Reference

Index-value-pair for sparse vectors and matrices. More...

#include <ValueIndexPair.h>

Inherits blaze::SparseElement.

Public Types

using ValueType = Type
 The value type of the value-index-pair.
 
using IndexType = size_t
 The index type of the value-index-pair.
 
using Reference = Type &
 Reference return type.
 
using ConstReference = const Type &
 Reference-to-const return type.
 

Public Member Functions

template<typename Other >
constexpr ValueIndexPair< Type > & operator+= (const Other &v)
 Addition assignment to the value of the value-index-pair. More...
 
template<typename Other >
constexpr ValueIndexPair< Type > & operator-= (const Other &v)
 Subtraction assignment to the value of the value-index-pair. More...
 
template<typename Other >
constexpr ValueIndexPair< Type > & operator*= (const Other &v)
 Multiplication assignment to the value of the value-index-pair. More...
 
template<typename Other >
constexpr ValueIndexPair< Type > & operator/= (const Other &v)
 Division assignment to the value of the value-index-pair. More...
 
Constructors
constexpr ValueIndexPair ()
 Default constructor for value-index-pairs.
 
constexpr ValueIndexPair (const Type &v, size_t i)
 Constructor for a direct initialization of value-index-pairs. More...
 
 ValueIndexPair (const ValueIndexPair &)=default
 
 ValueIndexPair (ValueIndexPair &&)=default
 
Destructor
 ~ValueIndexPair ()=default
 
Assignment operators
ValueIndexPairoperator= (const ValueIndexPair &)=default
 
ValueIndexPairoperator= (ValueIndexPair &&)=default
 
template<typename Other >
constexpr auto operator= (const Other &rhs) -> EnableIf_t< IsSparseElement_v< Other >, ValueIndexPair & >
 Assignment operator for different value-index-pair types. More...
 
template<typename Other >
constexpr auto operator= (Other &&rhs) -> EnableIf_t< IsSparseElement_v< RemoveReference_t< Other > > &&IsRValueReference_v< Other && >, ValueIndexPair & >
 Assignment operator for different value-index-pair types. More...
 
template<typename Other >
constexpr auto operator= (const Other &v) -> EnableIf_t< !IsSparseElement_v< Other >, ValueIndexPair & >
 
template<typename Other >
constexpr auto operator= (Other &&v) -> EnableIf_t< !IsSparseElement_v< RemoveReference_t< Other > > &&IsRValueReference_v< Other && >, ValueIndexPair & >
 
template<typename Other >
constexpr ValueIndexPairoperator+= (const Other &v)
 
template<typename Other >
constexpr ValueIndexPairoperator-= (const Other &v)
 
template<typename Other >
constexpr ValueIndexPairoperator*= (const Other &v)
 
template<typename Other >
constexpr ValueIndexPairoperator/= (const Other &v)
 
Access functions
constexpr Reference value () noexcept
 Access to the current value of the value-index-pair. More...
 
constexpr ConstReference value () const noexcept
 Access to the current value of the value-index-pair. More...
 
constexpr IndexType index () const noexcept
 Access to the current index of the value-index-pair. More...
 

Protected Attributes

Member variables
Type value_
 Value of the value-index-pair.
 
size_t index_
 Index of the value-index-pair.
 

Detailed Description

template<typename Type>
class blaze::ValueIndexPair< Type >

Index-value-pair for sparse vectors and matrices.

The ValueIndexPair class represents a single index-value-pair of a sparse vector or sparse matrix.

Constructor & Destructor Documentation

◆ ValueIndexPair()

template<typename Type >
constexpr blaze::ValueIndexPair< Type >::ValueIndexPair ( const Type &  v,
size_t  i 
)
constexpr

Constructor for a direct initialization of value-index-pairs.

Parameters
vThe value of the value-index-pair.
iThe index of the value-index-pair.

Member Function Documentation

◆ index()

template<typename Type >
constexpr ValueIndexPair< Type >::IndexType blaze::ValueIndexPair< Type >::index
constexprnoexcept

Access to the current index of the value-index-pair.

Returns
The current index of the value-index-pair.

◆ operator*=()

template<typename Type >
template<typename Other >
constexpr ValueIndexPair< Type > & blaze::ValueIndexPair< Type >::operator*= ( const Other &  v)
constexpr

Multiplication assignment to the value of the value-index-pair.

Parameters
vThe right-hand side value for the multiplication.
Returns
Reference to the assigned value-index-pair.

◆ operator+=()

template<typename Type >
template<typename Other >
constexpr ValueIndexPair< Type > & blaze::ValueIndexPair< Type >::operator+= ( const Other &  v)
constexpr

Addition assignment to the value of the value-index-pair.

Parameters
vThe right-hand side value to be added to the value-index-pair value.
Returns
Reference to the assigned value-index-pair.

◆ operator-=()

template<typename Type >
template<typename Other >
constexpr ValueIndexPair< Type > & blaze::ValueIndexPair< Type >::operator-= ( const Other &  v)
constexpr

Subtraction assignment to the value of the value-index-pair.

Parameters
vThe right-hand side value to be subtracted from the value-index-pair value.
Returns
Reference to the assigned value-index-pair.

◆ operator/=()

template<typename Type >
template<typename Other >
constexpr ValueIndexPair< Type > & blaze::ValueIndexPair< Type >::operator/= ( const Other &  v)
constexpr

Division assignment to the value of the value-index-pair.

Parameters
vThe right-hand side value for the division
Returns
Reference to the assigned value-index-pair.

◆ operator=() [1/2]

template<typename Type >
template<typename Other >
constexpr auto blaze::ValueIndexPair< Type >::operator= ( const Other &  v) -> EnableIf_t< IsSparseElement_v<Other>, ValueIndexPair& >
constexpr

Assignment operator for different value-index-pair types.

Assignment to the value of the value-index-pair.

Parameters
rhsValue-index-pair to be copied.
Returns
Reference to the assigned value-index-pair.

This assignment operator enables the assignment of other value-index-pair types. The given Other data type qualifies as value-index-pair type in case it provides a value() and an index() member function.

Parameters
vThe new value-index-pair value.
Returns
Reference to the assigned value-index-pair.

◆ operator=() [2/2]

template<typename Type >
template<typename Other >
constexpr auto blaze::ValueIndexPair< Type >::operator= ( Other &&  v) -> EnableIf_t< IsSparseElement_v< RemoveReference_t<Other> > && IsRValueReference_v<Other&&>, ValueIndexPair& >
constexpr

Assignment operator for different value-index-pair types.

Assignment to the value of the value-index-pair.

Parameters
rhsValue-index-pair to be moved.
Returns
Reference to the assigned value-index-pair.

This assignment operator enables the assignment of other value-index-pair types. The given Other data type qualifies as value-index-pair type in case it provides a value() and an index() member function.

Parameters
vThe new value-index-pair value.
Returns
Reference to the assigned value-index-pair.

◆ value() [1/2]

template<typename Type >
constexpr ValueIndexPair< Type >::ConstReference blaze::ValueIndexPair< Type >::value
constexprnoexcept

Access to the current value of the value-index-pair.

Returns
The current value of the value-index-pair.

◆ value() [2/2]

template<typename Type >
constexpr ValueIndexPair< Type >::Reference blaze::ValueIndexPair< Type >::value
constexprnoexcept

Access to the current value of the value-index-pair.

Returns
The current value of the value-index-pair.

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