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/mpl/And.h>
57 #include <blaze/util/mpl/Not.h>
58 #include <blaze/util/Types.h>
60 #include <blaze/util/Unused.h>
61 
62 
63 namespace blaze {
64 
65 //=================================================================================================
66 //
67 // CLASS DEFINITION
68 //
69 //=================================================================================================
70 
71 //*************************************************************************************************
82 template< typename MT // Type of the matrix
83  , bool SO > // Storage order
84 struct Matrix
85 {
86  //**Type definitions****************************************************************************
87  using MatrixType = MT;
88  //**********************************************************************************************
89 
90  //**Non-const conversion operator***************************************************************
96  return *static_cast<MatrixType*>( this );
97  }
98  //**********************************************************************************************
99 
100  //**Const conversion operator*******************************************************************
105  BLAZE_ALWAYS_INLINE const MatrixType& operator~() const noexcept {
106  return *static_cast<const MatrixType*>( this );
107  }
108  //**********************************************************************************************
109 };
110 //*************************************************************************************************
111 
112 
113 
114 
115 //=================================================================================================
116 //
117 // GLOBAL OPERATORS
118 //
119 //=================================================================================================
120 
121 //*************************************************************************************************
135 template< typename VT // Type of the left-hand side column vector
136  , typename MT // Type of the right-hand side matrix
137  , bool SO > // Storage order of the right-hand side matrix
138 inline VT& operator*=( Vector<VT,false>& lhs, const Matrix<MT,SO>& rhs )
139 {
140  ResultType_<VT> tmp( (~rhs) * (~lhs) );
141  (~lhs) = std::move( tmp );
142  return (~lhs);
143 }
145 //*************************************************************************************************
146 
147 
148 //*************************************************************************************************
162 template< typename VT // Type of the left-hand side column vector
163  , typename MT // Type of the right-hand side matrix
164  , bool SO > // Storage order of the right-hand side matrix
165 inline VT& operator*=( Vector<VT,false>&& lhs, const Matrix<MT,SO>& rhs )
166 {
167  return (~lhs) *= (~rhs);
168 }
170 //*************************************************************************************************
171 
172 
173 //*************************************************************************************************
187 template< typename VT // Type of the left-hand side row vector
188  , typename MT // Type of the right-hand side matrix
189  , bool SO > // Storage order of the right-hand side matrix
190 inline VT& operator*=( Vector<VT,true>& lhs, const Matrix<MT,SO>& rhs )
191 {
192  ResultType_<VT> tmp( (~lhs) * (~rhs) );
193  (~lhs) = std::move( tmp );
194  return (~lhs);
195 }
197 //*************************************************************************************************
198 
199 
200 //*************************************************************************************************
214 template< typename VT // Type of the left-hand side row vector
215  , typename MT // Type of the right-hand side matrix
216  , bool SO > // Storage order of the right-hand side matrix
217 inline VT& operator*=( Vector<VT,true>&& lhs, const Matrix<MT,SO>& rhs )
218 {
219  return (~lhs) *= (~rhs);
220 }
222 //*************************************************************************************************
223 
224 
225 //*************************************************************************************************
238 template< typename MT1 // Type of the left-hand side matrix
239  , bool SO1 // Storage order of the left-hand side matrix
240  , typename MT2 // Type of the right-hand side matrix
241  , bool SO2 > // Storage order of the right-hand side matrix
242 inline MT1& operator*=( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
243 {
244  ResultType_<MT1> tmp( (~lhs) * (~rhs) );
245  (~lhs) = std::move( tmp );
246  return (~lhs);
247 }
249 //*************************************************************************************************
250 
251 
252 //*************************************************************************************************
266 template< typename MT1 // Type of the left-hand side matrix
267  , bool SO1 // Storage order of the left-hand side matrix
268  , typename MT2 // Type of the right-hand side matrix
269  , bool SO2 > // Storage order of the right-hand side matrix
270 inline MT1& operator*=( Matrix<MT1,SO1>&& lhs, const Matrix<MT2,SO2>& rhs )
271 {
272  return (~lhs) *= (~rhs);
273 }
275 //*************************************************************************************************
276 
277 
278 
279 
280 //=================================================================================================
281 //
282 // GLOBAL FUNCTIONS
283 //
284 //=================================================================================================
285 
286 //*************************************************************************************************
289 template< typename MT, bool SO >
290 BLAZE_ALWAYS_INLINE typename MT::Iterator begin( Matrix<MT,SO>& matrix, size_t i );
291 
292 template< typename MT, bool SO >
293 BLAZE_ALWAYS_INLINE typename MT::ConstIterator begin( const Matrix<MT,SO>& matrix, size_t i );
294 
295 template< typename MT, bool SO >
296 BLAZE_ALWAYS_INLINE typename MT::ConstIterator cbegin( const Matrix<MT,SO>& matrix, size_t i );
297 
298 template< typename MT, bool SO >
299 BLAZE_ALWAYS_INLINE typename MT::Iterator end( Matrix<MT,SO>& matrix, size_t i );
300 
301 template< typename MT, bool SO >
302 BLAZE_ALWAYS_INLINE typename MT::ConstIterator end( const Matrix<MT,SO>& matrix, size_t i );
303 
304 template< typename MT, bool SO >
305 BLAZE_ALWAYS_INLINE typename MT::ConstIterator cend( const Matrix<MT,SO>& matrix, size_t i );
306 
307 template< typename MT, bool SO >
308 BLAZE_ALWAYS_INLINE size_t rows( const Matrix<MT,SO>& matrix ) noexcept;
309 
310 template< typename MT, bool SO >
311 BLAZE_ALWAYS_INLINE size_t columns( const Matrix<MT,SO>& matrix ) noexcept;
312 
313 template< typename MT, bool SO >
314 BLAZE_ALWAYS_INLINE size_t capacity( const Matrix<MT,SO>& matrix ) noexcept;
315 
316 template< typename MT, bool SO >
317 BLAZE_ALWAYS_INLINE size_t capacity( const Matrix<MT,SO>& matrix, size_t i ) noexcept;
318 
319 template< typename MT, bool SO >
320 BLAZE_ALWAYS_INLINE size_t nonZeros( const Matrix<MT,SO>& matrix );
321 
322 template< typename MT, bool SO >
323 BLAZE_ALWAYS_INLINE size_t nonZeros( const Matrix<MT,SO>& matrix, size_t i );
324 
325 template< typename MT, bool SO >
326 BLAZE_ALWAYS_INLINE void resize( Matrix<MT,SO>& matrix, size_t rows, size_t columns, bool preserve=true );
327 
328 template< typename MT, bool SO >
330 
331 template< typename MT, bool SO >
333 
334 template< typename MT, bool SO >
336 
337 template< typename MT, bool SO >
338 inline const typename MT::ResultType evaluate( const Matrix<MT,SO>& matrix );
339 
340 template< typename MT, bool SO >
341 BLAZE_ALWAYS_INLINE bool isSquare( const Matrix<MT,SO>& matrix ) noexcept;
342 
343 template< typename MT1, bool SO1, typename MT2, bool SO2 >
344 BLAZE_ALWAYS_INLINE bool isSame( const Matrix<MT1,SO1>& a, const Matrix<MT2,SO2>& b ) noexcept;
346 //*************************************************************************************************
347 
348 
349 //*************************************************************************************************
362 template< typename MT // Type of the matrix
363  , bool SO > // Storage order of the matrix
365 {
366  return (~matrix).begin(i);
367 }
368 //*************************************************************************************************
369 
370 
371 //*************************************************************************************************
384 template< typename MT // Type of the matrix
385  , bool SO > // Storage order of the matrix
386 BLAZE_ALWAYS_INLINE typename MT::ConstIterator begin( const Matrix<MT,SO>& matrix, size_t i )
387 {
388  return (~matrix).begin(i);
389 }
390 //*************************************************************************************************
391 
392 
393 //*************************************************************************************************
406 template< typename MT // Type of the matrix
407  , bool SO > // Storage order of the matrix
408 BLAZE_ALWAYS_INLINE typename MT::ConstIterator cbegin( const Matrix<MT,SO>& matrix, size_t i )
409 {
410  return (~matrix).cbegin(i);
411 }
412 //*************************************************************************************************
413 
414 
415 //*************************************************************************************************
428 template< typename MT // Type of the matrix
429  , bool SO > // Storage order of the matrix
430 BLAZE_ALWAYS_INLINE typename MT::Iterator end( Matrix<MT,SO>& matrix, size_t i )
431 {
432  return (~matrix).end(i);
433 }
434 //*************************************************************************************************
435 
436 
437 //*************************************************************************************************
450 template< typename MT // Type of the matrix
451  , bool SO > // Storage order of the matrix
452 BLAZE_ALWAYS_INLINE typename MT::ConstIterator end( const Matrix<MT,SO>& matrix, size_t i )
453 {
454  return (~matrix).end(i);
455 }
456 //*************************************************************************************************
457 
458 
459 //*************************************************************************************************
472 template< typename MT // Type of the matrix
473  , bool SO > // Storage order of the matrix
474 BLAZE_ALWAYS_INLINE typename MT::ConstIterator cend( const Matrix<MT,SO>& matrix, size_t i )
475 {
476  return (~matrix).cend(i);
477 }
478 //*************************************************************************************************
479 
480 
481 //*************************************************************************************************
488 template< typename MT // Type of the matrix
489  , bool SO > // Storage order of the matrix
490 BLAZE_ALWAYS_INLINE size_t rows( const Matrix<MT,SO>& matrix ) noexcept
491 {
492  return (~matrix).rows();
493 }
494 //*************************************************************************************************
495 
496 
497 //*************************************************************************************************
504 template< typename MT // Type of the matrix
505  , bool SO > // Storage order of the matrix
506 BLAZE_ALWAYS_INLINE size_t columns( const Matrix<MT,SO>& matrix ) noexcept
507 {
508  return (~matrix).columns();
509 }
510 //*************************************************************************************************
511 
512 
513 //*************************************************************************************************
520 template< typename MT // Type of the matrix
521  , bool SO > // Storage order of the matrix
522 BLAZE_ALWAYS_INLINE size_t capacity( const Matrix<MT,SO>& matrix ) noexcept
523 {
524  return (~matrix).capacity();
525 }
526 //*************************************************************************************************
527 
528 
529 //*************************************************************************************************
542 template< typename MT // Type of the matrix
543  , bool SO > // Storage order of the matrix
544 BLAZE_ALWAYS_INLINE size_t capacity( const Matrix<MT,SO>& matrix, size_t i ) noexcept
545 {
546  return (~matrix).capacity( i );
547 }
548 //*************************************************************************************************
549 
550 
551 //*************************************************************************************************
558 template< typename MT // Type of the matrix
559  , bool SO > // Storage order of the matrix
561 {
562  return (~matrix).nonZeros();
563 }
564 //*************************************************************************************************
565 
566 
567 //*************************************************************************************************
580 template< typename MT // Type of the matrix
581  , bool SO > // Storage order of the matrix
582 BLAZE_ALWAYS_INLINE size_t nonZeros( const Matrix<MT,SO>& matrix, size_t i )
583 {
584  return (~matrix).nonZeros( i );
585 }
586 //*************************************************************************************************
587 
588 
589 //*************************************************************************************************
606 template< typename MT // Type of the matrix
607  , bool SO > // Storage order of the matrix
609  resize_backend( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
610 {
611  UNUSED_PARAMETER( preserve );
612 
613  if( (~matrix).rows() != m || (~matrix).columns() != n ) {
614  BLAZE_THROW_INVALID_ARGUMENT( "Matrix cannot be resized" );
615  }
616 }
618 //*************************************************************************************************
619 
620 
621 //*************************************************************************************************
634 template< typename MT // Type of the matrix
635  , bool SO > // Storage order of the matrix
637  resize_backend( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
638 {
639  (~matrix).resize( m, n, preserve );
640 }
642 //*************************************************************************************************
643 
644 
645 //*************************************************************************************************
659 template< typename MT // Type of the matrix
660  , bool SO > // Storage order of the matrix
661 BLAZE_ALWAYS_INLINE EnableIf_< And< IsResizable<MT>, IsSquare<MT> > >
662  resize_backend( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
663 {
664  if( m != n ) {
665  BLAZE_THROW_INVALID_ARGUMENT( "Invalid resize arguments for square matrix" );
666  }
667 
668  (~matrix).resize( m, preserve );
669 }
671 //*************************************************************************************************
672 
673 
674 //*************************************************************************************************
712 template< typename MT // Type of the matrix
713  , bool SO > // Storage order of the matrix
714 BLAZE_ALWAYS_INLINE void resize( Matrix<MT,SO>& matrix, size_t m, size_t n, bool preserve )
715 {
716  resize_backend( matrix, m, n, preserve );
717 }
718 //*************************************************************************************************
719 
720 
721 //*************************************************************************************************
729 template< typename MT // Type of the matrix
730  , bool SO > // Storage order of the matrix
732  shrinkToFit_backend( Matrix<MT,SO>& matrix )
733 {
734  UNUSED_PARAMETER( matrix );
735 }
737 //*************************************************************************************************
738 
739 
740 //*************************************************************************************************
748 template< typename MT // Type of the matrix
749  , bool SO > // Storage order of the matrix
751  shrinkToFit_backend( Matrix<MT,SO>& matrix )
752 {
753  (~matrix).shrinkToFit();
754 }
756 //*************************************************************************************************
757 
758 
759 //*************************************************************************************************
773 template< typename MT // Type of the matrix
774  , bool SO > // Storage order of the matrix
776 {
777  shrinkToFit_backend( matrix );
778 }
779 //*************************************************************************************************
780 
781 
782 //*************************************************************************************************
799 template< typename MT // Type of the matrix
800  , bool SO > // Storage order of the matrix
802 {
803  (~matrix).transpose();
804 }
805 //*************************************************************************************************
806 
807 
808 //*************************************************************************************************
825 template< typename MT // Type of the matrix
826  , bool SO > // Storage order of the matrix
828 {
829  (~matrix).ctranspose();
830 }
831 //*************************************************************************************************
832 
833 
834 //*************************************************************************************************
886 template< typename MT // Type of the matrix
887  , bool SO > // Storage order of the matrix
888 inline const typename MT::ResultType evaluate( const Matrix<MT,SO>& matrix )
889 {
890  const typename MT::ResultType tmp( ~matrix );
891  return tmp;
892 }
893 //*************************************************************************************************
894 
895 
896 //*************************************************************************************************
906 template< typename MT // Type of the matrix
907  , bool SO > // Storage order
908 BLAZE_ALWAYS_INLINE bool isSquare( const Matrix<MT,SO>& matrix ) noexcept
909 {
910  return ( IsSquare<MT>::value || (~matrix).rows() == (~matrix).columns() );
911 }
912 //*************************************************************************************************
913 
914 
915 //*************************************************************************************************
945 template< typename MT1 // Type of the left-hand side matrix
946  , bool SO1 // Storage order of the left-hand side matrix
947  , typename MT2 // Type of the right-hand side matrix
948  , bool SO2 > // Storage order of the right-hand side matrix
949 BLAZE_ALWAYS_INLINE bool isSame( const Matrix<MT1,SO1>& a, const Matrix<MT2,SO2>& b ) noexcept
950 {
951  return ( IsSame<MT1,MT2>::value &&
952  reinterpret_cast<const void*>( &a ) == reinterpret_cast<const void*>( &b ) );
953 }
954 //*************************************************************************************************
955 
956 
957 //*************************************************************************************************
966 template< typename MT1 // Type of the left-hand side matrix
967  , typename MT2 // Type of the right-hand side matrix
968  , bool SO > // Storage order of both matrices
969 BLAZE_ALWAYS_INLINE void assign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
970 {
972 
973  (~lhs).assign( ~rhs );
974 }
976 //*************************************************************************************************
977 
978 
979 //*************************************************************************************************
988 template< typename MT1 // Type of the left-hand side matrix
989  , bool SO // Storage order of the left-hand side matrix
990  , typename MT2 > // Type of the right-hand side matrix
992  assign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
993 {
995 
997 
998  (~lhs).assign( ~rhs );
999 }
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1014 template< typename MT1 // Type of the left-hand side matrix
1015  , bool SO // Storage order of the left-hand side matrix
1016  , typename MT2 > // Type of the right-hand side matrix
1018  assign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1019 {
1021 
1023 
1024  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1025 
1026  (~lhs).assign( trans( ~rhs ) );
1027 }
1029 //*************************************************************************************************
1030 
1031 
1032 //*************************************************************************************************
1047 template< typename MT1 // Type of the left-hand side matrix
1048  , bool SO1 // Storage order of the left-hand side matrix
1049  , typename MT2 // Type of the right-hand side matrix
1050  , bool SO2 > // Storage order of the right-hand side matrix
1051 BLAZE_ALWAYS_INLINE void assign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1052 {
1054 
1055  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1056  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1057 
1058  assign_backend( ~lhs, ~rhs );
1059 }
1061 //*************************************************************************************************
1062 
1063 
1064 //*************************************************************************************************
1074 template< typename MT1 // Type of the left-hand side matrix
1075  , typename MT2 // Type of the right-hand side matrix
1076  , bool SO > // Storage order of both matrices
1077 BLAZE_ALWAYS_INLINE void addAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1078 {
1080 
1081  (~lhs).addAssign( ~rhs );
1082 }
1084 //*************************************************************************************************
1085 
1086 
1087 //*************************************************************************************************
1097 template< typename MT1 // Type of the left-hand side matrix
1098  , bool SO // Storage order of the left-hand side matrix
1099  , typename MT2 > // Type of the right-hand side matrix
1101  addAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1102 {
1104 
1106 
1107  (~lhs).addAssign( ~rhs );
1108 }
1110 //*************************************************************************************************
1111 
1112 
1113 //*************************************************************************************************
1123 template< typename MT1 // Type of the left-hand side matrix
1124  , bool SO // Storage order of the left-hand side matrix
1125  , typename MT2 > // Type of the right-hand side matrix
1127  addAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1128 {
1130 
1132 
1133  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1134 
1135  (~lhs).addAssign( trans( ~rhs ) );
1136 }
1138 //*************************************************************************************************
1139 
1140 
1141 //*************************************************************************************************
1156 template< typename MT1 // Type of the left-hand side matrix
1157  , bool SO1 // Storage order of the left-hand side matrix
1158  , typename MT2 // Type of the right-hand side matrix
1159  , bool SO2 > // Storage order of the right-hand side matrix
1160 BLAZE_ALWAYS_INLINE void addAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1161 {
1163 
1164  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1165  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1166 
1167  addAssign_backend( ~lhs, ~rhs );
1168 }
1170 //*************************************************************************************************
1171 
1172 
1173 //*************************************************************************************************
1183 template< typename MT1 // Type of the left-hand side matrix
1184  , typename MT2 // Type of the right-hand side matrix
1185  , bool SO > // Storage order of both matrices
1186 BLAZE_ALWAYS_INLINE void subAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1187 {
1189 
1190  (~lhs).subAssign( ~rhs );
1191 }
1193 //*************************************************************************************************
1194 
1195 
1196 //*************************************************************************************************
1206 template< typename MT1 // Type of the left-hand side matrix
1207  , bool SO // Storage order of the left-hand side matrix
1208  , typename MT2 > // Type of the right-hand side matrix
1210  subAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1211 {
1213 
1215 
1216  (~lhs).subAssign( ~rhs );
1217 }
1219 //*************************************************************************************************
1220 
1221 
1222 //*************************************************************************************************
1232 template< typename MT1 // Type of the left-hand side matrix
1233  , bool SO // Storage order of the left-hand side matrix
1234  , typename MT2 > // Type of the right-hand side matrix
1236  subAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1237 {
1239 
1241 
1242  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1243 
1244  (~lhs).subAssign( trans( ~rhs ) );
1245 }
1247 //*************************************************************************************************
1248 
1249 
1250 //*************************************************************************************************
1265 template< typename MT1 // Type of the left-hand side matrix
1266  , bool SO1 // Storage order of the left-hand side matrix
1267  , typename MT2 // Type of the right-hand side matrix
1268  , bool SO2 > // Storage order of the right-hand side matrix
1269 BLAZE_ALWAYS_INLINE void subAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1270 {
1272 
1273  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1274  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1275 
1276  subAssign_backend( ~lhs, ~rhs );
1277 }
1279 //*************************************************************************************************
1280 
1281 
1282 //*************************************************************************************************
1292 template< typename MT1 // Type of the left-hand side matrix
1293  , typename MT2 // Type of the right-hand side matrix
1294  , bool SO > // Storage order of both matrices
1295 BLAZE_ALWAYS_INLINE void schurAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,SO>& rhs )
1296 {
1298 
1299  (~lhs).schurAssign( ~rhs );
1300 }
1302 //*************************************************************************************************
1303 
1304 
1305 //*************************************************************************************************
1315 template< typename MT1 // Type of the left-hand side matrix
1316  , bool SO // Storage order of the left-hand side matrix
1317  , typename MT2 > // Type of the right-hand side matrix
1319  schurAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1320 {
1322 
1324 
1325  (~lhs).schurAssign( ~rhs );
1326 }
1328 //*************************************************************************************************
1329 
1330 
1331 //*************************************************************************************************
1341 template< typename MT1 // Type of the left-hand side matrix
1342  , bool SO // Storage order of the left-hand side matrix
1343  , typename MT2 > // Type of the right-hand side matrix
1345  schurAssign_backend( Matrix<MT1,SO>& lhs, const Matrix<MT2,!SO>& rhs )
1346 {
1348 
1350 
1351  BLAZE_INTERNAL_ASSERT( isSquare( ~rhs ), "Non-square symmetric matrix detected" );
1352 
1353  (~lhs).schurAssign( trans( ~rhs ) );
1354 }
1356 //*************************************************************************************************
1357 
1358 
1359 //*************************************************************************************************
1374 template< typename MT1 // Type of the left-hand side matrix
1375  , bool SO1 // Storage order of the left-hand side matrix
1376  , typename MT2 // Type of the right-hand side matrix
1377  , bool SO2 > // Storage order of the right-hand side matrix
1378 BLAZE_ALWAYS_INLINE void schurAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1379 {
1381 
1382  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1383  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1384 
1385  schurAssign_backend( ~lhs, ~rhs );
1386 }
1388 //*************************************************************************************************
1389 
1390 
1391 //*************************************************************************************************
1406 template< typename MT1 // Type of the left-hand side matrix
1407  , bool SO1 // Storage order of the left-hand side matrix
1408  , typename MT2 // Type of the right-hand side matrix
1409  , bool SO2 > // Storage order of the right-hand side matrix
1410 BLAZE_ALWAYS_INLINE void multAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
1411 {
1413 
1414  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).rows(), "Invalid matrix sizes" );
1415 
1416  (~lhs).multAssign( ~rhs );
1417 }
1419 //*************************************************************************************************
1420 
1421 
1422 //*************************************************************************************************
1438 template< typename MT // Type of the matrix
1439  , bool SO // Storage order
1440  , typename ET > // Type of the element
1441 BLAZE_ALWAYS_INLINE bool trySet( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1442 {
1443  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1444  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1445 
1446  UNUSED_PARAMETER( mat, i, j, value );
1447 
1448  return true;
1449 }
1451 //*************************************************************************************************
1452 
1453 
1454 //*************************************************************************************************
1470 template< typename MT // Type of the matrix
1471  , bool SO // Storage order
1472  , typename ET > // Type of the element
1473 BLAZE_ALWAYS_INLINE bool tryAdd( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1474 {
1475  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1476  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1477 
1478  UNUSED_PARAMETER( mat, i, j, value );
1479 
1480  return true;
1481 }
1483 //*************************************************************************************************
1484 
1485 
1486 //*************************************************************************************************
1502 template< typename MT // Type of the matrix
1503  , bool SO // Storage order
1504  , typename ET > // Type of the element
1505 BLAZE_ALWAYS_INLINE bool trySub( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1506 {
1507  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1508  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1509 
1510  UNUSED_PARAMETER( mat, i, j, value );
1511 
1512  return true;
1513 }
1515 //*************************************************************************************************
1516 
1517 
1518 //*************************************************************************************************
1534 template< typename MT // Type of the matrix
1535  , bool SO // Storage order
1536  , typename ET > // Type of the element
1537 BLAZE_ALWAYS_INLINE bool tryMult( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1538 {
1539  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1540  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1541 
1542  UNUSED_PARAMETER( mat, i, j, value );
1543 
1544  return true;
1545 }
1547 //*************************************************************************************************
1548 
1549 
1550 //*************************************************************************************************
1568 template< typename MT // Type of the matrix
1569  , bool SO // Storage order
1570  , typename ET > // Type of the element
1572  tryMult( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1573 {
1574  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1575  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1576  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1577  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1578 
1579  UNUSED_PARAMETER( mat, row, column, m, n, value );
1580 
1581  return true;
1582 }
1584 //*************************************************************************************************
1585 
1586 
1587 //*************************************************************************************************
1603 template< typename MT // Type of the matrix
1604  , bool SO // Storage order
1605  , typename ET > // Type of the element
1606 BLAZE_ALWAYS_INLINE bool tryDiv( const Matrix<MT,SO>& mat, size_t i, size_t j, const ET& value )
1607 {
1608  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
1609  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
1610 
1611  UNUSED_PARAMETER( mat, i, j, value );
1612 
1613  return true;
1614 }
1616 //*************************************************************************************************
1617 
1618 
1619 //*************************************************************************************************
1637 template< typename MT // Type of the matrix
1638  , bool SO // Storage order
1639  , typename ET > // Type of the element
1641  tryDiv( const Matrix<MT,SO>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1642 {
1643  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
1644  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
1645  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
1646  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
1647 
1648  UNUSED_PARAMETER( mat, row, column, m, n, value );
1649 
1650  return true;
1651 }
1653 //*************************************************************************************************
1654 
1655 
1656 //*************************************************************************************************
1672 template< typename MT // Type of the left-hand side matrix
1673  , bool SO // Storage order of the left-hand side matrix
1674  , typename VT // Type of the right-hand side vector
1675  , bool TF > // Transpose flag of the right-hand side vector
1676 BLAZE_ALWAYS_INLINE bool tryAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
1677  size_t row, size_t column )
1678 {
1679  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1680  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1681  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
1682  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
1683 
1684  UNUSED_PARAMETER( lhs, rhs, row, column );
1685 
1686  return true;
1687 }
1689 //*************************************************************************************************
1690 
1691 
1692 //*************************************************************************************************
1709 template< typename MT // Type of the left-hand side matrix
1710  , bool SO // Storage order of the left-hand side matrix
1711  , typename VT // Type of the right-hand side vector
1712  , bool TF > // Transpose flag of the right-hand side vector
1713 BLAZE_ALWAYS_INLINE bool tryAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
1714  ptrdiff_t band, size_t row, size_t column )
1715 {
1716  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1717  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1718  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
1719  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
1720 
1721  UNUSED_PARAMETER( lhs, rhs, band, row, column );
1722 
1723  return true;
1724 }
1726 //*************************************************************************************************
1727 
1728 
1729 //*************************************************************************************************
1745 template< typename MT1 // Type of the left-hand side matrix
1746  , bool SO1 // Storage order of the left-hand side matrix
1747  , typename MT2 // Type of the right-hand side matrix
1748  , bool SO2 > // Storage order of the right-hand side matrix
1749 BLAZE_ALWAYS_INLINE bool tryAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
1750  size_t row, size_t column )
1751 {
1752  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1753  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1754  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
1755  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
1756 
1757  UNUSED_PARAMETER( lhs, rhs, row, column );
1758 
1759  return true;
1760 }
1762 //*************************************************************************************************
1763 
1764 
1765 //*************************************************************************************************
1781 template< typename MT // Type of the left-hand side matrix
1782  , bool SO // Storage order of the left-hand side matrix
1783  , typename VT // Type of the right-hand side vector
1784  , bool TF > // Transpose flag of the right-hand side vector
1785 BLAZE_ALWAYS_INLINE bool tryAddAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
1786  size_t row, size_t column )
1787 {
1788  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1789  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1790  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
1791  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
1792 
1793  UNUSED_PARAMETER( lhs, rhs, row, column );
1794 
1795  return true;
1796 }
1798 //*************************************************************************************************
1799 
1800 
1801 //*************************************************************************************************
1818 template< typename MT // Type of the left-hand side matrix
1819  , bool SO // Storage order of the left-hand side matrix
1820  , typename VT // Type of the right-hand side vector
1821  , bool TF > // Transpose flag of the right-hand side vector
1822 BLAZE_ALWAYS_INLINE bool tryAddAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
1823  ptrdiff_t band, size_t row, size_t column )
1824 {
1825  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1826  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1827  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
1828  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
1829 
1830  UNUSED_PARAMETER( lhs, rhs, band, row, column );
1831 
1832  return true;
1833 }
1835 //*************************************************************************************************
1836 
1837 
1838 //*************************************************************************************************
1854 template< typename MT1 // Type of the left-hand side matrix
1855  , bool SO1 // Storage order of the left-hand side matrix
1856  , typename MT2 // Type of the right-hand side matrix
1857  , bool SO2 > // Storage order of the right-hand side matrix
1858 BLAZE_ALWAYS_INLINE bool tryAddAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
1859  size_t row, size_t column )
1860 {
1861  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1862  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1863  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
1864  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
1865 
1866  UNUSED_PARAMETER( lhs, rhs, row, column );
1867 
1868  return true;
1869 }
1871 //*************************************************************************************************
1872 
1873 
1874 //*************************************************************************************************
1890 template< typename MT // Type of the left-hand side matrix
1891  , bool SO // Storage order of the left-hand side matrix
1892  , typename VT // Type of the right-hand side vector
1893  , bool TF > // Transpose flag of the right-hand side vector
1894 BLAZE_ALWAYS_INLINE bool trySubAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
1895  size_t row, size_t column )
1896 {
1897  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1898  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1899  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
1900  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
1901 
1902  UNUSED_PARAMETER( lhs, rhs, row, column );
1903 
1904  return true;
1905 }
1907 //*************************************************************************************************
1908 
1909 
1910 //*************************************************************************************************
1928 template< typename MT // Type of the left-hand side matrix
1929  , bool SO // Storage order of the left-hand side matrix
1930  , typename VT // Type of the right-hand side vector
1931  , bool TF > // Transpose flag of the right-hand side vector
1932 BLAZE_ALWAYS_INLINE bool trySubAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
1933  ptrdiff_t band, size_t row, size_t column )
1934 {
1935  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1936  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1937  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
1938  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
1939 
1940  UNUSED_PARAMETER( lhs, rhs, band, row, column );
1941 
1942  return true;
1943 }
1945 //*************************************************************************************************
1946 
1947 
1948 //*************************************************************************************************
1964 template< typename MT1 // Type of the left-hand side matrix
1965  , bool SO1 // Storage order of the left-hand side matrix
1966  , typename MT2 // Type of the right-hand side matrix
1967  , bool SO2 > // Storage order of the right-hand side matrix
1968 BLAZE_ALWAYS_INLINE bool trySubAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
1969  size_t row, size_t column )
1970 {
1971  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
1972  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
1973  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
1974  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
1975 
1976  UNUSED_PARAMETER( lhs, rhs, row, column );
1977 
1978  return true;
1979 }
1981 //*************************************************************************************************
1982 
1983 
1984 //*************************************************************************************************
2000 template< typename MT // Type of the left-hand side matrix
2001  , bool SO // Storage order of the left-hand side matrix
2002  , typename VT // Type of the right-hand side vector
2003  , bool TF > // Transpose flag of the right-hand side vector
2004 BLAZE_ALWAYS_INLINE bool tryMultAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2005  size_t row, size_t column )
2006 {
2007  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2008  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2009  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2010  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2011 
2012  UNUSED_PARAMETER( lhs, rhs, row, column );
2013 
2014  return true;
2015 }
2017 //*************************************************************************************************
2018 
2019 
2020 //*************************************************************************************************
2038 template< typename MT // Type of the left-hand side matrix
2039  , bool SO // Storage order of the left-hand side matrix
2040  , typename VT // Type of the right-hand side vector
2041  , bool TF > // Transpose flag of the right-hand side vector
2042 BLAZE_ALWAYS_INLINE bool tryMultAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2043  ptrdiff_t band, size_t row, size_t column )
2044 {
2045  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2046  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2047  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2048  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2049 
2050  UNUSED_PARAMETER( lhs, rhs, band, row, column );
2051 
2052  return true;
2053 }
2055 //*************************************************************************************************
2056 
2057 
2058 //*************************************************************************************************
2074 template< typename MT1 // Type of the left-hand side matrix
2075  , bool SO1 // Storage order of the left-hand side matrix
2076  , typename MT2 // Type of the right-hand side matrix
2077  , bool SO2 > // Storage order of the right-hand side matrix
2078 BLAZE_ALWAYS_INLINE bool trySchurAssign( const Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs,
2079  size_t row, size_t column )
2080 {
2081  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2082  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2083  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= (~lhs).rows(), "Invalid number of rows" );
2084  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= (~lhs).columns(), "Invalid number of columns" );
2085 
2086  UNUSED_PARAMETER( lhs, rhs, row, column );
2087 
2088  return true;
2089 }
2091 //*************************************************************************************************
2092 
2093 
2094 //*************************************************************************************************
2110 template< typename MT // Type of the left-hand side matrix
2111  , bool SO // Storage order of the left-hand side matrix
2112  , typename VT // Type of the right-hand side vector
2113  , bool TF > // Transpose flag of the right-hand side vector
2114 BLAZE_ALWAYS_INLINE bool tryDivAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2115  size_t row, size_t column )
2116 {
2117  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2118  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2119  BLAZE_INTERNAL_ASSERT( TF || ( row + (~rhs).size() <= (~lhs).rows() ), "Invalid number of rows" );
2120  BLAZE_INTERNAL_ASSERT( !TF || ( column + (~rhs).size() <= (~lhs).columns() ), "Invalid number of columns" );
2121 
2122  UNUSED_PARAMETER( lhs, rhs, row, column );
2123 
2124  return true;
2125 }
2127 //*************************************************************************************************
2128 
2129 
2130 //*************************************************************************************************
2148 template< typename MT // Type of the left-hand side matrix
2149  , bool SO // Storage order of the left-hand side matrix
2150  , typename VT // Type of the right-hand side vector
2151  , bool TF > // Transpose flag of the right-hand side vector
2152 BLAZE_ALWAYS_INLINE bool tryDivAssign( const Matrix<MT,SO>& lhs, const Vector<VT,TF>& rhs,
2153  ptrdiff_t band, size_t row, size_t column )
2154 {
2155  BLAZE_INTERNAL_ASSERT( row <= (~lhs).rows(), "Invalid row access index" );
2156  BLAZE_INTERNAL_ASSERT( column <= (~lhs).columns(), "Invalid column access index" );
2157  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= (~lhs).rows(), "Invalid number of rows" );
2158  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= (~lhs).columns(), "Invalid number of columns" );
2159 
2160  UNUSED_PARAMETER( lhs, rhs, band, row, column );
2161 
2162  return true;
2163 }
2165 //*************************************************************************************************
2166 
2167 
2168 //*************************************************************************************************
2183 template< typename MT // Type of the matrix
2184  , bool SO > // Storage order
2185 BLAZE_ALWAYS_INLINE MT& derestrict( Matrix<MT,SO>& matrix )
2186 {
2187  return ~matrix;
2188 }
2190 //*************************************************************************************************
2191 
2192 } // namespace blaze
2193 
2194 #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
Pointer difference type of the Blaze library.
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:131
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
BLAZE_ALWAYS_INLINE 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:949
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Header file for the IsSame and IsStrictlySame type traits.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the And class template.
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
const MT::ResultType evaluate(const Matrix< MT, SO > &matrix)
Evaluates the given matrix expression.
Definition: Matrix.h:888
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:474
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:408
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.
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:88
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:714
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:430
Header file for all forward declarations for expression class templates.
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:134
#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, a compilation error is created.
Definition: Symmetric.h:79
Header file for run time assertion macros.
BLAZE_ALWAYS_INLINE const MatrixType & operator~() const noexcept
Conversion operator for constant matrices.
Definition: Matrix.h:105
Expression object for sparse matrix-scalar divisions.The SMatScalarMult class represents the compile ...
Definition: Forward.h:113
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#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
Compile time type negation.The Not alias declaration negates the given compile time condition...
Definition: Not.h:70
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
Header file for the IsResizable type trait.
BLAZE_ALWAYS_INLINE MatrixType & operator~() noexcept
Conversion operator for non-constant matrices.
Definition: Matrix.h:95
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, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the function trace functionality.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801