35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANVALUE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANVALUE_H_ 115 template<
typename MT >
117 :
public Proxy< HermitianValue<MT> >
128 template<
typename T >
129 struct BuiltinType {
using Type = INVALID_TYPE; };
137 template<
typename T >
138 struct ComplexType {
using Type =
typename T::value_type; };
148 , ComplexType<RepresentedType>
149 , BuiltinType<RepresentedType> >::Type;
166 template<
typename T >
inline HermitianValue& operator+=(
const T& value );
167 template<
typename T >
inline HermitianValue& operator-=(
const T& value );
168 template<
typename T >
inline HermitianValue& operator*=(
const T& value );
169 template<
typename T >
inline HermitianValue& operator/=(
const T& value );
176 inline void reset ()
const;
177 inline void clear ()
const;
178 inline void invert()
const;
205 inline
void sync() const;
249 template< typename MT >
273 template<
typename MT >
296 template<
typename MT >
297 template<
typename T >
306 pos_->value() = value;
320 template<
typename MT >
321 template<
typename T >
330 pos_->value() += value;
344 template<
typename MT >
345 template<
typename T >
354 pos_->value() -= value;
368 template<
typename MT >
369 template<
typename T >
378 pos_->value() *= value;
392 template<
typename MT >
393 template<
typename T >
402 pos_->value() /= value;
424 template<
typename MT >
433 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
434 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
437 reset( pos2->value() );
450 template<
typename MT >
459 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
460 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
463 clear( pos2->value() );
474 template<
typename MT >
483 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
484 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
487 pos2->value() =
conj(
pos_->value() );
498 template<
typename MT >
501 return pos_->value();
511 template<
typename MT >
517 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
518 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
538 template<
typename MT >
541 return pos_->value();
562 template<
typename MT >
565 return pos_->value().real();
579 template<
typename MT >
582 pos_->value().real() = value;
596 template<
typename MT >
599 return pos_->value.imag();
613 template<
typename MT >
616 pos_->value().imag( value );
633 template<
typename MT >
636 template<
typename MT >
639 template<
typename MT >
642 template<
bool RF,
typename MT >
645 template<
bool RF,
typename MT >
648 template<
bool RF,
typename MT >
651 template<
bool RF,
typename MT >
654 template<
typename MT >
669 template<
typename MT >
686 template<
typename MT >
701 template<
typename MT >
719 template<
bool RF,
typename MT >
724 return isDefault<RF>( value.
get() );
741 template<
bool RF,
typename MT >
746 return isReal<RF>( value.
get() );
761 template<
bool RF,
typename MT >
766 return isZero<RF>( value.
get() );
781 template<
bool RF,
typename MT >
786 return isOne<RF>( value.
get() );
801 template<
typename MT >
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:653
Header file for the isnan shim.
IteratorType pos_
Iterator to the current sparse Hermitian matrix element.
Definition: HermitianValue.h:210
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
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
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.
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: HermitianValue.h:597
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Forward.h:51
Header file for the isZero shim.
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
ElementType_t< MT > RepresentedType
Type of the represented matrix element.
Definition: HermitianValue.h:144
ValueType value_type
Value type of the represented complex element.
Definition: HermitianValue.h:151
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
Header file for the invert shim.
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1539
Header file for the reset shim.
size_t index_
The row/column index of the iterator.
Definition: HermitianValue.h:212
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
RepresentedType get() const noexcept
Access to the represented value.
Definition: HermitianValue.h:499
Constraint on the data type.
ValueType real() const
Returns the real part of the represented complex number.
Definition: HermitianValue.h:563
Header file for the Proxy class.
typename MT::Iterator IteratorType
Type of the underlying sparse matrix iterators.
Definition: HermitianValue.h:121
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.
Constraint on the data type.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:775
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
HermitianValue & operator=(const HermitianValue &hv)
Copy assignment operator for HermitianValue.
Definition: HermitianValue.h:274
Constraint on the data type.
void sync() const
Synchronization of the current sparse element to the according paired element.
Definition: HermitianValue.h:512
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:713
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 invert() const
In-place inversion of the Hermitian value.
Definition: HermitianValue.h:475
void clear() const
Clearing the Hermitian value.
Definition: HermitianValue.h:451
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Representation of two synchronized values within a sparse Hermitian matrix.The HermitianValue class r...
Definition: HermitianValue.h:116
Header file for the isOne shim.
Header file for the conjugate shim.
#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, a compilation error is created.
Definition: Symmetric.h:79
void reset() const
Reset the Hermitian value to its default initial value.
Definition: HermitianValue.h:425
Utility type for generic codes.
Constraint on the data type.
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, a compilation error is created.
Definition: Reference.h:79
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:693
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
typename If_t< IsComplex_v< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type ValueType
Value type of the represented complex element.
Definition: HermitianValue.h:149
Header file for the IsRowMajorMatrix type trait.
HermitianValue(IteratorType pos, MT *matrix, size_t index)
Constructor for the HermitianValue class.
Definition: HermitianValue.h:250
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
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:631
#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, a compilation error is created.
Definition: Hermitian.h:79
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1326
MT * matrix_
The sparse matrix containing the iterator.
Definition: HermitianValue.h:211
Header file for the isReal shim.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Header file for the clear shim.