Expression Templates Library (ETL)
Public Types | Public Member Functions | Public Attributes | List of all members
etl::sparse_detail::sparse_reference< M > Struct Template Reference

A proxy representing a reference to an element of a sparse matrix. More...

#include <sparse.hpp>

Public Types

using matrix_type = M
 The matrix type.
 
using value_type = typename matrix_type::value_type
 The value type.
 
using raw_pointer_type = value_type *
 A raw pointer type.
 
using raw_reference_type = value_type &
 A raw reference type.
 
using const_raw_reference_type = std::add_const_t< value_type > &
 A raw const reference type.
 

Public Member Functions

 sparse_reference (matrix_type &matrix, size_t i, size_t j)
 Constructs a new sparse_reference. More...
 
 ~sparse_reference ()
 Destruct the proxy reference and updates the matrix to the correct value.
 
 sparse_reference (sparse_reference &)=delete
 
sparse_referenceoperator= (sparse_reference &)=delete
 
 sparse_reference (sparse_reference &&)=delete
 
sparse_referenceoperator= (sparse_reference &&)=delete
 
sparse_referenceoperator= (value_type rhs)
 Sets a new value to the proxy reference. More...
 
sparse_referenceoperator+= (value_type rhs)
 Adds a new value to the proxy reference. More...
 
sparse_referenceoperator-= (value_type rhs)
 Subtract a new value from the proxy reference. More...
 
sparse_referenceoperator*= (value_type rhs)
 Multiply by a new value the proxy reference. More...
 
sparse_referenceoperator/= (value_type rhs)
 Divide by a new value the proxy reference. More...
 
sparse_referenceoperator%= (value_type rhs)
 Modulo by a new value the proxy reference. More...
 
 operator raw_reference_type ()
 Casts the proxy reference to the raw reference type. More...
 
 operator const_raw_reference_type () const
 Casts the proxy reference to the raw reference type. More...
 

Public Attributes

matrix_typematrix
 Reference to the matrix.
 
size_t i
 The first index.
 
size_t j
 The second index.
 
size_t n
 hint
 
raw_pointer_type ptr
 Pointer to the element.
 

Detailed Description

template<typename M>
struct etl::sparse_detail::sparse_reference< M >

A proxy representing a reference to an element of a sparse matrix.

Template Parameters
MThe matrix type

Constructor & Destructor Documentation

◆ sparse_reference()

template<typename M >
etl::sparse_detail::sparse_reference< M >::sparse_reference ( matrix_type matrix,
size_t  i,
size_t  j 
)
inline

Constructs a new sparse_reference.

Parameters
matrixThe source matrix
iThe index i of the first dimension
jThe index j of the second dimension

Member Function Documentation

◆ operator const_raw_reference_type()

template<typename M >
etl::sparse_detail::sparse_reference< M >::operator const_raw_reference_type ( ) const
inline

Casts the proxy reference to the raw reference type.

Returns
a raw reference to the element

◆ operator raw_reference_type()

template<typename M >
etl::sparse_detail::sparse_reference< M >::operator raw_reference_type ( )
inline

Casts the proxy reference to the raw reference type.

Returns
a raw reference to the element

◆ operator%=()

template<typename M >
sparse_reference& etl::sparse_detail::sparse_reference< M >::operator%= ( value_type  rhs)
inline

Modulo by a new value the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

◆ operator*=()

template<typename M >
sparse_reference& etl::sparse_detail::sparse_reference< M >::operator*= ( value_type  rhs)
inline

Multiply by a new value the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

◆ operator+=()

template<typename M >
sparse_reference& etl::sparse_detail::sparse_reference< M >::operator+= ( value_type  rhs)
inline

Adds a new value to the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

◆ operator-=()

template<typename M >
sparse_reference& etl::sparse_detail::sparse_reference< M >::operator-= ( value_type  rhs)
inline

Subtract a new value from the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

◆ operator/=()

template<typename M >
sparse_reference& etl::sparse_detail::sparse_reference< M >::operator/= ( value_type  rhs)
inline

Divide by a new value the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

◆ operator=()

template<typename M >
sparse_reference& etl::sparse_detail::sparse_reference< M >::operator= ( value_type  rhs)
inline

Sets a new value to the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

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