Blaze 3.9
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 <blaze/math/Aliases.h>
51#include <blaze/system/Inline.h>
52#include <blaze/util/EnableIf.h>
53#include <blaze/util/Types.h>
54
55
56namespace blaze {
57
58//=================================================================================================
59//
60// CLASS DEFINITION
61//
62//=================================================================================================
63
64//*************************************************************************************************
72template< typename PT // Type of the proxy
73 , typename MT > // Type of the sparse matrix
75 : public SparseMatrix< PT, IsColumnMajorMatrix_v<MT> >
76{
77 public:
78 //**Type definitions****************************************************************************
89 //**********************************************************************************************
90
91 //**Compilation flags***************************************************************************
93 static constexpr bool smpAssignable = MT::smpAssignable;
94 //**********************************************************************************************
95
96 //**Data access functions***********************************************************************
99 inline Reference operator()( size_t i, size_t j ) const;
100 inline Reference at( size_t i, size_t j ) const;
101
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;
107 //**********************************************************************************************
108
109 //**Utility functions***************************************************************************
112 inline size_t rows() const;
113 inline size_t columns() const;
114 inline size_t capacity() const;
115 inline size_t capacity( size_t i ) const;
116 inline size_t nonZeros() 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;
128 //**********************************************************************************************
129
130 //**Insertion functions*************************************************************************
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;
137 //**********************************************************************************************
138
139 //**Erase functions*****************************************************************************
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;
145
146 template< typename Pred >
147 inline void erase( Pred predicate );
148
149 template< typename Pred >
150 inline void erase( size_t i, Iterator first, Iterator last, Pred predicate );
152 //**********************************************************************************************
153
154 //**Lookup functions****************************************************************************
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;
161 //**********************************************************************************************
162
163 //**Numeric functions***************************************************************************
166 inline void transpose() const;
167 inline void ctranspose() const;
168
169 template< typename Other > inline void scale( const Other& scalar ) const;
171 //**********************************************************************************************
172
173 protected:
174 //**Special member functions********************************************************************
177 SparseMatrixProxy() = default;
178 SparseMatrixProxy( const SparseMatrixProxy& ) = default;
180 ~SparseMatrixProxy() = default;
181 SparseMatrixProxy& operator=( const SparseMatrixProxy& ) = default;
182 SparseMatrixProxy& operator=( SparseMatrixProxy&& ) = default;
184 //**********************************************************************************************
185
186 private:
187 //**Compile time checks*************************************************************************
191 //**********************************************************************************************
192};
193//*************************************************************************************************
194
195
196
197
198//=================================================================================================
199//
200// DATA ACCESS FUNCTIONS
201//
202//=================================================================================================
203
204//*************************************************************************************************
218template< typename PT // Type of the proxy
219 , typename MT > // Type of the sparse matrix
221 SparseMatrixProxy<PT,MT>::operator()( size_t i, size_t j ) const
222{
223 if( (**this).isRestricted() ) {
224 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
225 }
226
227 return (**this).get()(i,j);
228}
229//*************************************************************************************************
230
231
232//*************************************************************************************************
246template< typename PT // Type of the proxy
247 , typename MT > // Type of the sparse matrix
249 SparseMatrixProxy<PT,MT>::at( size_t i, size_t j ) const
250{
251 if( (**this).isRestricted() ) {
252 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
253 }
254
255 return (**this).get().at(i,j);
256}
257//*************************************************************************************************
258
259
260//*************************************************************************************************
271template< typename PT // Type of the proxy
272 , typename MT > // Type of the sparse matrix
275{
276 return (**this).get().begin(i);
277}
278//*************************************************************************************************
279
280
281//*************************************************************************************************
292template< typename PT // Type of the proxy
293 , typename MT > // Type of the sparse matrix
296{
297 return (**this).get().cbegin(i);
298}
299//*************************************************************************************************
300
301
302//*************************************************************************************************
313template< typename PT // Type of the proxy
314 , typename MT > // Type of the sparse matrix
317{
318 return (**this).get().end(i);
319}
320//*************************************************************************************************
321
322
323//*************************************************************************************************
334template< typename PT // Type of the proxy
335 , typename MT > // Type of the sparse matrix
338{
339 return (**this).get().cend(i);
340}
341//*************************************************************************************************
342
343
344
345
346//=================================================================================================
347//
348// UTILITY FUNCTIONS
349//
350//=================================================================================================
351
352//*************************************************************************************************
357template< typename PT // Type of the proxy
358 , typename MT > // Type of the sparse matrix
360{
361 return (**this).get().rows();
362}
363//*************************************************************************************************
364
365
366//*************************************************************************************************
371template< typename PT // Type of the proxy
372 , typename MT > // Type of the sparse matrix
374{
375 return (**this).get().columns();
376}
377//*************************************************************************************************
378
379
380//*************************************************************************************************
385template< typename PT // Type of the proxy
386 , typename MT > // Type of the sparse matrix
388{
389 return (**this).get().capacity();
390}
391//*************************************************************************************************
392
393
394//*************************************************************************************************
405template< typename PT // Type of the proxy
406 , typename MT > // Type of the sparse matrix
407inline size_t SparseMatrixProxy<PT,MT>::capacity( size_t i ) const
408{
409 return (**this).get().capacity(i);
410}
411//*************************************************************************************************
412
413
414//*************************************************************************************************
419template< typename PT // Type of the proxy
420 , typename MT > // Type of the sparse matrix
422{
423 return (**this).get().nonZeros();
424}
425//*************************************************************************************************
426
427
428//*************************************************************************************************
439template< typename PT // Type of the proxy
440 , typename MT > // Type of the sparse matrix
441inline size_t SparseMatrixProxy<PT,MT>::nonZeros( size_t i ) const
442{
443 return (**this).get().nonZeros(i);
444}
445//*************************************************************************************************
446
447
448//*************************************************************************************************
455template< typename PT // Type of the proxy
456 , typename MT > // Type of the sparse matrix
458{
459 using blaze::reset;
460
461 reset( (**this).get() );
462}
463//*************************************************************************************************
464
465
466//*************************************************************************************************
477template< typename PT // Type of the proxy
478 , typename MT > // Type of the sparse matrix
479inline void SparseMatrixProxy<PT,MT>::reset( size_t i ) const
480{
481 using blaze::reset;
482
483 reset( (**this).get(), i );
484}
485//*************************************************************************************************
486
487
488//*************************************************************************************************
495template< typename PT // Type of the proxy
496 , typename MT > // Type of the sparse matrix
498{
499 using blaze::clear;
500
501 clear( (**this).get() );
502}
503//*************************************************************************************************
504
505
506//*************************************************************************************************
520template< typename PT // Type of the proxy
521 , typename MT > // Type of the sparse matrix
523 SparseMatrixProxy<PT,MT>::set( size_t i, size_t j, const ElementType& value ) const
524{
525 if( (**this).isRestricted() ) {
526 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
527 }
528
529 return (**this).get().set( i, j, value );
530}
531//*************************************************************************************************
532
533
534//*************************************************************************************************
548template< typename PT // Type of the proxy
549 , typename MT > // Type of the sparse matrix
551 SparseMatrixProxy<PT,MT>::insert( size_t i, size_t j, const ElementType& value ) const
552{
553 if( (**this).isRestricted() ) {
554 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
555 }
556
557 return (**this).get().insert( i, j, value );
558}
559//*************************************************************************************************
560
561
562//*************************************************************************************************
589template< typename PT // Type of the proxy
590 , typename MT > // Type of the sparse matrix
591inline void SparseMatrixProxy<PT,MT>::append( size_t i, size_t j, const ElementType& value, bool check ) const
592{
593 if( (**this).isRestricted() ) {
594 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
595 }
596
597 (**this).get().append( i, j, value, check );
598}
599//*************************************************************************************************
600
601
602//*************************************************************************************************
616template< typename PT // Type of the proxy
617 , typename MT > // Type of the sparse matrix
618inline void SparseMatrixProxy<PT,MT>::finalize( size_t i ) const
619{
620 if( (**this).isRestricted() ) {
621 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
622 }
623
624 (**this).get().finalize( i );
625}
626//*************************************************************************************************
627
628
629//*************************************************************************************************
645template< typename PT // Type of the proxy
646 , typename MT > // Type of the sparse matrix
647inline void SparseMatrixProxy<PT,MT>::resize( size_t m, size_t n, bool preserve ) const
648{
649 if( (**this).isRestricted() ) {
650 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
651 }
652
653 (**this).get().resize( m, n, preserve );
654}
655//*************************************************************************************************
656
657
658//*************************************************************************************************
669template< typename PT // Type of the proxy
670 , typename MT > // Type of the sparse matrix
671inline void SparseMatrixProxy<PT,MT>::reserve( size_t n ) const
672{
673 if( (**this).isRestricted() ) {
674 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
675 }
676
677 (**this).get().reserve( n );
678}
679//*************************************************************************************************
680
681
682//*************************************************************************************************
697template< typename PT // Type of the proxy
698 , typename MT > // Type of the sparse matrix
699inline void SparseMatrixProxy<PT,MT>::reserve( size_t i, size_t n ) const
700{
701 if( (**this).isRestricted() ) {
702 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
703 }
704
705 (**this).get().reserve( i, n );
706}
707//*************************************************************************************************
708
709
710//*************************************************************************************************
721template< typename PT // Type of the proxy
722 , typename MT > // Type of the sparse matrix
724{
725 if( (**this).isRestricted() ) {
726 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
727 }
728
729 (**this).get().trim();
730}
731//*************************************************************************************************
732
733
734//*************************************************************************************************
746template< typename PT // Type of the proxy
747 , typename MT > // Type of the sparse matrix
748inline void SparseMatrixProxy<PT,MT>::trim( size_t i ) const
749{
750 if( (**this).isRestricted() ) {
751 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
752 }
753
754 (**this).get().trim( i );
755}
756//*************************************************************************************************
757
758
759//*************************************************************************************************
765template< typename PT // Type of the proxy
766 , typename MT > // Type of the sparse matrix
768{
769 if( (**this).isRestricted() ) {
770 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
771 }
772
773 (**this).get().transpose();
774}
775//*************************************************************************************************
776
777
778//*************************************************************************************************
784template< typename PT // Type of the proxy
785 , typename MT > // Type of the sparse matrix
787{
788 if( (**this).isRestricted() ) {
789 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
790 }
791
792 (**this).get().ctranspose();
793}
794//*************************************************************************************************
795
796
797//*************************************************************************************************
808template< typename PT // Type of the proxy
809 , typename MT > // Type of the sparse matrix
810template< typename Other > // Data type of the scalar value
811inline void SparseMatrixProxy<PT,MT>::scale( const Other& scalar ) const
812{
813 if( (**this).isRestricted() ) {
814 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
815 }
816
817 (**this).get().scale( scalar );
818}
819//*************************************************************************************************
820
821
822
823
824//=================================================================================================
825//
826// ERASE FUNCTIONS
827//
828//=================================================================================================
829
830//*************************************************************************************************
840template< typename PT // Type of the proxy
841 , typename MT > // Type of the sparse matrix
842inline void SparseMatrixProxy<PT,MT>::erase( size_t i, size_t j ) const
843{
844 if( (**this).isRestricted() ) {
845 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
846 }
847
848 (**this).get().erase( i, j );
849}
850//*************************************************************************************************
851
852
853//*************************************************************************************************
865template< typename PT // Type of the proxy
866 , typename MT > // Type of the sparse matrix
869{
870 if( (**this).isRestricted() ) {
871 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
872 }
873
874 return (**this).get().erase( i, pos );
875}
876//*************************************************************************************************
877
878
879//*************************************************************************************************
892template< typename PT // Type of the proxy
893 , typename MT > // Type of the sparse matrix
895 SparseMatrixProxy<PT,MT>::erase( size_t i, Iterator first, Iterator last ) const
896{
897 if( (**this).isRestricted() ) {
898 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
899 }
900
901 return (**this).get().erase( i, first, last );
902}
903//*************************************************************************************************
904
905
906//*************************************************************************************************
919template< typename PT // Type of the proxy
920 , typename MT > // Type of the sparse matrix
921template< typename Pred > // Type of the unary predicate
922inline void SparseMatrixProxy<PT,MT>::erase( Pred predicate )
923{
924 if( (**this).isRestricted() ) {
925 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
926 }
927
928 (**this).get().erase( predicate );
929}
930//*************************************************************************************************
931
932
933//*************************************************************************************************
951template< typename PT // Type of the proxy
952 , typename MT > // Type of the sparse matrix
953template< typename Pred > // Type of the unary predicate
954inline void SparseMatrixProxy<PT,MT>::erase( size_t i, Iterator first, Iterator last, Pred predicate )
955{
956 if( (**this).isRestricted() ) {
957 BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
958 }
959
960 (**this).get().erase( i, first, last, predicate );
961}
962//*************************************************************************************************
963
964
965
966
967//=================================================================================================
968//
969// LOOKUP FUNCTIONS
970//
971//=================================================================================================
972
973//*************************************************************************************************
988template< typename PT // Type of the proxy
989 , typename MT > // Type of the sparse matrix
991 SparseMatrixProxy<PT,MT>::find( size_t i, size_t j ) const
992{
993 return (**this).get().find( i, j );
994}
995//*************************************************************************************************
996
997
998//*************************************************************************************************
1013template< typename PT // Type of the proxy
1014 , typename MT > // Type of the sparse matrix
1016 SparseMatrixProxy<PT,MT>::lowerBound( size_t i, size_t j ) const
1017{
1018 return (**this).get().lowerBound( i, j );
1019}
1020//*************************************************************************************************
1021
1022
1023//*************************************************************************************************
1038template< typename PT // Type of the proxy
1039 , typename MT > // Type of the sparse matrix
1041 SparseMatrixProxy<PT,MT>::upperBound( size_t i, size_t j ) const
1042{
1043 return (**this).get().upperBound( i, j );
1044}
1045//*************************************************************************************************
1046
1047
1048
1049
1050//=================================================================================================
1051//
1052// GLOBAL FUNCTIONS
1053//
1054//=================================================================================================
1055
1056//*************************************************************************************************
1059template< typename PT, typename MT >
1061 begin( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
1062
1063template< typename PT, typename MT >
1065 cbegin( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
1066
1067template< typename PT, typename MT >
1069 end( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
1070
1071template< typename PT, typename MT >
1073 cend( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
1074
1075template< typename PT, typename MT >
1076size_t rows( const SparseMatrixProxy<PT,MT>& proxy );
1077
1078template< typename PT, typename MT >
1079size_t columns( const SparseMatrixProxy<PT,MT>& proxy );
1080
1081template< typename PT, typename MT >
1082size_t capacity( const SparseMatrixProxy<PT,MT>& proxy );
1083
1084template< typename PT, typename MT >
1085size_t capacity( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
1086
1087template< typename PT, typename MT >
1088size_t nonZeros( const SparseMatrixProxy<PT,MT>& proxy );
1089
1090template< typename PT, typename MT >
1091size_t nonZeros( const SparseMatrixProxy<PT,MT>& proxy, size_t i );
1092
1093template< typename PT, typename MT >
1094void resize( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve=true );
1095
1096template< typename PT, typename MT >
1098 find( const SparseMatrixProxy<PT,MT>& proxy, size_t i, size_t j );
1099
1100template< typename PT, typename MT >
1102 lowerBound( const SparseMatrixProxy<PT,MT>& proxy, size_t i, size_t j );
1103
1104template< typename PT, typename MT >
1106 upperBound( const SparseMatrixProxy<PT,MT>& proxy, size_t i, size_t j );
1108//*************************************************************************************************
1109
1110
1111//*************************************************************************************************
1124template< typename PT // Type of the proxy
1125 , typename MT > // Type of the sparse matrix
1127 begin( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
1128{
1129 return proxy.begin(i);
1130}
1131//*************************************************************************************************
1132
1133
1134//*************************************************************************************************
1147template< typename PT // Type of the proxy
1148 , typename MT > // Type of the sparse matrix
1150 cbegin( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
1151{
1152 return proxy.cbegin(i);
1153}
1154//*************************************************************************************************
1155
1156
1157//*************************************************************************************************
1171template< typename PT // Type of the proxy
1172 , typename MT > // Type of the sparse matrix
1174 end( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
1175{
1176 return proxy.end(i);
1177}
1178//*************************************************************************************************
1179
1180
1181//*************************************************************************************************
1195template< typename PT // Type of the proxy
1196 , typename MT > // Type of the sparse matrix
1198 cend( const SparseMatrixProxy<PT,MT>& proxy, size_t i )
1199{
1200 return proxy.cend(i);
1201}
1202//*************************************************************************************************
1203
1204
1205//*************************************************************************************************
1212template< typename PT // Type of the proxy
1213 , typename MT > // Type of the sparse matrix
1215{
1216 return proxy.rows();
1217}
1218//*************************************************************************************************
1219
1220
1221//*************************************************************************************************
1228template< typename PT // Type of the proxy
1229 , typename MT > // Type of the sparse matrix
1231{
1232 return proxy.columns();
1233}
1234//*************************************************************************************************
1235
1236
1237//*************************************************************************************************
1244template< typename PT // Type of the proxy
1245 , typename MT > // Type of the sparse matrix
1247{
1248 return proxy.capacity();
1249}
1250//*************************************************************************************************
1251
1252
1253//*************************************************************************************************
1266template< typename PT // Type of the proxy
1267 , typename MT > // Type of the sparse matrix
1269{
1270 return proxy.capacity(i);
1271}
1272//*************************************************************************************************
1273
1274
1275//*************************************************************************************************
1282template< typename PT // Type of the proxy
1283 , typename MT > // Type of the sparse matrix
1285{
1286 return proxy.nonZeros();
1287}
1288//*************************************************************************************************
1289
1290
1291//*************************************************************************************************
1304template< typename PT // Type of the proxy
1305 , typename MT > // Type of the sparse matrix
1307{
1308 return proxy.nonZeros(i);
1309}
1310//*************************************************************************************************
1311
1312
1313//*************************************************************************************************
1326template< typename PT // Type of the proxy
1327 , typename MT > // Type of the sparse matrix
1328BLAZE_ALWAYS_INLINE DisableIf_t< IsSquare_v<MT> >
1329 resize_backend( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve )
1330{
1331 proxy.resize( m, n, preserve );
1332}
1334//*************************************************************************************************
1335
1336
1337//*************************************************************************************************
1351template< typename PT // Type of the proxy
1352 , typename MT > // Type of the sparse matrix
1353BLAZE_ALWAYS_INLINE EnableIf_t< IsSquare_v<MT> >
1354 resize_backend( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve )
1355{
1356 if( m != n ) {
1357 BLAZE_THROW_INVALID_ARGUMENT( "Invalid resize arguments for square matrix" );
1358 }
1359
1360 proxy.resize( m, preserve );
1361}
1363//*************************************************************************************************
1364
1365
1366//*************************************************************************************************
1382template< typename PT // Type of the proxy
1383 , typename MT > // Type of the sparse matrix
1384BLAZE_ALWAYS_INLINE void resize( const SparseMatrixProxy<PT,MT>& proxy, size_t m, size_t n, bool preserve )
1385{
1386 resize_backend( proxy, m, n, preserve );
1387}
1388//*************************************************************************************************
1389
1390
1391//*************************************************************************************************
1400template< typename PT // Type of the proxy
1401 , typename MT > // Type of the sparse matrix
1403 find( const SparseMatrixProxy<PT,MT>& proxy, size_t i, size_t j )
1404{
1405 return proxy.find( i, j );
1406}
1407//*************************************************************************************************
1408
1409
1410//*************************************************************************************************
1419template< typename PT // Type of the proxy
1420 , typename MT > // Type of the sparse matrix
1422 lowerBound( const SparseMatrixProxy<PT,MT>& proxy, size_t i, size_t j )
1423{
1424 return proxy.lowerBound( i, j );
1425}
1426//*************************************************************************************************
1427
1428
1429//*************************************************************************************************
1438template< typename PT // Type of the proxy
1439 , typename MT > // Type of the sparse matrix
1441 upperBound( const SparseMatrixProxy<PT,MT>& proxy, size_t i, size_t j )
1442{
1443 return proxy.upperBound( i, j );
1444}
1445//*************************************************************************************************
1446
1447} // namespace blaze
1448
1449#endif
Header file for auxiliary alias declarations.
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.
Definition: Aliases.h:170
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::Iterator Iterator_t
Alias declaration for nested Iterator type definitions.
Definition: Aliases.h:210
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition: Aliases.h:310
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition: Aliases.h:130
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.
Definition: Aliases.h:390
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for the EnableIf class template.
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsSquare type trait.
Proxy backend for sparse matrix types.
Definition: SparseMatrixProxy.h:76
size_t capacity() const
Returns the maximum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:387
ResultType_t< MT > ResultType
Result type for expression template evaluations.
Definition: SparseMatrixProxy.h:79
void erase(size_t i, size_t j) const
Erasing an element from the sparse matrix.
Definition: SparseMatrixProxy.h:842
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:671
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:359
void scale(const Other &scalar) const
Scaling of the sparse matrix by the scalar value scalar ( ).
Definition: SparseMatrixProxy.h:811
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:295
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:591
void reset() const
Reset to the default initial value.
Definition: SparseMatrixProxy.h:457
OppositeType_t< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SparseMatrixProxy.h:80
void ctranspose() const
In-place conjugate transpose of the represented matrix.
Definition: SparseMatrixProxy.h:786
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:274
Iterator insert(size_t i, size_t j, const ElementType &value) const
Inserting an element into the represented sparse matrix.
Definition: SparseMatrixProxy.h:551
Iterator set(size_t i, size_t j, const ElementType &value) const
Setting an element of the represented sparse matrix.
Definition: SparseMatrixProxy.h:523
ElementType_t< MT > ElementType
Type of the sparse matrix elements.
Definition: SparseMatrixProxy.h:82
void trim() const
Removing all excessive capacity from all rows/columns.
Definition: SparseMatrixProxy.h:723
void transpose() const
In-place transpose of the represented matrix.
Definition: SparseMatrixProxy.h:767
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:337
Reference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SparseMatrixProxy.h:249
Iterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SparseMatrixProxy.h:1041
CompositeType_t< MT > CompositeType
Data type for composite expression templates.
Definition: SparseMatrixProxy.h:84
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: SparseMatrixProxy.h:421
Iterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:991
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: SparseMatrixProxy.h:221
void finalize(size_t i) const
Finalizing the element insertion of a row/column.
Definition: SparseMatrixProxy.h:618
Iterator_t< MT > Iterator
Iterator over non-constant elements.
Definition: SparseMatrixProxy.h:87
void resize(size_t m, size_t n, bool preserve=true) const
Changing the size of the represented matrix.
Definition: SparseMatrixProxy.h:647
Reference_t< MT > Reference
Reference to a non-constant matrix value.
Definition: SparseMatrixProxy.h:85
TransposeType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SparseMatrixProxy.h:81
ConstIterator_t< MT > ConstIterator
Iterator over constant elements.
Definition: SparseMatrixProxy.h:88
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:1016
ConstReference_t< MT > ConstReference
Reference to a constant matrix value.
Definition: SparseMatrixProxy.h:86
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SparseMatrixProxy.h:83
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:316
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: SparseMatrixProxy.h:93
void clear() const
Clearing the represented vector.
Definition: SparseMatrixProxy.h:497
size_t columns() const
Returns the current number of columns of the represented matrix.
Definition: SparseMatrixProxy.h:373
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Header file for the SparseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::Iterator upperBound(const SparseMatrixProxy< PT, MT > &proxy, size_t i, size_t j)
Returns an iterator to the first index greater than the given index.
Definition: SparseMatrixProxy.h:1441
BLAZE_ALWAYS_INLINE size_t capacity(const SparseMatrixProxy< PT, MT > &proxy, size_t i)
Returns the current capacity of the specified row/column of the represented matrix.
Definition: SparseMatrixProxy.h:1268
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::Iterator begin(const SparseMatrixProxy< PT, MT > &proxy, size_t i)
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:1127
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::Iterator find(const SparseMatrixProxy< PT, MT > &proxy, size_t i, size_t j)
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:1403
BLAZE_ALWAYS_INLINE size_t rows(const SparseMatrixProxy< PT, MT > &proxy)
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:1214
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::ConstIterator cend(const SparseMatrixProxy< PT, MT > &proxy, size_t i)
Returns an iterator just past the last element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:1198
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::Iterator lowerBound(const SparseMatrixProxy< PT, MT > &proxy, size_t i, size_t j)
Returns an iterator to the first index not less than the given index.
Definition: SparseMatrixProxy.h:1422
BLAZE_ALWAYS_INLINE size_t columns(const SparseMatrixProxy< PT, MT > &proxy)
Returns the current number of columns of the represented matrix.
Definition: SparseMatrixProxy.h:1230
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::ConstIterator cbegin(const SparseMatrixProxy< PT, MT > &proxy, size_t i)
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:1150
BLAZE_ALWAYS_INLINE size_t nonZeros(const SparseMatrixProxy< PT, MT > &proxy, size_t i)
Returns the number of non-zero elements in the specified row/column of the represented matrix.
Definition: SparseMatrixProxy.h:1306
BLAZE_ALWAYS_INLINE void resize(const SparseMatrixProxy< PT, MT > &proxy, size_t m, size_t n, bool preserve)
Changing the size of the represented matrix.
Definition: SparseMatrixProxy.h:1384
BLAZE_ALWAYS_INLINE SparseMatrixProxy< PT, MT >::Iterator end(const SparseMatrixProxy< PT, MT > &proxy, size_t i)
Returns an iterator just past the last element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:1174
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
Header file for the clear shim.
Header file for the reset shim.
System settings for the inline keywords.
Header file for basic type definitions.