35 #ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_DIAGONALPROXY_H_
36 #define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_DIAGONALPROXY_H_
91 template<
typename MT >
126 template<
typename T >
inline DiagonalProxy& operator+=(
const T& value );
127 template<
typename T >
inline DiagonalProxy& operator-=(
const T& value );
128 template<
typename T >
inline DiagonalProxy& operator*=(
const T& value );
129 template<
typename T >
inline DiagonalProxy& operator/=(
const T& value );
136 inline RawReference
get()
const;
192 template<
typename MT >
194 : value_ ( matrix( row, column ) )
195 , restricted_( row != column )
205 template<
typename MT >
207 : value_ ( dp.value_ )
208 , restricted_( dp.restricted_ )
227 template<
typename MT >
247 template<
typename MT >
248 template<
typename T >
252 throw std::invalid_argument(
"Invalid assignment to non-diagonal matrix element" );
271 template<
typename MT >
272 template<
typename T >
276 throw std::invalid_argument(
"Invalid assignment to non-diagonal matrix element" );
295 template<
typename MT >
296 template<
typename T >
300 throw std::invalid_argument(
"Invalid assignment to non-diagonal matrix element" );
319 template<
typename MT >
320 template<
typename T >
324 throw std::invalid_argument(
"Invalid assignment to non-diagonal matrix element" );
343 template<
typename MT >
344 template<
typename T >
348 throw std::invalid_argument(
"Invalid assignment to non-diagonal matrix element" );
370 template<
typename MT >
383 template<
typename MT >
404 template<
typename MT >
423 template<
typename MT1,
typename MT2 >
426 template<
typename MT,
typename T >
429 template<
typename T,
typename MT >
432 template<
typename MT1,
typename MT2 >
435 template<
typename MT,
typename T >
438 template<
typename T,
typename MT >
441 template<
typename MT1,
typename MT2 >
442 inline bool operator<( const DiagonalProxy<MT1>& lhs,
const DiagonalProxy<MT2>& rhs );
444 template<
typename MT,
typename T >
445 inline bool operator<( const DiagonalProxy<MT>& lhs,
const T& rhs );
447 template<
typename T,
typename MT >
448 inline bool operator<( const T& lhs, const DiagonalProxy<MT>& rhs );
450 template<
typename MT1,
typename MT2 >
453 template<
typename MT,
typename T >
456 template<
typename T,
typename MT >
459 template<
typename MT1,
typename MT2 >
460 inline bool operator<=( const DiagonalProxy<MT1>& lhs,
const DiagonalProxy<MT2>& rhs );
462 template<
typename MT,
typename T >
463 inline bool operator<=( const DiagonalProxy<MT>& lhs,
const T& rhs );
465 template<
typename T,
typename MT >
466 inline bool operator<=( const T& lhs, const DiagonalProxy<MT>& rhs );
468 template<
typename MT1,
typename MT2 >
471 template<
typename MT,
typename T >
474 template<
typename T,
typename MT >
477 template<
typename MT >
478 inline std::ostream& operator<<( std::ostream& os, const DiagonalProxy<MT>& proxy );
491 template<
typename MT1,
typename MT2 >
494 return ( lhs.
get() == rhs.
get() );
507 template<
typename MT,
typename T >
510 return ( lhs.
get() == rhs );
523 template<
typename T,
typename MT >
526 return ( lhs == rhs.
get() );
539 template<
typename MT1,
typename MT2 >
542 return ( lhs.
get() != rhs.
get() );
555 template<
typename MT,
typename T >
558 return ( lhs.
get() != rhs );
571 template<
typename T,
typename MT >
574 return ( lhs != rhs.
get() );
587 template<
typename MT1,
typename MT2 >
590 return ( lhs.get() < rhs.get() );
603 template<
typename MT,
typename T >
604 inline bool operator<( const DiagonalProxy<MT>& lhs,
const T& rhs )
606 return ( lhs.get() < rhs );
619 template<
typename T,
typename MT >
620 inline bool operator<( const T& lhs, const DiagonalProxy<MT>& rhs )
622 return ( lhs < rhs.get() );
635 template<
typename MT1,
typename MT2 >
638 return ( lhs.
get() > rhs.
get() );
651 template<
typename MT,
typename T >
654 return ( lhs.
get() > rhs );
667 template<
typename T,
typename MT >
670 return ( lhs > rhs.
get() );
683 template<
typename MT1,
typename MT2 >
686 return ( lhs.get() <= rhs.get() );
699 template<
typename MT,
typename T >
700 inline bool operator<=( const DiagonalProxy<MT>& lhs,
const T& rhs )
702 return ( lhs.get() <= rhs );
715 template<
typename T,
typename MT >
716 inline bool operator<=( const T& lhs, const DiagonalProxy<MT>& rhs )
718 return ( lhs <= rhs.get() );
731 template<
typename MT1,
typename MT2 >
734 return ( lhs.
get() >= rhs.
get() );
747 template<
typename MT,
typename T >
750 return ( lhs.
get() >= rhs );
763 template<
typename T,
typename MT >
766 return ( lhs >= rhs.
get() );
779 template<
typename MT >
780 inline std::ostream& operator<<( std::ostream& os, const DiagonalProxy<MT>& proxy )
782 return os << proxy.get();
798 template<
typename MT >
799 inline void reset(
const DiagonalProxy<MT>& proxy );
801 template<
typename MT >
802 inline void clear(
const DiagonalProxy<MT>& proxy );
804 template<
typename MT >
805 inline bool isDefault(
const DiagonalProxy<MT>& proxy );
820 template<
typename MT >
840 template<
typename MT >
860 template<
typename MT >
#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
Header file for the AddConst type trait.
Header file for basic type definitions.
Addition of a top level 'const' qualifier.The AddConst type trait adds a top level 'const' qualifier ...
Definition: AddConst.h:69
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Proxy.h:99
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
Access proxy for diagonal matrices.The DiagonalProxy provides controlled access to the elements of a ...
Definition: DiagonalProxy.h:92
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
DiagonalProxy & operator=(const DiagonalProxy &dp)
Copy assignment operator for DiagonalProxy.
Definition: DiagonalProxy.h:228
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
Constraint on the data type.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Constraint on the data type.
AddConst< typename MT::Reference >::Type ReferenceType
Reference type of the underlying matrix type.
Definition: DiagonalProxy.h:97
Addition of a top level reference.In case the given type T is not a reference type, the AddReference type trait adds a top level reference to the given type T. Else the resulting type Type is T.
Definition: AddReference.h:69
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#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.
const bool restricted_
Access flag for the accessed matrix element.
Definition: DiagonalProxy.h:153
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
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
MT::ElementType RepresentedType
Type of the represented matrix element.
Definition: DiagonalProxy.h:103
RawReference get() const
Returning the value of the accessed matrix element.
Definition: DiagonalProxy.h:371
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
Header file for the Proxy class.
Constraint on the data type.
Constraint on the data type.
AddReference< ReferenceType >::Type RawReference
Reference to the represented element.
Definition: DiagonalProxy.h:106
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
ReferenceType value_
Reference to the accessed matrix element.
Definition: DiagonalProxy.h:152
#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.
Constraint on the data type.
Constraint on the data type.
bool isRestricted() const
Returns whether the proxy represents a restricted matrix element..
Definition: DiagonalProxy.h:384
DiagonalProxy(MT &matrix, size_t row, size_t column)
Initialization constructor for a DiagonalProxy.
Definition: DiagonalProxy.h:193
#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
Header file for the AddReference type trait.
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
#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