35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SYMMETRICVALUE_H_ 36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SYMMETRICVALUE_H_ 112 template<
typename MT >
114 :
public Proxy< SymmetricValue<MT> >
125 template<
typename T >
126 struct BuiltinType {
using Type = INVALID_TYPE; };
134 template<
typename T >
135 struct ComplexType {
using Type =
typename T::value_type; };
145 , ComplexType<RepresentedType>
146 , BuiltinType<RepresentedType> >::Type;
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;
202 inline
void sync() const;
246 template< typename MT >
269 template<
typename MT >
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 >
389 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
390 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
393 reset( pos2->value() );
406 template<
typename MT >
415 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
416 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
419 clear( pos2->value() );
430 template<
typename MT >
439 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
440 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
443 pos2->value() =
pos_->value();
454 template<
typename MT >
457 return pos_->value();
467 template<
typename MT >
473 const size_t row ( ( IsRowMajorMatrix_v<MT> )?(
pos_->index() ):(
index_ ) );
474 const size_t column( ( IsRowMajorMatrix_v<MT> )?(
index_ ):(
pos_->index() ) );
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 >
592 template<
typename MT >
595 template<
typename MT >
598 template<
bool RF,
typename MT >
601 template<
bool RF,
typename MT >
604 template<
bool RF,
typename MT >
607 template<
bool RF,
typename MT >
610 template<
typename MT >
625 template<
typename MT >
642 template<
typename MT >
657 template<
typename MT >
675 template<
bool RF,
typename MT >
680 return isDefault<RF>( value.
get() );
697 template<
bool RF,
typename MT >
702 return isReal<RF>( value.
get() );
717 template<
bool RF,
typename MT >
722 return isZero<RF>( value.
get() );
737 template<
bool RF,
typename MT >
742 return isOne<RF>( value.
get() );
757 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.
#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
Header file for auxiliary alias declarations.
typename MT::Iterator IteratorType
Type of the underlying sparse matrix iterators.
Definition: SymmetricValue.h:118
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.
void sync() const
Synchronization of the current sparse element to the according paired element.
Definition: SymmetricValue.h:468
Header file for basic type definitions.
typename If_t< IsComplex_v< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type ValueType
Value type of the represented complex element.
Definition: SymmetricValue.h:146
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.
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:591
#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.
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Constraint on the data type.
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.
IteratorType pos_
Iterator to the current sparse symmetric matrix element.
Definition: SymmetricValue.h:207
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
Constraint on the data type.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:713
#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
RepresentedType get() const noexcept
Access to the represented value.
Definition: SymmetricValue.h:455
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the isOne shim.
size_t index_
The row/column index of the iterator.
Definition: SymmetricValue.h:209
ElementType_t< MT > RepresentedType
Type of the represented matrix element.
Definition: SymmetricValue.h:141
ValueType value_type
Value type of the represented complex element.
Definition: SymmetricValue.h:148
#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.
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
Representation of two synchronized values within a sparse symmetric matrix.The SymmetricValue class r...
Definition: SymmetricValue.h:113
#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.
void clear() const
Clearing the symmetric value.
Definition: SymmetricValue.h:407
void reset() const
Reset the symmetric value to its default initial value.
Definition: SymmetricValue.h:381
void invert() const
In-place inversion of the symmetric value.
Definition: SymmetricValue.h:431
SymmetricValue(IteratorType pos, MT *matrix, size_t index)
Constructor for the SymmetricValue class.
Definition: SymmetricValue.h:247
Header file for the IsRowMajorMatrix type trait.
ValueType real() const
Returns the real part of the represented complex number.
Definition: SymmetricValue.h:519
#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
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: SymmetricValue.h:553
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
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.