35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANPROXY_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANPROXY_H_ 100 template<
typename MT >
102 :
public Proxy< HermitianProxy<MT> >
109 template<
typename T >
110 struct BuiltinType {
using Type = INVALID_TYPE; };
118 template<
typename T >
119 struct ComplexType {
using Type =
typename T::value_type; };
133 , ComplexType<RepresentedType>
134 , BuiltinType<RepresentedType> >::Type;
157 template<
typename T >
inline HermitianProxy& operator+=(
const T& value );
158 template<
typename T >
inline HermitianProxy& operator-=(
const T& value );
159 template<
typename T >
inline HermitianProxy& operator*=(
const T& value );
160 template<
typename T >
inline HermitianProxy& operator/=(
const T& value );
161 template<
typename T >
inline HermitianProxy& operator%=(
const T& value );
176 inline
void reset () const;
177 inline
void clear () const;
178 inline
void invert() const;
250 template< typename MT >
264 template<
typename MT >
291 template<
typename MT >
296 if( IsComplex_v<ET> && diagonal_ && !
isReal( hp.
value1_ ) ) {
302 value2_ =
conj( value1_ );
319 template<
typename MT >
320 template<
typename T >
325 if( IsComplex_v<ET> && diagonal_ && !
isReal( value ) ) {
331 value2_ =
conj( value1_ );
348 template<
typename MT >
349 template<
typename T >
354 if( IsComplex_v<ET> && diagonal_ && !
isReal( value ) ) {
360 value2_ =
conj( value1_ );
377 template<
typename MT >
378 template<
typename T >
383 if( IsComplex_v<ET> && diagonal_ && !
isReal( value ) ) {
389 value2_ =
conj( value1_ );
406 template<
typename MT >
407 template<
typename T >
412 if( IsComplex_v<ET> && diagonal_ && !
isReal( value ) ) {
418 value2_ =
conj( value1_ );
435 template<
typename MT >
436 template<
typename T >
441 if( IsComplex_v<ET> && diagonal_ && !
isReal( value ) ) {
447 value2_ =
conj( value1_ );
464 template<
typename MT >
465 template<
typename T >
470 if( IsComplex_v<ET> && diagonal_ && !
isReal( value ) ) {
476 value2_ =
conj( value1_ );
496 template<
typename MT >
509 template<
typename MT >
532 template<
typename MT >
551 template<
typename MT >
568 template<
typename MT >
575 value2_ =
conj( value1_ );
585 template<
typename MT >
606 template<
typename MT >
630 template<
typename MT >
633 return value1_.real();
646 template<
typename MT >
649 value1_.real( value );
651 value2_.real( value );
664 template<
typename MT >
667 return value1_.imag();
683 template<
typename MT >
686 if( diagonal_ && !
isZero( value ) ) {
690 value1_.imag( value );
692 value2_.imag( -value );
708 template<
typename MT >
711 template<
typename MT >
714 template<
typename MT >
717 template<
bool RF,
typename MT >
720 template<
bool RF,
typename MT >
723 template<
bool RF,
typename MT >
726 template<
bool RF,
typename MT >
729 template<
typename MT >
745 template<
typename MT >
763 template<
typename MT >
778 template<
typename MT >
796 template<
bool RF,
typename MT >
801 return isDefault<RF>( proxy.
get() );
818 template<
bool RF,
typename MT >
823 return isReal<RF>( proxy.
get() );
838 template<
bool RF,
typename MT >
843 return isZero<RF>( proxy.
get() );
858 template<
bool RF,
typename MT >
863 return isOne<RF>( proxy.
get() );
878 template<
typename MT >
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:657
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
Header file for the isnan shim.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Constraint on the data type.
Constraint on the data type.
HermitianProxy & operator=(const HermitianProxy &hp)
Copy assignment operator for HermitianProxy.
Definition: HermitianProxy.h:292
Reference value2_
Reference to the second accessed matrix element.
Definition: HermitianProxy.h:206
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
void invert() const
In-place inversion of the represented element.
Definition: HermitianProxy.h:569
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Forward.h:51
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.The Reference_t alias declaration provides a ...
Definition: Aliases.h:330
Header file for the isZero shim.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Access proxy for Hermitian matrices.The HermitianProxy provides controlled access to the elements of ...
Definition: HermitianProxy.h:101
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: HermitianProxy.h:665
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
Header file for the invert shim.
typename If_t< IsComplex_v< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type ValueType
Value type of the represented complex element.
Definition: HermitianProxy.h:134
Header file for the reset shim.
ValueType real() const
Returns the real part of the represented complex number.
Definition: HermitianProxy.h:631
Constraint on the data type.
const bool diagonal_
Flag for the accessed matrix element.
Definition: HermitianProxy.h:207
Pointer operator->() noexcept
Direct access to the represented matrix element.
Definition: HermitianProxy.h:497
Header file for the Proxy class.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
Constraint on the data type.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:677
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:779
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Constraint on the data type.
Constraint on the data type.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:717
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type,...
Definition: Upper.h:81
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the isOne shim.
Header file for the conjugate shim.
HermitianProxy(MT &matrix, size_t row, size_t column)
Initialization constructor for a HermitianProxy.
Definition: HermitianProxy.h:251
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type,...
Definition: Symmetric.h:79
Utility type for generic codes.
Constraint on the data type.
void clear() const
Clearing the represented element.
Definition: HermitianProxy.h:552
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type,...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type,...
Definition: Reference.h:79
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:697
Header file for the isDefault shim.
ConstReference get() const noexcept
Returning the value of the accessed matrix element.
Definition: HermitianProxy.h:586
Constraint on the data type.
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.The ConstReference_t alias declaration p...
Definition: Aliases.h:150
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
void reset() const
Reset the represented element to its default initial value.
Definition: HermitianProxy.h:533
Reference value1_
Reference to the first accessed matrix element.
Definition: HermitianProxy.h:205
Reference_t< MT > Reference
Reference to the represented element.
Definition: HermitianProxy.h:126
ConstReference_t< MT > ConstReference
Reference-to-const to the represented element.
Definition: HermitianProxy.h:127
Header file for the IsComplex type trait.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type,...
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a N-dimensional matrix type,...
Definition: Matrix.h:61
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1324
Header file for the isReal shim.
ElementType_t< MT > RepresentedType
Type of the represented matrix element.
Definition: HermitianProxy.h:125
Header file for the clear shim.
constexpr Type & get(StaticVector< Type, N, TF > &v) noexcept
Tuple-like index-based access the contents of a static vector.
Definition: StaticVector.h:2704