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

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

#include <hermitian_reference.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 reference type.
 
using expr_t = M
 The hermitian matrix.
 

Public Member Functions

 hermitian_reference (matrix_type &matrix, size_t i, size_t j)
 Constructs a new hermitian_reference. More...
 
hermitian_referenceoperator= (const value_type &rhs)
 Sets a new value to the proxy reference. More...
 
hermitian_referenceoperator+= (value_type rhs)
 Adds a new value to the proxy reference. More...
 
hermitian_referenceoperator-= (value_type rhs)
 Subtract a new value from the proxy reference. More...
 
hermitian_referenceoperator*= (value_type rhs)
 Multiply by a new value the proxy reference. More...
 
hermitian_referenceoperator/= (value_type rhs)
 Divide by a new value the proxy reference. More...
 
hermitian_referenceoperator%= (value_type rhs)
 Modulo by a new value the proxy reference. More...
 
bool operator== (const hermitian_reference &rhs) const
 Test if the hermitian reference value is equals to the given value. More...
 
bool operator!= (const hermitian_reference &rhs) const
 Test if the hermitian reference value is not equals to the given value. More...
 
bool operator== (const value_type &rhs) const
 Test if the hermitian reference value is equals to the given value. More...
 
bool operator!= (const value_type &rhs) const
 Test if the hermitian reference value is not equals to the given value. 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.
 
value_typevalue
 Reference to the value.
 
value_typesym_value
 Reference to the symmetric value.
 

Friends

std::ostream & operator<< (std::ostream &os, const hermitian_reference &ref)
 Outputs an hermitian reference to the stream. More...
 

Detailed Description

template<typename M>
struct etl::herm_detail::hermitian_reference< M >

A proxy representing a reference to a mutable element of an hermitian matrix.

Template Parameters
MThe matrix type

Constructor & Destructor Documentation

◆ hermitian_reference()

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

Constructs a new hermitian_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::herm_detail::hermitian_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!=() [1/2]

template<typename M>
bool etl::herm_detail::hermitian_reference< M >::operator!= ( const hermitian_reference< M > &  rhs) const
inline

Test if the hermitian reference value is not equals to the given value.

Parameters
rhsThe right hand side of the comparison
Returns
true if the two values are not equals, false otherwise

◆ operator!=() [2/2]

template<typename M>
bool etl::herm_detail::hermitian_reference< M >::operator!= ( const value_type rhs) const
inline

Test if the hermitian reference value is not equals to the given value.

Parameters
rhsThe right hand side of the comparison
Returns
true if the two values are not equals, false otherwise

◆ operator%=()

template<typename M>
hermitian_reference& etl::herm_detail::hermitian_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>
hermitian_reference& etl::herm_detail::hermitian_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>
hermitian_reference& etl::herm_detail::hermitian_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>
hermitian_reference& etl::herm_detail::hermitian_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>
hermitian_reference& etl::herm_detail::hermitian_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>
hermitian_reference& etl::herm_detail::hermitian_reference< M >::operator= ( const value_type rhs)
inline

Sets a new value to the proxy reference.

Parameters
rhsThe new value
Returns
a reference to the proxy reference

◆ operator==() [1/2]

template<typename M>
bool etl::herm_detail::hermitian_reference< M >::operator== ( const hermitian_reference< M > &  rhs) const
inline

Test if the hermitian reference value is equals to the given value.

Parameters
rhsThe right hand side of the comparison
Returns
true if the two values are equals, false otherwise

◆ operator==() [2/2]

template<typename M>
bool etl::herm_detail::hermitian_reference< M >::operator== ( const value_type rhs) const
inline

Test if the hermitian reference value is equals to the given value.

Parameters
rhsThe right hand side of the comparison
Returns
true if the two values are equals, false otherwise

Friends And Related Function Documentation

◆ operator<<

template<typename M>
std::ostream& operator<< ( std::ostream &  os,
const hermitian_reference< M > &  ref 
)
friend

Outputs an hermitian reference to the stream.

Parameters
osThe output stream
refThe hermitian reference to output
Returns
The output stream

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