35 #ifndef _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_ 36 #define _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_ 75 class SparseMatrixProxy :
public SparseMatrix< PT, IsColumnMajorMatrix<MT>::value >
93 enum :
bool { smpAssignable = MT::smpAssignable };
99 inline Reference
operator()(
size_t i,
size_t j )
const;
100 inline Reference
at(
size_t i,
size_t j )
const;
102 inline Iterator
begin (
size_t i )
const;
103 inline ConstIterator
cbegin(
size_t i )
const;
104 inline Iterator
end (
size_t i )
const;
105 inline ConstIterator
cend (
size_t i )
const;
112 inline size_t rows()
const;
115 inline size_t capacity(
size_t i )
const;
117 inline size_t nonZeros(
size_t i )
const;
118 inline void reset()
const;
119 inline void reset(
size_t i )
const;
120 inline void clear()
const;
121 inline void finalize(
size_t i )
const;
122 inline void resize(
size_t m,
size_t n,
bool preserve=
true )
const;
123 inline void reserve(
size_t n )
const;
124 inline void reserve(
size_t i,
size_t n )
const;
125 inline void trim()
const;
126 inline void trim(
size_t i )
const;
133 inline Iterator
set (
size_t i,
size_t j,
const ElementType& value )
const;
134 inline Iterator
insert(
size_t i,
size_t j,
const ElementType& value )
const;
135 inline void append(
size_t i,
size_t j,
const ElementType& value,
bool check=
false )
const;
142 inline void erase(
size_t i,
size_t j )
const;
143 inline Iterator
erase(
size_t i, Iterator pos )
const;
144 inline Iterator
erase(
size_t i, Iterator first, Iterator last )
const;
146 template<
typename Pred >
147 inline void erase( Pred predicate );
149 template<
typename Pred >
150 inline void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
157 inline Iterator
find (
size_t i,
size_t j )
const;
158 inline Iterator
lowerBound(
size_t i,
size_t j )
const;
159 inline Iterator
upperBound(
size_t i,
size_t j )
const;
169 template<
typename Other >
inline void scale(
const Other& scalar )
const;
205 template<
typename PT
210 if( (~*
this).isRestricted() ) {
214 return (~*
this).get()(i,j);
233 template<
typename PT
238 if( (~*
this).isRestricted() ) {
242 return (~*
this).get().at(i,j);
258 template<
typename PT
263 return (~*
this).get().begin(i);
279 template<
typename PT
284 return (~*
this).get().cbegin(i);
300 template<
typename PT
305 return (~*
this).get().end(i);
321 template<
typename PT
326 return (~*
this).get().cend(i);
344 template<
typename PT
348 return (~*
this).get().rows();
358 template<
typename PT
362 return (~*
this).get().columns();
372 template<
typename PT
376 return (~*
this).get().capacity();
392 template<
typename PT
396 return (~*
this).get().capacity(i);
406 template<
typename PT
410 return (~*
this).get().nonZeros();
426 template<
typename PT
430 return (~*
this).get().nonZeros(i);
442 template<
typename PT
448 reset( (~*
this).
get() );
464 template<
typename PT
470 reset( (~*
this).
get(), i );
482 template<
typename PT
488 clear( (~*
this).
get() );
507 template<
typename PT
512 if( (~*
this).isRestricted() ) {
516 return (~*
this).get().set( i, j, value );
535 template<
typename PT
540 if( (~*
this).isRestricted() ) {
544 return (~*
this).get().insert( i, j, value );
576 template<
typename PT
580 if( (~*
this).isRestricted() ) {
584 (~*
this).
get().append( i, j, value, check );
603 template<
typename PT
607 if( (~*
this).isRestricted() ) {
611 (~*
this).
get().finalize( i );
632 template<
typename PT
636 if( (~*
this).isRestricted() ) {
640 (~*
this).
get().resize( m, n, preserve );
656 template<
typename PT
660 if( (~*
this).isRestricted() ) {
664 (~*
this).
get().reserve( n );
684 template<
typename PT
688 if( (~*
this).isRestricted() ) {
692 (~*
this).
get().reserve( i, n );
708 template<
typename PT
712 if( (~*
this).isRestricted() ) {
716 (~*
this).
get().trim();
733 template<
typename PT
737 if( (~*
this).isRestricted() ) {
741 (~*
this).
get().trim( i );
752 template<
typename PT
756 if( (~*
this).isRestricted() ) {
760 (~*
this).
get().transpose();
771 template<
typename PT
775 if( (~*
this).isRestricted() ) {
779 (~*
this).
get().ctranspose();
791 template<
typename PT
793 template<
typename Other >
796 if( (~*
this).isRestricted() ) {
800 (~*
this).
get().scale( scalar );
823 template<
typename PT
827 if( (~*
this).isRestricted() ) {
831 (~*
this).
get().erase( i, j );
848 template<
typename PT
853 if( (~*
this).isRestricted() ) {
857 return (~*
this).get().erase( i, pos );
875 template<
typename PT
880 if( (~*
this).isRestricted() ) {
884 return (~*
this).get().erase( i, first, last );
902 template<
typename PT
904 template<
typename Pred >
907 if( (~*
this).isRestricted() ) {
911 (~*
this).
get().erase( predicate );
934 template<
typename PT
936 template<
typename Pred >
939 if( (~*
this).isRestricted() ) {
943 (~*
this).
get().erase( i, first, last, predicate );
971 template<
typename PT
976 return (~*
this).get().find( i, j );
996 template<
typename PT
1001 return (~*
this).get().lowerBound( i, j );
1021 template<
typename PT
1026 return (~*
this).get().upperBound( i, j );
1042 template<
typename PT,
typename MT >
1046 template<
typename PT,
typename MT >
1050 template<
typename PT,
typename MT >
1054 template<
typename PT,
typename MT >
1058 template<
typename PT,
typename MT >
1061 template<
typename PT,
typename MT >
1064 template<
typename PT,
typename MT >
1067 template<
typename PT,
typename MT >
1070 template<
typename PT,
typename MT >
1073 template<
typename PT,
typename MT >
1076 template<
typename PT,
typename MT >
1079 template<
typename PT,
typename MT >
1082 template<
typename PT,
typename MT >
1085 template<
typename PT,
typename MT >
1104 template<
typename PT
1109 return proxy.begin(i);
1127 template<
typename PT
1132 return proxy.cbegin(i);
1151 template<
typename PT
1156 return proxy.end(i);
1175 template<
typename PT
1180 return proxy.cend(i);
1192 template<
typename PT
1196 return proxy.rows();
1208 template<
typename PT
1212 return proxy.columns();
1224 template<
typename PT
1228 return proxy.capacity();
1246 template<
typename PT
1250 return proxy.capacity(i);
1262 template<
typename PT
1266 return proxy.nonZeros();
1284 template<
typename PT
1288 return proxy.nonZeros(i);
1306 template<
typename PT
1311 proxy.resize( m, n, preserve );
1331 template<
typename PT
1340 proxy.resize( m, preserve );
1362 template<
typename PT
1366 resize_backend( proxy, m, n, preserve );
1380 template<
typename PT
1402 template<
typename PT
1420 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:374
Header file for auxiliary alias declarations.
Iterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:974
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:261
Header file for basic type definitions.
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: SparseMatrixProxy.h:79
ConstReference_< MT > ConstReference
Reference to a constant matrix value.
Definition: SparseMatrixProxy.h:86
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: SparseMatrixProxy.h:408
void trim() const
Removing all excessive capacity from all rows/columns.
Definition: SparseMatrixProxy.h:710
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:533
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
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:578
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:282
void resize(size_t m, size_t n, bool preserve=true) const
Changing the size of the represented matrix.
Definition: SparseMatrixProxy.h:634
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
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:754
void scale(const Other &scalar) const
Scaling of the sparse matrix by the scalar value scalar ( ).
Definition: SparseMatrixProxy.h:794
CompositeType_< MT > CompositeType
Data type for composite expression templates.
Definition: SparseMatrixProxy.h:84
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:360
Header file for the DisableIf class template.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#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:510
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
void reset() const
Reset to the default initial value.
Definition: SparseMatrixProxy.h:444
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SparseMatrixProxy.h:83
Iterator insert(size_t i, size_t j, const ElementType &value) const
Inserting an element into the represented sparse matrix.
Definition: SparseMatrixProxy.h:538
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:236
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:484
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:283
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SparseMatrixProxy.h:81
Reference_< MT > Reference
Reference to a non-constant matrix value.
Definition: SparseMatrixProxy.h:85
ElementType_< MT > ElementType
Type of the sparse matrix elements.
Definition: SparseMatrixProxy.h:82
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:303
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: SparseMatrixProxy.h:208
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:324
void finalize(size_t i) const
Finalizing the element insertion of a row/column.
Definition: SparseMatrixProxy.h:605
void erase(size_t i, size_t j) const
Erasing an element from the sparse matrix.
Definition: SparseMatrixProxy.h:825
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:658
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
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:1024
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SparseMatrixProxy.h:80
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
Iterator_< MT > Iterator
Iterator over non-constant elements.
Definition: SparseMatrixProxy.h:87
ConstIterator_< MT > ConstIterator
Iterator over constant elements.
Definition: SparseMatrixProxy.h:88
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:346
void ctranspose() const
In-place conjugate transpose of the represented matrix.
Definition: SparseMatrixProxy.h:773
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
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:999