35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_NUMERICPROXY_H_
36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_NUMERICPROXY_H_
90 template<
typename MT >
98 template<
typename T >
99 struct BuiltinType {
typedef INVALID_TYPE Type; };
107 template<
typename T >
108 struct ComplexType {
typedef typename T::value_type Type; };
122 , ComplexType<RepresentedType>
143 template<
typename T >
inline NumericProxy& operator+=(
const T& value );
144 template<
typename T >
inline NumericProxy& operator-=(
const T& value );
145 template<
typename T >
inline NumericProxy& operator*=(
const T& value );
146 template<
typename T >
inline NumericProxy& operator/=(
const T& value );
161 inline void reset()
const;
162 inline void clear()
const;
228 template<
typename MT >
242 template<
typename MT >
244 : matrix_( np.matrix_ )
246 , column_( np.column_ )
265 template<
typename MT >
282 template<
typename MT >
283 template<
typename T >
286 matrix_(row_,column_) = value;
287 if( row_ != column_ )
288 matrix_(column_,row_) = value;
301 template<
typename MT >
302 template<
typename T >
305 matrix_(row_,column_) += value;
306 if( row_ != column_ )
307 matrix_(column_,row_) += value;
320 template<
typename MT >
321 template<
typename T >
324 matrix_(row_,column_) -= value;
325 if( row_ != column_ )
326 matrix_(column_,row_) -= value;
339 template<
typename MT >
340 template<
typename T >
343 matrix_(row_,column_) *= value;
344 if( row_ != column_ )
345 matrix_(column_,row_) *= value;
358 template<
typename MT >
359 template<
typename T >
362 matrix_(row_,column_) /= value;
363 if( row_ != column_ )
364 matrix_(column_,row_) /= value;
384 template<
typename MT >
397 template<
typename MT >
420 template<
typename MT >
425 reset( matrix_(row_,column_) );
426 if( row_ != column_ )
427 reset( matrix_(column_,row_) );
439 template<
typename MT >
444 clear( matrix_(row_,column_) );
445 if( row_ != column_ )
446 clear( matrix_(column_,row_) );
456 template<
typename MT >
459 return const_cast<const MT&
>( matrix_ )(row_,column_);
477 template<
typename MT >
501 template<
typename MT >
504 return matrix_(row_,column_).real();
517 template<
typename MT >
520 matrix_(row_,column_).real( value );
521 if( row_ != column_ )
522 matrix_(column_,row_).real( value );
535 template<
typename MT >
538 return matrix_(row_,column_).imag();
552 template<
typename MT >
555 matrix_(row_,column_).imag( value );
556 if( row_ != column_ )
557 matrix_(column_,row_).imag( value );
573 template<
typename MT1,
typename MT2 >
576 template<
typename MT,
typename T >
579 template<
typename T,
typename MT >
582 template<
typename MT1,
typename MT2 >
585 template<
typename MT,
typename T >
588 template<
typename T,
typename MT >
591 template<
typename MT1,
typename MT2 >
592 inline bool operator<( const NumericProxy<MT1>& lhs,
const NumericProxy<MT2>& rhs );
594 template<
typename MT,
typename T >
595 inline bool operator<( const NumericProxy<MT>& lhs,
const T& rhs );
597 template<
typename T,
typename MT >
598 inline bool operator<( const T& lhs, const NumericProxy<MT>& rhs );
600 template<
typename MT1,
typename MT2 >
603 template<
typename MT,
typename T >
606 template<
typename T,
typename MT >
609 template<
typename MT1,
typename MT2 >
610 inline bool operator<=( const NumericProxy<MT1>& lhs,
const NumericProxy<MT2>& rhs );
612 template<
typename MT,
typename T >
613 inline bool operator<=( const NumericProxy<MT>& lhs,
const T& rhs );
615 template<
typename T,
typename MT >
616 inline bool operator<=( const T& lhs, const NumericProxy<MT>& rhs );
618 template<
typename MT1,
typename MT2 >
621 template<
typename MT,
typename T >
624 template<
typename T,
typename MT >
627 template<
typename MT >
628 inline std::ostream& operator<<( std::ostream& os, const NumericProxy<MT>& proxy );
641 template<
typename MT1,
typename MT2 >
644 return ( lhs.
get() == rhs.
get() );
657 template<
typename MT,
typename T >
660 return ( lhs.
get() == rhs );
673 template<
typename T,
typename MT >
676 return ( lhs == rhs.
get() );
689 template<
typename MT1,
typename MT2 >
692 return ( lhs.
get() != rhs.
get() );
705 template<
typename MT,
typename T >
708 return ( lhs.
get() != rhs );
721 template<
typename T,
typename MT >
724 return ( lhs != rhs.
get() );
737 template<
typename MT1,
typename MT2 >
740 return ( lhs.get() < rhs.get() );
753 template<
typename MT,
typename T >
754 inline bool operator<( const NumericProxy<MT>& lhs,
const T& rhs )
756 return ( lhs.get() < rhs );
769 template<
typename T,
typename MT >
770 inline bool operator<( const T& lhs, const NumericProxy<MT>& rhs )
772 return ( lhs < rhs.get() );
785 template<
typename MT1,
typename MT2 >
788 return ( lhs.
get() > rhs.
get() );
801 template<
typename MT,
typename T >
804 return ( lhs.
get() > rhs );
817 template<
typename T,
typename MT >
820 return ( lhs > rhs.
get() );
833 template<
typename MT1,
typename MT2 >
836 return ( lhs.get() <= rhs.get() );
849 template<
typename MT,
typename T >
850 inline bool operator<=( const NumericProxy<MT>& lhs,
const T& rhs )
852 return ( lhs.get() <= rhs );
865 template<
typename T,
typename MT >
866 inline bool operator<=( const T& lhs, const NumericProxy<MT>& rhs )
868 return ( lhs <= rhs.get() );
881 template<
typename MT1,
typename MT2 >
884 return ( lhs.
get() >= rhs.
get() );
897 template<
typename MT,
typename T >
900 return ( lhs.
get() >= rhs );
913 template<
typename T,
typename MT >
916 return ( lhs >= rhs.
get() );
929 template<
typename MT >
930 inline std::ostream& operator<<( std::ostream& os, const NumericProxy<MT>& proxy )
932 return os << proxy.get();
948 template<
typename MT >
949 inline void reset(
const NumericProxy<MT>& proxy );
951 template<
typename MT >
952 inline void clear(
const NumericProxy<MT>& proxy );
954 template<
typename MT >
955 inline bool isDefault(
const NumericProxy<MT>& proxy );
970 template<
typename MT >
988 template<
typename MT >
1006 template<
typename MT >
MT::ElementType RepresentedType
Type of the represented matrix element.
Definition: NumericProxy.h:114
#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
Constraint on the data type.
size_t row_
Row index of the accessed matrix element.
Definition: NumericProxy.h:190
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
NumericProxy * Pointer
Pointer to the represented element.
Definition: NumericProxy.h:117
Constraint on the data type.
MT & matrix_
Reference to the adapted matrix.
Definition: NumericProxy.h:189
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:103
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
#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
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: NumericProxy.h:536
Constraint on the data type.
ConstReference get() const
Returning the value of the accessed matrix element.
Definition: NumericProxy.h:457
void reset() const
Reset the represented element to its default initial value.
Definition: NumericProxy.h:421
Constraint on the data type.
Header file for the clear shim.
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:116
Constraint on the data type.
Access proxy for symmetric, square matrices with numeric element types.The NumericProxy provides cont...
Definition: NumericProxy.h:91
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
ValueType real() const
Returns the real part of the represented complex number.
Definition: NumericProxy.h:502
Constraint on the data type.
#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
Pointer operator->()
Direct access to the represented matrix element.
Definition: NumericProxy.h:385
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
MT::Reference Reference
Reference to the represented element.
Definition: NumericProxy.h:115
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:103
#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.
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
size_t column_
Column index of the accessed matrix element.
Definition: NumericProxy.h:191
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
Header file for the isDefault shim.
If< IsComplex< RepresentedType >, ComplexType< RepresentedType >, BuiltinType< RepresentedType > >::Type::Type ValueType
Value type of the represented complex element.
Definition: NumericProxy.h:123
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
NumericProxy & operator=(const NumericProxy &sp)
Copy assignment operator for NumericProxy.
Definition: NumericProxy.h:266
MT::ConstReference ConstReference
Reference-to-const to the represented element.
Definition: NumericProxy.h:116
const NumericProxy * ConstPointer
Pointer-to-const to the represented element.
Definition: NumericProxy.h:118
#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 operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
Header file for the IsComplex type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
NumericProxy(MT &matrix, size_t row, size_t column)
Initialization constructor for a NumericProxy.
Definition: NumericProxy.h:229
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a N-dimensional matrix type...
Definition: Matrix.h:79
void clear() const
Clearing the represented element.
Definition: NumericProxy.h:440