SparseMatrixProxy.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_
36 #define _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
46 #include <blaze/math/shims/Clear.h>
47 #include <blaze/math/shims/Reset.h>
49 #include <blaze/system/Inline.h>
50 #include <blaze/util/Types.h>
51 
52 
53 namespace blaze {
54 
55 //=================================================================================================
56 //
57 // CLASS DEFINITION
58 //
59 //=================================================================================================
60 
61 //*************************************************************************************************
69 template< typename PT // Type of the proxy
70  , typename MT > // Type of the sparse matrix
71 class SparseMatrixProxy : public SparseMatrix< PT, IsColumnMajorMatrix<MT>::value >
72 {
73  public:
74  //**Type definitions****************************************************************************
75  typedef typename MT::ElementType ElementType;
76  typedef typename MT::Reference Reference;
78  typedef typename MT::Iterator Iterator;
79  typedef typename MT::ConstIterator ConstIterator;
80  //**********************************************************************************************
81 
82  //**Data access functions***********************************************************************
85  inline Reference operator()( size_t i, size_t j ) const;
86 
87  inline Iterator begin ( size_t i ) const;
88  inline ConstIterator cbegin( size_t i ) const;
89  inline Iterator end ( size_t i ) const;
90  inline ConstIterator cend ( size_t i ) const;
92  //**********************************************************************************************
93 
94  //**Utility functions***************************************************************************
97  inline size_t rows() const;
98  inline size_t columns() const;
99  inline size_t capacity() const;
100  inline size_t capacity( size_t i ) const;
101  inline size_t nonZeros() const;
102  inline size_t nonZeros( size_t i ) const;
103  inline void reset() const;
104  inline void reset( size_t i ) const;
105  inline void clear() const;
106  inline Iterator set( size_t i, size_t j, const ElementType& value ) const;
107  inline Iterator insert( size_t i, size_t j, const ElementType& value ) const;
108  inline void append( size_t i, size_t j, const ElementType& value, bool check=false ) const;
109  inline void finalize( size_t i ) const;
110  inline void erase( size_t i, size_t j ) const;
111  inline Iterator erase( size_t i, Iterator pos ) const;
112  inline Iterator erase( size_t i, Iterator first, Iterator last ) const;
113  inline void resize( size_t m, size_t n, bool preserve=true ) const;
114  inline void reserve( size_t n ) const;
115  inline void reserve( size_t i, size_t n ) const;
116  inline void trim() const;
117  inline void trim( size_t i ) const;
118  inline void transpose() const;
119 
120  template< typename Other > inline void scale( const Other& scalar ) const;
122  //**********************************************************************************************
123 
124  //**Lookup functions****************************************************************************
127  inline Iterator find ( size_t i, size_t j ) const;
128  inline Iterator lowerBound( size_t i, size_t j ) const;
129  inline Iterator upperBound( size_t i, size_t j ) const;
131  //**********************************************************************************************
132 
133  private:
134  //**Compile time checks*************************************************************************
138  //**********************************************************************************************
139 };
140 //*************************************************************************************************
141 
142 
143 
144 
145 //=================================================================================================
146 //
147 // DATA ACCESS FUNCTIONS
148 //
149 //=================================================================================================
150 
151 //*************************************************************************************************
158 template< typename PT // Type of the proxy
159  , typename MT > // Type of the sparse matrix
161  SparseMatrixProxy<PT,MT>::operator()( size_t i, size_t j ) const
162 {
163  if( (~*this).isRestricted() )
164  throw std::invalid_argument( "Invalid access to restricted element" );
165 
166  return (~*this).get()(i,j);
167 }
168 //*************************************************************************************************
169 
170 
171 //*************************************************************************************************
182 template< typename PT // Type of the proxy
183  , typename MT > // Type of the sparse matrix
186 {
187  return (~*this).get().begin(i);
188 }
189 //*************************************************************************************************
190 
191 
192 //*************************************************************************************************
203 template< typename PT // Type of the proxy
204  , typename MT > // Type of the sparse matrix
207 {
208  return (~*this).get().cbegin(i);
209 }
210 //*************************************************************************************************
211 
212 
213 //*************************************************************************************************
224 template< typename PT // Type of the proxy
225  , typename MT > // Type of the sparse matrix
228 {
229  return (~*this).get().end(i);
230 }
231 //*************************************************************************************************
232 
233 
234 //*************************************************************************************************
245 template< typename PT // Type of the proxy
246  , typename MT > // Type of the sparse matrix
249 {
250  return (~*this).get().cend(i);
251 }
252 //*************************************************************************************************
253 
254 
255 
256 
257 //=================================================================================================
258 //
259 // UTILITY FUNCTIONS
260 //
261 //=================================================================================================
262 
263 //*************************************************************************************************
268 template< typename PT // Type of the proxy
269  , typename MT > // Type of the sparse matrix
270 inline size_t SparseMatrixProxy<PT,MT>::rows() const
271 {
272  return (~*this).get().rows();
273 }
274 //*************************************************************************************************
275 
276 
277 //*************************************************************************************************
282 template< typename PT // Type of the proxy
283  , typename MT > // Type of the sparse matrix
285 {
286  return (~*this).get().columns();
287 }
288 //*************************************************************************************************
289 
290 
291 //*************************************************************************************************
296 template< typename PT // Type of the proxy
297  , typename MT > // Type of the sparse matrix
299 {
300  return (~*this).get().capacity();
301 }
302 //*************************************************************************************************
303 
304 
305 //*************************************************************************************************
316 template< typename PT // Type of the proxy
317  , typename MT > // Type of the sparse matrix
318 inline size_t SparseMatrixProxy<PT,MT>::capacity( size_t i ) const
319 {
320  return (~*this).get().capacity(i);
321 }
322 //*************************************************************************************************
323 
324 
325 //*************************************************************************************************
330 template< typename PT // Type of the proxy
331  , typename MT > // Type of the sparse matrix
333 {
334  return (~*this).get().nonZeros();
335 }
336 //*************************************************************************************************
337 
338 
339 //*************************************************************************************************
350 template< typename PT // Type of the proxy
351  , typename MT > // Type of the sparse matrix
352 inline size_t SparseMatrixProxy<PT,MT>::nonZeros( size_t i ) const
353 {
354  return (~*this).get().nonZeros(i);
355 }
356 //*************************************************************************************************
357 
358 
359 //*************************************************************************************************
366 template< typename PT // Type of the proxy
367  , typename MT > // Type of the sparse matrix
369 {
370  using blaze::reset;
371 
372  reset( (~*this).get() );
373 }
374 //*************************************************************************************************
375 
376 
377 //*************************************************************************************************
388 template< typename PT // Type of the proxy
389  , typename MT > // Type of the sparse matrix
390 inline void SparseMatrixProxy<PT,MT>::reset( size_t i ) const
391 {
392  using blaze::reset;
393 
394  reset( (~*this).get(), i );
395 }
396 //*************************************************************************************************
397 
398 
399 //*************************************************************************************************
406 template< typename PT // Type of the proxy
407  , typename MT > // Type of the sparse matrix
409 {
410  using blaze::clear;
411 
412  clear( (~*this).get() );
413 }
414 //*************************************************************************************************
415 
416 
417 //*************************************************************************************************
430 template< typename PT // Type of the proxy
431  , typename MT > // Type of the sparse matrix
433  SparseMatrixProxy<PT,MT>::set( size_t i, size_t j, const ElementType& value ) const
434 {
435  if( (~*this).isRestricted() )
436  throw std::invalid_argument( "Invalid access to restricted element" );
437 
438  return (~*this).get().set( i, j, value );
439 }
440 //*************************************************************************************************
441 
442 
443 //*************************************************************************************************
456 template< typename PT // Type of the proxy
457  , typename MT > // Type of the sparse matrix
459  SparseMatrixProxy<PT,MT>::insert( size_t i, size_t j, const ElementType& value ) const
460 {
461  if( (~*this).isRestricted() )
462  throw std::invalid_argument( "Invalid access to restricted element" );
463 
464  return (~*this).get().insert( i, j, value );
465 }
466 //*************************************************************************************************
467 
468 
469 //*************************************************************************************************
495 template< typename PT // Type of the proxy
496  , typename MT > // Type of the sparse matrix
497 inline void SparseMatrixProxy<PT,MT>::append( size_t i, size_t j, const ElementType& value, bool check ) const
498 {
499  if( (~*this).isRestricted() )
500  throw std::invalid_argument( "Invalid access to restricted element" );
501 
502  (~*this).get().append( i, j, value, check );
503 }
504 //*************************************************************************************************
505 
506 
507 //*************************************************************************************************
520 template< typename PT // Type of the proxy
521  , typename MT > // Type of the sparse matrix
522 inline void SparseMatrixProxy<PT,MT>::finalize( size_t i ) const
523 {
524  if( (~*this).isRestricted() )
525  throw std::invalid_argument( "Invalid access to restricted element" );
526 
527  (~*this).get().finalize( i );
528 }
529 //*************************************************************************************************
530 
531 
532 //*************************************************************************************************
541 template< typename PT // Type of the proxy
542  , typename MT > // Type of the sparse matrix
543 inline void SparseMatrixProxy<PT,MT>::erase( size_t i, size_t j ) const
544 {
545  if( (~*this).isRestricted() )
546  throw std::invalid_argument( "Invalid access to restricted element" );
547 
548  (~*this).get().erase( i, j );
549 }
550 //*************************************************************************************************
551 
552 
553 //*************************************************************************************************
564 template< typename PT // Type of the proxy
565  , typename MT > // Type of the sparse matrix
568 {
569  if( (~*this).isRestricted() )
570  throw std::invalid_argument( "Invalid access to restricted element" );
571 
572  return (~*this).get().erase( i, pos );
573 }
574 //*************************************************************************************************
575 
576 
577 //*************************************************************************************************
589 template< typename PT // Type of the proxy
590  , typename MT > // Type of the sparse matrix
592  SparseMatrixProxy<PT,MT>::erase( size_t i, Iterator first, Iterator last ) const
593 {
594  if( (~*this).isRestricted() )
595  throw std::invalid_argument( "Invalid access to restricted element" );
596 
597  return (~*this).get().erase( i, first, last );
598 }
599 //*************************************************************************************************
600 
601 
602 //*************************************************************************************************
617 template< typename PT // Type of the proxy
618  , typename MT > // Type of the sparse matrix
619 inline void SparseMatrixProxy<PT,MT>::resize( size_t m, size_t n, bool preserve ) const
620 {
621  if( (~*this).isRestricted() )
622  throw std::invalid_argument( "Invalid access to restricted element" );
623 
624  (~*this).get().resize( m, n, preserve );
625 }
626 //*************************************************************************************************
627 
628 
629 //*************************************************************************************************
639 template< typename PT // Type of the proxy
640  , typename MT > // Type of the sparse matrix
641 inline void SparseMatrixProxy<PT,MT>::reserve( size_t n ) const
642 {
643  if( (~*this).isRestricted() )
644  throw std::invalid_argument( "Invalid access to restricted element" );
645 
646  (~*this).get().reserve( n );
647 }
648 //*************************************************************************************************
649 
650 
651 //*************************************************************************************************
665 template< typename PT // Type of the proxy
666  , typename MT > // Type of the sparse matrix
667 inline void SparseMatrixProxy<PT,MT>::reserve( size_t i, size_t n ) const
668 {
669  if( (~*this).isRestricted() )
670  throw std::invalid_argument( "Invalid access to restricted element" );
671 
672  (~*this).get().reserve( i, n );
673 }
674 //*************************************************************************************************
675 
676 
677 //*************************************************************************************************
687 template< typename PT // Type of the proxy
688  , typename MT > // Type of the sparse matrix
690 {
691  if( (~*this).isRestricted() )
692  throw std::invalid_argument( "Invalid access to restricted element" );
693 
694  (~*this).get().trim();
695 }
696 //*************************************************************************************************
697 
698 
699 //*************************************************************************************************
710 template< typename PT // Type of the proxy
711  , typename MT > // Type of the sparse matrix
712 inline void SparseMatrixProxy<PT,MT>::trim( size_t i ) const
713 {
714  if( (~*this).isRestricted() )
715  throw std::invalid_argument( "Invalid access to restricted element" );
716 
717  (~*this).get().trim( i );
718 }
719 //*************************************************************************************************
720 
721 
722 //*************************************************************************************************
727 template< typename PT // Type of the proxy
728  , typename MT > // Type of the sparse matrix
730 {
731  if( (~*this).isRestricted() )
732  throw std::invalid_argument( "Invalid access to restricted element" );
733 
734  (~*this).get().transpose();
735 }
736 //*************************************************************************************************
737 
738 
739 //*************************************************************************************************
745 template< typename PT // Type of the proxy
746  , typename MT > // Type of the sparse matrix
747 template< typename Other > // Data type of the scalar value
748 inline void SparseMatrixProxy<PT,MT>::scale( const Other& scalar ) const
749 {
750  if( (~*this).isRestricted() )
751  throw std::invalid_argument( "Invalid access to restricted element" );
752 
753  (~*this).get().scale( scalar );
754 }
755 //*************************************************************************************************
756 
757 
758 
759 
760 //=================================================================================================
761 //
762 // LOOKUP FUNCTIONS
763 //
764 //=================================================================================================
765 
766 //*************************************************************************************************
781 template< typename PT // Type of the proxy
782  , typename MT > // Type of the sparse matrix
784  SparseMatrixProxy<PT,MT>::find( size_t i, size_t j ) const
785 {
786  return (~*this).get().find( i, j );
787 }
788 //*************************************************************************************************
789 
790 
791 //*************************************************************************************************
806 template< typename PT // Type of the proxy
807  , typename MT > // Type of the sparse matrix
809  SparseMatrixProxy<PT,MT>::lowerBound( size_t i, size_t j ) const
810 {
811  return (~*this).get().lowerBound( i, j );
812 }
813 //*************************************************************************************************
814 
815 
816 //*************************************************************************************************
831 template< typename PT // Type of the proxy
832  , typename MT > // Type of the sparse matrix
834  SparseMatrixProxy<PT,MT>::upperBound( size_t i, size_t j ) const
835 {
836  return (~*this).get().upperBound( i, j );
837 }
838 //*************************************************************************************************
839 
840 
841 
842 
843 //=================================================================================================
844 //
845 // GLOBAL FUNCTIONS
846 //
847 //=================================================================================================
848 
849 //*************************************************************************************************
852 template< typename PT, typename MT >
854  begin( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
855 
856 template< typename PT, typename MT >
858  cbegin( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
859 
860 template< typename PT, typename MT >
862  end( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
863 
864 template< typename PT, typename MT >
866  cend( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
867 
868 template< typename PT, typename MT >
869 BLAZE_ALWAYS_INLINE size_t rows( const SparseMatrixProxy<PT,MT>& proxy );
870 
871 template< typename PT, typename MT >
873 
874 template< typename PT, typename MT >
876 
877 template< typename PT, typename MT >
878 BLAZE_ALWAYS_INLINE size_t capacity( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
879 
880 template< typename PT, typename MT >
882 
883 template< typename PT, typename MT >
884 BLAZE_ALWAYS_INLINE size_t nonZeros( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
885 
886 template< typename PT, typename MT >
888 
889 template< typename PT, typename MT >
890 BLAZE_ALWAYS_INLINE void reset( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
891 
892 template< typename PT, typename MT >
895 //*************************************************************************************************
896 
897 
898 //*************************************************************************************************
911 template< typename PT // Type of the proxy
912  , typename MT > // Type of the sparse matrix
914  begin( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
915 {
916  return proxy.begin(i);
917 }
918 //*************************************************************************************************
919 
920 
921 //*************************************************************************************************
934 template< typename PT // Type of the proxy
935  , typename MT > // Type of the sparse matrix
937  cbegin( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
938 {
939  return proxy.cbegin(i);
940 }
941 //*************************************************************************************************
942 
943 
944 //*************************************************************************************************
958 template< typename PT // Type of the proxy
959  , typename MT > // Type of the sparse matrix
961  end( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
962 {
963  return proxy.end(i);
964 }
965 //*************************************************************************************************
966 
967 
968 //*************************************************************************************************
982 template< typename PT // Type of the proxy
983  , typename MT > // Type of the sparse matrix
985  cend( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
986 {
987  return proxy.cend(i);
988 }
989 //*************************************************************************************************
990 
991 
992 //*************************************************************************************************
999 template< typename PT // Type of the proxy
1000  , typename MT > // Type of the sparse matrix
1002 {
1003  return proxy.rows();
1004 }
1005 //*************************************************************************************************
1006 
1007 
1008 //*************************************************************************************************
1015 template< typename PT // Type of the proxy
1016  , typename MT > // Type of the sparse matrix
1018 {
1019  return proxy.columns();
1020 }
1021 //*************************************************************************************************
1022 
1023 
1024 //*************************************************************************************************
1031 template< typename PT // Type of the proxy
1032  , typename MT > // Type of the sparse matrix
1034 {
1035  return proxy.capacity();
1036 }
1037 //*************************************************************************************************
1038 
1039 
1040 //*************************************************************************************************
1053 template< typename PT // Type of the proxy
1054  , typename MT > // Type of the sparse matrix
1056 {
1057  return proxy.capacity(i);
1058 }
1059 //*************************************************************************************************
1060 
1061 
1062 //*************************************************************************************************
1069 template< typename PT // Type of the proxy
1070  , typename MT > // Type of the sparse matrix
1072 {
1073  return proxy.nonZeros();
1074 }
1075 //*************************************************************************************************
1076 
1077 
1078 //*************************************************************************************************
1091 template< typename PT // Type of the proxy
1092  , typename MT > // Type of the sparse matrix
1094 {
1095  return proxy.nonZeros(i);
1096 }
1097 //*************************************************************************************************
1098 
1099 
1100 //*************************************************************************************************
1109 template< typename PT // Type of the proxy
1110  , typename MT > // Type of the sparse matrix
1112 {
1113  proxy.reset();
1114 }
1115 //*************************************************************************************************
1116 
1117 
1118 //*************************************************************************************************
1131 template< typename PT // Type of the proxy
1132  , typename MT > // Type of the sparse matrix
1134 {
1135  proxy.reset(i);
1136 }
1137 //*************************************************************************************************
1138 
1139 
1140 //*************************************************************************************************
1149 template< typename PT // Type of the proxy
1150  , typename MT > // Type of the sparse matrix
1152 {
1153  proxy.clear();
1154 }
1155 //*************************************************************************************************
1156 
1157 } // namespace blaze
1158 
1159 #endif
Iterator set(size_t i, size_t j, const ElementType &value) const
Setting an element of the represented sparse matrix.
Definition: SparseMatrixProxy.h:433
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:497
Header file for basic type definitions.
Iterator insert(size_t i, size_t j, const ElementType &value) const
Inserting an element into the represented sparse matrix.
Definition: SparseMatrixProxy.h:459
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: SparseMatrixProxy.h:332
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:237
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:300
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
MT::Iterator Iterator
Iterator over non-constant elements.
Definition: SparseMatrixProxy.h:78
void reset() const
Reset to the default initial value.
Definition: SparseMatrixProxy.h:368
void erase(size_t i, size_t j) const
Erasing an element from the sparse matrix.
Definition: SparseMatrixProxy.h:543
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:821
Iterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SparseMatrixProxy.h:834
size_t capacity() const
Returns the maximum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:298
void transpose() const
Transposing the represented matrix.
Definition: SparseMatrixProxy.h:729
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
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:248
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:386
void finalize(size_t i) const
Finalizing the element insertion of a row/column.
Definition: SparseMatrixProxy.h:522
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:809
MT::Reference Reference
Reference to a non-constant matrix value.
Definition: SparseMatrixProxy.h:76
Iterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:784
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
Header file for the SparseMatrix base class.
Constraint on the data type.
void trim() const
Removing all excessive capacity from all rows/columns.
Definition: SparseMatrixProxy.h:689
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:185
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:641
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
MT::ConstReference ConstReference
Reference to a constant matrix value.
Definition: SparseMatrixProxy.h:77
MT::ElementType ElementType
Type of the sparse matrix elements.
Definition: SparseMatrixProxy.h:75
void scale(const Other &scalar) const
Scaling of the sparse matrix by the scalar value scalar ( ).
Definition: SparseMatrixProxy.h:748
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
Proxy backend for sparse matrix types.The SparseMatrixProxy class serves as a backend for the Proxy c...
Definition: SparseMatrixProxy.h:71
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:206
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
void clear() const
Clearing the represented vector.
Definition: SparseMatrixProxy.h:408
size_t columns() const
Returns the current number of columns of the represented matrix.
Definition: SparseMatrixProxy.h:284
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: SparseMatrixProxy.h:79
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: SparseMatrixProxy.h:161
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:227
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:270
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
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:79
void resize(size_t m, size_t n, bool preserve=true) const
Changing the size of the represented matrix.
Definition: SparseMatrixProxy.h:619