Column.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_H_
36 #define _BLAZE_MATH_VIEWS_COLUMN_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 // Column index
128  , typename MT // Type of the matrix
129  , bool SO // Storage order
130  , typename... RCAs > // Optional column arguments
131 inline decltype(auto) column( Matrix<MT,SO>& matrix, RCAs... args )
132 {
134 
135  using ReturnType = Column_<MT,I>;
136  return ReturnType( ~matrix, args... );
137 }
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
176 template< size_t I // Column index
177  , typename MT // Type of the matrix
178  , bool SO // Storage order
179  , typename... RCAs > // Optional column arguments
180 inline decltype(auto) column( const Matrix<MT,SO>& matrix, RCAs... args )
181 {
183 
184  using ReturnType = const Column_<const MT,I>;
185  return ReturnType( ~matrix, args... );
186 }
187 //*************************************************************************************************
188 
189 
190 //*************************************************************************************************
204 template< size_t I // Column index
205  , typename MT // Type of the matrix
206  , bool SO // Storage order
207  , typename... RCAs > // Optional column arguments
208 inline decltype(auto) column( Matrix<MT,SO>&& matrix, RCAs... args )
209 {
211 
212  using ReturnType = Column_<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... RCAs > // Optional column arguments
257 inline decltype(auto) column( Matrix<MT,SO>& matrix, size_t index, RCAs... args )
258 {
260 
261  using ReturnType = Column_<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... RCAs > // Optional column arguments
306 inline decltype(auto) column( const Matrix<MT,SO>& matrix, size_t index, RCAs... args )
307 {
309 
310  using ReturnType = const Column_<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... RCAs > // Optional column arguments
334 inline decltype(auto) column( Matrix<MT,SO>&& matrix, size_t index, RCAs... args )
335 {
337 
338  using ReturnType = Column_<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... CCAs // Compile time column arguments
365  , typename MT // Matrix base type of the expression
366  , typename... RCAs > // Runtime column arguments
367 inline decltype(auto) column( const MatMatAddExpr<MT>& matrix, RCAs... args )
368 {
370 
371  return column<CCAs...>( (~matrix).leftOperand(), args... ) +
372  column<CCAs...>( (~matrix).rightOperand(), args... );
373 }
375 //*************************************************************************************************
376 
377 
378 //*************************************************************************************************
390 template< size_t... CCAs // Compile time column arguments
391  , typename MT // Matrix base type of the expression
392  , typename... RCAs > // Runtime column arguments
393 inline decltype(auto) column( const MatMatSubExpr<MT>& matrix, RCAs... args )
394 {
396 
397  return column<CCAs...>( (~matrix).leftOperand(), args... ) -
398  column<CCAs...>( (~matrix).rightOperand(), args... );
399 }
401 //*************************************************************************************************
402 
403 
404 //*************************************************************************************************
416 template< size_t... CCAs // Compile time column arguments
417  , typename MT // Matrix base type of the expression
418  , typename... RCAs > // Runtime column arguments
419 inline decltype(auto) column( const SchurExpr<MT>& matrix, RCAs... args )
420 {
422 
423  return column<CCAs...>( (~matrix).leftOperand(), args... ) *
424  column<CCAs...>( (~matrix).rightOperand(), args... );
425 }
427 //*************************************************************************************************
428 
429 
430 //*************************************************************************************************
442 template< size_t... CCAs // Compile time column arguments
443  , typename MT // Matrix base type of the expression
444  , typename... RCAs > // Runtime column arguments
445 inline decltype(auto) column( const MatMatMultExpr<MT>& matrix, RCAs... args )
446 {
448 
449  return (~matrix).leftOperand() * column<CCAs...>( (~matrix).rightOperand(), args... );
450 }
452 //*************************************************************************************************
453 
454 
455 //*************************************************************************************************
468 template< size_t I // Column index
469  , typename MT // Matrix base type of the expression
470  , typename... RCAs > // Optional column arguments
471 inline decltype(auto) column( const VecTVecMultExpr<MT>& matrix, RCAs... args )
472 {
474 
475  UNUSED_PARAMETER( args... );
476 
477  if( !Contains< TypeList<RCAs...>, Unchecked >::value ) {
478  if( (~matrix).columns() <= I ) {
479  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
480  }
481  }
482 
483  return (~matrix).leftOperand() * (~matrix).rightOperand()[I];
484 }
486 //*************************************************************************************************
487 
488 
489 //*************************************************************************************************
503 template< typename MT // Matrix base type of the expression
504  , typename... RCAs > // Optional column arguments
505 inline decltype(auto) column( const VecTVecMultExpr<MT>& matrix, size_t index, RCAs... args )
506 {
508 
509  UNUSED_PARAMETER( args... );
510 
511  if( !Contains< TypeList<RCAs...>, Unchecked >::value ) {
512  if( (~matrix).columns() <= index ) {
513  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
514  }
515  }
516 
517  return (~matrix).leftOperand() * (~matrix).rightOperand()[index];
518 }
520 //*************************************************************************************************
521 
522 
523 //*************************************************************************************************
535 template< size_t... CCAs // Compile time column arguments
536  , typename MT // Matrix base type of the expression
537  , typename... RCAs > // Runtime column arguments
538 inline decltype(auto) column( const MatScalarMultExpr<MT>& matrix, RCAs... args )
539 {
541 
542  return column<CCAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
543 }
545 //*************************************************************************************************
546 
547 
548 //*************************************************************************************************
560 template< size_t... CCAs // Compile time column arguments
561  , typename MT // Matrix base type of the expression
562  , typename... RCAs > // Runtime column arguments
563 inline decltype(auto) column( const MatScalarDivExpr<MT>& matrix, RCAs... args )
564 {
566 
567  return column<CCAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
568 }
570 //*************************************************************************************************
571 
572 
573 //*************************************************************************************************
585 template< size_t... CCAs // Compile time column arguments
586  , typename MT // Matrix base type of the expression
587  , typename... RCAs > // Runtime column arguments
588 inline decltype(auto) column( const MatMapExpr<MT>& matrix, RCAs... args )
589 {
591 
592  return map( column<CCAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
593 }
595 //*************************************************************************************************
596 
597 
598 //*************************************************************************************************
610 template< size_t... CCAs // Compile time column arguments
611  , typename MT // Matrix base type of the expression
612  , typename... RCAs > // Runtime column arguments
613 inline decltype(auto) column( const MatMatMapExpr<MT>& matrix, RCAs... args )
614 {
616 
617  return map( column<CCAs...>( (~matrix).leftOperand(), args... ),
618  column<CCAs...>( (~matrix).rightOperand(), args... ),
619  (~matrix).operation() );
620 }
622 //*************************************************************************************************
623 
624 
625 //*************************************************************************************************
637 template< size_t... CCAs // Compile time column arguments
638  , typename MT // Matrix base type of the expression
639  , typename... RCAs > // Runtime column arguments
640 inline decltype(auto) column( const MatEvalExpr<MT>& matrix, RCAs... args )
641 {
643 
644  return eval( column<CCAs...>( (~matrix).operand(), args... ) );
645 }
647 //*************************************************************************************************
648 
649 
650 //*************************************************************************************************
662 template< size_t... CCAs // Compile time column arguments
663  , typename MT // Matrix base type of the expression
664  , typename... RCAs > // Runtime column arguments
665 inline decltype(auto) column( const MatSerialExpr<MT>& matrix, RCAs... args )
666 {
668 
669  return serial( column<CCAs...>( (~matrix).operand(), args... ) );
670 }
672 //*************************************************************************************************
673 
674 
675 //*************************************************************************************************
687 template< size_t... CCAs // Compile time column arguments
688  , typename MT // Matrix base type of the expression
689  , typename... RCAs > // Runtime column arguments
690 inline decltype(auto) column( const DeclExpr<MT>& matrix, RCAs... args )
691 {
693 
694  return column<CCAs...>( (~matrix).operand(), args... );
695 }
697 //*************************************************************************************************
698 
699 
700 //*************************************************************************************************
712 template< size_t... CCAs // Compile time column arguments
713  , typename MT // Matrix base type of the expression
714  , typename... RCAs > // Runtime column arguments
715 inline decltype(auto) column( const MatTransExpr<MT>& matrix, RCAs... args )
716 {
718 
719  return trans( row<CCAs...>( (~matrix).operand(), args... ) );
720 }
722 //*************************************************************************************************
723 
724 
725 
726 
727 //=================================================================================================
728 //
729 // COLUMN OPERATORS
730 //
731 //=================================================================================================
732 
733 //*************************************************************************************************
741 template< typename MT // Type of the matrix
742  , bool SO // Storage order
743  , bool DF // Density flag
744  , bool SF // Symmetry flag
745  , size_t... CCAs > // Compile time column arguments
746 inline void reset( Column<MT,SO,DF,SF,CCAs...>& column )
747 {
748  column.reset();
749 }
751 //*************************************************************************************************
752 
753 
754 //*************************************************************************************************
762 template< typename MT // Type of the matrix
763  , bool SO // Storage order
764  , bool DF // Density flag
765  , bool SF // Symmetry flag
766  , size_t... CCAs > // Compile time column arguments
767 inline void reset( Column<MT,SO,DF,SF,CCAs...>&& column )
768 {
769  column.reset();
770 }
772 //*************************************************************************************************
773 
774 
775 //*************************************************************************************************
785 template< typename MT // Type of the matrix
786  , bool SO // Storage order
787  , bool DF // Density flag
788  , bool SF // Symmetry flag
789  , size_t... CCAs > // Compile time column arguments
790 inline void clear( Column<MT,SO,DF,SF,CCAs...>& column )
791 {
792  column.reset();
793 }
795 //*************************************************************************************************
796 
797 
798 //*************************************************************************************************
808 template< typename MT // Type of the matrix
809  , bool SO // Storage order
810  , bool DF // Density flag
811  , bool SF // Symmetry flag
812  , size_t... CCAs > // Compile time column arguments
813 inline void clear( Column<MT,SO,DF,SF,CCAs...>&& column )
814 {
815  column.reset();
816 }
818 //*************************************************************************************************
819 
820 
821 //*************************************************************************************************
847 template< bool RF // Relaxation flag
848  , typename MT // Type of the dense matrix
849  , bool SO // Storage order
850  , bool SF // Symmetry flag
851  , size_t... CCAs > // Compile time column arguments
852 inline bool isDefault( const Column<MT,SO,true,SF,CCAs...>& column )
853 {
854  using blaze::isDefault;
855 
856  for( size_t i=0UL; i<column.size(); ++i )
857  if( !isDefault<RF>( column[i] ) ) return false;
858  return true;
859 }
861 //*************************************************************************************************
862 
863 
864 //*************************************************************************************************
890 template< bool RF // Relaxation flag
891  , typename MT // Type of the sparse matrix
892  , bool SO // Storage order
893  , bool SF // Symmetry flag
894  , size_t... CCAs > // Compile time column arguments
895 inline bool isDefault( const Column<MT,SO,false,SF,CCAs...>& column )
896 {
897  using blaze::isDefault;
898 
899  for( const auto& element : column )
900  if( !isDefault<RF>( element.value() ) ) return false;
901  return true;
902 }
904 //*************************************************************************************************
905 
906 
907 //*************************************************************************************************
925 template< typename MT // Type of the matrix
926  , bool SO // Storage order
927  , bool DF // Density flag
928  , bool SF // Symmetry flag
929  , size_t... CCAs > // Compile time column arguments
930 inline bool isIntact( const Column<MT,SO,DF,SF,CCAs...>& column ) noexcept
931 {
932  return ( column.column() < column.operand().columns() &&
933  isIntact( column.operand() ) );
934 }
936 //*************************************************************************************************
937 
938 
939 //*************************************************************************************************
952 template< typename MT1 // Type of the matrix of the left-hand side column
953  , bool SO // Storage order
954  , bool DF // Density flag
955  , bool SF1 // Symmetry flag of the left-hand side column
956  , size_t... CCAs1 // Compile time column arguments of the left-hand side column
957  , typename MT2 // Type of the matrix of the right-hand side column
958  , bool SF2 // Symmetry flag of the right-hand side column
959  , size_t... CCAs2 > // Compile time column arguments of the right-hand side column
960 inline bool isSame( const Column<MT1,SO,DF,SF1,CCAs1...>& a,
961  const Column<MT2,SO,DF,SF2,CCAs2...>& b ) noexcept
962 {
963  return ( isSame( a.operand(), b.operand() ) && ( a.column() == b.column() ) );
964 }
966 //*************************************************************************************************
967 
968 
969 //*************************************************************************************************
984 template< typename MT // Type of the matrix
985  , bool SO // Storage order
986  , bool DF // Density flag
987  , bool SF // Symmetry flag
988  , size_t... CCAs // Compile time column arguments
989  , typename ET > // Type of the element
990 inline bool trySet( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, const ET& value )
991 {
992  BLAZE_INTERNAL_ASSERT( index < column.size(), "Invalid vector access index" );
993 
994  return trySet( column.operand(), index, column.column(), value );
995 }
997 //*************************************************************************************************
998 
999 
1000 //*************************************************************************************************
1015 template< typename MT // Type of the matrix
1016  , bool SO // Storage order
1017  , bool DF // Density flag
1018  , bool SF // Symmetry flag
1019  , size_t... CCAs // Compile time column arguments
1020  , typename ET > // Type of the element
1021 inline bool tryAdd( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, const ET& value )
1022 {
1023  BLAZE_INTERNAL_ASSERT( index < column.size(), "Invalid vector access index" );
1024 
1025  return tryAdd( column.operand(), index, column.column(), value );
1026 }
1028 //*************************************************************************************************
1029 
1030 
1031 //*************************************************************************************************
1046 template< typename MT // Type of the matrix
1047  , bool SO // Storage order
1048  , bool DF // Density flag
1049  , bool SF // Symmetry flag
1050  , size_t... CCAs // Compile time column arguments
1051  , typename ET > // Type of the element
1052 inline bool trySub( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, const ET& value )
1053 {
1054  BLAZE_INTERNAL_ASSERT( index < column.size(), "Invalid vector access index" );
1055 
1056  return trySub( column.operand(), index, column.column(), value );
1057 }
1059 //*************************************************************************************************
1060 
1061 
1062 //*************************************************************************************************
1077 template< typename MT // Type of the matrix
1078  , bool SO // Storage order
1079  , bool DF // Density flag
1080  , bool SF // Symmetry flag
1081  , size_t... CCAs // Compile time column arguments
1082  , typename ET > // Type of the element
1083 inline bool tryMult( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, const ET& value )
1084 {
1085  BLAZE_INTERNAL_ASSERT( index < column.size(), "Invalid vector access index" );
1086 
1087  return tryMult( column.operand(), index, column.column(), value );
1088 }
1090 //*************************************************************************************************
1091 
1092 
1093 //*************************************************************************************************
1109 template< typename MT // Type of the matrix
1110  , bool SO // Storage order
1111  , bool DF // Density flag
1112  , bool SF // Symmetry flag
1113  , size_t... CCAs // Compile time column arguments
1114  , typename ET > // Type of the element
1116  tryMult( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, size_t size, const ET& value )
1117 {
1118  BLAZE_INTERNAL_ASSERT( index <= (~column).size(), "Invalid vector access index" );
1119  BLAZE_INTERNAL_ASSERT( index + size <= (~column).size(), "Invalid range size" );
1120 
1121  return tryMult( column.operand(), index, column.column(), size, 1UL, value );
1122 }
1124 //*************************************************************************************************
1125 
1126 
1127 //*************************************************************************************************
1142 template< typename MT // Type of the matrix
1143  , bool SO // Storage order
1144  , bool DF // Density flag
1145  , bool SF // Symmetry flag
1146  , size_t... CCAs // Compile time column arguments
1147  , typename ET > // Type of the element
1148 inline bool tryDiv( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, const ET& value )
1149 {
1150  BLAZE_INTERNAL_ASSERT( index < column.size(), "Invalid vector access index" );
1151 
1152  return tryDiv( column.operand(), index, column.column(), value );
1153 }
1155 //*************************************************************************************************
1156 
1157 
1158 //*************************************************************************************************
1174 template< typename MT // Type of the matrix
1175  , bool SO // Storage order
1176  , bool DF // Density flag
1177  , bool SF // Symmetry flag
1178  , size_t... CCAs // Compile time column arguments
1179  , typename ET > // Type of the element
1181  tryDiv( const Column<MT,SO,DF,SF,CCAs...>& column, size_t index, size_t size, const ET& value )
1182 {
1183  BLAZE_INTERNAL_ASSERT( index <= (~column).size(), "Invalid vector access index" );
1184  BLAZE_INTERNAL_ASSERT( index + size <= (~column).size(), "Invalid range size" );
1185 
1186  return tryDiv( column.operand(), index, column.column(), size, 1UL, value );
1187 }
1189 //*************************************************************************************************
1190 
1191 
1192 //*************************************************************************************************
1207 template< typename MT // Type of the matrix
1208  , bool SO // Storage order
1209  , bool DF // Density flag
1210  , bool SF // Symmetry flag
1211  , size_t... CCAs // Compile time column arguments
1212  , typename VT > // Type of the right-hand side vector
1213 inline bool tryAssign( const Column<MT,SO,DF,SF,CCAs...>& lhs,
1214  const Vector<VT,false>& rhs, size_t index )
1215 {
1216  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1217  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1218 
1219  return tryAssign( lhs.operand(), ~rhs, index, lhs.column() );
1220 }
1222 //*************************************************************************************************
1223 
1224 
1225 //*************************************************************************************************
1240 template< typename MT // Type of the matrix
1241  , bool SO // Storage order
1242  , bool DF // Density flag
1243  , bool SF // Symmetry flag
1244  , size_t... CCAs // Compile time column arguments
1245  , typename VT > // Type of the right-hand side vector
1246 inline bool tryAddAssign( const Column<MT,SO,SF,SF,CCAs...>& lhs,
1247  const Vector<VT,false>& rhs, size_t index )
1248 {
1249  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1250  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1251 
1252  return tryAddAssign( lhs.operand(), ~rhs, index, lhs.column() );
1253 }
1255 //*************************************************************************************************
1256 
1257 
1258 //*************************************************************************************************
1273 template< typename MT // Type of the matrix
1274  , bool SO // Storage order
1275  , bool DF // Density flag
1276  , bool SF // Symmetry flag
1277  , size_t... CCAs // Compile time column arguments
1278  , typename VT > // Type of the right-hand side vector
1279 inline bool trySubAssign( const Column<MT,SO,DF,SF,CCAs...>& lhs,
1280  const Vector<VT,false>& rhs, size_t index )
1281 {
1282  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1283  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1284 
1285  return trySubAssign( lhs.operand(), ~rhs, index, lhs.column() );
1286 }
1288 //*************************************************************************************************
1289 
1290 
1291 //*************************************************************************************************
1306 template< typename MT // Type of the matrix
1307  , bool SO // Storage order
1308  , bool DF // Density flag
1309  , bool SF // Symmetry flag
1310  , size_t... CCAs // Compile time column arguments
1311  , typename VT > // Type of the right-hand side vector
1312 inline bool tryMultAssign( const Column<MT,SO,DF,SF,CCAs...>& lhs,
1313  const Vector<VT,false>& rhs, size_t index )
1314 {
1315  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1316  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1317 
1318  return tryMultAssign( lhs.operand(), ~rhs, index, lhs.column() );
1319 }
1321 //*************************************************************************************************
1322 
1323 
1324 //*************************************************************************************************
1339 template< typename MT // Type of the matrix
1340  , bool SO // Storage order
1341  , bool DF // Density flag
1342  , bool SF // Symmetry flag
1343  , size_t... CCAs // Compile time column arguments
1344  , typename VT > // Type of the right-hand side vector
1345 inline bool tryDivAssign( const Column<MT,SO,DF,SF,CCAs...>& lhs,
1346  const Vector<VT,false>& rhs, size_t index )
1347 {
1348  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1349  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1350 
1351  return tryDivAssign( lhs.operand(), ~rhs, index, lhs.column() );
1352 }
1354 //*************************************************************************************************
1355 
1356 
1357 //*************************************************************************************************
1372 template< typename MT // Type of the matrix
1373  , bool SO // Storage order
1374  , bool DF // Density flag
1375  , bool SF // Symmetry flag
1376  , size_t I > // Compile time column arguments
1377 inline decltype(auto) derestrict( Column<MT,SO,DF,SF,I>& c )
1378 {
1379  return column<I>( derestrict( c.operand() ), unchecked );
1380 }
1382 //*************************************************************************************************
1383 
1384 
1385 //*************************************************************************************************
1400 template< typename MT // Type of the matrix
1401  , bool SO // Storage order
1402  , bool DF // Density flag
1403  , bool SF // Symmetry flag
1404  , size_t I > // Compile time column arguments
1405 inline decltype(auto) derestrict( Column<MT,SO,DF,SF,I>&& c )
1406 {
1407  return column<I>( derestrict( c.operand() ), unchecked );
1408 }
1410 //*************************************************************************************************
1411 
1412 
1413 //*************************************************************************************************
1428 template< typename MT // Type of the matrix
1429  , bool SO // Storage order
1430  , bool DF // Density flag
1431  , bool SF > // Symmetry flag
1432 inline decltype(auto) derestrict( Column<MT,SO,DF,SF>& c )
1433 {
1434  return column( derestrict( c.operand() ), c.column(), unchecked );
1435 }
1437 //*************************************************************************************************
1438 
1439 
1440 //*************************************************************************************************
1455 template< typename MT // Type of the matrix
1456  , bool SO // Storage order
1457  , bool DF // Density flag
1458  , bool SF > // Symmetry flag
1459 inline decltype(auto) derestrict( Column<MT,SO,DF,SF>&& c )
1460 {
1461  return column( derestrict( c.operand() ), c.column(), unchecked );
1462 }
1464 //*************************************************************************************************
1465 
1466 
1467 
1468 
1469 //=================================================================================================
1470 //
1471 // SIZE SPECIALIZATIONS
1472 //
1473 //=================================================================================================
1474 
1475 //*************************************************************************************************
1477 template< typename MT, bool SO, bool DF, bool SF, size_t... CRAs >
1478 struct Size< Column<MT,SO,DF,SF,CRAs...>, 0UL >
1479  : public Size<MT,0UL>
1480 {};
1482 //*************************************************************************************************
1483 
1484 
1485 
1486 
1487 //=================================================================================================
1488 //
1489 // ISRESTRICTED SPECIALIZATIONS
1490 //
1491 //=================================================================================================
1492 
1493 //*************************************************************************************************
1495 template< typename MT, bool SO, bool DF, bool SF, size_t... CCAs >
1496 struct IsRestricted< Column<MT,SO,DF,SF,CCAs...> >
1497  : public IsRestricted<MT>
1498 {};
1500 //*************************************************************************************************
1501 
1502 
1503 
1504 
1505 //=================================================================================================
1506 //
1507 // HASCONSTDATAACCESS SPECIALIZATIONS
1508 //
1509 //=================================================================================================
1510 
1511 //*************************************************************************************************
1513 template< typename MT, bool SO, bool SF, size_t... CCAs >
1514 struct HasConstDataAccess< Column<MT,SO,true,SF,CCAs...> >
1515  : public HasConstDataAccess<MT>
1516 {};
1518 //*************************************************************************************************
1519 
1520 
1521 
1522 
1523 //=================================================================================================
1524 //
1525 // HASMUTABLEDATAACCESS SPECIALIZATIONS
1526 //
1527 //=================================================================================================
1528 
1529 //*************************************************************************************************
1531 template< typename MT, bool SO, bool SF, size_t... CCAs >
1532 struct HasMutableDataAccess< Column<MT,SO,true,SF,CCAs...> >
1533  : public HasMutableDataAccess<MT>
1534 {};
1536 //*************************************************************************************************
1537 
1538 
1539 
1540 
1541 //=================================================================================================
1542 //
1543 // ISALIGNED SPECIALIZATIONS
1544 //
1545 //=================================================================================================
1546 
1547 //*************************************************************************************************
1549 template< typename MT, bool SO, bool SF, size_t... CCAs >
1550 struct IsAligned< Column<MT,SO,true,SF,CCAs...> >
1551  : public And< IsAligned<MT>, Or< IsColumnMajorMatrix<MT>, IsSymmetric<MT> > >
1552 {};
1554 //*************************************************************************************************
1555 
1556 
1557 
1558 
1559 //=================================================================================================
1560 //
1561 // ISCONTIGOUS SPECIALIZATIONS
1562 //
1563 //=================================================================================================
1564 
1565 //*************************************************************************************************
1567 template< typename MT, bool SF, size_t... CCAs >
1568 struct IsContiguous< Column<MT,true,true,SF,CCAs...> >
1569  : public IsContiguous<MT>
1570 {};
1572 //*************************************************************************************************
1573 
1574 
1575 
1576 
1577 //=================================================================================================
1578 //
1579 // ISPADDED SPECIALIZATIONS
1580 //
1581 //=================================================================================================
1582 
1583 //*************************************************************************************************
1585 template< typename MT, bool SO, bool SF, size_t... CCAs >
1586 struct IsPadded< Column<MT,SO,true,SF,CCAs...> >
1587  : public And< IsPadded<MT>, Or< IsColumnMajorMatrix<MT>, IsSymmetric<MT> > >
1588 {};
1590 //*************************************************************************************************
1591 
1592 
1593 
1594 
1595 //=================================================================================================
1596 //
1597 // ISOPPOSEDVIEW SPECIALIZATIONS
1598 //
1599 //=================================================================================================
1600 
1601 //*************************************************************************************************
1603 template< typename MT, bool DF, size_t... CCAs >
1604 struct IsOpposedView< Column<MT,false,DF,false,CCAs...> >
1605  : public TrueType
1606 {};
1608 //*************************************************************************************************
1609 
1610 
1611 
1612 
1613 //=================================================================================================
1614 //
1615 // SUBVECTORTRAIT SPECIALIZATIONS
1616 //
1617 //=================================================================================================
1618 
1619 //*************************************************************************************************
1621 template< typename MT, bool SO, bool DF, bool SF, size_t... CCAs, size_t... CSAs >
1622 struct SubvectorTrait< Column<MT,SO,DF,SF,CCAs...>, CSAs... >
1623 {
1624  using Type = SubvectorTrait_< ResultType_< Column<MT,SO,DF,SF,CCAs...> >, CSAs... >;
1625 };
1627 //*************************************************************************************************
1628 
1629 
1630 
1631 
1632 //=================================================================================================
1633 //
1634 // ELEMENTSTRAIT SPECIALIZATIONS
1635 //
1636 //=================================================================================================
1637 
1638 //*************************************************************************************************
1640 template< typename MT, bool SO, bool DF, bool SF, size_t... CCAs, size_t... CEAs >
1641 struct ElementsTrait< Column<MT,SO,DF,SF,CCAs...>, CEAs... >
1642 {
1643  using Type = ElementsTrait_< ResultType_< Column<MT,SO,DF,SF,CCAs...> >, CEAs... >;
1644 };
1646 //*************************************************************************************************
1647 
1648 } // namespace blaze
1649 
1650 #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
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 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
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
Header file for the IsColumnMajorMatrix type trait.
Header file for the implementation of the Column base template.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
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
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
Column specialization for dense matrices.
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 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.
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
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.
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 column trait.
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
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
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
Column specialization for sparse matrices.
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