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 
45 #include <blaze/math/shims/Clear.h>
46 #include <blaze/math/shims/Reset.h>
49 #include <blaze/system/Inline.h>
50 #include <blaze/util/DisableIf.h>
51 #include <blaze/util/EnableIf.h>
52 #include <blaze/util/Exception.h>
53 #include <blaze/util/Types.h>
54 
55 
56 namespace blaze {
57 
58 //=================================================================================================
59 //
60 // CLASS DEFINITION
61 //
62 //=================================================================================================
63 
64 //*************************************************************************************************
72 template< typename PT // Type of the proxy
73  , typename MT > // Type of the sparse matrix
74 class SparseMatrixProxy : public SparseMatrix< PT, IsColumnMajorMatrix<MT>::value >
75 {
76  public:
77  //**Type definitions****************************************************************************
78  typedef typename MT::ResultType ResultType;
79  typedef typename MT::OppositeType OppositeType;
80  typedef typename MT::TransposeType TransposeType;
81  typedef typename MT::ElementType ElementType;
82  typedef typename MT::ReturnType ReturnType;
83  typedef typename MT::CompositeType CompositeType;
84  typedef typename MT::Reference Reference;
86  typedef typename MT::Iterator Iterator;
87  typedef typename MT::ConstIterator ConstIterator;
88  //**********************************************************************************************
89 
90  //**Compilation flags***************************************************************************
92  enum { smpAssignable = MT::smpAssignable };
93  //**********************************************************************************************
94 
95  //**Data access functions***********************************************************************
98  inline Reference operator()( size_t i, size_t j ) const;
99 
100  inline Iterator begin ( size_t i ) const;
101  inline ConstIterator cbegin( size_t i ) const;
102  inline Iterator end ( size_t i ) const;
103  inline ConstIterator cend ( size_t i ) const;
105  //**********************************************************************************************
106 
107  //**Utility functions***************************************************************************
110  inline size_t rows() const;
111  inline size_t columns() const;
112  inline size_t capacity() const;
113  inline size_t capacity( size_t i ) const;
114  inline size_t nonZeros() const;
115  inline size_t nonZeros( size_t i ) const;
116  inline void reset() const;
117  inline void reset( size_t i ) const;
118  inline void clear() const;
119  inline Iterator set( size_t i, size_t j, const ElementType& value ) const;
120  inline Iterator insert( size_t i, size_t j, const ElementType& value ) const;
121  inline void append( size_t i, size_t j, const ElementType& value, bool check=false ) const;
122  inline void finalize( size_t i ) const;
123  inline void erase( size_t i, size_t j ) const;
124  inline Iterator erase( size_t i, Iterator pos ) const;
125  inline Iterator erase( size_t i, Iterator first, Iterator last ) const;
126  inline void resize( size_t m, size_t n, bool preserve=true ) const;
127  inline void reserve( size_t n ) const;
128  inline void reserve( size_t i, size_t n ) const;
129  inline void trim() const;
130  inline void trim( size_t i ) const;
131  inline void transpose() const;
132  inline void ctranspose() const;
133 
134  template< typename Other > inline void scale( const Other& scalar ) const;
136  //**********************************************************************************************
137 
138  //**Lookup functions****************************************************************************
141  inline Iterator find ( size_t i, size_t j ) const;
142  inline Iterator lowerBound( size_t i, size_t j ) const;
143  inline Iterator upperBound( size_t i, size_t j ) const;
145  //**********************************************************************************************
146 
147  private:
148  //**Compile time checks*************************************************************************
152  //**********************************************************************************************
153 };
154 //*************************************************************************************************
155 
156 
157 
158 
159 //=================================================================================================
160 //
161 // DATA ACCESS FUNCTIONS
162 //
163 //=================================================================================================
164 
165 //*************************************************************************************************
172 template< typename PT // Type of the proxy
173  , typename MT > // Type of the sparse matrix
175  SparseMatrixProxy<PT,MT>::operator()( size_t i, size_t j ) const
176 {
177  if( (~*this).isRestricted() ) {
178  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
179  }
180 
181  return (~*this).get()(i,j);
182 }
183 //*************************************************************************************************
184 
185 
186 //*************************************************************************************************
197 template< typename PT // Type of the proxy
198  , typename MT > // Type of the sparse matrix
201 {
202  return (~*this).get().begin(i);
203 }
204 //*************************************************************************************************
205 
206 
207 //*************************************************************************************************
218 template< typename PT // Type of the proxy
219  , typename MT > // Type of the sparse matrix
222 {
223  return (~*this).get().cbegin(i);
224 }
225 //*************************************************************************************************
226 
227 
228 //*************************************************************************************************
239 template< typename PT // Type of the proxy
240  , typename MT > // Type of the sparse matrix
243 {
244  return (~*this).get().end(i);
245 }
246 //*************************************************************************************************
247 
248 
249 //*************************************************************************************************
260 template< typename PT // Type of the proxy
261  , typename MT > // Type of the sparse matrix
264 {
265  return (~*this).get().cend(i);
266 }
267 //*************************************************************************************************
268 
269 
270 
271 
272 //=================================================================================================
273 //
274 // UTILITY FUNCTIONS
275 //
276 //=================================================================================================
277 
278 //*************************************************************************************************
283 template< typename PT // Type of the proxy
284  , typename MT > // Type of the sparse matrix
285 inline size_t SparseMatrixProxy<PT,MT>::rows() const
286 {
287  return (~*this).get().rows();
288 }
289 //*************************************************************************************************
290 
291 
292 //*************************************************************************************************
297 template< typename PT // Type of the proxy
298  , typename MT > // Type of the sparse matrix
300 {
301  return (~*this).get().columns();
302 }
303 //*************************************************************************************************
304 
305 
306 //*************************************************************************************************
311 template< typename PT // Type of the proxy
312  , typename MT > // Type of the sparse matrix
314 {
315  return (~*this).get().capacity();
316 }
317 //*************************************************************************************************
318 
319 
320 //*************************************************************************************************
331 template< typename PT // Type of the proxy
332  , typename MT > // Type of the sparse matrix
333 inline size_t SparseMatrixProxy<PT,MT>::capacity( size_t i ) const
334 {
335  return (~*this).get().capacity(i);
336 }
337 //*************************************************************************************************
338 
339 
340 //*************************************************************************************************
345 template< typename PT // Type of the proxy
346  , typename MT > // Type of the sparse matrix
348 {
349  return (~*this).get().nonZeros();
350 }
351 //*************************************************************************************************
352 
353 
354 //*************************************************************************************************
365 template< typename PT // Type of the proxy
366  , typename MT > // Type of the sparse matrix
367 inline size_t SparseMatrixProxy<PT,MT>::nonZeros( size_t i ) const
368 {
369  return (~*this).get().nonZeros(i);
370 }
371 //*************************************************************************************************
372 
373 
374 //*************************************************************************************************
381 template< typename PT // Type of the proxy
382  , typename MT > // Type of the sparse matrix
384 {
385  using blaze::reset;
386 
387  reset( (~*this).get() );
388 }
389 //*************************************************************************************************
390 
391 
392 //*************************************************************************************************
403 template< typename PT // Type of the proxy
404  , typename MT > // Type of the sparse matrix
405 inline void SparseMatrixProxy<PT,MT>::reset( size_t i ) const
406 {
407  using blaze::reset;
408 
409  reset( (~*this).get(), i );
410 }
411 //*************************************************************************************************
412 
413 
414 //*************************************************************************************************
421 template< typename PT // Type of the proxy
422  , typename MT > // Type of the sparse matrix
424 {
425  using blaze::clear;
426 
427  clear( (~*this).get() );
428 }
429 //*************************************************************************************************
430 
431 
432 //*************************************************************************************************
445 template< typename PT // Type of the proxy
446  , typename MT > // Type of the sparse matrix
448  SparseMatrixProxy<PT,MT>::set( size_t i, size_t j, const ElementType& value ) const
449 {
450  if( (~*this).isRestricted() ) {
451  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
452  }
453 
454  return (~*this).get().set( i, j, value );
455 }
456 //*************************************************************************************************
457 
458 
459 //*************************************************************************************************
472 template< typename PT // Type of the proxy
473  , typename MT > // Type of the sparse matrix
475  SparseMatrixProxy<PT,MT>::insert( size_t i, size_t j, const ElementType& value ) const
476 {
477  if( (~*this).isRestricted() ) {
478  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
479  }
480 
481  return (~*this).get().insert( i, j, value );
482 }
483 //*************************************************************************************************
484 
485 
486 //*************************************************************************************************
512 template< typename PT // Type of the proxy
513  , typename MT > // Type of the sparse matrix
514 inline void SparseMatrixProxy<PT,MT>::append( size_t i, size_t j, const ElementType& value, bool check ) const
515 {
516  if( (~*this).isRestricted() ) {
517  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
518  }
519 
520  (~*this).get().append( i, j, value, check );
521 }
522 //*************************************************************************************************
523 
524 
525 //*************************************************************************************************
538 template< typename PT // Type of the proxy
539  , typename MT > // Type of the sparse matrix
540 inline void SparseMatrixProxy<PT,MT>::finalize( size_t i ) const
541 {
542  if( (~*this).isRestricted() ) {
543  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
544  }
545 
546  (~*this).get().finalize( i );
547 }
548 //*************************************************************************************************
549 
550 
551 //*************************************************************************************************
560 template< typename PT // Type of the proxy
561  , typename MT > // Type of the sparse matrix
562 inline void SparseMatrixProxy<PT,MT>::erase( size_t i, size_t j ) const
563 {
564  if( (~*this).isRestricted() ) {
565  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
566  }
567 
568  (~*this).get().erase( i, j );
569 }
570 //*************************************************************************************************
571 
572 
573 //*************************************************************************************************
584 template< typename PT // Type of the proxy
585  , typename MT > // Type of the sparse matrix
588 {
589  if( (~*this).isRestricted() ) {
590  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
591  }
592 
593  return (~*this).get().erase( i, pos );
594 }
595 //*************************************************************************************************
596 
597 
598 //*************************************************************************************************
610 template< typename PT // Type of the proxy
611  , typename MT > // Type of the sparse matrix
613  SparseMatrixProxy<PT,MT>::erase( size_t i, Iterator first, Iterator last ) const
614 {
615  if( (~*this).isRestricted() ) {
616  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
617  }
618 
619  return (~*this).get().erase( i, first, last );
620 }
621 //*************************************************************************************************
622 
623 
624 //*************************************************************************************************
639 template< typename PT // Type of the proxy
640  , typename MT > // Type of the sparse matrix
641 inline void SparseMatrixProxy<PT,MT>::resize( size_t m, size_t n, bool preserve ) const
642 {
643  if( (~*this).isRestricted() ) {
644  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
645  }
646 
647  (~*this).get().resize( m, n, preserve );
648 }
649 //*************************************************************************************************
650 
651 
652 //*************************************************************************************************
662 template< typename PT // Type of the proxy
663  , typename MT > // Type of the sparse matrix
664 inline void SparseMatrixProxy<PT,MT>::reserve( size_t n ) const
665 {
666  if( (~*this).isRestricted() ) {
667  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
668  }
669 
670  (~*this).get().reserve( n );
671 }
672 //*************************************************************************************************
673 
674 
675 //*************************************************************************************************
689 template< typename PT // Type of the proxy
690  , typename MT > // Type of the sparse matrix
691 inline void SparseMatrixProxy<PT,MT>::reserve( size_t i, size_t n ) const
692 {
693  if( (~*this).isRestricted() ) {
694  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
695  }
696 
697  (~*this).get().reserve( i, n );
698 }
699 //*************************************************************************************************
700 
701 
702 //*************************************************************************************************
712 template< typename PT // Type of the proxy
713  , typename MT > // Type of the sparse matrix
715 {
716  if( (~*this).isRestricted() ) {
717  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
718  }
719 
720  (~*this).get().trim();
721 }
722 //*************************************************************************************************
723 
724 
725 //*************************************************************************************************
736 template< typename PT // Type of the proxy
737  , typename MT > // Type of the sparse matrix
738 inline void SparseMatrixProxy<PT,MT>::trim( size_t i ) const
739 {
740  if( (~*this).isRestricted() ) {
741  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
742  }
743 
744  (~*this).get().trim( i );
745 }
746 //*************************************************************************************************
747 
748 
749 //*************************************************************************************************
754 template< typename PT // Type of the proxy
755  , typename MT > // Type of the sparse matrix
757 {
758  if( (~*this).isRestricted() ) {
759  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
760  }
761 
762  (~*this).get().transpose();
763 }
764 //*************************************************************************************************
765 
766 
767 //*************************************************************************************************
772 template< typename PT // Type of the proxy
773  , typename MT > // Type of the sparse matrix
775 {
776  if( (~*this).isRestricted() ) {
777  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
778  }
779 
780  (~*this).get().ctranspose();
781 }
782 //*************************************************************************************************
783 
784 
785 //*************************************************************************************************
791 template< typename PT // Type of the proxy
792  , typename MT > // Type of the sparse matrix
793 template< typename Other > // Data type of the scalar value
794 inline void SparseMatrixProxy<PT,MT>::scale( const Other& scalar ) const
795 {
796  if( (~*this).isRestricted() ) {
797  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
798  }
799 
800  (~*this).get().scale( scalar );
801 }
802 //*************************************************************************************************
803 
804 
805 
806 
807 //=================================================================================================
808 //
809 // LOOKUP FUNCTIONS
810 //
811 //=================================================================================================
812 
813 //*************************************************************************************************
828 template< typename PT // Type of the proxy
829  , typename MT > // Type of the sparse matrix
831  SparseMatrixProxy<PT,MT>::find( size_t i, size_t j ) const
832 {
833  return (~*this).get().find( i, j );
834 }
835 //*************************************************************************************************
836 
837 
838 //*************************************************************************************************
853 template< typename PT // Type of the proxy
854  , typename MT > // Type of the sparse matrix
856  SparseMatrixProxy<PT,MT>::lowerBound( size_t i, size_t j ) const
857 {
858  return (~*this).get().lowerBound( i, j );
859 }
860 //*************************************************************************************************
861 
862 
863 //*************************************************************************************************
878 template< typename PT // Type of the proxy
879  , typename MT > // Type of the sparse matrix
881  SparseMatrixProxy<PT,MT>::upperBound( size_t i, size_t j ) const
882 {
883  return (~*this).get().upperBound( i, j );
884 }
885 //*************************************************************************************************
886 
887 
888 
889 
890 //=================================================================================================
891 //
892 // GLOBAL FUNCTIONS
893 //
894 //=================================================================================================
895 
896 //*************************************************************************************************
899 template< typename PT, typename MT >
901  begin( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
902 
903 template< typename PT, typename MT >
905  cbegin( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
906 
907 template< typename PT, typename MT >
909  end( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
910 
911 template< typename PT, typename MT >
913  cend( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
914 
915 template< typename PT, typename MT >
916 BLAZE_ALWAYS_INLINE size_t rows( const SparseMatrixProxy<PT,MT>& proxy );
917 
918 template< typename PT, typename MT >
920 
921 template< typename PT, typename MT >
923 
924 template< typename PT, typename MT >
925 BLAZE_ALWAYS_INLINE size_t capacity( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
926 
927 template< typename PT, typename MT >
929 
930 template< typename PT, typename MT >
931 BLAZE_ALWAYS_INLINE size_t nonZeros( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
932 
933 template< typename PT, typename MT >
934 BLAZE_ALWAYS_INLINE void resize( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve=true );
935 
936 template< typename PT, typename MT >
938 
939 template< typename PT, typename MT >
940 BLAZE_ALWAYS_INLINE void reset( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
941 
942 template< typename PT, typename MT >
945 //*************************************************************************************************
946 
947 
948 //*************************************************************************************************
961 template< typename PT // Type of the proxy
962  , typename MT > // Type of the sparse matrix
964  begin( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
965 {
966  return proxy.begin(i);
967 }
968 //*************************************************************************************************
969 
970 
971 //*************************************************************************************************
984 template< typename PT // Type of the proxy
985  , typename MT > // Type of the sparse matrix
987  cbegin( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
988 {
989  return proxy.cbegin(i);
990 }
991 //*************************************************************************************************
992 
993 
994 //*************************************************************************************************
1008 template< typename PT // Type of the proxy
1009  , typename MT > // Type of the sparse matrix
1011  end( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
1012 {
1013  return proxy.end(i);
1014 }
1015 //*************************************************************************************************
1016 
1017 
1018 //*************************************************************************************************
1032 template< typename PT // Type of the proxy
1033  , typename MT > // Type of the sparse matrix
1035  cend( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
1036 {
1037  return proxy.cend(i);
1038 }
1039 //*************************************************************************************************
1040 
1041 
1042 //*************************************************************************************************
1049 template< typename PT // Type of the proxy
1050  , typename MT > // Type of the sparse matrix
1052 {
1053  return proxy.rows();
1054 }
1055 //*************************************************************************************************
1056 
1057 
1058 //*************************************************************************************************
1065 template< typename PT // Type of the proxy
1066  , typename MT > // Type of the sparse matrix
1068 {
1069  return proxy.columns();
1070 }
1071 //*************************************************************************************************
1072 
1073 
1074 //*************************************************************************************************
1081 template< typename PT // Type of the proxy
1082  , typename MT > // Type of the sparse matrix
1084 {
1085  return proxy.capacity();
1086 }
1087 //*************************************************************************************************
1088 
1089 
1090 //*************************************************************************************************
1103 template< typename PT // Type of the proxy
1104  , typename MT > // Type of the sparse matrix
1106 {
1107  return proxy.capacity(i);
1108 }
1109 //*************************************************************************************************
1110 
1111 
1112 //*************************************************************************************************
1119 template< typename PT // Type of the proxy
1120  , typename MT > // Type of the sparse matrix
1122 {
1123  return proxy.nonZeros();
1124 }
1125 //*************************************************************************************************
1126 
1127 
1128 //*************************************************************************************************
1141 template< typename PT // Type of the proxy
1142  , typename MT > // Type of the sparse matrix
1144 {
1145  return proxy.nonZeros(i);
1146 }
1147 //*************************************************************************************************
1148 
1149 
1150 //*************************************************************************************************
1163 template< typename PT // Type of the proxy
1164  , typename MT > // Type of the sparse matrix
1165 BLAZE_ALWAYS_INLINE typename DisableIf< IsSquare<MT> >::Type
1166  resize_backend( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve )
1167 {
1168  proxy.resize( m, n, preserve );
1169 }
1171 //*************************************************************************************************
1172 
1173 
1174 //*************************************************************************************************
1188 template< typename PT // Type of the proxy
1189  , typename MT > // Type of the sparse matrix
1190 BLAZE_ALWAYS_INLINE typename EnableIf< IsSquare<MT> >::Type
1191  resize_backend( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve )
1192 {
1193  if( m != n ) {
1194  BLAZE_THROW_INVALID_ARGUMENT( "Invalid resize arguments for square matrix" );
1195  }
1196 
1197  proxy.resize( m, preserve );
1198 }
1200 //*************************************************************************************************
1201 
1202 
1203 //*************************************************************************************************
1219 template< typename PT // Type of the proxy
1220  , typename MT > // Type of the sparse matrix
1221 BLAZE_ALWAYS_INLINE void resize( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve )
1222 {
1223  resize_backend( proxy, m, n, preserve );
1224 }
1225 //*************************************************************************************************
1226 
1227 
1228 //*************************************************************************************************
1237 template< typename PT // Type of the proxy
1238  , typename MT > // Type of the sparse matrix
1240 {
1241  proxy.reset();
1242 }
1243 //*************************************************************************************************
1244 
1245 
1246 //*************************************************************************************************
1259 template< typename PT // Type of the proxy
1260  , typename MT > // Type of the sparse matrix
1262 {
1263  proxy.reset(i);
1264 }
1265 //*************************************************************************************************
1266 
1267 
1268 //*************************************************************************************************
1277 template< typename PT // Type of the proxy
1278  , typename MT > // Type of the sparse matrix
1280 {
1281  proxy.clear();
1282 }
1283 //*************************************************************************************************
1284 
1285 } // namespace blaze
1286 
1287 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Iterator set(size_t i, size_t j, const ElementType &value) const
Setting an element of the represented sparse matrix.
Definition: SparseMatrixProxy.h:448
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:514
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:475
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: SparseMatrixProxy.h:347
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:229
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:292
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:250
MT::Iterator Iterator
Iterator over non-constant elements.
Definition: SparseMatrixProxy.h:86
void reset() const
Reset to the default initial value.
Definition: SparseMatrixProxy.h:383
void erase(size_t i, size_t j) const
Erasing an element from the sparse matrix.
Definition: SparseMatrixProxy.h:562
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:507
Iterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SparseMatrixProxy.h:881
size_t capacity() const
Returns the maximum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:313
void transpose() const
In-place transpose of the represented matrix.
Definition: SparseMatrixProxy.h:756
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:340
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
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:263
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:378
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SparseMatrixProxy.h:82
void finalize(size_t i) const
Finalizing the element insertion of a row/column.
Definition: SparseMatrixProxy.h:540
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:856
MT::Reference Reference
Reference to a non-constant matrix value.
Definition: SparseMatrixProxy.h:84
Iterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:831
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: SparseMatrixProxy.h:78
Header file for the SparseMatrix base class.
Header file for the IsSquare type trait.
Constraint on the data type.
void trim() const
Removing all excessive capacity from all rows/columns.
Definition: SparseMatrixProxy.h:714
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:200
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:664
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
MT::ConstReference ConstReference
Reference to a constant matrix value.
Definition: SparseMatrixProxy.h:85
MT::ElementType ElementType
Type of the sparse matrix elements.
Definition: SparseMatrixProxy.h:81
void scale(const Other &scalar) const
Scaling of the sparse matrix by the scalar value scalar ( ).
Definition: SparseMatrixProxy.h:794
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
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:187
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:532
Proxy backend for sparse matrix types.The SparseMatrixProxy class serves as a backend for the Proxy c...
Definition: Forward.h:52
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:221
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
void clear() const
Clearing the represented vector.
Definition: SparseMatrixProxy.h:423
size_t columns() const
Returns the current number of columns of the represented matrix.
Definition: SparseMatrixProxy.h:299
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: SparseMatrixProxy.h:87
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: SparseMatrixProxy.h:175
MT::CompositeType CompositeType
Data type for composite expression templates.
Definition: SparseMatrixProxy.h:83
void ctranspose() const
In-place conjugate transpose of the represented matrix.
Definition: SparseMatrixProxy.h:774
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:242
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SparseMatrixProxy.h:79
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:285
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SparseMatrixProxy.h:80
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
Header file for exception macros.
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:641