Blaze  3.6
Matrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_MATRIX_H_
36 #define _BLAZE_MATH_EXPRESSIONS_MATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
45 #include <blaze/math/Exception.h>
51 #include <blaze/system/Inline.h>
52 #include <blaze/util/Assert.h>
53 #include <blaze/util/DisableIf.h>
54 #include <blaze/util/EnableIf.h>
56 #include <blaze/util/MaybeUnused.h>
57 #include <blaze/util/Types.h>
59 
60 
61 namespace blaze {
62 
63 //=================================================================================================
64 //
65 // CLASS DEFINITION
66 //
67 //=================================================================================================
68 
69 //*************************************************************************************************
80 template< typename MT // Type of the matrix
81  , bool SO > // Storage order
82 struct Matrix
83 {
84  //**Type definitions****************************************************************************
85  using MatrixType = MT;
86  //**********************************************************************************************
87 
88  //**Compilation flags***************************************************************************
89  static constexpr bool storageOrder = SO;
90  //**********************************************************************************************
91 
92  //**Non-const conversion operator***************************************************************
97  BLAZE_ALWAYS_INLINE constexpr MatrixType& operator~() noexcept {
98  return *static_cast<MatrixType*>( this );
99  }
100  //**********************************************************************************************
101 
102  //**Const conversion operator*******************************************************************
107  BLAZE_ALWAYS_INLINE constexpr const MatrixType& operator~() const noexcept {
108  return *static_cast<const MatrixType*>( this );
109  }
110  //**********************************************************************************************
111 };
112 //*************************************************************************************************
113 
114 
115 
116 
117 //=================================================================================================
118 //
119 // GLOBAL OPERATORS
120 //
121 //=================================================================================================
122 
123 //*************************************************************************************************
137 template< typename VT // Type of the left-hand side column vector
138  , typename MT // Type of the right-hand side matrix
139  , bool SO > // Storage order of the right-hand side matrix
140 inline VT& operator*=( Vector<VT,false>& lhs, const Matrix<MT,SO>& rhs )
141 {
142  ResultType_t<VT> tmp( (~rhs) * (~lhs) );
143  (~lhs) = std::move( tmp );
144  return (~lhs);
145 }
147 //*************************************************************************************************
148 
149 
150 //*************************************************************************************************
164 template< typename VT // Type of the left-hand side column vector
165  , typename MT // Type of the right-hand side matrix
166  , bool SO > // Storage order of the right-hand side matrix
167 inline VT& operator*=( Vector<VT,false>&& lhs, const Matrix<MT,SO>& rhs )
168 {
169  return (~lhs) *= (~rhs);
170 }
172 //*************************************************************************************************
173 
174 
175 //*************************************************************************************************
189 template< typename VT // Type of the left-hand side row vector
190  , typename MT // Type of the right-hand side matrix
191  , bool SO > // Storage order of the right-hand side matrix
192 inline VT& operator*=( Vector<VT,true>& lhs, const Matrix<MT,SO>& rhs )
193 {
194  ResultType_t<VT> tmp( (~lhs) * (~rhs) );
195  (~lhs) = std::move( tmp );
196  return (~lhs);
197 }
199 //*************************************************************************************************
200 
201 
202 //*************************************************************************************************
216 template< typename VT // Type of the left-hand side row vector
217  , typename MT // Type of the right-hand side matrix
218  , bool SO > // Storage order of the right-hand side matrix
219 inline VT& operator*=( Vector<VT,true>&& lhs, const Matrix<MT,SO>& rhs )
220 {
221  return (~lhs) *= (~rhs);
222 }
224 //*************************************************************************************************
225 
226 
227 //*************************************************************************************************
240 template< typename MT1 // Type of the left-hand side matrix
241  , bool SO1 // Storage order of the left-hand side matrix
242  , typename MT2 // Type of the right-hand side matrix
243  , bool SO2 > // Storage order of the right-hand side matrix
244 inline MT1& operator*=( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
245 {
246  ResultType_t<MT1> tmp( (~lhs) * (~rhs) );
247  (~lhs) = std::move( tmp );
248  return (~lhs);
249 }
251 //*************************************************************************************************
252 
253 
254 //*************************************************************************************************
268 template< typename MT1 // Type of the left-hand side matrix
269  , bool SO1 // Storage order of the left-hand side matrix
270  , typename MT2 // Type of the right-hand side matrix
271  , bool SO2 > // Storage order of the right-hand side matrix
272 inline MT1& operator*=( Matrix<MT1,SO1>&& lhs, const Matrix<MT2,SO2>& rhs )
273 {
274  return (~lhs) *= (~rhs);
275 }
277 //*************************************************************************************************
278 
279 
280 
281 
282 //=================================================================================================
283 //
284 // GLOBAL FUNCTIONS
285 //
286 //=================================================================================================
287 
288 //*************************************************************************************************
291 template< typename MT, bool SO >
292 typename MT::Iterator begin( Matrix<MT,SO>& matrix, size_t i );
293 
294 template< typename MT, bool SO >
295 typename MT::ConstIterator begin( const Matrix<MT,SO>& matrix, size_t i );
296 
297 template< typename MT, bool SO >
298 typename MT::ConstIterator cbegin( const Matrix<MT,SO>& matrix, size_t i );
299 
300 template< typename MT, bool SO >
301 typename MT::Iterator end( Matrix<MT,SO>& matrix, size_t i );
302 
303 template< typename MT, bool SO >
304 typename MT::ConstIterator end( const Matrix<MT,SO>& matrix, size_t i );
305 
306 template< typename MT, bool SO >
307 typename MT::ConstIterator cend( const Matrix<MT,SO>& matrix, size_t i );
308 
309 template< typename MT, bool SO >
310 constexpr size_t rows( const Matrix<MT,SO>& matrix ) noexcept;
311 
312 template< typename MT, bool SO >
313 constexpr size_t columns( const Matrix<MT,SO>& matrix ) noexcept;
314 
315 template< typename MT, bool SO >
316 constexpr size_t size( const Matrix<MT,SO>& matrix ) noexcept;
317 
318 template< typename MT, bool SO >
319 size_t capacity( const Matrix<MT,SO>& matrix ) noexcept;
320 
321 template< typename MT, bool SO >
322 size_t capacity( const Matrix<MT,SO>& matrix, size_t i ) noexcept;
323 
324 template< typename MT, bool SO >
325 size_t nonZeros( const Matrix<MT,SO>& matrix );
326 
327 template< typename MT, bool SO >
328 size_t nonZeros( const Matrix<MT,SO>& matrix, size_t i );
329 
330 template< typename MT, bool SO >
331 void resize( Matrix<MT,SO>& matrix, size_t rows, size_t columns, bool preserve=true );
332 
333 template< typename MT, bool SO >
334 void shrinkToFit( Matrix<MT,SO>& matrix );
335 
336 template< typename MT, bool SO >
337 void transpose( Matrix<MT,SO>& matrix );
338 
339 template< typename MT, bool SO >
340 void ctranspose( Matrix<MT,SO>& matrix );
341 
342 template< typename MT, bool SO >
343 const typename MT::ResultType evaluate( const Matrix<MT,SO>& matrix );
344 
345 template< typename MT, bool SO >
346 constexpr bool isEmpty( const Matrix<MT,SO>& matrix ) noexcept;
347 
348 template< typename MT, bool SO >
349 bool isSquare( const Matrix<MT,SO>& matrix ) noexcept;
350 
351 template< typename MT1, bool SO1, typename MT2, bool SO2 >
352 bool isSame( const Matrix<MT1,SO1>& a, const Matrix<MT2,SO2>& b ) noexcept;
354 //*************************************************************************************************
355 
356 
357 //*************************************************************************************************
370 template< typename MT // Type of the matrix
371  , bool SO > // Storage order of the matrix
372 BLAZE_ALWAYS_INLINE typename MT::Iterator begin( Matrix<MT,SO>& matrix, size_t i )
373 {
374  return (~matrix).begin(i);
375 }
376 //*************************************************************************************************
377 
378 
379 //*************************************************************************************************
392 template< typename MT // Type of the matrix
393  , bool SO > // Storage order of the matrix
394 BLAZE_ALWAYS_INLINE typename MT::ConstIterator begin( const Matrix<MT,SO>& matrix, size_t i )
395 {
396  return (~matrix).begin(i);
397 }
398 //*************************************************************************************************
399 
400 
401 //*************************************************************************************************
414 template< typename MT // Type of the matrix
415  , bool SO > // Storage order of the matrix
416 BLAZE_ALWAYS_INLINE typename MT::ConstIterator cbegin( const Matrix<MT,SO>& matrix, size_t i )
417 {
418  return (~matrix).cbegin(i);
419 }
420 //*************************************************************************************************
421 
422 
423 //*************************************************************************************************
436 template< typename MT // Type of the matrix
437  , bool SO > // Storage order of the matrix
438 BLAZE_ALWAYS_INLINE typename MT::Iterator end( Matrix<MT,SO>& matrix, size_t i )
439 {
440  return (~matrix).end(i);
441 }
442 //*************************************************************************************************
443 
444 
445 //*************************************************************************************************
458 template< typename MT // Type of the matrix
459  , bool SO > // Storage order of the matrix
460 BLAZE_ALWAYS_INLINE typename MT::ConstIterator end( const Matrix<MT,SO>& matrix, size_t i )
461 {
462  return (~matrix).end(i);
463 }
464 //*************************************************************************************************
465 
466 
467 //*************************************************************************************************
480 template< typename MT // Type of the matrix
481  , bool SO > // Storage order of the matrix
482 BLAZE_ALWAYS_INLINE typename MT::ConstIterator cend( const Matrix<MT,SO>& matrix, size_t i )
483 {
484  return (~matrix).cend(i);
485 }
486 //*************************************************************************************************
487 
488 
489 //*************************************************************************************************
496 template< typename MT // Type of the matrix
497  , bool SO > // Storage order of the matrix
498 BLAZE_ALWAYS_INLINE constexpr size_t rows( const Matrix<MT,SO>& matrix ) noexcept
499 {
500  return (~matrix).rows();
501 }
502 //*************************************************************************************************
503 
504 
505 //*************************************************************************************************
512 template< typename MT // Type of the matrix
513  , bool SO > // Storage order of the matrix
514 BLAZE_ALWAYS_INLINE constexpr size_t columns( const Matrix<MT,SO>& matrix ) noexcept
515 {
516  return (~matrix).columns();
517 }
518 //*************************************************************************************************
519 
520 
521 //*************************************************************************************************
528 template< typename MT // Type of the matrix
529  , bool SO > // Storage order of the matrix
530 BLAZE_ALWAYS_INLINE constexpr size_t size( const Matrix<MT,SO>& matrix ) noexcept
531 {
532  return (~matrix).rows() * (~matrix).columns();
533 }
534 //*************************************************************************************************
535 
536 
537 //*************************************************************************************************
544 template< typename MT // Type of the matrix
545  , bool SO > // Storage order of the matrix
546 BLAZE_ALWAYS_INLINE size_t capacity( const Matrix<MT,SO>& matrix ) noexcept
547 {
548  return (~matrix).capacity();
549 }
550 //*************************************************************************************************
551 
552 
553 //*************************************************************************************************
566 template< typename MT // Type of the matrix
567  , bool SO > // Storage order of the matrix
568 BLAZE_ALWAYS_INLINE size_t capacity( const Matrix<MT,SO>& matrix, size_t i ) noexcept
569 {
570  return (~matrix).capacity( i );
571 }
572 //*************************************************************************************************
573 
574 
575 //*************************************************************************************************
582 template< typename MT // Type of the matrix
583  , bool SO > // Storage order of the matrix
585 {
586  return (~matrix).nonZeros();
587 }
588 //*************************************************************************************************
589 
590 
591 //*************************************************************************************************
604 template< typename MT // Type of the matrix
605  , bool SO > // Storage order of the matrix
606 BLAZE_ALWAYS_INLINE size_t nonZeros( const Matrix<MT,SO>& matrix, size_t i )
607 {
608  return (~matrix).nonZeros( i );
609 }
610 //*************************************************************************************************
611 
612 
613 //*************************************************************************************************
630 template< typename MT // Type of the matrix
631  , bool SO > // Storage order of the matrix
632 BLAZE_ALWAYS_INLINE auto resize_backend( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
633  -> DisableIf_t< IsResizable_v<MT> >
634 {
635  MAYBE_UNUSED( preserve );
636 
637  if( (~matrix).rows() != m || (~matrix).columns() != n ) {
638  BLAZE_THROW_INVALID_ARGUMENT( "Matrix cannot be resized" );
639  }
640 }
642 //*************************************************************************************************
643 
644 
645 //*************************************************************************************************
658 template< typename MT // Type of the matrix
659  , bool SO > // Storage order of the matrix
660 BLAZE_ALWAYS_INLINE auto resize_backend( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
661  -> EnableIf_t< IsResizable_v<MT> && !IsSquare_v<MT> >
662 {
663  (~matrix).resize( m, n, preserve );
664 }
666 //*************************************************************************************************
667 
668 
669 //*************************************************************************************************
683 template< typename MT // Type of the matrix
684  , bool SO > // Storage order of the matrix
685 BLAZE_ALWAYS_INLINE auto resize_backend( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
686  -> EnableIf_t< IsResizable_v<MT> && IsSquare_v<MT> >
687 {
688  if( m != n ) {
689  BLAZE_THROW_INVALID_ARGUMENT( "Invalid resize arguments for square matrix" );
690  }
691 
692  (~matrix).resize( m, preserve );
693 }
695 //*************************************************************************************************
696 
697 
698 //*************************************************************************************************
736 template< typename MT // Type of the matrix
737  , bool SO > // Storage order of the matrix
738 BLAZE_ALWAYS_INLINE void resize( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
739 {
740  resize_backend( matrix, m, n, preserve );
741 }
742 //*************************************************************************************************
743 
744 
745 //*************************************************************************************************
753 template< typename MT // Type of the matrix
754  , bool SO > // Storage order of the matrix
755 BLAZE_ALWAYS_INLINE auto shrinkToFit_backend( Matrix<MT,SO>& matrix )
756  -> DisableIf_t< IsShrinkable_v<MT> >
757 {
758  MAYBE_UNUSED( matrix );
759 }
761 //*************************************************************************************************
762 
763 
764 //*************************************************************************************************
772 template< typename MT // Type of the matrix
773  , bool SO > // Storage order of the matrix
774 BLAZE_ALWAYS_INLINE auto shrinkToFit_backend( Matrix<MT,SO>& matrix )
775  -> EnableIf_t< IsShrinkable_v<MT> >
776 {
777  (~matrix).shrinkToFit();
778 }
780 //*************************************************************************************************
781 
782 
783 //*************************************************************************************************
797 template< typename MT // Type of the matrix
798  , bool SO > // Storage order of the matrix
800 {
801  shrinkToFit_backend( matrix );
802 }
803 //*************************************************************************************************
804 
805 
806 //*************************************************************************************************
823 template< typename MT // Type of the matrix
824  , bool SO > // Storage order of the matrix
826 {
827  (~matrix).transpose();
828 }
829 //*************************************************************************************************
830 
831 
832 //*************************************************************************************************
849 template< typename MT // Type of the matrix
850  , bool SO > // Storage order of the matrix
852 {
853  (~matrix).ctranspose();
854 }
855 //*************************************************************************************************
856 
857 
858 //*************************************************************************************************
910 template< typename MT // Type of the matrix
911  , bool SO > // Storage order of the matrix
912 inline const typename MT::ResultType evaluate( const Matrix<MT,SO>& matrix )
913 {
914  const typename MT::ResultType tmp( ~matrix );
915  return tmp;
916 }
917 //*************************************************************************************************
918 
919 
920 //*************************************************************************************************
930 template< typename MT // Type of the matrix
931  , bool SO > // Storage order of the matrix
932 BLAZE_ALWAYS_INLINE constexpr bool isEmpty( const Matrix<MT,SO>& matrix ) noexcept
933 {
934  return size( ~matrix ) == 0UL;
935 }
936 //*************************************************************************************************
937 
938 
939 //*************************************************************************************************
949 template< typename MT // Type of the matrix
950  , bool SO > // Storage order
951 BLAZE_ALWAYS_INLINE bool isSquare( const Matrix<MT,SO>& matrix ) noexcept
952 {
953  return ( IsSquare_v<MT> || (~matrix).rows() == (~matrix).columns() );
954 }
955 //*************************************************************************************************
956 
957 
958 //*************************************************************************************************
988 template< typename MT1 // Type of the left-hand side matrix
989  , bool SO1 // Storage order of the left-hand side matrix
990  , typename MT2 // Type of the right-hand side matrix
991  , bool SO2 > // Storage order of the right-hand side matrix
992 BLAZE_ALWAYS_INLINE bool isSame( const Matrix<MT1,SO1>& a, const Matrix<MT2,SO2>& b ) noexcept
993 {
994  return ( IsSame_v<MT1,MT2> &&
995  reinterpret_cast<const void*>( &a ) == reinterpret_cast<const void*>( &b ) );
996 }
997 //*************************************************************************************************
998 
999 
1000 //*************************************************************************************************
1009 template< typename MT1 // Type of the left-hand side matrix
1010  , typename MT2 // Type of the right-hand side matrix
1011  , bool SO > // Storage order of both matrices
1012 BLAZE_ALWAYS_INLINE void assign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1013 {
1015 
1016  (~lhs).assign( ~rhs );
1017 }
1019 //*************************************************************************************************
1020 
1021 
1022 //*************************************************************************************************
1031 template< typename MT1 // Type of the left-hand side matrix
1032  , bool SO // Storage order of the left-hand side matrix
1033  , typename MT2 > // Type of the right-hand side matrix
1034 BLAZE_ALWAYS_INLINE auto assign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1035  -> DisableIf_t< IsSymmetric_v<MT2> >
1036 {
1038 
1040 
1041  (~lhs).assign( ~rhs );
1042 }
1044 //*************************************************************************************************
1045 
1046 
1047 //*************************************************************************************************
1057 template< typename MT1 // Type of the left-hand side matrix
1058  , bool SO // Storage order of the left-hand side matrix
1059  , typename MT2 > // Type of the right-hand side matrix
1060 BLAZE_ALWAYS_INLINE auto assign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1061  -> EnableIf_t< IsSymmetric_v<MT2> >
1062 {
1064 
1066 
1067  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1068 
1069  (~lhs).assign( trans( ~rhs ) );
1070 }
1072 //*************************************************************************************************
1073 
1074 
1075 //*************************************************************************************************
1090 template< typename MT1 // Type of the left-hand side matrix
1091  , bool SO1 // Storage order of the left-hand side matrix
1092  , typename MT2 // Type of the right-hand side matrix
1093  , bool SO2 > // Storage order of the right-hand side matrix
1094 BLAZE_ALWAYS_INLINE void assign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1095 {
1097 
1098  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1099  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1100 
1101  assign_backend( ~lhs, ~rhs );
1102 }
1104 //*************************************************************************************************
1105 
1106 
1107 //*************************************************************************************************
1117 template< typename MT1 // Type of the left-hand side matrix
1118  , typename MT2 // Type of the right-hand side matrix
1119  , bool SO > // Storage order of both matrices
1120 BLAZE_ALWAYS_INLINE void addAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1121 {
1123 
1124  (~lhs).addAssign( ~rhs );
1125 }
1127 //*************************************************************************************************
1128 
1129 
1130 //*************************************************************************************************
1140 template< typename MT1 // Type of the left-hand side matrix
1141  , bool SO // Storage order of the left-hand side matrix
1142  , typename MT2 > // Type of the right-hand side matrix
1143 BLAZE_ALWAYS_INLINE auto addAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1144  -> DisableIf_t< IsSymmetric_v<MT2> >
1145 {
1147 
1149 
1150  (~lhs).addAssign( ~rhs );
1151 }
1153 //*************************************************************************************************
1154 
1155 
1156 //*************************************************************************************************
1166 template< typename MT1 // Type of the left-hand side matrix
1167  , bool SO // Storage order of the left-hand side matrix
1168  , typename MT2 > // Type of the right-hand side matrix
1169 BLAZE_ALWAYS_INLINE auto addAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1170  -> EnableIf_t< IsSymmetric_v<MT2> >
1171 {
1173 
1175 
1176  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1177 
1178  (~lhs).addAssign( trans( ~rhs ) );
1179 }
1181 //*************************************************************************************************
1182 
1183 
1184 //*************************************************************************************************
1199 template< typename MT1 // Type of the left-hand side matrix
1200  , bool SO1 // Storage order of the left-hand side matrix
1201  , typename MT2 // Type of the right-hand side matrix
1202  , bool SO2 > // Storage order of the right-hand side matrix
1203 BLAZE_ALWAYS_INLINE void addAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1204 {
1206 
1207  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1208  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1209 
1210  addAssign_backend( ~lhs, ~rhs );
1211 }
1213 //*************************************************************************************************
1214 
1215 
1216 //*************************************************************************************************
1226 template< typename MT1 // Type of the left-hand side matrix
1227  , typename MT2 // Type of the right-hand side matrix
1228  , bool SO > // Storage order of both matrices
1229 BLAZE_ALWAYS_INLINE void subAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1230 {
1232 
1233  (~lhs).subAssign( ~rhs );
1234 }
1236 //*************************************************************************************************
1237 
1238 
1239 //*************************************************************************************************
1249 template< typename MT1 // Type of the left-hand side matrix
1250  , bool SO // Storage order of the left-hand side matrix
1251  , typename MT2 > // Type of the right-hand side matrix
1252 BLAZE_ALWAYS_INLINE auto subAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1253  -> DisableIf_t< IsSymmetric_v<MT2> >
1254 {
1256 
1258 
1259  (~lhs).subAssign( ~rhs );
1260 }
1262 //*************************************************************************************************
1263 
1264 
1265 //*************************************************************************************************
1275 template< typename MT1 // Type of the left-hand side matrix
1276  , bool SO // Storage order of the left-hand side matrix
1277  , typename MT2 > // Type of the right-hand side matrix
1278 BLAZE_ALWAYS_INLINE auto subAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1279  -> EnableIf_t< IsSymmetric_v<MT2> >
1280 {
1282 
1284 
1285  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1286 
1287  (~lhs).subAssign( trans( ~rhs ) );
1288 }
1290 //*************************************************************************************************
1291 
1292 
1293 //*************************************************************************************************
1308 template< typename MT1 // Type of the left-hand side matrix
1309  , bool SO1 // Storage order of the left-hand side matrix
1310  , typename MT2 // Type of the right-hand side matrix
1311  , bool SO2 > // Storage order of the right-hand side matrix
1312 BLAZE_ALWAYS_INLINE void subAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1313 {
1315 
1316  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1317  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1318 
1319  subAssign_backend( ~lhs, ~rhs );
1320 }
1322 //*************************************************************************************************
1323 
1324 
1325 //*************************************************************************************************
1335 template< typename MT1 // Type of the left-hand side matrix
1336  , typename MT2 // Type of the right-hand side matrix
1337  , bool SO > // Storage order of both matrices
1338 BLAZE_ALWAYS_INLINE void schurAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1339 {
1341 
1342  (~lhs).schurAssign( ~rhs );
1343 }
1345 //*************************************************************************************************
1346 
1347 
1348 //*************************************************************************************************
1358 template< typename MT1 // Type of the left-hand side matrix
1359  , bool SO // Storage order of the left-hand side matrix
1360  , typename MT2 > // Type of the right-hand side matrix
1361 BLAZE_ALWAYS_INLINE auto schurAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1362  -> DisableIf_t< IsSymmetric_v<MT2> >
1363 {
1365 
1367 
1368  (~lhs).schurAssign( ~rhs );
1369 }
1371 //*************************************************************************************************
1372 
1373 
1374 //*************************************************************************************************
1384 template< typename MT1 // Type of the left-hand side matrix
1385  , bool SO // Storage order of the left-hand side matrix
1386  , typename MT2 > // Type of the right-hand side matrix
1387 BLAZE_ALWAYS_INLINE auto schurAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1388  -> EnableIf_t< IsSymmetric_v<MT2> >
1389 {
1391 
1393 
1394  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1395 
1396  (~lhs).schurAssign( trans( ~rhs ) );
1397 }
1399 //*************************************************************************************************
1400 
1401 
1402 //*************************************************************************************************
1417 template< typename MT1 // Type of the left-hand side matrix
1418  , bool SO1 // Storage order of the left-hand side matrix
1419  , typename MT2 // Type of the right-hand side matrix
1420  , bool SO2 > // Storage order of the right-hand side matrix
1421 BLAZE_ALWAYS_INLINE void schurAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1422 {
1424 
1425  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1426  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1427 
1428  schurAssign_backend( ~lhs, ~rhs );
1429 }
1431 //*************************************************************************************************
1432 
1433 
1434 //*************************************************************************************************
1449 template< typename MT1 // Type of the left-hand side matrix
1450  , bool SO1 // Storage order of the left-hand side matrix
1451  , typename MT2 // Type of the right-hand side matrix
1452  , bool SO2 > // Storage order of the right-hand side matrix
1453 BLAZE_ALWAYS_INLINE void multAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1454 {
1456 
1457  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).rows(), "Invalid matrix sizes" );
1458 
1459  (~lhs).multAssign( ~rhs );
1460 }
1462 //*************************************************************************************************
1463 
1464 
1465 //*************************************************************************************************
1481 template< typename MT // Type of the matrix
1482  , bool SO // Storage order
1483  , typename ET > // Type of the element
1484 BLAZE_ALWAYS_INLINE bool trySet( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1485 {
1486  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1487  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1488 
1489  MAYBE_UNUSED( mat, i, j, value );
1490 
1491  return true;
1492 }
1494 //*************************************************************************************************
1495 
1496 
1497 //*************************************************************************************************
1515 template< typename MT // Type of the matrix
1516  , bool SO // Storage order
1517  , typename ET > // Type of the element
1519  trySet( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1520 {
1521  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1522  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1523  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1524  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1525 
1526  MAYBE_UNUSED( mat, row, column, m, n, value );
1527 
1528  return true;
1529 }
1531 //*************************************************************************************************
1532 
1533 
1534 //*************************************************************************************************
1550 template< typename MT // Type of the matrix
1551  , bool SO // Storage order
1552  , typename ET > // Type of the element
1553 BLAZE_ALWAYS_INLINE bool tryAdd( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1554 {
1555  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1556  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1557 
1558  MAYBE_UNUSED( mat, i, j, value );
1559 
1560  return true;
1561 }
1563 //*************************************************************************************************
1564 
1565 
1566 //*************************************************************************************************
1584 template< typename MT // Type of the matrix
1585  , bool SO // Storage order
1586  , typename ET > // Type of the element
1588  tryAdd( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1589 {
1590  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1591  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1592  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1593  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1594 
1595  MAYBE_UNUSED( mat, row, column, m, n, value );
1596 
1597  return true;
1598 }
1600 //*************************************************************************************************
1601 
1602 
1603 //*************************************************************************************************
1619 template< typename MT // Type of the matrix
1620  , bool SO // Storage order
1621  , typename ET > // Type of the element
1622 BLAZE_ALWAYS_INLINE bool trySub( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1623 {
1624  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1625  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1626 
1627  MAYBE_UNUSED( mat, i, j, value );
1628 
1629  return true;
1630 }
1632 //*************************************************************************************************
1633 
1634 
1635 //*************************************************************************************************
1653 template< typename MT // Type of the matrix
1654  , bool SO // Storage order
1655  , typename ET > // Type of the element
1657  trySub( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1658 {
1659  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1660  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1661  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1662  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1663 
1664  MAYBE_UNUSED( mat, row, column, m, n, value );
1665 
1666  return true;
1667 }
1669 //*************************************************************************************************
1670 
1671 
1672 //*************************************************************************************************
1688 template< typename MT // Type of the matrix
1689  , bool SO // Storage order
1690  , typename ET > // Type of the element
1691 BLAZE_ALWAYS_INLINE bool tryMult( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1692 {
1693  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1694  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1695 
1696  MAYBE_UNUSED( mat, i, j, value );
1697 
1698  return true;
1699 }
1701 //*************************************************************************************************
1702 
1703 
1704 //*************************************************************************************************
1722 template< typename MT // Type of the matrix
1723  , bool SO // Storage order
1724  , typename ET > // Type of the element
1726  tryMult( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1727 {
1728  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1729  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1730  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1731  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1732 
1733  MAYBE_UNUSED( mat, row, column, m, n, value );
1734 
1735  return true;
1736 }
1738 //*************************************************************************************************
1739 
1740 
1741 //*************************************************************************************************
1757 template< typename MT // Type of the matrix
1758  , bool SO // Storage order
1759  , typename ET > // Type of the element
1760 BLAZE_ALWAYS_INLINE bool tryDiv( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1761 {
1762  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1763  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1764 
1765  MAYBE_UNUSED( mat, i, j, value );
1766 
1767  return true;
1768 }
1770 //*************************************************************************************************
1771 
1772 
1773 //*************************************************************************************************
1791 template< typename MT // Type of the matrix
1792  , bool SO // Storage order
1793  , typename ET > // Type of the element
1795  tryDiv( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1796 {
1797  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1798  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1799  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1800  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1801 
1802  MAYBE_UNUSED( mat, row, column, m, n, value );
1803 
1804  return true;
1805 }
1807 //*************************************************************************************************
1808 
1809 
1810 //*************************************************************************************************
1826 template< typename MT // Type of the matrix
1827  , bool SO > // Storage order
1828 BLAZE_ALWAYS_INLINE bool tryShift( const Matrix<MT,SO>& mat, size_t i, size_t j, int count )
1829 {
1830  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1831  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1832 
1833  MAYBE_UNUSED( mat, i, j, count );
1834 
1835  return true;
1836 }
1838 //*************************************************************************************************
1839 
1840 
1841 //*************************************************************************************************
1859 template< typename MT // Type of the matrix
1860  , bool SO > // Storage order
1862  tryShift( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, int count )
1863 {
1864  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1865  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1866  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1867  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1868 
1869  MAYBE_UNUSED( mat, row, column, m, n, count );
1870 
1871  return true;
1872 }
1874 //*************************************************************************************************
1875 
1876 
1877 //*************************************************************************************************
1893 template< typename MT // Type of the matrix
1894  , bool SO // Storage order
1895  , typename ET > // Type of the element
1896 BLAZE_ALWAYS_INLINE bool tryBitand( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1897 {
1898  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1899  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1900 
1901  MAYBE_UNUSED( mat, i, j, value );
1902 
1903  return true;
1904 }
1906 //*************************************************************************************************
1907 
1908 
1909 //*************************************************************************************************
1927 template< typename MT // Type of the matrix
1928  , bool SO // Storage order
1929  , typename ET > // Type of the element
1931  tryBitand( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1932 {
1933  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1934  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1935  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1936  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1937 
1938  MAYBE_UNUSED( mat, row, column, m, n, value );
1939 
1940  return true;
1941 }
1943 //*************************************************************************************************
1944 
1945 
1946 //*************************************************************************************************
1962 template< typename MT // Type of the matrix
1963  , bool SO // Storage order
1964  , typename ET > // Type of the element
1965 BLAZE_ALWAYS_INLINE bool tryBitor( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1966 {
1967  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1968  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1969 
1970  MAYBE_UNUSED( mat, i, j, value );
1971 
1972  return true;
1973 }
1975 //*************************************************************************************************
1976 
1977 
1978 //*************************************************************************************************
1996 template< typename MT // Type of the matrix
1997  , bool SO // Storage order
1998  , typename ET > // Type of the element
2000  tryBitor( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
2001 {
2002  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
2003  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
2004  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
2005  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
2006 
2007  MAYBE_UNUSED( mat, row, column, m, n, value );
2008 
2009  return true;
2010 }
2012 //*************************************************************************************************
2013 
2014 
2015 //*************************************************************************************************
2031 template< typename MT // Type of the matrix
2032  , bool SO // Storage order
2033  , typename ET > // Type of the element
2034 BLAZE_ALWAYS_INLINE bool tryBitxor( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
2035 {
2036  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
2037  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
2038 
2039  MAYBE_UNUSED( mat, i, j, value );
2040 
2041  return true;
2042 }
2044 //*************************************************************************************************
2045 
2046 
2047 //*************************************************************************************************
2065 template< typename MT // Type of the matrix
2066  , bool SO // Storage order
2067  , typename ET > // Type of the element
2069  tryBitxor( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
2070 {
2071  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
2072  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
2073  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
2074  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
2075 
2076  MAYBE_UNUSED( mat, row, column, m, n, value );
2077 
2078  return true;
2079 }
2081 //*************************************************************************************************
2082 
2083 
2084 //*************************************************************************************************
2100 template< typename MT // Type of the left-hand side matrix
2101  , bool SO // Storage order of the left-hand side matrix
2102  , typename VT // Type of the right-hand side vector
2103  , bool TF > // Transpose flag of the right-hand side vector
2104 BLAZE_ALWAYS_INLINE bool tryAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2105  size_t row, size_t column )
2106 {
2107  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2108  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2109  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2110  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2111 
2112  MAYBE_UNUSED( lhs, rhs, row, column );
2113 
2114  return true;
2115 }
2117 //*************************************************************************************************
2118 
2119 
2120 //*************************************************************************************************
2137 template< typename MT // Type of the left-hand side matrix
2138  , bool SO // Storage order of the left-hand side matrix
2139  , typename VT // Type of the right-hand side vector
2140  , bool TF > // Transpose flag of the right-hand side vector
2141 BLAZE_ALWAYS_INLINE bool tryAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2142  ptrdiff_t band, size_t row, size_t column )
2143 {
2144  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2145  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2146  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2147  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2148 
2149  MAYBE_UNUSED( lhs, rhs, band, row, column );
2150 
2151  return true;
2152 }
2154 //*************************************************************************************************
2155 
2156 
2157 //*************************************************************************************************
2173 template< typename MT1 // Type of the left-hand side matrix
2174  , bool SO1 // Storage order of the left-hand side matrix
2175  , typename MT2 // Type of the right-hand side matrix
2176  , bool SO2 > // Storage order of the right-hand side matrix
2177 BLAZE_ALWAYS_INLINE bool tryAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2178  size_t row, size_t column )
2179 {
2180  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2181  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2182  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2183  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2184 
2185  MAYBE_UNUSED( lhs, rhs, row, column );
2186 
2187  return true;
2188 }
2190 //*************************************************************************************************
2191 
2192 
2193 //*************************************************************************************************
2209 template< typename MT // Type of the left-hand side matrix
2210  , bool SO // Storage order of the left-hand side matrix
2211  , typename VT // Type of the right-hand side vector
2212  , bool TF > // Transpose flag of the right-hand side vector
2213 BLAZE_ALWAYS_INLINE bool tryAddAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2214  size_t row, size_t column )
2215 {
2216  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2217  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2218  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2219  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2220 
2221  MAYBE_UNUSED( lhs, rhs, row, column );
2222 
2223  return true;
2224 }
2226 //*************************************************************************************************
2227 
2228 
2229 //*************************************************************************************************
2246 template< typename MT // Type of the left-hand side matrix
2247  , bool SO // Storage order of the left-hand side matrix
2248  , typename VT // Type of the right-hand side vector
2249  , bool TF > // Transpose flag of the right-hand side vector
2250 BLAZE_ALWAYS_INLINE bool tryAddAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2251  ptrdiff_t band, size_t row, size_t column )
2252 {
2253  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2254  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2255  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2256  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2257 
2258  MAYBE_UNUSED( lhs, rhs, band, row, column );
2259 
2260  return true;
2261 }
2263 //*************************************************************************************************
2264 
2265 
2266 //*************************************************************************************************
2282 template< typename MT1 // Type of the left-hand side matrix
2283  , bool SO1 // Storage order of the left-hand side matrix
2284  , typename MT2 // Type of the right-hand side matrix
2285  , bool SO2 > // Storage order of the right-hand side matrix
2286 BLAZE_ALWAYS_INLINE bool tryAddAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2287  size_t row, size_t column )
2288 {
2289  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2290  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2291  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2292  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2293 
2294  MAYBE_UNUSED( lhs, rhs, row, column );
2295 
2296  return true;
2297 }
2299 //*************************************************************************************************
2300 
2301 
2302 //*************************************************************************************************
2318 template< typename MT // Type of the left-hand side matrix
2319  , bool SO // Storage order of the left-hand side matrix
2320  , typename VT // Type of the right-hand side vector
2321  , bool TF > // Transpose flag of the right-hand side vector
2322 BLAZE_ALWAYS_INLINE bool trySubAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2323  size_t row, size_t column )
2324 {
2325  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2326  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2327  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2328  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2329 
2330  MAYBE_UNUSED( lhs, rhs, row, column );
2331 
2332  return true;
2333 }
2335 //*************************************************************************************************
2336 
2337 
2338 //*************************************************************************************************
2356 template< typename MT // Type of the left-hand side matrix
2357  , bool SO // Storage order of the left-hand side matrix
2358  , typename VT // Type of the right-hand side vector
2359  , bool TF > // Transpose flag of the right-hand side vector
2360 BLAZE_ALWAYS_INLINE bool trySubAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2361  ptrdiff_t band, size_t row, size_t column )
2362 {
2363  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2364  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2365  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2366  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2367 
2368  MAYBE_UNUSED( lhs, rhs, band, row, column );
2369 
2370  return true;
2371 }
2373 //*************************************************************************************************
2374 
2375 
2376 //*************************************************************************************************
2392 template< typename MT1 // Type of the left-hand side matrix
2393  , bool SO1 // Storage order of the left-hand side matrix
2394  , typename MT2 // Type of the right-hand side matrix
2395  , bool SO2 > // Storage order of the right-hand side matrix
2396 BLAZE_ALWAYS_INLINE bool trySubAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2397  size_t row, size_t column )
2398 {
2399  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2400  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2401  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2402  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2403 
2404  MAYBE_UNUSED( lhs, rhs, row, column );
2405 
2406  return true;
2407 }
2409 //*************************************************************************************************
2410 
2411 
2412 //*************************************************************************************************
2428 template< typename MT // Type of the left-hand side matrix
2429  , bool SO // Storage order of the left-hand side matrix
2430  , typename VT // Type of the right-hand side vector
2431  , bool TF > // Transpose flag of the right-hand side vector
2432 BLAZE_ALWAYS_INLINE bool tryMultAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2433  size_t row, size_t column )
2434 {
2435  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2436  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2437  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2438  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2439 
2440  MAYBE_UNUSED( lhs, rhs, row, column );
2441 
2442  return true;
2443 }
2445 //*************************************************************************************************
2446 
2447 
2448 //*************************************************************************************************
2466 template< typename MT // Type of the left-hand side matrix
2467  , bool SO // Storage order of the left-hand side matrix
2468  , typename VT // Type of the right-hand side vector
2469  , bool TF > // Transpose flag of the right-hand side vector
2470 BLAZE_ALWAYS_INLINE bool tryMultAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2471  ptrdiff_t band, size_t row, size_t column )
2472 {
2473  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2474  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2475  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2476  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2477 
2478  MAYBE_UNUSED( lhs, rhs, band, row, column );
2479 
2480  return true;
2481 }
2483 //*************************************************************************************************
2484 
2485 
2486 //*************************************************************************************************
2502 template< typename MT1 // Type of the left-hand side matrix
2503  , bool SO1 // Storage order of the left-hand side matrix
2504  , typename MT2 // Type of the right-hand side matrix
2505  , bool SO2 > // Storage order of the right-hand side matrix
2506 BLAZE_ALWAYS_INLINE bool trySchurAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2507  size_t row, size_t column )
2508 {
2509  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2510  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2511  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2512  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2513 
2514  MAYBE_UNUSED( lhs, rhs, row, column );
2515 
2516  return true;
2517 }
2519 //*************************************************************************************************
2520 
2521 
2522 //*************************************************************************************************
2538 template< typename MT // Type of the left-hand side matrix
2539  , bool SO // Storage order of the left-hand side matrix
2540  , typename VT // Type of the right-hand side vector
2541  , bool TF > // Transpose flag of the right-hand side vector
2542 BLAZE_ALWAYS_INLINE bool tryDivAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2543  size_t row, size_t column )
2544 {
2545  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2546  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2547  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2548  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2549 
2550  MAYBE_UNUSED( lhs, rhs, row, column );
2551 
2552  return true;
2553 }
2555 //*************************************************************************************************
2556 
2557 
2558 //*************************************************************************************************
2576 template< typename MT // Type of the left-hand side matrix
2577  , bool SO // Storage order of the left-hand side matrix
2578  , typename VT // Type of the right-hand side vector
2579  , bool TF > // Transpose flag of the right-hand side vector
2580 BLAZE_ALWAYS_INLINE bool tryDivAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2581  ptrdiff_t band, size_t row, size_t column )
2582 {
2583  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2584  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2585  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2586  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2587 
2588  MAYBE_UNUSED( lhs, rhs, band, row, column );
2589 
2590  return true;
2591 }
2593 //*************************************************************************************************
2594 
2595 
2596 //*************************************************************************************************
2612 template< typename MT // Type of the left-hand side matrix
2613  , bool SO // Storage order of the left-hand side matrix
2614  , typename VT // Type of the right-hand side vector
2615  , bool TF > // Transpose flag of the right-hand side vector
2616 BLAZE_ALWAYS_INLINE bool tryShiftAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2617  size_t row, size_t column )
2618 {
2619  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2620  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2621  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2622  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2623 
2624  MAYBE_UNUSED( lhs, rhs, row, column );
2625 
2626  return true;
2627 }
2629 //*************************************************************************************************
2630 
2631 
2632 //*************************************************************************************************
2649 template< typename MT // Type of the left-hand side matrix
2650  , bool SO // Storage order of the left-hand side matrix
2651  , typename VT // Type of the right-hand side vector
2652  , bool TF > // Transpose flag of the right-hand side vector
2653 BLAZE_ALWAYS_INLINE bool tryShiftAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2654  ptrdiff_t band, size_t row, size_t column )
2655 {
2656  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2657  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2658  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2659  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2660 
2661  MAYBE_UNUSED( lhs, rhs, band, row, column );
2662 
2663  return true;
2664 }
2666 //*************************************************************************************************
2667 
2668 
2669 //*************************************************************************************************
2685 template< typename MT1 // Type of the left-hand side matrix
2686  , bool SO1 // Storage order of the left-hand side matrix
2687  , typename MT2 // Type of the right-hand side matrix
2688  , bool SO2 > // Storage order of the right-hand side matrix
2689 BLAZE_ALWAYS_INLINE bool tryShiftAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2690  size_t row, size_t column )
2691 {
2692  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2693  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2694  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2695  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2696 
2697  MAYBE_UNUSED( lhs, rhs, row, column );
2698 
2699  return true;
2700 }
2702 //*************************************************************************************************
2703 
2704 
2705 //*************************************************************************************************
2721 template< typename MT // Type of the left-hand side matrix
2722  , bool SO // Storage order of the left-hand side matrix
2723  , typename VT // Type of the right-hand side vector
2724  , bool TF > // Transpose flag of the right-hand side vector
2725 BLAZE_ALWAYS_INLINE bool tryBitandAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2726  size_t row, size_t column )
2727 {
2728  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2729  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2730  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2731  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2732 
2733  MAYBE_UNUSED( lhs, rhs, row, column );
2734 
2735  return true;
2736 }
2738 //*************************************************************************************************
2739 
2740 
2741 //*************************************************************************************************
2759 template< typename MT // Type of the left-hand side matrix
2760  , bool SO // Storage order of the left-hand side matrix
2761  , typename VT // Type of the right-hand side vector
2762  , bool TF > // Transpose flag of the right-hand side vector
2763 BLAZE_ALWAYS_INLINE bool tryBitandAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2764  ptrdiff_t band, size_t row, size_t column )
2765 {
2766  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2767  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2768  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2769  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2770 
2771  MAYBE_UNUSED( lhs, rhs, band, row, column );
2772 
2773  return true;
2774 }
2776 //*************************************************************************************************
2777 
2778 
2779 //*************************************************************************************************
2795 template< typename MT1 // Type of the left-hand side matrix
2796  , bool SO1 // Storage order of the left-hand side matrix
2797  , typename MT2 // Type of the right-hand side matrix
2798  , bool SO2 > // Storage order of the right-hand side matrix
2799 BLAZE_ALWAYS_INLINE bool tryBitandAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2800  size_t row, size_t column )
2801 {
2802  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2803  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2804  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2805  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2806 
2807  MAYBE_UNUSED( lhs, rhs, row, column );
2808 
2809  return true;
2810 }
2812 //*************************************************************************************************
2813 
2814 
2815 //*************************************************************************************************
2831 template< typename MT // Type of the left-hand side matrix
2832  , bool SO // Storage order of the left-hand side matrix
2833  , typename VT // Type of the right-hand side vector
2834  , bool TF > // Transpose flag of the right-hand side vector
2835 BLAZE_ALWAYS_INLINE bool tryBitorAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2836  size_t row, size_t column )
2837 {
2838  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2839  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2840  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2841  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2842 
2843  MAYBE_UNUSED( lhs, rhs, row, column );
2844 
2845  return true;
2846 }
2848 //*************************************************************************************************
2849 
2850 
2851 //*************************************************************************************************
2869 template< typename MT // Type of the left-hand side matrix
2870  , bool SO // Storage order of the left-hand side matrix
2871  , typename VT // Type of the right-hand side vector
2872  , bool TF > // Transpose flag of the right-hand side vector
2873 BLAZE_ALWAYS_INLINE bool tryBitorAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2874  ptrdiff_t band, size_t row, size_t column )
2875 {
2876  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2877  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2878  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2879  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2880 
2881  MAYBE_UNUSED( lhs, rhs, band, row, column );
2882 
2883  return true;
2884 }
2886 //*************************************************************************************************
2887 
2888 
2889 //*************************************************************************************************
2905 template< typename MT1 // Type of the left-hand side matrix
2906  , bool SO1 // Storage order of the left-hand side matrix
2907  , typename MT2 // Type of the right-hand side matrix
2908  , bool SO2 > // Storage order of the right-hand side matrix
2909 BLAZE_ALWAYS_INLINE bool tryBitorAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2910  size_t row, size_t column )
2911 {
2912  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2913  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2914  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2915  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2916 
2917  MAYBE_UNUSED( lhs, rhs, row, column );
2918 
2919  return true;
2920 }
2922 //*************************************************************************************************
2923 
2924 
2925 //*************************************************************************************************
2941 template< typename MT // Type of the left-hand side matrix
2942  , bool SO // Storage order of the left-hand side matrix
2943  , typename VT // Type of the right-hand side vector
2944  , bool TF > // Transpose flag of the right-hand side vector
2945 BLAZE_ALWAYS_INLINE bool tryBitxorAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2946  size_t row, size_t column )
2947 {
2948  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2949  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2950  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2951  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2952 
2953  MAYBE_UNUSED( lhs, rhs, row, column );
2954 
2955  return true;
2956 }
2958 //*************************************************************************************************
2959 
2960 
2961 //*************************************************************************************************
2979 template< typename MT // Type of the left-hand side matrix
2980  , bool SO // Storage order of the left-hand side matrix
2981  , typename VT // Type of the right-hand side vector
2982  , bool TF > // Transpose flag of the right-hand side vector
2983 BLAZE_ALWAYS_INLINE bool tryBitxorAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2984  ptrdiff_t band, size_t row, size_t column )
2985 {
2986  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2987  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2988  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2989  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2990 
2991  MAYBE_UNUSED( lhs, rhs, band, row, column );
2992 
2993  return true;
2994 }
2996 //*************************************************************************************************
2997 
2998 
2999 //*************************************************************************************************
3015 template< typename MT1 // Type of the left-hand side matrix
3016  , bool SO1 // Storage order of the left-hand side matrix
3017  , typename MT2 // Type of the right-hand side matrix
3018  , bool SO2 > // Storage order of the right-hand side matrix
3019 BLAZE_ALWAYS_INLINE bool tryBitxorAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
3020  size_t row, size_t column )
3021 {
3022  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
3023  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
3024  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
3025  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
3026 
3027  MAYBE_UNUSED( lhs, rhs, row, column );
3028 
3029  return true;
3030 }
3032 //*************************************************************************************************
3033 
3034 
3035 //*************************************************************************************************
3050 template< typename MT // Type of the matrix
3051  , bool SO > // Storage order
3052 BLAZE_ALWAYS_INLINE MT& derestrict( Matrix<MT,SO>& matrix )
3053 {
3054  return ~matrix;
3055 }
3057 //*************************************************************************************************
3058 
3059 } // namespace blaze
3060 
3061 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:992
Header file for basic type definitions.
Header file for the IsSame and IsStrictlySame type traits.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
Header file for the MAYBE_UNUSED function template.
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BLAZE_ALWAYS_INLINE constexpr const MatrixType & operator~() const noexcept
Conversion operator for constant matrices.
Definition: Matrix.h:107
const MT::ResultType evaluate(const Matrix< MT, SO > &matrix)
Evaluates the given matrix expression.
Definition: Matrix.h:912
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
Header file for the IsSquare type trait.
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the IsShrinkable type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the exception macros of the math module.
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
Header file for the EnableIf class template.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:137
BLAZE_ALWAYS_INLINE constexpr MatrixType & operator~() noexcept
Conversion operator for non-constant matrices.
Definition: Matrix.h:97
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type,...
Definition: Symmetric.h:79
static constexpr bool storageOrder
Storage order of the matrix.
Definition: Matrix.h:89
Header file for run time assertion macros.
constexpr bool isEmpty(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is empty.
Definition: Matrix.h:932
Expression object for sparse matrix-scalar divisions.The SMatScalarMult class represents the compile ...
Definition: Forward.h:127
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:114
Constraint on the data type.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
auto operator *=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:494
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
Header file for the function trace functionality.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825