Row.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_ROW_H_
36 #define _BLAZE_MATH_VIEWS_ROW_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Exception.h>
70 #include <blaze/math/views/Check.h>
74 #include <blaze/util/Assert.h>
76 #include <blaze/util/mpl/And.h>
77 #include <blaze/util/mpl/Or.h>
78 #include <blaze/util/TrueType.h>
79 #include <blaze/util/TypeList.h>
80 #include <blaze/util/Types.h>
81 #include <blaze/util/Unused.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // GLOBAL FUNCTIONS
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
127 template< size_t I // Row index
128  , typename MT // Type of the matrix
129  , bool SO // Storage order
130  , typename... RRAs > // Optional row arguments
131 inline decltype(auto) row( Matrix<MT,SO>& matrix, RRAs... args )
132 {
134 
135  using ReturnType = Row_<MT,I>;
136  return ReturnType( ~matrix, args... );
137 }
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
176 template< size_t I // Row index
177  , typename MT // Type of the matrix
178  , bool SO // Storage order
179  , typename... RRAs > // Optional row arguments
180 inline decltype(auto) row( const Matrix<MT,SO>& matrix, RRAs... args )
181 {
183 
184  using ReturnType = const Row_<const MT,I>;
185  return ReturnType( ~matrix, args... );
186 }
187 //*************************************************************************************************
188 
189 
190 //*************************************************************************************************
204 template< size_t I // Row index
205  , typename MT // Type of the matrix
206  , bool SO // Storage order
207  , typename... RRAs > // Optional row arguments
208 inline decltype(auto) row( Matrix<MT,SO>&& matrix, RRAs... args )
209 {
211 
212  using ReturnType = Row_<MT,I>;
213  return ReturnType( ~matrix, args... );
214 }
215 //*************************************************************************************************
216 
217 
218 //*************************************************************************************************
254 template< typename MT // Type of the matrix
255  , bool SO // Storage order
256  , typename... RRAs > // Optional row arguments
257 inline decltype(auto) row( Matrix<MT,SO>& matrix, size_t index, RRAs... args )
258 {
260 
261  using ReturnType = Row_<MT>;
262  return ReturnType( ~matrix, index, args... );
263 }
264 //*************************************************************************************************
265 
266 
267 //*************************************************************************************************
303 template< typename MT // Type of the matrix
304  , bool SO // Storage order
305  , typename... RRAs > // Optional row arguments
306 inline decltype(auto) row( const Matrix<MT,SO>& matrix, size_t index, RRAs... args )
307 {
309 
310  using ReturnType = const Row_<const MT>;
311  return ReturnType( ~matrix, index, args... );
312 }
313 //*************************************************************************************************
314 
315 
316 //*************************************************************************************************
331 template< typename MT // Type of the matrix
332  , bool SO // Storage order
333  , typename... RRAs > // Optional row arguments
334 inline decltype(auto) row( Matrix<MT,SO>&& matrix, size_t index, RRAs... args )
335 {
337 
338  using ReturnType = Row_<MT>;
339  return ReturnType( ~matrix, index, args... );
340 }
341 //*************************************************************************************************
342 
343 
344 
345 
346 //=================================================================================================
347 //
348 // GLOBAL RESTRUCTURING FUNCTIONS
349 //
350 //=================================================================================================
351 
352 //*************************************************************************************************
364 template< size_t... CRAs // Compile time row arguments
365  , typename MT // Matrix base type of the expression
366  , typename... RRAs > // Runtime row arguments
367 inline decltype(auto) row( const MatMatAddExpr<MT>& matrix, RRAs... args )
368 {
370 
371  return row<CRAs...>( (~matrix).leftOperand(), args... ) +
372  row<CRAs...>( (~matrix).rightOperand(), args... );
373 }
375 //*************************************************************************************************
376 
377 
378 //*************************************************************************************************
390 template< size_t... CRAs // Compile time row arguments
391  , typename MT // Matrix base type of the expression
392  , typename... RRAs > // Runtime row arguments
393 inline decltype(auto) row( const MatMatSubExpr<MT>& matrix, RRAs... args )
394 {
396 
397  return row<CRAs...>( (~matrix).leftOperand(), args... ) -
398  row<CRAs...>( (~matrix).rightOperand(), args... );
399 }
401 //*************************************************************************************************
402 
403 
404 //*************************************************************************************************
415 template< size_t... CRAs // Compile time row arguments
416  , typename MT // Matrix base type of the expression
417  , typename... RRAs > // Runtime row arguments
418 inline decltype(auto) row( const SchurExpr<MT>& matrix, RRAs... args )
419 {
421 
422  return row<CRAs...>( (~matrix).leftOperand(), args... ) *
423  row<CRAs...>( (~matrix).rightOperand(), args... );
424 }
426 //*************************************************************************************************
427 
428 
429 //*************************************************************************************************
441 template< size_t... CRAs // Compile time row arguments
442  , typename MT // Matrix base type of the expression
443  , typename... RRAs > // Runtime row arguments
444 inline decltype(auto) row( const MatMatMultExpr<MT>& matrix, RRAs... args )
445 {
447 
448  return row<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
449 }
451 //*************************************************************************************************
452 
453 
454 //*************************************************************************************************
466 template< size_t I // Row index
467  , typename MT // Matrix base type of the expression
468  , typename... RRAs > // Optional row arguments
469 inline decltype(auto) row( const VecTVecMultExpr<MT>& matrix, RRAs... args )
470 {
472 
473  UNUSED_PARAMETER( args... );
474 
475  if( !Contains< TypeList<RRAs...>, Unchecked >::value ) {
476  if( (~matrix).rows() <= I ) {
477  BLAZE_THROW_INVALID_ARGUMENT( "Invalid row access index" );
478  }
479  }
480 
481  return (~matrix).leftOperand()[I] * (~matrix).rightOperand();
482 }
484 //*************************************************************************************************
485 
486 
487 //*************************************************************************************************
500 template< typename MT // Matrix base type of the expression
501  , typename... RRAs > // Optional row arguments
502 inline decltype(auto) row( const VecTVecMultExpr<MT>& matrix, size_t index, RRAs... args )
503 {
505 
506  UNUSED_PARAMETER( args... );
507 
508  if( !Contains< TypeList<RRAs...>, Unchecked >::value ) {
509  if( (~matrix).rows() <= index ) {
510  BLAZE_THROW_INVALID_ARGUMENT( "Invalid row access index" );
511  }
512  }
513 
514  return (~matrix).leftOperand()[index] * (~matrix).rightOperand();
515 }
517 //*************************************************************************************************
518 
519 
520 //*************************************************************************************************
532 template< size_t... CRAs // Compile time row arguments
533  , typename MT // Matrix base type of the expression
534  , typename... RRAs > // Runtime row arguments
535 inline decltype(auto) row( const MatScalarMultExpr<MT>& matrix, RRAs... args )
536 {
538 
539  return row<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
540 }
542 //*************************************************************************************************
543 
544 
545 //*************************************************************************************************
557 template< size_t... CRAs // Compile time row arguments
558  , typename MT // Matrix base type of the expression
559  , typename... RRAs > // Runtime row arguments
560 inline decltype(auto) row( const MatScalarDivExpr<MT>& matrix, RRAs... args )
561 {
563 
564  return row<CRAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
565 }
567 //*************************************************************************************************
568 
569 
570 //*************************************************************************************************
582 template< size_t... CRAs // Compile time row arguments
583  , typename MT // Matrix base type of the expression
584  , typename... RRAs > // Runtime row arguments
585 inline decltype(auto) row( const MatMapExpr<MT>& matrix, RRAs... args )
586 {
588 
589  return map( row<CRAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
590 }
592 //*************************************************************************************************
593 
594 
595 //*************************************************************************************************
607 template< size_t... CRAs // Compile time row arguments
608  , typename MT // Matrix base type of the expression
609  , typename... RRAs > // Runtime row arguments
610 inline decltype(auto) row( const MatMatMapExpr<MT>& matrix, RRAs... args )
611 {
613 
614  return map( row<CRAs...>( (~matrix).leftOperand(), args... ),
615  row<CRAs...>( (~matrix).rightOperand(), args... ),
616  (~matrix).operation() );
617 }
619 //*************************************************************************************************
620 
621 
622 //*************************************************************************************************
634 template< size_t... CRAs // Compile time row arguments
635  , typename MT // Matrix base type of the expression
636  , typename... RRAs > // Runtime row arguments
637 inline decltype(auto) row( const MatEvalExpr<MT>& matrix, RRAs... args )
638 {
640 
641  return eval( row<CRAs...>( (~matrix).operand(), args... ) );
642 }
644 //*************************************************************************************************
645 
646 
647 //*************************************************************************************************
659 template< size_t... CRAs // Compile time row arguments
660  , typename MT // Matrix base type of the expression
661  , typename... RRAs > // Runtime row arguments
662 inline decltype(auto) row( const MatSerialExpr<MT>& matrix, RRAs... args )
663 {
665 
666  return serial( row<CRAs...>( (~matrix).operand(), args... ) );
667 }
669 //*************************************************************************************************
670 
671 
672 //*************************************************************************************************
684 template< size_t... CRAs // Compile time row arguments
685  , typename MT // Matrix base type of the expression
686  , typename... RRAs > // Runtime row arguments
687 inline decltype(auto) row( const DeclExpr<MT>& matrix, RRAs... args )
688 {
690 
691  return row<CRAs...>( (~matrix).operand(), args... );
692 }
694 //*************************************************************************************************
695 
696 
697 //*************************************************************************************************
709 template< size_t... CRAs // Compile time row arguments
710  , typename MT // Matrix base type of the expression
711  , typename... RRAs > // Runtime row arguments
712 inline decltype(auto) row( const MatTransExpr<MT>& matrix, RRAs... args )
713 {
715 
716  return trans( column<CRAs...>( (~matrix).operand(), args... ) );
717 }
719 //*************************************************************************************************
720 
721 
722 
723 
724 //=================================================================================================
725 //
726 // ROW OPERATORS
727 //
728 //=================================================================================================
729 
730 //*************************************************************************************************
738 template< typename MT // Type of the matrix
739  , bool SO // Storage order
740  , bool DF // Density flag
741  , bool SF // Symmetry flag
742  , size_t... CRAs > // Compile time row arguments
743 inline void reset( Row<MT,SO,DF,SF,CRAs...>& row )
744 {
745  row.reset();
746 }
748 //*************************************************************************************************
749 
750 
751 //*************************************************************************************************
759 template< typename MT // Type of the matrix
760  , bool SO // Storage order
761  , bool DF // Density flag
762  , bool SF // Symmetry flag
763  , size_t... CRAs > // Compile time row arguments
764 inline void reset( Row<MT,SO,DF,SF,CRAs...>&& row )
765 {
766  row.reset();
767 }
769 //*************************************************************************************************
770 
771 
772 //*************************************************************************************************
782 template< typename MT // Type of the matrix
783  , bool SO // Storage order
784  , bool DF // Density flag
785  , bool SF // Symmetry flag
786  , size_t... CRAs > // Compile time row arguments
787 inline void clear( Row<MT,SO,DF,SF,CRAs...>& row )
788 {
789  row.reset();
790 }
792 //*************************************************************************************************
793 
794 
795 //*************************************************************************************************
805 template< typename MT // Type of the matrix
806  , bool SO // Storage order
807  , bool DF // Density flag
808  , bool SF // Symmetry flag
809  , size_t... CRAs > // Compile time row arguments
810 inline void clear( Row<MT,SO,DF,SF,CRAs...>&& row )
811 {
812  row.reset();
813 }
815 //*************************************************************************************************
816 
817 
818 //*************************************************************************************************
844 template< bool RF // Relaxation flag
845  , typename MT // Type of the matrix
846  , bool SO // Storage order
847  , bool SF // Symmetry flag
848  , size_t... CRAs > // Compile time row arguments
849 inline bool isDefault( const Row<MT,SO,true,SF,CRAs...>& row )
850 {
851  using blaze::isDefault;
852 
853  for( size_t i=0UL; i<row.size(); ++i )
854  if( !isDefault<RF>( row[i] ) ) return false;
855  return true;
856 }
858 //*************************************************************************************************
859 
860 
861 //*************************************************************************************************
887 template< bool RF // Relaxation flag
888  , typename MT // Type of the matrix
889  , bool SO // Storage order
890  , bool SF // Symmetry flag
891  , size_t... CRAs > // Compile time row arguments
892 inline bool isDefault( const Row<MT,SO,false,SF,CRAs...>& row )
893 {
894  using blaze::isDefault;
895 
896  for( const auto& element : row )
897  if( !isDefault<RF>( element.value() ) ) return false;
898  return true;
899 }
901 //*************************************************************************************************
902 
903 
904 //*************************************************************************************************
922 template< typename MT // Type of the matrix
923  , bool SO // Storage order
924  , bool DF // Density flag
925  , bool SF // Symmetry flag
926  , size_t... CRAs > // Compile time row arguments
927 inline bool isIntact( const Row<MT,SO,DF,SF,CRAs...>& row ) noexcept
928 {
929  return ( row.row() < row.operand().rows() &&
930  isIntact( row.operand() ) );
931 }
933 //*************************************************************************************************
934 
935 
936 //*************************************************************************************************
949 template< typename MT1 // Type of the matrix of the left-hand side row
950  , bool SO // Storage order
951  , bool DF // Density flag
952  , bool SF1 // Symmetry flag of the left-hand side row
953  , size_t... CRAs1 // Compile time row arguments of the left-hand side row
954  , typename MT2 // Type of the matrix of the right-hand side row
955  , bool SF2 // Symmetry flag of the right-hand side row
956  , size_t... CRAs2 > // Compile time row arguments of the right-hand side row
957 inline bool isSame( const Row<MT1,SO,DF,SF1,CRAs1...>& a,
958  const Row<MT2,SO,DF,SF2,CRAs2...>& b ) noexcept
959 {
960  return ( isSame( a.operand(), b.operand() ) && ( a.row() == b.row() ) );
961 }
963 //*************************************************************************************************
964 
965 
966 //*************************************************************************************************
981 template< typename MT // Type of the matrix
982  , bool SO // Storage order
983  , bool DF // Density flag
984  , bool SF // Symmetry flag
985  , size_t... CRAs // Compile time row arguments
986  , typename ET > // Type of the element
987 inline bool trySet( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, const ET& value )
988 {
989  BLAZE_INTERNAL_ASSERT( index < row.size(), "Invalid vector access index" );
990 
991  return trySet( row.operand(), row.row(), index, value );
992 }
994 //*************************************************************************************************
995 
996 
997 //*************************************************************************************************
1012 template< typename MT // Type of the matrix
1013  , bool SO // Storage order
1014  , bool DF // Density flag
1015  , bool SF // Symmetry flag
1016  , size_t... CRAs // Compile time row arguments
1017  , typename ET > // Type of the element
1018 inline bool tryAdd( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, const ET& value )
1019 {
1020  BLAZE_INTERNAL_ASSERT( index < row.size(), "Invalid vector access index" );
1021 
1022  return tryAdd( row.operand(), row.row(), index, value );
1023 }
1025 //*************************************************************************************************
1026 
1027 
1028 //*************************************************************************************************
1043 template< typename MT // Type of the matrix
1044  , bool SO // Storage order
1045  , bool DF // Density flag
1046  , bool SF // Symmetry flag
1047  , size_t... CRAs // Compile time row arguments
1048  , typename ET > // Type of the element
1049 inline bool trySub( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, const ET& value )
1050 {
1051  BLAZE_INTERNAL_ASSERT( index < row.size(), "Invalid vector access index" );
1052 
1053  return trySub( row.operand(), row.row(), index, value );
1054 }
1056 //*************************************************************************************************
1057 
1058 
1059 //*************************************************************************************************
1074 template< typename MT // Type of the matrix
1075  , bool SO // Storage order
1076  , bool DF // Density flag
1077  , bool SF // Symmetry flag
1078  , size_t... CRAs // Compile time row arguments
1079  , typename ET > // Type of the element
1080 inline bool tryMult( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, const ET& value )
1081 {
1082  BLAZE_INTERNAL_ASSERT( index < row.size(), "Invalid vector access index" );
1083 
1084  return tryMult( row.operand(), row.row(), index, value );
1085 }
1087 //*************************************************************************************************
1088 
1089 
1090 //*************************************************************************************************
1106 template< typename MT // Type of the matrix
1107  , bool SO // Storage order
1108  , bool DF // Density flag
1109  , bool SF // Symmetry flag
1110  , size_t... CRAs // Compile time row arguments
1111  , typename ET > // Type of the element
1113  tryMult( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, size_t size, const ET& value )
1114 {
1115  BLAZE_INTERNAL_ASSERT( index <= (~row).size(), "Invalid vector access index" );
1116  BLAZE_INTERNAL_ASSERT( index + size <= (~row).size(), "Invalid range size" );
1117 
1118  return tryMult( row.operand(), row.row(), index, 1UL, size, value );
1119 }
1121 //*************************************************************************************************
1122 
1123 
1124 //*************************************************************************************************
1139 template< typename MT // Type of the matrix
1140  , bool SO // Storage order
1141  , bool DF // Density flag
1142  , bool SF // Symmetry flag
1143  , size_t... CRAs // Compile time row arguments
1144  , typename ET > // Type of the element
1145 inline bool tryDiv( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, const ET& value )
1146 {
1147  BLAZE_INTERNAL_ASSERT( index < row.size(), "Invalid vector access index" );
1148 
1149  return tryDiv( row.operand(), row.row(), index, value );
1150 }
1152 //*************************************************************************************************
1153 
1154 
1155 //*************************************************************************************************
1171 template< typename MT // Type of the matrix
1172  , bool SO // Storage order
1173  , bool DF // Density flag
1174  , bool SF // Symmetry flag
1175  , size_t... CRAs // Compile time row arguments
1176  , typename ET > // Type of the element
1178  tryDiv( const Row<MT,SO,DF,SF,CRAs...>& row, size_t index, size_t size, const ET& value )
1179 {
1180  BLAZE_INTERNAL_ASSERT( index <= (~row).size(), "Invalid vector access index" );
1181  BLAZE_INTERNAL_ASSERT( index + size <= (~row).size(), "Invalid range size" );
1182 
1183  return tryDiv( row.operand(), row.row(), index, 1UL, size, value );
1184 }
1186 //*************************************************************************************************
1187 
1188 
1189 //*************************************************************************************************
1204 template< typename MT // Type of the matrix
1205  , bool SO // Storage order
1206  , bool DF // Density flag
1207  , bool SF // Symmetry flag
1208  , size_t... CRAs // Compile time row arguments
1209  , typename VT > // Type of the right-hand side vector
1210 inline bool tryAssign( const Row<MT,SO,DF,SF,CRAs...>& lhs,
1211  const Vector<VT,true>& rhs, size_t index )
1212 {
1213  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1214  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1215 
1216  return tryAssign( lhs.operand(), ~rhs, lhs.row(), index );
1217 }
1219 //*************************************************************************************************
1220 
1221 
1222 //*************************************************************************************************
1237 template< typename MT // Type of the matrix
1238  , bool SO // Storage order
1239  , bool DF // Density flag
1240  , bool SF // Symmetry flag
1241  , size_t... CRAs // Compile time row arguments
1242  , typename VT > // Type of the right-hand side vector
1243 inline bool tryAddAssign( const Row<MT,SO,DF,SF,CRAs...>& lhs,
1244  const Vector<VT,true>& rhs, size_t index )
1245 {
1246  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1247  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1248 
1249  return tryAddAssign( lhs.operand(), ~rhs, lhs.row(), index );
1250 }
1252 //*************************************************************************************************
1253 
1254 
1255 //*************************************************************************************************
1270 template< typename MT // Type of the matrix
1271  , bool SO // Storage order
1272  , bool DF // Density flag
1273  , bool SF // Symmetry flag
1274  , size_t... CRAs // Compile time row arguments
1275  , typename VT > // Type of the right-hand side vector
1276 inline bool trySubAssign( const Row<MT,SO,DF,SF,CRAs...>& lhs,
1277  const Vector<VT,true>& rhs, size_t index )
1278 {
1279  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1280  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1281 
1282  return trySubAssign( lhs.operand(), ~rhs, lhs.row(), index );
1283 }
1285 //*************************************************************************************************
1286 
1287 
1288 //*************************************************************************************************
1303 template< typename MT // Type of the matrix
1304  , bool SO // Storage order
1305  , bool DF // Density flag
1306  , bool SF // Symmetry flag
1307  , size_t... CRAs // Compile time row arguments
1308  , typename VT > // Type of the right-hand side vector
1309 inline bool tryMultAssign( const Row<MT,SO,DF,SF,CRAs...>& lhs,
1310  const Vector<VT,true>& rhs, size_t index )
1311 {
1312  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1313  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1314 
1315  return tryMultAssign( lhs.operand(), ~rhs, lhs.row(), index );
1316 }
1318 //*************************************************************************************************
1319 
1320 
1321 //*************************************************************************************************
1336 template< typename MT // Type of the matrix
1337  , bool SO // Storage order
1338  , bool DF // Density flag
1339  , bool SF // Symmetry flag
1340  , size_t... CRAs // Compile time row arguments
1341  , typename VT > // Type of the right-hand side vector
1342 inline bool tryDivAssign( const Row<MT,SO,DF,SF,CRAs...>& lhs,
1343  const Vector<VT,true>& rhs, size_t index )
1344 {
1345  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1346  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1347 
1348  return tryDivAssign( lhs.operand(), ~rhs, lhs.row(), index );
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1369 template< typename MT // Type of the matrix
1370  , bool SO // Storage order
1371  , bool DF // Density flag
1372  , bool SF // Symmetry flag
1373  , size_t I > // Row index
1374 inline decltype(auto) derestrict( Row<MT,SO,DF,SF,I>& r )
1375 {
1376  return row<I>( derestrict( r.operand() ), unchecked );
1377 }
1379 //*************************************************************************************************
1380 
1381 
1382 //*************************************************************************************************
1397 template< typename MT // Type of the matrix
1398  , bool SO // Storage order
1399  , bool DF // Density flag
1400  , bool SF // Symmetry flag
1401  , size_t I > // Row index
1402 inline decltype(auto) derestrict( Row<MT,SO,DF,SF,I>&& r )
1403 {
1404  return row<I>( derestrict( r.operand() ), unchecked );
1405 }
1407 //*************************************************************************************************
1408 
1409 
1410 //*************************************************************************************************
1425 template< typename MT // Type of the matrix
1426  , bool SO // Storage order
1427  , bool DF // Density flag
1428  , bool SF > // Symmetry flag
1429 inline decltype(auto) derestrict( Row<MT,SO,DF,SF>& r )
1430 {
1431  return row( derestrict( r.operand() ), r.row(), unchecked );
1432 }
1434 //*************************************************************************************************
1435 
1436 
1437 //*************************************************************************************************
1452 template< typename MT // Type of the matrix
1453  , bool SO // Storage order
1454  , bool DF // Density flag
1455  , bool SF > // Symmetry flag
1456 inline decltype(auto) derestrict( Row<MT,SO,DF,SF>&& r )
1457 {
1458  return row( derestrict( r.operand() ), r.row(), unchecked );
1459 }
1461 //*************************************************************************************************
1462 
1463 
1464 
1465 
1466 //=================================================================================================
1467 //
1468 // SIZE SPECIALIZATIONS
1469 //
1470 //=================================================================================================
1471 
1472 //*************************************************************************************************
1474 template< typename MT, bool SO, bool DF, bool SF, size_t... CRAs >
1475 struct Size< Row<MT,SO,DF,SF,CRAs...>, 0UL >
1476  : public Size<MT,1UL>
1477 {};
1479 //*************************************************************************************************
1480 
1481 
1482 
1483 
1484 //=================================================================================================
1485 //
1486 // ISRESTRICTED SPECIALIZATIONS
1487 //
1488 //=================================================================================================
1489 
1490 //*************************************************************************************************
1492 template< typename MT, bool SO, bool DF, bool SF, size_t... CRAs >
1493 struct IsRestricted< Row<MT,SO,DF,SF,CRAs...> >
1494  : public IsRestricted<MT>
1495 {};
1497 //*************************************************************************************************
1498 
1499 
1500 
1501 
1502 //=================================================================================================
1503 //
1504 // HASCONSTDATAACCESS SPECIALIZATIONS
1505 //
1506 //=================================================================================================
1507 
1508 //*************************************************************************************************
1510 template< typename MT, bool SO, bool SF, size_t... CRAs >
1511 struct HasConstDataAccess< Row<MT,SO,true,SF,CRAs...> >
1512  : public HasConstDataAccess<MT>
1513 {};
1515 //*************************************************************************************************
1516 
1517 
1518 
1519 
1520 //=================================================================================================
1521 //
1522 // HASMUTABLEDATAACCESS SPECIALIZATIONS
1523 //
1524 //=================================================================================================
1525 
1526 //*************************************************************************************************
1528 template< typename MT, bool SO, bool SF, size_t... CRAs >
1529 struct HasMutableDataAccess< Row<MT,SO,true,SF,CRAs...> >
1530  : public HasMutableDataAccess<MT>
1531 {};
1533 //*************************************************************************************************
1534 
1535 
1536 
1537 
1538 //=================================================================================================
1539 //
1540 // ISALIGNED SPECIALIZATIONS
1541 //
1542 //=================================================================================================
1543 
1544 //*************************************************************************************************
1546 template< typename MT, bool SO, bool SF, size_t... CRAs >
1547 struct IsAligned< Row<MT,SO,true,SF,CRAs...> >
1548  : public And< IsAligned<MT>, Or< IsRowMajorMatrix<MT>, IsSymmetric<MT> > >
1549 {};
1551 //*************************************************************************************************
1552 
1553 
1554 
1555 
1556 //=================================================================================================
1557 //
1558 // ISCONTIGUOUS SPECIALIZATIONS
1559 //
1560 //=================================================================================================
1561 
1562 //*************************************************************************************************
1564 template< typename MT, bool SF, size_t... CRAs >
1565 struct IsContiguous< Row<MT,true,true,SF,CRAs...> >
1566  : public IsContiguous<MT>
1567 {};
1569 //*************************************************************************************************
1570 
1571 
1572 
1573 
1574 //=================================================================================================
1575 //
1576 // ISPADDED SPECIALIZATIONS
1577 //
1578 //=================================================================================================
1579 
1580 //*************************************************************************************************
1582 template< typename MT, bool SO, bool SF, size_t... CRAs >
1583 struct IsPadded< Row<MT,SO,true,SF,CRAs...> >
1584  : public And< IsPadded<MT>, Or< IsRowMajorMatrix<MT>, IsSymmetric<MT> > >
1585 {};
1587 //*************************************************************************************************
1588 
1589 
1590 
1591 
1592 //=================================================================================================
1593 //
1594 // ISOPPOSEDVIEW SPECIALIZATIONS
1595 //
1596 //=================================================================================================
1597 
1598 //*************************************************************************************************
1600 template< typename MT, bool DF, size_t... CRAs >
1601 struct IsOpposedView< Row<MT,false,DF,false,CRAs...> >
1602  : public TrueType
1603 {};
1605 //*************************************************************************************************
1606 
1607 
1608 
1609 
1610 //=================================================================================================
1611 //
1612 // SUBVECTORTRAIT SPECIALIZATIONS
1613 //
1614 //=================================================================================================
1615 
1616 //*************************************************************************************************
1618 template< typename MT, bool SO, bool DF, bool SF, size_t... CRAs, size_t... CSAs >
1619 struct SubvectorTrait< Row<MT,SO,DF,SF,CRAs...>, CSAs... >
1620 {
1621  using Type = SubvectorTrait_< ResultType_< Row<MT,SO,DF,SF,CRAs...> >, CSAs... >;
1622 };
1624 //*************************************************************************************************
1625 
1626 
1627 
1628 
1629 //=================================================================================================
1630 //
1631 // ELEMENTSTRAIT SPECIALIZATIONS
1632 //
1633 //=================================================================================================
1634 
1635 //*************************************************************************************************
1637 template< typename MT, bool SO, bool DF, bool SF, size_t... CRAs, size_t... CEAs >
1638 struct ElementsTrait< Row<MT,SO,DF,SF,CRAs...>, CEAs... >
1639 {
1640  using Type = ElementsTrait_< ResultType_< Row<MT,SO,DF,SF,CRAs...> >, CEAs... >;
1641 };
1643 //*************************************************************************************************
1644 
1645 } // namespace blaze
1646 
1647 #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 the blaze::checked and blaze::unchecked instances.
Base class for all binary matrix map expression templates.The MatMatMapExpr class serves as a tag for...
Definition: MatMatMapExpr.h:66
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Header file for the UNUSED_PARAMETER function template.
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.
Base class for all matrix serial evaluation expression templates.The MatSerialExpr class serves as a ...
Definition: MatSerialExpr.h:67
Header file for the row trait.
Base class for all matrix/scalar division expression templates.The MatScalarDivExpr class serves as a...
Definition: MatScalarDivExpr.h:66
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the MatTransExpr base class.
Compile time check for resizable data types.This type trait tests whether the given data type is an o...
Definition: IsOpposedView.h:81
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
Row specialization for dense matrices.
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the And class template.
Header file for the MatEvalExpr base class.
Header file for the MatMatMultExpr base class.
typename ElementsTrait< VT, CEAs... >::Type ElementsTrait_
Auxiliary alias declaration for the ElementsTrait type trait.The ElementsTrait_ alias declaration pro...
Definition: ElementsTrait.h:144
Row specialization for sparse matrices.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the elements trait.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Header file for the MatMapExpr base class.
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
Header file for the implementation of the Row base template.
Header file for the IsSymmetric type trait.
Base class for all matrix/matrix subtraction expression templates.The MatMatSubExpr class serves as a...
Definition: MatMatSubExpr.h:67
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
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Header file for the Or class template.
Header file for the subvector trait.
Base class for all matrix/matrix addition expression templates.The MatMatAddExpr class serves as a ta...
Definition: MatMatAddExpr.h:66
Header file for the MatMatSubExpr base class.
Header file for the IsAligned type trait.
Base class for all unary matrix map expression templates.The MatMapExpr class serves as a tag for all...
Definition: MatMapExpr.h:66
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
Header file for the IsOpposedView type trait.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:794
Header file for the exception macros of the math module.
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
Header file for the MatSerialExpr base class.
Header file for the VecTVecMultExpr base class.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_ alias declaration p...
Definition: SubvectorTrait.h:145
Header file for the HasConstDataAccess type trait.
Header file for the DeclExpr base class.
Base class for all matrix/matrix multiplication expression templates.The MatMatMultExpr class serves ...
Definition: MatMatMultExpr.h:67
Header file for the Matrix base class.
Header file for the MatScalarMultExpr base class.
Base class for all Schur product expression templates.The SchurExpr class serves as a tag for all exp...
Definition: SchurExpr.h:66
Header file for run time assertion macros.
Header file for the Unique class template.
Header file for the IsContiguous type trait.
Header file for the SchurExpr base class.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
Base class for all matrix evaluation expression templates.The MatEvalExpr class serves as a tag for a...
Definition: MatEvalExpr.h:66
#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 the isDefault shim.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:66
Header file for the HasMutableDataAccess type trait.
Header file for the MatMatAddExpr base class.
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:67
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Header file for the IsRowMajorMatrix type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Header file for the MatMatMapExpr base class.
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Compile time logical &#39;and&#39; evaluation.The And alias declaration performs at compile time a logical &#39;a...
Definition: And.h:76
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
Header file for the MatScalarDivExpr base class.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Searching a type list.The Contains class can be used to search the type list for a particular type Ty...
Definition: Contains.h:78
Header file for the Size type trait.
#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 TrueType type/value trait base class.
Header file for the function trace functionality.
Template for the blaze::checked and blaze::unchecked instances.blaze::Check is the template for the b...
Definition: Check.h:56
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs...
Definition: DMatDMatMapExpr.h:1134