35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANVALUE_H_
36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANVALUE_H_
115 template<
typename MT >
127 template<
typename T >
128 struct BuiltinType {
typedef INVALID_TYPE Type; };
136 template<
typename T >
137 struct ComplexType {
typedef typename T::value_type Type; };
147 , ComplexType<RepresentedType>
156 inline HermitianValue( IteratorType pos, MT* matrix,
size_t index );
165 template<
typename T >
inline HermitianValue& operator+=(
const T& value );
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 );
175 inline void reset ()
const;
176 inline void clear ()
const;
177 inline void invert()
const;
179 inline RepresentedType
get()
const noexcept;
193 inline ValueType
real() const;
194 inline
void real( ValueType value ) const;
195 inline ValueType
imag() const;
196 inline
void imag( ValueType value ) const;
204 inline
void sync() const;
248 template< typename MT >
272 template<
typename MT >
295 template<
typename MT >
296 template<
typename T >
305 pos_->value() = value;
319 template<
typename MT >
320 template<
typename T >
329 pos_->value() += value;
343 template<
typename MT >
344 template<
typename T >
353 pos_->value() -= value;
367 template<
typename MT >
368 template<
typename T >
377 pos_->value() *= value;
391 template<
typename MT >
392 template<
typename T >
401 pos_->value() /= value;
423 template<
typename MT >
434 const IteratorType pos2(
matrix_->find(
row, column ) );
436 reset( pos2->value() );
449 template<
typename MT >
460 const IteratorType pos2(
matrix_->find(
row, column ) );
462 clear( pos2->value() );
473 template<
typename MT >
484 const IteratorType pos2(
matrix_->find(
row, column ) );
486 pos2->value() =
conj(
pos_->value() );
497 template<
typename MT >
500 return pos_->value();
510 template<
typename MT >
537 template<
typename MT >
540 return pos_->value();
561 template<
typename MT >
564 return pos_->value().real();
578 template<
typename MT >
581 pos_->value().real() = value;
595 template<
typename MT >
598 return pos_->value.imag();
612 template<
typename MT >
615 pos_->value().imag( value );
632 template<
typename MT >
635 template<
typename MT >
638 template<
typename MT >
641 template<
typename MT >
644 template<
typename MT >
647 template<
typename MT >
650 template<
typename MT >
653 template<
typename MT >
668 template<
typename MT >
685 template<
typename MT >
700 template<
typename MT >
718 template<
typename MT >
740 template<
typename MT >
760 template<
typename MT >
780 template<
typename MT >
800 template<
typename MT >
Header file for the isnan shim.
IteratorType pos_
Iterator to the current sparse Hermitian matrix element.
Definition: HermitianValue.h:209
#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
If_< IsComplex< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type ValueType
Value type of the represented complex element.
Definition: HermitianValue.h:148
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:635
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1158
Header file for auxiliary alias declarations.
Constraint on the data type.
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1499
Header file for basic type definitions.
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: HermitianValue.h:596
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Forward.h:51
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:595
ValueType real() const
Returns the real part of the represented complex number.
Definition: HermitianValue.h:562
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
void sync() const
Synchronization of the current sparse element to the according paired element.
Definition: HermitianValue.h:511
RepresentedType get() const noexcept
Access to the represented value.
Definition: HermitianValue.h:498
#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.
size_t index_
The row/column index of the iterator.
Definition: HermitianValue.h:211
Constraint on the data type.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
Header file for the Proxy class.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
Constraint on the data type.
MT::Iterator IteratorType
Type of the underlying sparse matrix iterators.
Definition: HermitianValue.h:120
Constraint on the data type.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:741
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
#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:273
ValueType value_type
Value type of the represented complex element.
Definition: HermitianValue.h:150
Header file for the isZero shim.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Constraint on the data type.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:655
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
Clearing the Hermitian value.
Definition: HermitianValue.h:450
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
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.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
#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
Utility type for generic codes.
Constraint on the data type.
Constraint on the data type.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
#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
Header file for the reset shim.
#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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
Header file for the isDefault shim.
void reset() const
Reset the Hermitian value to its default initial value.
Definition: HermitianValue.h:424
Constraint on the data type.
ElementType_< MT > RepresentedType
Type of the represented matrix element.
Definition: HermitianValue.h:143
Constraint on the data type.
Compile time check for complex types.This type trait tests whether or not the given template paramete...
Definition: IsComplex.h:76
Header file for the IsRowMajorMatrix type trait.
HermitianValue(IteratorType pos, MT *matrix, size_t index)
Constructor for the HermitianValue class.
Definition: HermitianValue.h:249
void invert() const
In-place inversion of the Hermitian value.
Definition: HermitianValue.h:474
#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
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:615
Header file for the IsComplex type trait.
#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
MT * matrix_
The sparse matrix containing the iterator.
Definition: HermitianValue.h:210
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