35 #ifndef _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_ 36 #define _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_ 75 class SparseMatrixProxy
76 :
public SparseMatrix< PT, IsColumnMajorMatrix<MT>::value >
94 enum :
bool { smpAssignable = MT::smpAssignable };
113 inline size_t rows()
const;
116 inline size_t capacity(
size_t i )
const;
118 inline size_t nonZeros(
size_t i )
const;
119 inline void reset()
const;
120 inline void reset(
size_t i )
const;
121 inline void clear()
const;
122 inline void finalize(
size_t i )
const;
123 inline void resize(
size_t m,
size_t n,
bool preserve=
true )
const;
124 inline void reserve(
size_t n )
const;
125 inline void reserve(
size_t i,
size_t n )
const;
126 inline void trim()
const;
127 inline void trim(
size_t i )
const;
136 inline void append(
size_t i,
size_t j,
const ElementType& value,
bool check=
false )
const;
143 inline void erase(
size_t i,
size_t j )
const;
147 template<
typename Pred >
148 inline void erase( Pred predicate );
150 template<
typename Pred >
170 template<
typename Other >
inline void scale(
const Other& scalar )
const;
206 template<
typename PT
211 if( (~*
this).isRestricted() ) {
215 return (~*
this).get()(i,j);
234 template<
typename PT
239 if( (~*
this).isRestricted() ) {
243 return (~*
this).get().at(i,j);
259 template<
typename PT
264 return (~*
this).get().begin(i);
280 template<
typename PT
285 return (~*
this).get().cbegin(i);
301 template<
typename PT
306 return (~*
this).get().end(i);
322 template<
typename PT
327 return (~*
this).get().cend(i);
345 template<
typename PT
349 return (~*
this).get().rows();
359 template<
typename PT
363 return (~*
this).get().columns();
373 template<
typename PT
377 return (~*
this).get().capacity();
393 template<
typename PT
397 return (~*
this).get().capacity(i);
407 template<
typename PT
411 return (~*
this).get().nonZeros();
427 template<
typename PT
431 return (~*
this).get().nonZeros(i);
443 template<
typename PT
449 reset( (~*
this).
get() );
465 template<
typename PT
471 reset( (~*
this).
get(), i );
483 template<
typename PT
489 clear( (~*
this).
get() );
508 template<
typename PT
513 if( (~*
this).isRestricted() ) {
517 return (~*
this).get().set( i, j, value );
536 template<
typename PT
541 if( (~*
this).isRestricted() ) {
545 return (~*
this).get().insert( i, j, value );
577 template<
typename PT
581 if( (~*
this).isRestricted() ) {
585 (~*
this).
get().append( i, j, value, check );
604 template<
typename PT
608 if( (~*
this).isRestricted() ) {
612 (~*
this).
get().finalize( i );
633 template<
typename PT
637 if( (~*
this).isRestricted() ) {
641 (~*
this).
get().resize( m, n, preserve );
657 template<
typename PT
661 if( (~*
this).isRestricted() ) {
665 (~*
this).
get().reserve( n );
685 template<
typename PT
689 if( (~*
this).isRestricted() ) {
693 (~*
this).
get().reserve( i, n );
709 template<
typename PT
713 if( (~*
this).isRestricted() ) {
717 (~*
this).
get().trim();
734 template<
typename PT
738 if( (~*
this).isRestricted() ) {
742 (~*
this).
get().trim( i );
753 template<
typename PT
757 if( (~*
this).isRestricted() ) {
761 (~*
this).
get().transpose();
772 template<
typename PT
776 if( (~*
this).isRestricted() ) {
780 (~*
this).
get().ctranspose();
796 template<
typename PT
798 template<
typename Other >
801 if( (~*
this).isRestricted() ) {
805 (~*
this).
get().scale( scalar );
828 template<
typename PT
832 if( (~*
this).isRestricted() ) {
836 (~*
this).
get().erase( i, j );
853 template<
typename PT
858 if( (~*
this).isRestricted() ) {
862 return (~*
this).get().erase( i, pos );
880 template<
typename PT
885 if( (~*
this).isRestricted() ) {
889 return (~*
this).get().erase( i, first, last );
907 template<
typename PT
909 template<
typename Pred >
912 if( (~*
this).isRestricted() ) {
916 (~*
this).
get().erase( predicate );
939 template<
typename PT
941 template<
typename Pred >
944 if( (~*
this).isRestricted() ) {
948 (~*
this).
get().erase( i, first, last, predicate );
976 template<
typename PT
981 return (~*
this).get().find( i, j );
1001 template<
typename PT
1006 return (~*
this).get().lowerBound( i, j );
1026 template<
typename PT
1031 return (~*
this).get().upperBound( i, j );
1047 template<
typename PT,
typename MT >
1051 template<
typename PT,
typename MT >
1055 template<
typename PT,
typename MT >
1059 template<
typename PT,
typename MT >
1063 template<
typename PT,
typename MT >
1066 template<
typename PT,
typename MT >
1069 template<
typename PT,
typename MT >
1072 template<
typename PT,
typename MT >
1075 template<
typename PT,
typename MT >
1078 template<
typename PT,
typename MT >
1081 template<
typename PT,
typename MT >
1084 template<
typename PT,
typename MT >
1087 template<
typename PT,
typename MT >
1090 template<
typename PT,
typename MT >
1109 template<
typename PT
1114 return proxy.begin(i);
1132 template<
typename PT
1137 return proxy.cbegin(i);
1156 template<
typename PT
1161 return proxy.end(i);
1180 template<
typename PT
1185 return proxy.cend(i);
1197 template<
typename PT
1201 return proxy.rows();
1213 template<
typename PT
1217 return proxy.columns();
1229 template<
typename PT
1233 return proxy.capacity();
1251 template<
typename PT
1255 return proxy.capacity(i);
1267 template<
typename PT
1271 return proxy.nonZeros();
1289 template<
typename PT
1293 return proxy.nonZeros(i);
1311 template<
typename PT
1316 proxy.resize( m, n, preserve );
1336 template<
typename PT
1345 proxy.resize( m, preserve );
1367 template<
typename PT
1371 resize_backend( proxy, m, n, preserve );
1385 template<
typename PT
1407 template<
typename PT
1425 template<
typename PT
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
size_t capacity() const
Returns the maximum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:375
Header file for auxiliary alias declarations.
Iterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:979
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:262
Header file for basic type definitions.
ElementType_< MT > ElementType
Type of the sparse matrix elements.
Definition: SparseMatrixProxy.h:83
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: SparseMatrixProxy.h:409
void trim() const
Removing all excessive capacity from all rows/columns.
Definition: SparseMatrixProxy.h:711
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void append(size_t i, size_t j, const ElementType &value, bool check=false) const
Appending an element to the specified row/column of the sparse matrix.
Definition: SparseMatrixProxy.h:579
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
ConstReference_< MT > ConstReference
Reference to a constant matrix value.
Definition: SparseMatrixProxy.h:87
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:283
void resize(size_t m, size_t n, bool preserve=true) const
Changing the size of the represented matrix.
Definition: SparseMatrixProxy.h:635
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Header file for the SparseMatrix base class.
Header file for the IsSquare type trait.
void transpose() const
In-place transpose of the represented matrix.
Definition: SparseMatrixProxy.h:755
void scale(const Other &scalar) const
Scaling of the sparse matrix by the scalar value scalar ( ).
Definition: SparseMatrixProxy.h:799
Constraint on the data type.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
size_t columns() const
Returns the current number of columns of the represented matrix.
Definition: SparseMatrixProxy.h:361
Header file for the DisableIf class template.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Iterator set(size_t i, size_t j, const ElementType &value) const
Setting an element of the represented sparse matrix.
Definition: SparseMatrixProxy.h:511
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SparseMatrixProxy.h:82
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
CompositeType_< MT > CompositeType
Data type for composite expression templates.
Definition: SparseMatrixProxy.h:85
void reset() const
Reset to the default initial value.
Definition: SparseMatrixProxy.h:445
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: SparseMatrixProxy.h:80
Iterator insert(size_t i, size_t j, const ElementType &value) const
Inserting an element into the represented sparse matrix.
Definition: SparseMatrixProxy.h:539
Header file for the exception macros of the math module.
Reference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SparseMatrixProxy.h:237
Proxy backend for sparse matrix types.The SparseMatrixProxy class serves as a backend for the Proxy c...
Definition: Forward.h:52
void clear() const
Clearing the represented vector.
Definition: SparseMatrixProxy.h:485
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:303
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the reset shim.
Iterator end(size_t i) const
Returns an iterator just past the last element of row/column i of the represented matrix...
Definition: SparseMatrixProxy.h:304
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: SparseMatrixProxy.h:209
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i of the represented matrix...
Definition: SparseMatrixProxy.h:325
void finalize(size_t i) const
Finalizing the element insertion of a row/column.
Definition: SparseMatrixProxy.h:606
void erase(size_t i, size_t j) const
Erasing an element from the sparse matrix.
Definition: SparseMatrixProxy.h:830
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:659
Iterator_< MT > Iterator
Iterator over non-constant elements.
Definition: SparseMatrixProxy.h:88
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
Iterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SparseMatrixProxy.h:1029
typename T::ConstReference ConstReference_
Alias declaration for nested ConstReference type definitions.The ConstReference_ alias declaration pr...
Definition: Aliases.h:143
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Reference_< MT > Reference
Reference to a non-constant matrix value.
Definition: SparseMatrixProxy.h:86
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SparseMatrixProxy.h:84
ConstIterator_< MT > ConstIterator
Iterator over constant elements.
Definition: SparseMatrixProxy.h:89
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:347
void ctranspose() const
In-place conjugate transpose of the represented matrix.
Definition: SparseMatrixProxy.h:774
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SparseMatrixProxy.h:81
System settings for the inline keywords.
#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:61
Iterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SparseMatrixProxy.h:1004