35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SYMMETRICVALUE_H_
36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SYMMETRICVALUE_H_
113 template<
typename MT >
125 template<
typename T >
126 struct BuiltinType {
typedef INVALID_TYPE Type; };
134 template<
typename T >
135 struct ComplexType {
typedef typename T::value_type Type; };
145 , ComplexType<RepresentedType>
154 inline SymmetricValue( IteratorType pos, MT* matrix,
size_t index );
163 template<
typename T >
inline SymmetricValue& operator+=(
const T& value );
164 template<
typename T >
inline SymmetricValue& operator-=(
const T& value );
165 template<
typename T >
inline SymmetricValue& operator*=(
const T& value );
166 template<
typename T >
inline SymmetricValue& operator/=(
const T& value );
173 inline void reset ()
const;
174 inline void clear ()
const;
175 inline void invert()
const;
177 inline RepresentedType
get()
const;
191 inline ValueType
real()
const;
192 inline void real( ValueType value )
const;
193 inline ValueType
imag()
const;
194 inline void imag( ValueType value )
const;
202 inline void sync()
const;
246 template<
typename MT >
269 template<
typename MT >
272 pos_->value() = sv.
pos_->value();
285 template<
typename MT >
286 template<
typename T >
289 pos_->value() = value;
303 template<
typename MT >
304 template<
typename T >
307 pos_->value() += value;
320 template<
typename MT >
321 template<
typename T >
324 pos_->value() -= value;
337 template<
typename MT >
338 template<
typename T >
341 pos_->value() *= value;
354 template<
typename MT >
355 template<
typename T >
358 pos_->value() /= value;
380 template<
typename MT >
385 reset( pos_->value() );
387 if( pos_->index() != index_ )
393 reset( pos2->value() );
406 template<
typename MT >
411 clear( pos_->value() );
413 if( pos_->index() != index_ )
419 clear( pos2->value() );
430 template<
typename MT >
437 if( pos_->index() != index_ )
443 pos2->value() = pos_->value();
454 template<
typename MT >
457 return pos_->value();
467 template<
typename MT >
470 if( pos_->index() == index_ ||
isDefault( pos_->value() ) )
476 matrix_->set(
row, column, pos_->value() );
494 template<
typename MT >
497 return pos_->value();
518 template<
typename MT >
521 return pos_->value().real();
535 template<
typename MT >
538 pos_->value().real() = value;
552 template<
typename MT >
555 return pos_->value.imag();
569 template<
typename MT >
572 pos_->value().imag( value );
589 template<
typename MT >
593 template<
typename MT >
596 template<
typename MT >
599 template<
typename MT >
602 template<
typename MT >
605 template<
typename MT >
608 template<
typename MT >
611 template<
typename MT >
614 template<
typename MT >
631 template<
typename MT >
637 return conj( (~value).
get() );
651 template<
typename MT >
668 template<
typename MT >
683 template<
typename MT >
701 template<
typename MT >
723 template<
typename MT >
743 template<
typename MT >
763 template<
typename MT >
783 template<
typename MT >
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, a compilation error is created.
Definition: Const.h:116
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:609
Constraint on the data type.
void invert() const
In-place inversion of the symmetric value.
Definition: SymmetricValue.h:431
void clear() const
Clearing the symmetric value.
Definition: SymmetricValue.h:407
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Header file for basic type definitions.
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:569
SymmetricValue & operator=(const SymmetricValue &sv)
Copy assignment operator for SymmetricValue.
Definition: SymmetricValue.h:270
MT * matrix_
The sparse matrix containing the iterator.
Definition: SymmetricValue.h:208
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:107
#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:116
Header file for the invert shim.
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: SymmetricValue.h:553
RepresentedType get() const
Access to the represented value.
Definition: SymmetricValue.h:455
Constraint on the data type.
ValueType real() const
Returns the real part of the represented complex number.
Definition: SymmetricValue.h:519
Header file for the Proxy class.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
IteratorType pos_
Iterator to the current sparse symmetric matrix element.
Definition: SymmetricValue.h:207
Constraint on the data type.
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Constraint on the data type.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:767
MT::Iterator IteratorType
Type of the underlying sparse matrix iterators.
Definition: SymmetricValue.h:118
If< IsComplex< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type::Type ValueType
Value type of the represented complex element.
Definition: SymmetricValue.h:146
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:110
#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:116
Header file for the isZero shim.
Constraint on the data type.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:629
#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:118
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for the isOne shim.
size_t index_
The row/column index of the iterator.
Definition: SymmetricValue.h:209
Header file for the conjugate shim.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:107
ValueType value_type
Value type of the represented complex element.
Definition: SymmetricValue.h:148
void sync() const
Synchronization of the current sparse element to the according paired element.
Definition: SymmetricValue.h:468
Evaluation of the return type of a complex conjugate expression.Via this type trait it is possible to...
Definition: ConjExprTrait.h:87
#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:116
Utility type for generic codes.
MT::ElementType RepresentedType
Type of the represented matrix element.
Definition: SymmetricValue.h:141
Constraint on the data type.
Constraint on the data type.
#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:79
Representation of two synchronized values within a sparse symmetric matrix.The SymmetricValue class r...
Definition: SymmetricValue.h:114
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:118
#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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
SymmetricValue(IteratorType pos, MT *matrix, size_t index)
Constructor for the SymmetricValue class.
Definition: SymmetricValue.h:247
Header file for the IsRowMajorMatrix type trait.
void reset() const
Reset the symmetric value to its default initial value.
Definition: SymmetricValue.h:381
#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:118
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:589
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:116
Header file for the ConjExprTrait class template.
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:79