35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANVALUE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_HERMITIANVALUE_H_ 117 template<
typename MT >
119 :
public Proxy< HermitianValue<MT> >
130 template<
typename T >
131 struct BuiltinType {
using Type = INVALID_TYPE; };
139 template<
typename T >
140 struct ComplexType {
using Type =
typename T::value_type; };
150 , ComplexType<RepresentedType>
151 , BuiltinType<RepresentedType> >::Type;
168 template<
typename T >
inline HermitianValue& operator+=(
const T& value );
169 template<
typename T >
inline HermitianValue& operator-=(
const T& value );
170 template<
typename T >
inline HermitianValue& operator*=(
const T& value );
171 template<
typename T >
inline HermitianValue& operator/=(
const T& value );
178 inline void reset ()
const;
179 inline void clear ()
const;
180 inline void invert()
const;
207 inline
void sync() const;
253 template< typename MT >
277 template<
typename MT >
300 template<
typename MT >
301 template<
typename T >
310 pos_->value() = value;
324 template<
typename MT >
325 template<
typename T >
334 pos_->value() += value;
348 template<
typename MT >
349 template<
typename T >
358 pos_->value() -= value;
372 template<
typename MT >
373 template<
typename T >
382 pos_->value() *= value;
396 template<
typename MT >
397 template<
typename T >
406 pos_->value() /= value;
428 template<
typename MT >
437 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
438 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
441 reset( pos2->value() );
454 template<
typename MT >
463 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
464 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
467 clear( pos2->value() );
478 template<
typename MT >
487 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
488 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
491 pos2->value() =
conj(
pos_->value() );
502 template<
typename MT >
505 return pos_->value();
515 template<
typename MT >
521 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
522 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
542 template<
typename MT >
545 return pos_->value();
566 template<
typename MT >
569 return pos_->value().real();
583 template<
typename MT >
586 pos_->value().real() = value;
600 template<
typename MT >
603 return pos_->value.imag();
617 template<
typename MT >
620 pos_->value().imag( value );
637 template<
typename MT >
640 template<
typename MT >
643 template<
typename MT >
646 template<
bool RF,
typename MT >
649 template<
bool RF,
typename MT >
652 template<
bool RF,
typename MT >
655 template<
bool RF,
typename MT >
658 template<
typename MT >
673 template<
typename MT >
690 template<
typename MT >
705 template<
typename MT >
723 template<
bool RF,
typename MT >
728 return isDefault<RF>( value.
get() );
745 template<
bool RF,
typename MT >
750 return isReal<RF>( value.
get() );
765 template<
bool RF,
typename MT >
770 return isZero<RF>( value.
get() );
785 template<
bool RF,
typename MT >
790 return isOne<RF>( value.
get() );
805 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.
IteratorType pos_
Iterator to the current sparse Hermitian matrix element.
Definition: HermitianValue.h:212
#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.
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: HermitianValue.h:601
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
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.
#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
ElementType_t< MT > RepresentedType
Type of the represented matrix element.
Definition: HermitianValue.h:146
ValueType value_type
Value type of the represented complex element.
Definition: HermitianValue.h:153
#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.
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:2328
Header file for the reset shim.
size_t index_
The row/column index of the iterator.
Definition: HermitianValue.h:214
RepresentedType get() const noexcept
Access to the represented value.
Definition: HermitianValue.h:503
Constraint on the data type.
ValueType real() const
Returns the real part of the represented complex number.
Definition: HermitianValue.h:567
Header file for the Proxy class.
typename MT::Iterator IteratorType
Type of the underlying sparse matrix iterators.
Definition: HermitianValue.h:123
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: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
HermitianValue & operator=(const HermitianValue &hv)
Copy assignment operator for HermitianValue.
Definition: HermitianValue.h:278
Constraint on the data type.
void sync() const
Synchronization of the current sparse element to the according paired element.
Definition: HermitianValue.h:516
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 invert() const
In-place inversion of the Hermitian value.
Definition: HermitianValue.h:479
void clear() const
Clearing the Hermitian value.
Definition: HermitianValue.h:455
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Representation of two synchronized values within a sparse Hermitian matrix.The HermitianValue class r...
Definition: HermitianValue.h:118
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,...
Definition: Symmetric.h:79
void reset() const
Reset the Hermitian value to its default initial value.
Definition: HermitianValue.h:429
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,...
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.
Constraint on the data type.
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
typename If_t< IsComplex_v< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type ValueType
Value type of the represented complex element.
Definition: HermitianValue.h:151
Header file for the IsRowMajorMatrix type trait.
HermitianValue(IteratorType pos, MT *matrix, size_t index)
Constructor for the HermitianValue class.
Definition: HermitianValue.h:254
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
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
MT * matrix_
The sparse matrix containing the iterator.
Definition: HermitianValue.h:213
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.