All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
blaze::ValueIndexPair< Type > Class Template Reference

Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-value-pair of a sparse vector or sparse matrix. More...

#include <ValueIndexPair.h>

Inherits blaze::SparseElement.

Public Types

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

Public Member Functions

 ValueIndexPair ()
 Default constructor for value-index-pairs.
 
 ValueIndexPair (const Type &v, size_t i)
 Constructor for a direct initialization of value-index-pairs. More...
 
template<typename Other >
EnableIf< IsSparseElement
< Other >, ValueIndexPair
< Type > & >::Type 
operator= (const Other &rhs)
 Assignment operator for different value-index-pair types. More...
 
template<typename Other >
DisableIf< IsSparseElement
< Other >, ValueIndexPair
< Type > & >::Type 
operator= (const Other &v)
 Assignment to the value of the value-index-pair. More...
 
template<typename Other >
ValueIndexPair< Type > & operator+= (const Other &v)
 Addition assignment to the value of the value-index-pair. More...
 
template<typename Other >
ValueIndexPair< Type > & operator-= (const Other &v)
 Subtraction assignment to the value of the value-index-pair. More...
 
template<typename Other >
ValueIndexPair< Type > & operator*= (const Other &v)
 Multiplication assignment to the value of the value-index-pair. More...
 
template<typename Other >
ValueIndexPair< Type > & operator/= (const Other &v)
 Division assignment to the value of the value-index-pair. More...
 
Operators
template<typename Other >
EnableIf< IsSparseElement
< Other >, ValueIndexPair & >
::Type 
operator= (const Other &rhs)
 
template<typename Other >
DisableIf< IsSparseElement
< Other >, ValueIndexPair & >
::Type 
operator= (const Other &v)
 
template<typename Other >
ValueIndexPairoperator+= (const Other &v)
 
template<typename Other >
ValueIndexPairoperator-= (const Other &v)
 
template<typename Other >
ValueIndexPairoperator*= (const Other &v)
 
template<typename Other >
ValueIndexPairoperator/= (const Other &v)
 
Access functions
Reference value ()
 Access to the current value of the value-index-pair. More...
 
ConstReference value () const
 Access to the current value of the value-index-pair. More...
 
IndexType index () const
 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

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

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

template<typename Type >
ValueIndexPair< Type >::IndexType blaze::ValueIndexPair< Type >::index ( ) const
inline

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

Returns
The current index of the value-index-pair.
template<typename Type>
template<typename Other >
ValueIndexPair<Type>& blaze::ValueIndexPair< Type >::operator*= ( const Other &  v)
inline

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.
template<typename Type>
template<typename Other >
ValueIndexPair<Type>& blaze::ValueIndexPair< Type >::operator+= ( const Other &  v)
inline

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.
template<typename Type>
template<typename Other >
ValueIndexPair<Type>& blaze::ValueIndexPair< Type >::operator-= ( const Other &  v)
inline

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.
template<typename Type>
template<typename Other >
ValueIndexPair<Type>& blaze::ValueIndexPair< Type >::operator/= ( const Other &  v)
inline

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.
template<typename Type>
template<typename Other >
EnableIf< IsSparseElement<Other>, ValueIndexPair<Type>& >::Type blaze::ValueIndexPair< Type >::operator= ( const Other &  rhs)
inline

Assignment operator for different value-index-pair types.

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.

template<typename Type>
template<typename Other >
DisableIf< IsSparseElement<Other>, ValueIndexPair<Type>& >::Type blaze::ValueIndexPair< Type >::operator= ( const Other &  v)
inline

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

Parameters
vThe new value-index-pair value.
Returns
Reference to the assigned value-index-pair.
template<typename Type >
ValueIndexPair< Type >::Reference blaze::ValueIndexPair< Type >::value ( )
inline

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

Returns
The current value of the value-index-pair.
template<typename Type >
ValueIndexPair< Type >::ConstReference blaze::ValueIndexPair< Type >::value ( ) const
inline

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: