35#ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SCALARPROXY_H_
36#define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SCALARPROXY_H_
99template<
typename MT >
101 :
public Proxy< ScalarProxy<MT> >
108 template<
typename T >
109 struct BuiltinType {
using Type = INVALID_TYPE; };
117 template<
typename T >
118 struct ComplexType {
using Type =
typename T::value_type; };
132 , ComplexType<RepresentedType>
133 , BuiltinType<RepresentedType> >::Type;
157 template<
typename T >
inline ScalarProxy& operator+=(
const T& value );
158 template<
typename T >
inline ScalarProxy& operator-=(
const T& value );
159 template<
typename T >
inline ScalarProxy& operator*=(
const T& value );
160 template<
typename T >
inline ScalarProxy& operator/=(
const T& value );
161 template<
typename T >
inline ScalarProxy& operator%=(
const T& value );
176 inline void invert()
const;
242 reset( proxy.matrix_( proxy.row_, proxy.column_ ) );
243 if( proxy.row_ != proxy.column_ ) {
244 reset( proxy.matrix_( proxy.column_, proxy.row_ ) );
291template<
typename MT >
314template<
typename MT >
331template<
typename MT >
332template<
typename T >
335 matrix_(row_,column_) = value;
336 if( row_ != column_ )
337 matrix_(column_,row_) = value;
350template<
typename MT >
351template<
typename T >
354 matrix_(row_,column_) += value;
355 if( row_ != column_ )
356 matrix_(column_,row_) += value;
369template<
typename MT >
370template<
typename T >
373 matrix_(row_,column_) -= value;
374 if( row_ != column_ )
375 matrix_(column_,row_) -= value;
388template<
typename MT >
389template<
typename T >
392 matrix_(row_,column_) *= value;
393 if( row_ != column_ )
394 matrix_(column_,row_) *= value;
407template<
typename MT >
408template<
typename T >
411 matrix_(row_,column_) /= value;
412 if( row_ != column_ )
413 matrix_(column_,row_) /= value;
426template<
typename MT >
427template<
typename T >
430 matrix_(row_,column_) %= value;
431 if( row_ != column_ )
432 matrix_(column_,row_) %= value;
452template<
typename MT >
465template<
typename MT >
486template<
typename MT >
491 invert( matrix_(row_,column_) );
492 if( row_ != column_ )
493 matrix_(column_,row_) = matrix_(row_,column_);
503template<
typename MT >
506 return const_cast<const MT&
>( matrix_ )(row_,column_);
524template<
typename MT >
548template<
typename MT >
551 return matrix_(row_,column_).real();
564template<
typename MT >
567 matrix_(row_,column_).real( value );
568 if( row_ != column_ )
569 matrix_(column_,row_).real( value );
582template<
typename MT >
585 return matrix_(row_,column_).imag();
599template<
typename MT >
602 matrix_(row_,column_).imag( value );
603 if( row_ != column_ )
604 matrix_(column_,row_).imag( value );
620template<
typename MT >
633template<
typename MT >
Header file for auxiliary alias declarations.
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.
Definition: Aliases.h:170
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.
Definition: Aliases.h:390
Constraint on the data type.
Constraint on the data type.
Header file for the If class template.
Utility type for generic codes.
Header file for the invert shim.
Header file for the IsComplex type trait.
Header file for the isDefault shim.
Header file for the isOne shim.
Header file for the isReal shim.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the relaxation flag enumeration.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Proxy base class.
Definition: Proxy.h:169
Access proxy for symmetric, square matrices with scalar element types.
Definition: ScalarProxy.h:102
size_t row_
Row index of the accessed matrix element.
Definition: ScalarProxy.h:204
ScalarProxy(MT &matrix, size_t row, size_t column)
Initialization constructor for a ScalarProxy.
Definition: ScalarProxy.h:292
Pointer operator->()
Direct access to the represented matrix element.
Definition: ScalarProxy.h:453
size_t column_
Column index of the accessed matrix element.
Definition: ScalarProxy.h:205
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: ScalarProxy.h:583
ValueType real() const
Returns the real part of the represented complex number.
Definition: ScalarProxy.h:549
typename If_t< IsComplex_v< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type ValueType
Value type of the represented complex element.
Definition: ScalarProxy.h:133
MT & matrix_
Reference to the adapted matrix.
Definition: ScalarProxy.h:203
ScalarProxy & operator=(const ScalarProxy &sp)
Copy assignment operator for ScalarProxy.
Definition: ScalarProxy.h:315
ElementType_t< MT > RepresentedType
Type of the represented matrix element.
Definition: ScalarProxy.h:124
Reference_t< MT > Reference
Reference to the represented element.
Definition: ScalarProxy.h:125
ConstReference get() const noexcept
Returning the value of the accessed matrix element.
Definition: ScalarProxy.h:504
void invert() const
In-place inversion of the represented element.
Definition: ScalarProxy.h:487
ConstReference_t< MT > ConstReference
Reference-to-const to the represented element.
Definition: ScalarProxy.h:126
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Matrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.
Definition: View.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.
Definition: Transformation.h:81
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
constexpr Type & get(StaticVector< Type, N, TF, AF, PF, Tag > &v) noexcept
Tuple-like index-based access the contents of a static vector.
Definition: StaticVector.h:3052
void invert(const ScalarProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: ScalarProxy.h:634
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
Header file for the Proxy class.
Header file for the clear shim.
Header file for the isZero shim.
Header file for the reset shim.
Header file for basic type definitions.