35 #ifndef _BLAZE_MATH_SPARSE_MATRIXACCESSPROXY_H_
36 #define _BLAZE_MATH_SPARSE_MATRIXACCESSPROXY_H_
94 template<
typename MT >
191 template<
typename MT >
198 const size_t index( rmm ?
i_ :
j_ );
199 if( element ==
sm_.end(index) )
210 template<
typename MT >
232 template<
typename MT >
235 const typename MT::Iterator element( sm_.find( i_, j_ ) );
236 const size_t index( rmm ? i_ : j_ );
237 if( element != sm_.end( index ) &&
isDefault( element->value() ) )
238 sm_.erase( index, element );
257 template<
typename MT >
272 template<
typename MT >
273 template<
typename T >
288 template<
typename MT >
289 template<
typename T >
304 template<
typename MT >
305 template<
typename T >
320 template<
typename MT >
321 template<
typename T >
336 template<
typename MT >
337 template<
typename T >
359 template<
typename MT >
362 const typename MT::Iterator element( sm_.find( i_, j_ ) );
364 return element->value();
382 template<
typename MT >
401 template<
typename MT1,
typename MT2 >
404 template<
typename MT,
typename T >
407 template<
typename T,
typename MT >
410 template<
typename MT1,
typename MT2 >
413 template<
typename MT,
typename T >
416 template<
typename T,
typename MT >
419 template<
typename MT1,
typename MT2 >
422 template<
typename MT,
typename T >
423 inline bool operator<( const MatrixAccessProxy<MT>& lhs,
const T& rhs );
425 template<
typename T,
typename MT >
426 inline bool operator<( const T& lhs, const MatrixAccessProxy<MT>& rhs );
428 template<
typename MT1,
typename MT2 >
431 template<
typename MT,
typename T >
434 template<
typename T,
typename MT >
437 template<
typename MT1,
typename MT2 >
440 template<
typename MT,
typename T >
441 inline bool operator<=( const MatrixAccessProxy<MT>& lhs,
const T& rhs );
443 template<
typename T,
typename MT >
444 inline bool operator<=( const T& lhs, const MatrixAccessProxy<MT>& rhs );
446 template<
typename MT1,
typename MT2 >
449 template<
typename MT,
typename T >
452 template<
typename T,
typename MT >
455 template<
typename MT >
456 inline std::ostream& operator<<( std::ostream& os, const MatrixAccessProxy<MT>& proxy );
469 template<
typename MT1,
typename MT2 >
472 return ( lhs.
get() == rhs.
get() );
485 template<
typename MT,
typename T >
488 return ( lhs.
get() == rhs );
501 template<
typename T,
typename MT >
504 return ( lhs == rhs.
get() );
517 template<
typename MT1,
typename MT2 >
520 return ( lhs.
get() != rhs.
get() );
533 template<
typename MT,
typename T >
536 return ( lhs.
get() != rhs );
549 template<
typename T,
typename MT >
552 return ( lhs != rhs.
get() );
565 template<
typename MT1,
typename MT2 >
568 return ( lhs.get() < rhs.get() );
581 template<
typename MT,
typename T >
582 inline bool operator<( const MatrixAccessProxy<MT>& lhs,
const T& rhs )
584 return ( lhs.get() < rhs );
597 template<
typename T,
typename MT >
598 inline bool operator<( const T& lhs, const MatrixAccessProxy<MT>& rhs )
600 return ( lhs < rhs.get() );
613 template<
typename MT1,
typename MT2 >
616 return ( lhs.
get() > rhs.
get() );
629 template<
typename MT,
typename T >
632 return ( lhs.
get() > rhs );
645 template<
typename T,
typename MT >
648 return ( lhs > rhs.
get() );
661 template<
typename MT1,
typename MT2 >
664 return ( lhs.get() <= rhs.get() );
677 template<
typename MT,
typename T >
678 inline bool operator<=( const MatrixAccessProxy<MT>& lhs,
const T& rhs )
680 return ( lhs.get() <= rhs );
693 template<
typename T,
typename MT >
694 inline bool operator<=( const T& lhs, const MatrixAccessProxy<MT>& rhs )
696 return ( lhs <= rhs.get() );
709 template<
typename MT1,
typename MT2 >
712 return ( lhs.
get() >= rhs.
get() );
725 template<
typename MT,
typename T >
728 return ( lhs.
get() >= rhs );
741 template<
typename T,
typename MT >
744 return ( lhs >= rhs.
get() );
757 template<
typename MT >
758 inline std::ostream& operator<<( std::ostream& os, const MatrixAccessProxy<MT>& proxy )
760 return os << proxy.get();
776 template<
typename MT >
777 inline void reset(
const MatrixAccessProxy<MT>& proxy );
779 template<
typename MT >
780 inline void clear(
const MatrixAccessProxy<MT>& proxy );
782 template<
typename MT >
783 inline bool isDefault(
const MatrixAccessProxy<MT>& proxy );
785 template<
typename MT >
786 inline void swap(
const MatrixAccessProxy<MT>& a,
const MatrixAccessProxy<MT>& b ) ;
788 template<
typename MT,
typename T >
789 inline void swap(
const MatrixAccessProxy<MT>& a, T& b ) ;
791 template<
typename T,
typename MT >
792 inline void swap( T& a,
const MatrixAccessProxy<MT>& v ) ;
809 template<
typename MT >
830 template<
typename MT >
850 template<
typename MT >
869 template<
typename MT >
888 template<
typename MT,
typename T >
907 template<
typename T,
typename MT >
size_t i_
Row-index of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:155
void swap(SymmetricMatrix< MT, SO, DF, NF > &a, SymmetricMatrix< MT, SO, DF, NF > &b)
Swapping the contents of two matrices.
Definition: SymmetricMatrix.h:195
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Proxy.h:99
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
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.
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:4754
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
MatrixAccessProxy(MT &sm, size_t i, size_t j)
Initialization constructor for a MatrixAccessProxy.
Definition: MatrixAccessProxy.h:192
RawReference get() const
Returning the value of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:360
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
MatrixAccessProxy & operator=(const MatrixAccessProxy &map)
Copy assignment operator for MatrixAccessProxy.
Definition: MatrixAccessProxy.h:258
~MatrixAccessProxy()
The destructor for MatrixAccessProxy.
Definition: MatrixAccessProxy.h:233
Header file for run time assertion macros.
Header file for the Proxy class.
MT & sm_
Reference to the accessed sparse matrix.
Definition: MatrixAccessProxy.h:154
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
size_t j_
Column-index of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:156
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
Header file for basic type definitions.
#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