35 #ifndef _BLAZE_MATH_SPARSE_MATRIXACCESSPROXY_H_
36 #define _BLAZE_MATH_SPARSE_MATRIXACCESSPROXY_H_
94 template<
typename MT >
129 template<
typename T >
inline const MatrixAccessProxy& operator+=(
const T& value )
const;
130 template<
typename T >
inline const MatrixAccessProxy& operator-=(
const T& value )
const;
131 template<
typename T >
inline const MatrixAccessProxy& operator*=(
const T& value )
const;
132 template<
typename T >
inline const MatrixAccessProxy& operator/=(
const T& value )
const;
139 inline RawReference
get()
const;
192 template<
typename MT >
199 const size_t index( rmm ?
i_ :
j_ );
200 if( element ==
sm_.end(index) )
211 template<
typename MT >
233 template<
typename MT >
236 const typename MT::Iterator element( sm_.find( i_, j_ ) );
237 const size_t index( rmm ? i_ : j_ );
238 if( element != sm_.end( index ) &&
isDefault( element->value() ) )
239 sm_.erase( index, element );
258 template<
typename MT >
273 template<
typename MT >
274 template<
typename T >
289 template<
typename MT >
290 template<
typename T >
305 template<
typename MT >
306 template<
typename T >
321 template<
typename MT >
322 template<
typename T >
337 template<
typename MT >
338 template<
typename T >
360 template<
typename MT >
363 const typename MT::Iterator element( sm_.find( i_, j_ ) );
365 return element->value();
375 template<
typename MT >
396 template<
typename MT >
415 template<
typename MT1,
typename MT2 >
418 template<
typename MT,
typename T >
421 template<
typename T,
typename MT >
424 template<
typename MT1,
typename MT2 >
427 template<
typename MT,
typename T >
430 template<
typename T,
typename MT >
433 template<
typename MT1,
typename MT2 >
436 template<
typename MT,
typename T >
437 inline bool operator<( const MatrixAccessProxy<MT>& lhs,
const T& rhs );
439 template<
typename T,
typename MT >
440 inline bool operator<( const T& lhs, const MatrixAccessProxy<MT>& rhs );
442 template<
typename MT1,
typename MT2 >
445 template<
typename MT,
typename T >
448 template<
typename T,
typename MT >
451 template<
typename MT1,
typename MT2 >
454 template<
typename MT,
typename T >
455 inline bool operator<=( const MatrixAccessProxy<MT>& lhs,
const T& rhs );
457 template<
typename T,
typename MT >
458 inline bool operator<=( const T& lhs, const MatrixAccessProxy<MT>& rhs );
460 template<
typename MT1,
typename MT2 >
463 template<
typename MT,
typename T >
466 template<
typename T,
typename MT >
469 template<
typename MT >
470 inline std::ostream& operator<<( std::ostream& os, const MatrixAccessProxy<MT>& proxy );
483 template<
typename MT1,
typename MT2 >
486 return ( lhs.
get() == rhs.
get() );
499 template<
typename MT,
typename T >
502 return ( lhs.
get() == rhs );
515 template<
typename T,
typename MT >
518 return ( lhs == rhs.
get() );
531 template<
typename MT1,
typename MT2 >
534 return ( lhs.
get() != rhs.
get() );
547 template<
typename MT,
typename T >
550 return ( lhs.
get() != rhs );
563 template<
typename T,
typename MT >
566 return ( lhs != rhs.
get() );
579 template<
typename MT1,
typename MT2 >
582 return ( lhs.get() < rhs.get() );
595 template<
typename MT,
typename T >
596 inline bool operator<( const MatrixAccessProxy<MT>& lhs,
const T& rhs )
598 return ( lhs.get() < rhs );
611 template<
typename T,
typename MT >
612 inline bool operator<( const T& lhs, const MatrixAccessProxy<MT>& rhs )
614 return ( lhs < rhs.get() );
627 template<
typename MT1,
typename MT2 >
630 return ( lhs.
get() > rhs.
get() );
643 template<
typename MT,
typename T >
646 return ( lhs.
get() > rhs );
659 template<
typename T,
typename MT >
662 return ( lhs > rhs.
get() );
675 template<
typename MT1,
typename MT2 >
678 return ( lhs.get() <= rhs.get() );
691 template<
typename MT,
typename T >
692 inline bool operator<=( const MatrixAccessProxy<MT>& lhs,
const T& rhs )
694 return ( lhs.get() <= rhs );
707 template<
typename T,
typename MT >
708 inline bool operator<=( const T& lhs, const MatrixAccessProxy<MT>& rhs )
710 return ( lhs <= rhs.get() );
723 template<
typename MT1,
typename MT2 >
726 return ( lhs.
get() >= rhs.
get() );
739 template<
typename MT,
typename T >
742 return ( lhs.
get() >= rhs );
755 template<
typename T,
typename MT >
758 return ( lhs >= rhs.
get() );
771 template<
typename MT >
772 inline std::ostream& operator<<( std::ostream& os, const MatrixAccessProxy<MT>& proxy )
774 return os << proxy.get();
790 template<
typename MT >
791 inline void reset(
const MatrixAccessProxy<MT>& proxy );
793 template<
typename MT >
794 inline void clear(
const MatrixAccessProxy<MT>& proxy );
796 template<
typename MT >
797 inline bool isDefault(
const MatrixAccessProxy<MT>& proxy );
799 template<
typename MT >
800 inline void swap(
const MatrixAccessProxy<MT>& a,
const MatrixAccessProxy<MT>& b ) ;
802 template<
typename MT,
typename T >
803 inline void swap(
const MatrixAccessProxy<MT>& a, T& b ) ;
805 template<
typename T,
typename MT >
806 inline void swap( T& a,
const MatrixAccessProxy<MT>& v ) ;
823 template<
typename MT >
844 template<
typename MT >
864 template<
typename MT >
883 template<
typename MT >
902 template<
typename MT,
typename T >
921 template<
typename T,
typename MT >
size_t i_
Row-index of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:156
bool isRestricted() const
Returns whether the proxy represents a restricted sparse matrix element..
Definition: MatrixAccessProxy.h:376
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: Proxy.h:99
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
void * operator&() const
Address operator (private & undefined)
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
Access proxy for sparse, matrices.The MatrixAccessProxy provides safe access to the elements of a no...
Definition: MatrixAccessProxy.h:95
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
MT::ElementType RepresentedType
Type of the represented sparse matrix element.
Definition: MatrixAccessProxy.h:105
Constraint on the data type.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
const MatrixAccessProxy & operator=(const MatrixAccessProxy &map) const
Copy assignment operator for MatrixAccessProxy.
Definition: MatrixAccessProxy.h:259
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:104
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4807
MatrixAccessProxy(MT &sm, size_t i, size_t j)
Initialization constructor for a MatrixAccessProxy.
Definition: MatrixAccessProxy.h:193
RawReference get() const
Returning the value of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:361
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
~MatrixAccessProxy()
The destructor for MatrixAccessProxy.
Definition: MatrixAccessProxy.h:234
Header file for run time assertion macros.
Header file for the Proxy class.
MT & sm_
Reference to the accessed sparse matrix.
Definition: MatrixAccessProxy.h:155
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
size_t j_
Column-index of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:157
Header file for the IsRowMajorMatrix type trait.
RepresentedType & RawReference
Raw reference to the represented element.
Definition: MatrixAccessProxy.h:106
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
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#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