Blaze 3.9
Band.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_VIEWS_BAND_H_
36#define _BLAZE_MATH_VIEWS_BAND_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
83#include <blaze/util/Assert.h>
84#include <blaze/util/EnableIf.h>
87#include <blaze/util/mpl/If.h>
88#include <blaze/util/mpl/Min.h>
89#include <blaze/util/Types.h>
91
92
93namespace blaze {
94
95//=================================================================================================
96//
97// GLOBAL FUNCTIONS
98//
99//=================================================================================================
100
101//*************************************************************************************************
136template< ptrdiff_t I // Band index
137 , typename MT // Type of the matrix
138 , bool SO // Storage order
139 , typename... RBAs > // Optional band arguments
140inline decltype(auto) band( Matrix<MT,SO>& matrix, RBAs... args )
141{
143
144 using ReturnType = Band_<MT,I>;
145 return ReturnType( *matrix, args... );
146}
147//*************************************************************************************************
148
149
150//*************************************************************************************************
185template< ptrdiff_t I // Band index
186 , typename MT // Type of the matrix
187 , bool SO // Storage order
188 , typename... RBAs > // Optional band arguments
189inline decltype(auto) band( const Matrix<MT,SO>& matrix, RBAs... args )
190{
192
193 using ReturnType = const Band_<const MT,I>;
194 return ReturnType( *matrix, args... );
195}
196//*************************************************************************************************
197
198
199//*************************************************************************************************
213template< ptrdiff_t I // Band index
214 , typename MT // Type of the matrix
215 , bool SO // Storage order
216 , typename... RBAs > // Optional band arguments
217inline decltype(auto) band( Matrix<MT,SO>&& matrix, RBAs... args )
218{
220
221 using ReturnType = Band_<MT,I>;
222 return ReturnType( *matrix, args... );
223}
224//*************************************************************************************************
225
226
227//*************************************************************************************************
263template< typename MT // Type of the matrix
264 , bool SO // Storage order
265 , typename... RBAs > // Optional band arguments
266inline decltype(auto) band( Matrix<MT,SO>& matrix, ptrdiff_t index, RBAs... args )
267{
269
270 using ReturnType = Band_<MT>;
271 return ReturnType( *matrix, index, args... );
272}
273//*************************************************************************************************
274
275
276//*************************************************************************************************
312template< typename MT // Type of the matrix
313 , bool SO // Storage order
314 , typename... RBAs > // Optional band arguments
315inline decltype(auto) band( const Matrix<MT,SO>& matrix, ptrdiff_t index, RBAs... args )
316{
318
319 using ReturnType = const Band_<const MT>;
320 return ReturnType( *matrix, index, args... );
321}
322//*************************************************************************************************
323
324
325//*************************************************************************************************
340template< typename MT // Type of the matrix
341 , bool SO // Storage order
342 , typename... RBAs > // Optional band arguments
343inline decltype(auto) band( Matrix<MT,SO>&& matrix, ptrdiff_t index, RBAs... args )
344{
346
347 using ReturnType = Band_<MT>;
348 return ReturnType( *matrix, index, args... );
349}
350//*************************************************************************************************
351
352
353//*************************************************************************************************
377template< typename MT // Type of the matrix
378 , bool SO // Storage order
379 , typename... RDAs > // Optional diagonal arguments
380inline decltype(auto) diagonal( Matrix<MT,SO>& matrix, RDAs... args )
381{
383
384 return band<0L>( *matrix, unchecked, args... );
385}
386//*************************************************************************************************
387
388
389//*************************************************************************************************
412template< typename MT // Type of the matrix
413 , bool SO // Storage order
414 , typename... RDAs > // Optional diagonal arguments
415inline decltype(auto) diagonal( const Matrix<MT,SO>& matrix, RDAs... args )
416{
418
419 return band<0L>( *matrix, unchecked, args... );
420}
421//*************************************************************************************************
422
423
424//*************************************************************************************************
436template< typename MT // Type of the matrix
437 , bool SO // Storage order
438 , typename... RDAs > // Optional diagonal arguments
439inline decltype(auto) diagonal( Matrix<MT,SO>&& matrix, RDAs... args )
440{
442
443 return band<0L>( *matrix, unchecked, args... );
444}
445//*************************************************************************************************
446
447
448
449
450//=================================================================================================
451//
452// GLOBAL RESTRUCTURING FUNCTIONS
453//
454//=================================================================================================
455
456//*************************************************************************************************
469template< ptrdiff_t... CBAs // Compile time band arguments
470 , typename MT // Type of the matrix
471 , typename... RBAs > // Runtime band arguments
472inline decltype(auto) band( const MatMatAddExpr<MT>& matrix, RBAs... args )
473{
475
476 return band<CBAs...>( (*matrix).leftOperand(), args... ) +
477 band<CBAs...>( (*matrix).rightOperand(), args... );
478}
480//*************************************************************************************************
481
482
483//*************************************************************************************************
496template< ptrdiff_t... CBAs // Compile time band arguments
497 , typename MT // Type of the matrix
498 , typename... RBAs > // Runtime band arguments
499inline decltype(auto) band( const MatMatSubExpr<MT>& matrix, RBAs... args )
500{
502
503 return band<CBAs...>( (*matrix).leftOperand(), args... ) -
504 band<CBAs...>( (*matrix).rightOperand(), args... );
505}
507//*************************************************************************************************
508
509
510//*************************************************************************************************
522template< ptrdiff_t... CBAs // Compile time band arguments
523 , typename MT // Type of the matrix
524 , typename... RBAs > // Runtime band arguments
525inline decltype(auto) band( const SchurExpr<MT>& matrix, RBAs... args )
526{
528
529 return band<CBAs...>( (*matrix).leftOperand(), args... ) *
530 band<CBAs...>( (*matrix).rightOperand(), args... );
531}
533//*************************************************************************************************
534
535
536//*************************************************************************************************
549template< ptrdiff_t... CBAs // Compile time band arguments
550 , typename MT // Type of the matrix
551 , typename... RBAs > // Runtime band arguments
552inline decltype(auto) band( const MatMatKronExpr<MT>& matrix, RBAs... args )
553{
555
556 const BandData<CBAs...> bd( args... );
557
558 if( isChecked( args... ) ) {
559 if( ( bd.band() > 0L && bd.column() >= (*matrix).columns() ) ||
560 ( bd.band() < 0L && bd.row() >= (*matrix).rows() ) ) {
561 BLAZE_THROW_INVALID_ARGUMENT( "Invalid band access index" );
562 }
563 }
564
565 const size_t row ( bd.band() < 0L ? -bd.band() : 0UL );
566 const size_t column( bd.band() >= 0L ? bd.band() : 0UL );
567 const size_t n ( min( (*matrix).rows() - row, (*matrix).columns() - column ) );
568
569 return diagonal( submatrix( *matrix, row, column, n, n, unchecked ) );
570}
572//*************************************************************************************************
573
574
575//*************************************************************************************************
587template< ptrdiff_t... CBAs // Compile time band arguments
588 , typename MT // Type of the matrix
589 , typename... RBAs > // Runtime band arguments
590inline decltype(auto) band( const VecTVecMultExpr<MT>& matrix, RBAs... args )
591{
593
594 const BandData<CBAs...> bd( args... );
595
596 if( isChecked( args... ) ) {
597 if( ( bd.band() > 0L && bd.column() >= (*matrix).columns() ) ||
598 ( bd.band() < 0L && bd.row() >= (*matrix).rows() ) ) {
599 BLAZE_THROW_INVALID_ARGUMENT( "Invalid band access index" );
600 }
601 }
602
603 decltype(auto) leftOperand ( (*matrix).leftOperand() );
604 decltype(auto) rightOperand( (*matrix).rightOperand() );
605
606 const size_t row ( bd.band() < 0L ? -bd.band() : 0UL );
607 const size_t column( bd.band() >= 0L ? bd.band() : 0UL );
608 const size_t size ( min( leftOperand.size() - row, rightOperand.size() - column ) );
609
610 return transTo<defaultTransposeFlag>( subvector( leftOperand , row , size, unchecked ) ) *
611 transTo<defaultTransposeFlag>( subvector( rightOperand, column, size, unchecked ) );
612}
614//*************************************************************************************************
615
616
617//*************************************************************************************************
630template< ptrdiff_t... CBAs // Compile time band arguments
631 , typename MT // Type of the matrix
632 , typename... RBAs > // Runtime band arguments
633inline decltype(auto) band( const MatScalarMultExpr<MT>& matrix, RBAs... args )
634{
636
637 return band<CBAs...>( (*matrix).leftOperand(), args... ) * (*matrix).rightOperand();
638}
640//*************************************************************************************************
641
642
643//*************************************************************************************************
656template< ptrdiff_t... CBAs // Compile time band arguments
657 , typename MT // Type of the matrix
658 , typename... RBAs > // Runtime band arguments
659inline decltype(auto) band( const MatScalarDivExpr<MT>& matrix, RBAs... args )
660{
662
663 return band<CBAs...>( (*matrix).leftOperand(), args... ) / (*matrix).rightOperand();
664}
666//*************************************************************************************************
667
668
669//*************************************************************************************************
682template< ptrdiff_t... CBAs // Compile time band arguments
683 , typename MT // Type of the matrix
684 , typename... RBAs > // Runtime band arguments
685inline decltype(auto) band( const MatMapExpr<MT>& matrix, RBAs... args )
686{
688
689 return map( band<CBAs...>( (*matrix).operand(), args... ), (*matrix).operation() );
690}
692//*************************************************************************************************
693
694
695//*************************************************************************************************
708template< ptrdiff_t... CBAs // Compile time band arguments
709 , typename MT // Type of the matrix
710 , typename... RBAs > // Runtime band arguments
711inline decltype(auto) band( const MatMatMapExpr<MT>& matrix, RBAs... args )
712{
714
715 return map( band<CBAs...>( (*matrix).leftOperand(), args... ),
716 band<CBAs...>( (*matrix).rightOperand(), args... ),
717 (*matrix).operation() );
718}
720//*************************************************************************************************
721
722
723//*************************************************************************************************
736template< ptrdiff_t... CBAs // Compile time band arguments
737 , typename MT // Type of the matrix
738 , typename... RBAs > // Runtime band arguments
739inline decltype(auto) band( const VecTVecMapExpr<MT>& matrix, RBAs... args )
740{
742
743 const BandData<CBAs...> bd( args... );
744
745 if( isChecked( args... ) ) {
746 if( ( bd.band() > 0L && bd.column() >= (*matrix).columns() ) ||
747 ( bd.band() < 0L && bd.row() >= (*matrix).rows() ) ) {
748 BLAZE_THROW_INVALID_ARGUMENT( "Invalid band access index" );
749 }
750 }
751
752 decltype(auto) leftOperand ( (*matrix).leftOperand() );
753 decltype(auto) rightOperand( (*matrix).rightOperand() );
754
755 const size_t row ( bd.band() < 0L ? -bd.band() : 0UL );
756 const size_t column( bd.band() >= 0L ? bd.band() : 0UL );
757 const size_t size ( min( leftOperand.size() - row, rightOperand.size() - column ) );
758
759 return map( transTo<defaultTransposeFlag>( subvector( leftOperand , row , size, unchecked ) ),
760 transTo<defaultTransposeFlag>( subvector( rightOperand, column, size, unchecked ) ),
761 (*matrix).operation() );
762}
764//*************************************************************************************************
765
766
767//*************************************************************************************************
780template< ptrdiff_t... CBAs // Compile time band arguments
781 , typename MT // Type of the matrix
782 , typename... RBAs > // Runtime band arguments
783inline decltype(auto) band( const MatEvalExpr<MT>& matrix, RBAs... args )
784{
786
787 return eval( band<CBAs...>( (*matrix).operand(), args... ) );
788}
790//*************************************************************************************************
791
792
793//*************************************************************************************************
806template< ptrdiff_t... CBAs // Compile time band arguments
807 , typename MT // Type of the matrix
808 , typename... RBAs > // Runtime band arguments
809inline decltype(auto) band( const MatSerialExpr<MT>& matrix, RBAs... args )
810{
812
813 return serial( band<CBAs...>( (*matrix).operand(), args... ) );
814}
816//*************************************************************************************************
817
818
819//*************************************************************************************************
832template< ptrdiff_t... CBAs // Compile time band arguments
833 , typename MT // Type of the matrix
834 , typename... RBAs > // Runtime band arguments
835inline decltype(auto) band( const MatNoAliasExpr<MT>& matrix, RBAs... args )
836{
838
839 return noalias( band<CBAs...>( (*matrix).operand(), args... ) );
840}
842//*************************************************************************************************
843
844
845//*************************************************************************************************
858template< ptrdiff_t... CBAs // Compile time band arguments
859 , typename MT // Type of the matrix
860 , typename... RBAs > // Runtime band arguments
861inline decltype(auto) band( const MatNoSIMDExpr<MT>& matrix, RBAs... args )
862{
864
865 return nosimd( band<CBAs...>( (*matrix).operand(), args... ) );
866}
868//*************************************************************************************************
869
870
871//*************************************************************************************************
884template< ptrdiff_t... CBAs // Compile time band arguments
885 , typename MT // Type of the matrix
886 , typename... RBAs > // Runtime band arguments
887inline decltype(auto) band( const DeclExpr<MT>& matrix, RBAs... args )
888{
890
891 return band<CBAs...>( (*matrix).operand(), args... );
892}
894//*************************************************************************************************
895
896
897//*************************************************************************************************
910template< ptrdiff_t I // Band index
911 , typename MT // Type of the matrix
912 , typename... RBAs > // Runtime band arguments
913inline decltype(auto) band( const MatTransExpr<MT>& matrix, RBAs... args )
914{
916
917 return band<-I>( (*matrix).operand(), args... );
918}
920//*************************************************************************************************
921
922
923//*************************************************************************************************
937template< typename MT // Type of the matrix
938 , typename... RBAs > // Runtime band arguments
939inline decltype(auto) band( const MatTransExpr<MT>& matrix, ptrdiff_t index, RBAs... args )
940{
942
943 return band( (*matrix).operand(), -index, args... );
944}
946//*************************************************************************************************
947
948
949//*************************************************************************************************
962template< ptrdiff_t... CBAs // Compile time band arguments
963 , typename MT // Type of the matrix
964 , size_t... CEAs // Compile time expansion arguments
965 , typename... RBAs > // Runtime band arguments
966inline decltype(auto) band( const VecExpandExpr<MT,CEAs...>& matrix, RBAs... args )
967{
969
970 const BandData<CBAs...> bd( args... );
971
972 if( isChecked( args... ) ) {
973 if( ( bd.band() > 0L && bd.column() >= (*matrix).columns() ) ||
974 ( bd.band() < 0L && bd.row() >= (*matrix).rows() ) ) {
975 BLAZE_THROW_INVALID_ARGUMENT( "Invalid band access index" );
976 }
977 }
978
979 using VT = VectorType_t< RemoveReference_t< decltype( (*matrix).operand() ) > >;
980
981 constexpr bool TF( TransposeFlag_v<VT> );
982
983 const size_t index( TF ? bd.column() : bd.row() );
984 const size_t size ( min( (*matrix).rows() - bd.row(), (*matrix).columns() - bd.column() ) );
985
986 return subvector( transTo<defaultTransposeFlag>( (*matrix).operand() ), index, size, unchecked );
987}
989//*************************************************************************************************
990
991
992//*************************************************************************************************
1005template< ptrdiff_t... CBAs // Compile time band arguments
1006 , typename MT // Type of the matrix
1007 , size_t... CRAs // Compile time repeater arguments
1008 , typename... RBAs > // Runtime band arguments
1009inline decltype(auto) band( const MatRepeatExpr<MT,CRAs...>& matrix, RBAs... args )
1010{
1012
1013 using ReturnType = Band_< MatrixType_t<MT>, CBAs... >;
1014 return ReturnType( *matrix, args... );
1015}
1017//*************************************************************************************************
1018
1019
1020
1021
1022//=================================================================================================
1023//
1024// GLOBAL RESTRUCTURING FUNCTIONS (SUBVECTOR)
1025//
1026//=================================================================================================
1027
1028//*************************************************************************************************
1040template< AlignmentFlag AF // Alignment flag
1041 , size_t I // Index of the first subvector element
1042 , size_t N // Size of the subvector
1043 , typename VT // Type of the vector
1044 , typename... RSAs // Optional subvector arguments
1045 , EnableIf_t< IsBand_v< RemoveReference_t<VT> > &&
1046 RemoveReference_t<VT>::compileTimeArgs >* = nullptr >
1047inline decltype(auto) subvector( VT&& b, RSAs... args )
1048{
1050
1051 constexpr ptrdiff_t I2 = RemoveReference_t<VT>::band();
1052
1053 constexpr size_t row ( ( I2 >= 0L ? 0UL : -I2 ) + I );
1054 constexpr size_t column( ( I2 >= 0L ? I2 : 0UL ) + I );
1055
1056 constexpr auto check( getCheck( args... ) );
1057
1058 try {
1059 return diagonal( submatrix<AF,row,column,N,N>( b.operand(), check ), check );
1060 }
1061 catch( ... ) {
1062 BLAZE_THROW_INVALID_ARGUMENT( "Invalid subvector specification" );
1063 }
1064}
1066//*************************************************************************************************
1067
1068
1069//*************************************************************************************************
1081template< AlignmentFlag AF // Alignment flag
1082 , size_t... CSAs // Compile time subvector arguments
1083 , typename VT // Type of the vector
1084 , typename... RSAs // Optional subvector arguments
1085 , EnableIf_t< IsBand_v< RemoveReference_t<VT> > &&
1086 ( sizeof...( CSAs ) == 0UL || !RemoveReference_t<VT>::compileTimeArgs ) >* = nullptr >
1087inline decltype(auto) subvector( VT&& b, RSAs... args )
1088{
1090
1091 const SubvectorData<CSAs...> sd( args... );
1092
1093 const size_t row ( b.row() + sd.offset() );
1094 const size_t column( b.column() + sd.offset() );
1095
1096 constexpr auto check( getCheck( args... ) );
1097
1098 try {
1099 return diagonal( submatrix<AF>( b.operand(), row, column, sd.size(), sd.size(), check ), check );
1100 }
1101 catch( ... ) {
1102 BLAZE_THROW_INVALID_ARGUMENT( "Invalid subvector specification" );
1103 }
1104}
1106//*************************************************************************************************
1107
1108
1109
1110
1111//=================================================================================================
1112//
1113// BAND OPERATORS
1114//
1115//=================================================================================================
1116
1117//*************************************************************************************************
1143template< RelaxationFlag RF // Relaxation flag
1144 , typename MT // Type of the dense matrix
1145 , bool TF // Transpose flag
1146 , bool MF // Multiplication flag
1147 , ptrdiff_t... CBAs > // Compile time band arguments
1148inline bool isDefault( const Band<MT,TF,true,MF,CBAs...>& band )
1149{
1150 using blaze::isDefault;
1151
1152 for( size_t i=0UL; i<band.size(); ++i )
1153 if( !isDefault<RF>( band[i] ) ) return false;
1154 return true;
1155}
1157//*************************************************************************************************
1158
1159
1160//*************************************************************************************************
1186template< RelaxationFlag RF // Relaxation flag
1187 , typename MT // Type of the sparse matrix
1188 , bool TF // Transpose flag
1189 , bool MF // Multiplication flag
1190 , ptrdiff_t... CBAs > // Compile time band arguments
1191inline bool isDefault( const Band<MT,TF,false,MF,CBAs...>& band )
1192{
1193 using blaze::isDefault;
1194
1195 for( const auto& element : band )
1196 if( !isDefault<RF>( element.value() ) ) return false;
1197 return true;
1198}
1200//*************************************************************************************************
1201
1202
1203//*************************************************************************************************
1221template< typename MT // Type of the matrix
1222 , bool TF // Transpose flag
1223 , bool DF // Density flag
1224 , bool MF // Multiplication flag
1225 , ptrdiff_t... CBAs > // Compile time band arguments
1226inline bool isIntact( const Band<MT,TF,DF,MF,CBAs...>& band ) noexcept
1227{
1228 const ptrdiff_t index( band.band() );
1229
1230 return ( ( index >= 0L || size_t( -index ) < band.operand().rows() ) &&
1231 ( index <= 0L || size_t( index ) < band.operand().columns() ) &&
1232 isIntact( band.operand() ) );
1233}
1235//*************************************************************************************************
1236
1237
1238//*************************************************************************************************
1251template< typename MT1 // Type of the matrix of the left-hand side band
1252 , bool TF // Transpose flag
1253 , bool DF // Density flag
1254 , bool MF // Multiplication flag
1255 , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1256 , typename MT2 // Type of the matrix of the right-hand side band
1257 , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1258inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1259 const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1260 -> DisableIf_t< IsSubmatrix_v<MT1> || IsSubmatrix_v<MT2>, bool >
1261{
1262 return ( isSame( a.operand(), b.operand() ) && ( a.band() == b.band() ) );
1263}
1265//*************************************************************************************************
1266
1267
1268//*************************************************************************************************
1281template< typename MT1 // Type of the submatrix of the left-hand side band
1282 , bool TF // Transpose flag
1283 , bool DF // Density flag
1284 , bool MF // Multiplication flag
1285 , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1286 , typename MT2 // Type of the matrix of the right-hand side band
1287 , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1288inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1289 const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1290 -> EnableIf_t< IsSubmatrix_v<MT1> && !IsSubmatrix_v<MT2>, bool >
1291{
1292 return ( isSame( a.operand().operand(), b.operand() ) &&
1293 ( a.size() == b.size() ) &&
1294 ( a.row() + a.operand().row() == b.row() ) &&
1295 ( a.column() + a.operand().column() == b.column() ) );
1296}
1298//*************************************************************************************************
1299
1300
1301//*************************************************************************************************
1314template< typename MT1 // Type of the matrix of the left-hand side band
1315 , bool TF // Transpose flag
1316 , bool DF // Density flag
1317 , bool MF // Multiplication flag
1318 , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1319 , typename MT2 // Type of the submatrix of the right-hand side band
1320 , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1321inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1322 const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1323 -> EnableIf_t< !IsSubmatrix_v<MT1> && IsSubmatrix_v<MT2>, bool >
1324{
1325 return ( isSame( a.operand(), b.operand().operand() ) &&
1326 ( a.size() == b.size() ) &&
1327 ( a.row() == b.row() + b.operand().row() ) &&
1328 ( a.column() == b.column() + b.operand().column() ) );
1329}
1331//*************************************************************************************************
1332
1333
1334//*************************************************************************************************
1347template< typename MT1 // Type of the submatrix of the left-hand side band
1348 , bool TF // Transpose flag
1349 , bool DF // Density flag
1350 , bool MF // Multiplication flag
1351 , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1352 , typename MT2 // Type of the submatrix of the right-hand side band
1353 , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1354inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1355 const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1356 -> EnableIf_t< IsSubmatrix_v<MT1> && IsSubmatrix_v<MT2>, bool >
1357{
1358 return ( isSame( a.operand().operand(), b.operand().operand() ) &&
1359 ( a.size() == b.size() ) &&
1360 ( a.row() + a.operand().row() == b.row() + b.operand().row() ) &&
1361 ( a.column() + a.operand().column() == b.column() + b.operand().column() ) );
1362}
1364//*************************************************************************************************
1365
1366
1367//*************************************************************************************************
1380template< typename MT1 // Type of the matrix of the left-hand side band
1381 , bool TF // Transpose flag
1382 , bool DF // Density flag
1383 , bool MF // Multiplication flag
1384 , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1385 , typename MT2 // Type of the matrix of the right-hand side band
1386 , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1387inline bool isSame( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1388 const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1389{
1390 return isSame_backend( a, b );
1391}
1393//*************************************************************************************************
1394
1395
1396//*************************************************************************************************
1411template< typename MT // Type of the matrix
1412 , bool TF // Transpose flag
1413 , bool DF // Density flag
1414 , bool MF // Multiplication flag
1415 , ptrdiff_t... CBAs // Compile time band arguments
1416 , typename ET > // Type of the element
1417inline bool trySet( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1418{
1419 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1420
1421 return trySet( band.operand(), band.row()+index, band.column()+index, value );
1422}
1424//*************************************************************************************************
1425
1426
1427//*************************************************************************************************
1443template< typename MT // Type of the matrix
1444 , bool TF // Transpose flag
1445 , bool DF // Density flag
1446 , bool MF // Multiplication flag
1447 , ptrdiff_t... CBAs // Compile time band arguments
1448 , typename ET > // Type of the element
1450 trySet( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1451{
1452 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1453 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1454
1455 const size_t iend( index + size );
1456
1457 for( size_t i=index; i<iend; ++i ) {
1458 if( !trySet( band.operand(), band.row()+i, band.column()+i, value ) )
1459 return false;
1460 }
1461
1462 return true;
1463}
1465//*************************************************************************************************
1466
1467
1468//*************************************************************************************************
1483template< typename MT // Type of the matrix
1484 , bool TF // Transpose flag
1485 , bool DF // Density flag
1486 , bool MF // Multiplication flag
1487 , ptrdiff_t... CBAs // Compile time band arguments
1488 , typename ET > // Type of the element
1489inline bool tryAdd( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1490{
1491 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1492
1493 return tryAdd( band.operand(), band.row()+index, band.column()+index, value );
1494}
1496//*************************************************************************************************
1497
1498
1499//*************************************************************************************************
1515template< typename MT // Type of the matrix
1516 , bool TF // Transpose flag
1517 , bool DF // Density flag
1518 , bool MF // Multiplication flag
1519 , ptrdiff_t... CBAs // Compile time band arguments
1520 , typename ET > // Type of the element
1522 tryAdd( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1523{
1524 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1525 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1526
1527 const size_t iend( index + size );
1528
1529 for( size_t i=index; i<iend; ++i ) {
1530 if( !tryAdd( band.operand(), band.row()+i, band.column()+i, value ) )
1531 return false;
1532 }
1533
1534 return true;
1535}
1537//*************************************************************************************************
1538
1539
1540//*************************************************************************************************
1555template< typename MT // Type of the matrix
1556 , bool TF // Transpose flag
1557 , bool DF // Density flag
1558 , bool MF // Multiplication flag
1559 , ptrdiff_t... CBAs // Compile time band arguments
1560 , typename ET > // Type of the element
1561inline bool trySub( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1562{
1563 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1564
1565 return trySub( band.operand(), band.row()+index, band.column()+index, value );
1566}
1568//*************************************************************************************************
1569
1570
1571//*************************************************************************************************
1587template< typename MT // Type of the matrix
1588 , bool TF // Transpose flag
1589 , bool DF // Density flag
1590 , bool MF // Multiplication flag
1591 , ptrdiff_t... CBAs // Compile time band arguments
1592 , typename ET > // Type of the element
1594 trySub( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1595{
1596 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1597 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1598
1599 const size_t iend( index + size );
1600
1601 for( size_t i=index; i<iend; ++i ) {
1602 if( !trySub( band.operand(), band.row()+i, band.column()+i, value ) )
1603 return false;
1604 }
1605
1606 return true;
1607}
1609//*************************************************************************************************
1610
1611
1612//*************************************************************************************************
1627template< typename MT // Type of the matrix
1628 , bool TF // Transpose flag
1629 , bool DF // Density flag
1630 , bool MF // Multiplication flag
1631 , ptrdiff_t... CBAs // Compile time band arguments
1632 , typename ET > // Type of the element
1633inline bool tryMult( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1634{
1635 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1636
1637 return tryMult( band.operand(), band.row()+index, band.column()+index, value );
1638}
1640//*************************************************************************************************
1641
1642
1643//*************************************************************************************************
1659template< typename MT // Type of the matrix
1660 , bool TF // Transpose flag
1661 , bool DF // Density flag
1662 , bool MF // Multiplication flag
1663 , ptrdiff_t... CBAs // Compile time band arguments
1664 , typename ET > // Type of the element
1666 tryMult( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1667{
1668 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1669 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1670
1671 const size_t iend( index + size );
1672
1673 for( size_t i=index; i<iend; ++i ) {
1674 if( !tryMult( band.operand(), band.row()+i, band.column()+i, value ) )
1675 return false;
1676 }
1677
1678 return true;
1679}
1681//*************************************************************************************************
1682
1683
1684//*************************************************************************************************
1699template< typename MT // Type of the matrix
1700 , bool TF // Transpose flag
1701 , bool DF // Density flag
1702 , bool MF // Multiplication flag
1703 , ptrdiff_t... CBAs // Compile time band arguments
1704 , typename ET > // Type of the element
1705inline bool tryDiv( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1706{
1707 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1708
1709 return tryDiv( band.operand(), band.row()+index, band.column()+index, value );
1710}
1712//*************************************************************************************************
1713
1714
1715//*************************************************************************************************
1731template< typename MT // Type of the matrix
1732 , bool TF // Transpose flag
1733 , bool DF // Density flag
1734 , bool MF // Multiplication flag
1735 , ptrdiff_t... CBAs // Compile time band arguments
1736 , typename ET > // Type of the element
1738 tryDiv( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1739{
1740 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1741 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1742
1743 const size_t iend( index + size );
1744
1745 for( size_t i=index; i<iend; ++i ) {
1746 if( !tryDiv( band.operand(), band.row()+i, band.column()+i, value ) )
1747 return false;
1748 }
1749
1750 return true;
1751}
1753//*************************************************************************************************
1754
1755
1756//*************************************************************************************************
1771template< typename MT // Type of the matrix
1772 , bool TF // Transpose flag
1773 , bool DF // Density flag
1774 , bool MF // Multiplication flag
1775 , ptrdiff_t... CBAs > // Compile time band arguments
1776inline bool tryShift( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, int count )
1777{
1778 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1779
1780 return tryShift( band.operand(), band.row()+index, band.column()+index, count );
1781}
1783//*************************************************************************************************
1784
1785
1786//*************************************************************************************************
1802template< typename MT // Type of the matrix
1803 , bool TF // Transpose flag
1804 , bool DF // Density flag
1805 , bool MF // Multiplication flag
1806 , ptrdiff_t... CBAs > // Compile time band arguments
1808 tryShift( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, int count )
1809{
1810 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1811 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1812
1813 const size_t iend( index + size );
1814
1815 for( size_t i=index; i<iend; ++i ) {
1816 if( !tryShift( band.operand(), band.row()+i, band.column()+i, count ) )
1817 return false;
1818 }
1819
1820 return true;
1821}
1823//*************************************************************************************************
1824
1825
1826//*************************************************************************************************
1841template< typename MT // Type of the matrix
1842 , bool TF // Transpose flag
1843 , bool DF // Density flag
1844 , bool MF // Multiplication flag
1845 , ptrdiff_t... CBAs // Compile time band arguments
1846 , typename ET > // Type of the element
1847inline bool tryBitand( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1848{
1849 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1850
1851 return tryBitand( band.operand(), band.row()+index, band.column()+index, value );
1852}
1854//*************************************************************************************************
1855
1856
1857//*************************************************************************************************
1873template< typename MT // Type of the matrix
1874 , bool TF // Transpose flag
1875 , bool DF // Density flag
1876 , bool MF // Multiplication flag
1877 , ptrdiff_t... CBAs // Compile time band arguments
1878 , typename ET > // Type of the element
1880 tryBitand( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1881{
1882 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1883 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1884
1885 const size_t iend( index + size );
1886
1887 for( size_t i=index; i<iend; ++i ) {
1888 if( !tryBitand( band.operand(), band.row()+i, band.column()+i, value ) )
1889 return false;
1890 }
1891
1892 return true;
1893}
1895//*************************************************************************************************
1896
1897
1898//*************************************************************************************************
1913template< typename MT // Type of the matrix
1914 , bool TF // Transpose flag
1915 , bool DF // Density flag
1916 , bool MF // Multiplication flag
1917 , ptrdiff_t... CBAs // Compile time band arguments
1918 , typename ET > // Type of the element
1919inline bool tryBitor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1920{
1921 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1922
1923 return tryBitor( band.operand(), band.row()+index, band.column()+index, value );
1924}
1926//*************************************************************************************************
1927
1928
1929//*************************************************************************************************
1945template< typename MT // Type of the matrix
1946 , bool TF // Transpose flag
1947 , bool DF // Density flag
1948 , bool MF // Multiplication flag
1949 , ptrdiff_t... CBAs // Compile time band arguments
1950 , typename ET > // Type of the element
1952 tryBitor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1953{
1954 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
1955 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
1956
1957 const size_t iend( index + size );
1958
1959 for( size_t i=index; i<iend; ++i ) {
1960 if( !tryBitor( band.operand(), band.row()+i, band.column()+i, value ) )
1961 return false;
1962 }
1963
1964 return true;
1965}
1967//*************************************************************************************************
1968
1969
1970//*************************************************************************************************
1985template< typename MT // Type of the matrix
1986 , bool TF // Transpose flag
1987 , bool DF // Density flag
1988 , bool MF // Multiplication flag
1989 , ptrdiff_t... CBAs // Compile time band arguments
1990 , typename ET > // Type of the element
1991inline bool tryBitxor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1992{
1993 BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1994
1995 return tryBitxor( band.operand(), band.row()+index, band.column()+index, value );
1996}
1998//*************************************************************************************************
1999
2000
2001//*************************************************************************************************
2017template< typename MT // Type of the matrix
2018 , bool TF // Transpose flag
2019 , bool DF // Density flag
2020 , bool MF // Multiplication flag
2021 , ptrdiff_t... CBAs // Compile time band arguments
2022 , typename ET > // Type of the element
2024 tryBitxor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
2025{
2026 BLAZE_INTERNAL_ASSERT( index <= (*band).size(), "Invalid vector access index" );
2027 BLAZE_INTERNAL_ASSERT( index + size <= (*band).size(), "Invalid range size" );
2028
2029 const size_t iend( index + size );
2030
2031 for( size_t i=index; i<iend; ++i ) {
2032 if( !tryBitxor( band.operand(), band.row()+i, band.column()+i, value ) )
2033 return false;
2034 }
2035
2036 return true;
2037}
2039//*************************************************************************************************
2040
2041
2042//*************************************************************************************************
2057template< typename MT // Type of the matrix
2058 , bool TF // Transpose flag
2059 , bool DF // Density flag
2060 , bool MF // Multiplication flag
2061 , ptrdiff_t... CBAs // Compile time band arguments
2062 , typename VT > // Type of the right-hand side vector
2063inline bool tryAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2064 const Vector<VT,TF>& rhs, size_t index )
2065{
2066 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2067 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2068
2069 return tryAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2070}
2072//*************************************************************************************************
2073
2074
2075//*************************************************************************************************
2090template< typename MT // Type of the matrix
2091 , bool TF // Transpose flag
2092 , bool DF // Density flag
2093 , bool MF // Multiplication flag
2094 , ptrdiff_t... CBAs // Compile time band arguments
2095 , typename VT > // Type of the right-hand side vector
2096inline bool tryAddAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2097 const Vector<VT,TF>& rhs, size_t index )
2098{
2099 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2100 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2101
2102 return tryAddAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2103}
2105//*************************************************************************************************
2106
2107
2108//*************************************************************************************************
2123template< typename MT // Type of the matrix
2124 , bool TF // Transpose flag
2125 , bool DF // Density flag
2126 , bool MF // Multiplication flag
2127 , ptrdiff_t... CBAs // Compile time band arguments
2128 , typename VT > // Type of the right-hand side vector
2129inline bool trySubAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2130 const Vector<VT,TF>& rhs, size_t index )
2131{
2132 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2133 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2134
2135 return trySubAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2136}
2138//*************************************************************************************************
2139
2140
2141//*************************************************************************************************
2156template< typename MT // Type of the matrix
2157 , bool TF // Transpose flag
2158 , bool DF // Density flag
2159 , bool MF // Multiplication flag
2160 , ptrdiff_t... CBAs // Compile time band arguments
2161 , typename VT > // Type of the right-hand side vector
2162inline bool tryMultAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2163 const Vector<VT,TF>& rhs, size_t index )
2164{
2165 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2166 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2167
2168 return tryMultAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2169}
2171//*************************************************************************************************
2172
2173
2174//*************************************************************************************************
2189template< typename MT // Type of the matrix
2190 , bool TF // Transpose flag
2191 , bool DF // Density flag
2192 , bool MF // Multiplication flag
2193 , ptrdiff_t... CBAs // Compile time band arguments
2194 , typename VT > // Type of the right-hand side vector
2195inline bool tryDivAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2196 const Vector<VT,TF>& rhs, size_t index )
2197{
2198 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2199 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2200
2201 return tryDivAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2202}
2204//*************************************************************************************************
2205
2206
2207//*************************************************************************************************
2222template< typename MT // Type of the matrix
2223 , bool TF // Transpose flag
2224 , bool DF // Density flag
2225 , bool MF // Multiplication flag
2226 , ptrdiff_t... CBAs // Compile time band arguments
2227 , typename VT > // Type of the right-hand side vector
2228inline bool tryShiftAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2229 const Vector<VT,TF>& rhs, size_t index )
2230{
2231 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2232 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2233
2234 return tryShiftAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2235}
2237//*************************************************************************************************
2238
2239
2240//*************************************************************************************************
2255template< typename MT // Type of the matrix
2256 , bool TF // Transpose flag
2257 , bool DF // Density flag
2258 , bool MF // Multiplication flag
2259 , ptrdiff_t... CBAs // Compile time band arguments
2260 , typename VT > // Type of the right-hand side vector
2261inline bool tryBitandAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2262 const Vector<VT,TF>& rhs, size_t index )
2263{
2264 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2265 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2266
2267 return tryBitandAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2268}
2270//*************************************************************************************************
2271
2272
2273//*************************************************************************************************
2288template< typename MT // Type of the matrix
2289 , bool TF // Transpose flag
2290 , bool DF // Density flag
2291 , bool MF // Multiplication flag
2292 , ptrdiff_t... CBAs // Compile time band arguments
2293 , typename VT > // Type of the right-hand side vector
2294inline bool tryBitorAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2295 const Vector<VT,TF>& rhs, size_t index )
2296{
2297 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2298 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2299
2300 return tryBitorAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2301}
2303//*************************************************************************************************
2304
2305
2306//*************************************************************************************************
2321template< typename MT // Type of the matrix
2322 , bool TF // Transpose flag
2323 , bool DF // Density flag
2324 , bool MF // Multiplication flag
2325 , ptrdiff_t... CBAs // Compile time band arguments
2326 , typename VT > // Type of the right-hand side vector
2327inline bool tryBitxorAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2328 const Vector<VT,TF>& rhs, size_t index )
2329{
2330 BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2331 BLAZE_INTERNAL_ASSERT( index + (*rhs).size() <= lhs.size(), "Invalid vector size" );
2332
2333 return tryBitxorAssign( lhs.operand(), *rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2334}
2336//*************************************************************************************************
2337
2338
2339//*************************************************************************************************
2354template< typename MT // Type of the matrix
2355 , bool TF // Transpose flag
2356 , bool DF // Density flag
2357 , bool MF // Multiplication flag
2358 , ptrdiff_t I > // Band index
2359inline decltype(auto) derestrict( Band<MT,TF,DF,MF,I>& b )
2360{
2361 return band<I>( derestrict( b.operand() ), unchecked );
2362}
2364//*************************************************************************************************
2365
2366
2367//*************************************************************************************************
2382template< typename MT // Type of the matrix
2383 , bool TF // Transpose flag
2384 , bool DF // Density flag
2385 , bool MF // Multiplication flag
2386 , ptrdiff_t I > // Band index
2387inline decltype(auto) derestrict( Band<MT,TF,DF,MF,I>&& b )
2388{
2389 return band<I>( derestrict( b.operand() ), unchecked );
2390}
2392//*************************************************************************************************
2393
2394
2395//*************************************************************************************************
2410template< typename MT // Type of the matrix
2411 , bool TF // Transpose flag
2412 , bool DF // Density flag
2413 , bool MF > // Multiplication flag
2414inline decltype(auto) derestrict( Band<MT,TF,DF,MF>& b )
2415{
2416 return band( derestrict( b.operand() ), b.band(), unchecked );
2417}
2419//*************************************************************************************************
2420
2421
2422//*************************************************************************************************
2437template< typename MT // Type of the matrix
2438 , bool TF // Transpose flag
2439 , bool DF // Density flag
2440 , bool MF > // Multiplication flag
2441inline decltype(auto) derestrict( Band<MT,TF,DF,MF>&& b )
2442{
2443 return band( derestrict( b.operand() ), b.band(), unchecked );
2444}
2446//*************************************************************************************************
2447
2448
2449//*************************************************************************************************
2462template< typename MT // Type of the matrix
2463 , bool TF // Transpose flag
2464 , bool DF // Density flag
2465 , bool MF // Multiplication flag
2466 , ptrdiff_t... CBAs > // Compile time band arguments
2467inline decltype(auto) unview( Band<MT,TF,DF,MF,CBAs...>& b )
2468{
2469 return b.operand();
2470}
2472//*************************************************************************************************
2473
2474
2475//*************************************************************************************************
2488template< typename MT // Type of the matrix
2489 , bool TF // Transpose flag
2490 , bool DF // Density flag
2491 , bool MF // Multiplication flag
2492 , ptrdiff_t... CBAs > // Compile time band arguments
2493inline decltype(auto) unview( const Band<MT,TF,DF,MF,CBAs...>& b )
2494{
2495 return b.operand();
2496}
2498//*************************************************************************************************
2499
2500
2501
2502
2503//=================================================================================================
2504//
2505// SIZE SPECIALIZATIONS
2506//
2507//=================================================================================================
2508
2509//*************************************************************************************************
2511template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t I >
2512struct Size< Band<MT,TF,DF,MF,I>, 0UL >
2513 : public If_t< ( Size_v<MT,0UL> >= 0L && Size_v<MT,1UL> >= 0L )
2514 , Min_t< Ptrdiff_t< Size_v<MT,0UL> - ( I >= 0L ? 0L : -I ) >
2515 , Ptrdiff_t< Size_v<MT,1UL> - ( I >= 0L ? I : 0L ) > >
2516 , Ptrdiff_t<-1L> >
2517{};
2519//*************************************************************************************************
2520
2521
2522
2523
2524//=================================================================================================
2525//
2526// MAXSIZE SPECIALIZATIONS
2527//
2528//=================================================================================================
2529
2530//*************************************************************************************************
2532template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t I >
2533struct MaxSize< Band<MT,TF,DF,MF,I>, 0UL >
2534 : public If_t< ( MaxSize_v<MT,0UL> >= 0L && MaxSize_v<MT,1UL> >= 0L )
2535 , Min_t< Ptrdiff_t< MaxSize_v<MT,0UL> - ( I >= 0L ? 0L : -I ) >
2536 , Ptrdiff_t< MaxSize_v<MT,1UL> - ( I >= 0L ? I : 0L ) > >
2537 , Ptrdiff_t<-1L> >
2538{};
2540//*************************************************************************************************
2541
2542
2543
2544
2545//=================================================================================================
2546//
2547// ISRESTRICTED SPECIALIZATIONS
2548//
2549//=================================================================================================
2550
2551//*************************************************************************************************
2553template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t... CBAs >
2554struct IsRestricted< Band<MT,TF,DF,MF,CBAs...> >
2555 : public IsRestricted<MT>
2556{};
2558//*************************************************************************************************
2559
2560
2561
2562
2563//=================================================================================================
2564//
2565// HASCONSTDATAACCESS SPECIALIZATIONS
2566//
2567//=================================================================================================
2568
2569//*************************************************************************************************
2571template< typename MT, bool TF, bool MF, ptrdiff_t... CBAs >
2572struct HasConstDataAccess< Band<MT,TF,true,MF,CBAs...> >
2573 : public HasConstDataAccess<MT>
2574{};
2576//*************************************************************************************************
2577
2578
2579
2580
2581//=================================================================================================
2582//
2583// HASMUTABLEDATAACCESS SPECIALIZATIONS
2584//
2585//=================================================================================================
2586
2587//*************************************************************************************************
2589template< typename MT, bool TF, bool MF, ptrdiff_t... CBAs >
2590struct HasMutableDataAccess< Band<MT,TF,true,MF,CBAs...> >
2591 : public HasMutableDataAccess<MT>
2592{};
2594//*************************************************************************************************
2595
2596
2597
2598
2599//=================================================================================================
2600//
2601// ISOPPOSEDVIEW SPECIALIZATIONS
2602//
2603//=================================================================================================
2604
2605//*************************************************************************************************
2607template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t... CBAs >
2608struct IsOpposedView< Band<MT,TF,DF,MF,CBAs...> >
2609 : public TrueType
2610{};
2612//*************************************************************************************************
2613
2614} // namespace blaze
2615
2616#endif
Header file for auxiliary alias declarations.
typename T::VectorType VectorType_t
Alias declaration for nested VectorType type definitions.
Definition: Aliases.h:590
Header file for run time assertion macros.
Header file for the implementation of the BandData class template.
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsBand type trait.
Header file for the isDefault shim.
Header file for the IsOpposedView type trait.
Header file for the IsRestricted type trait.
Header file for the IsSubmatrix type trait.
Header file for the MaxSize type trait.
Header file for the relaxation flag enumeration.
Header file for the RemoveReference type trait.
Header file for the implementation of the SubvectorData class template.
Base class for matrices.
Definition: Matrix.h:85
Pointer difference type of the Blaze library.
Header file for the DeclExpr base class.
Header file for the MatEvalExpr base class.
Header file for the MatMapExpr base class.
Header file for the MatMatAddExpr base class.
Header file for the MatMatKronExpr base class.
Header file for the MatMatMapExpr base class.
Header file for the MatMatSubExpr base class.
Header file for the MatNoAliasExpr base class.
Header file for the MatNoSIMDExpr base class.
Header file for the MatScalarDivExpr base class.
Header file for the MatScalarMultExpr base class.
Header file for the MatSerialExpr base class.
Header file for the MatTransExpr base class.
Header file for the Matrix base class.
Header file for the SchurExpr base class.
Header file for the VecExpandExpr base class.
Header file for the VecTVecMapExpr base class.
Header file for the VecTVecMultExpr base class.
decltype(auto) diagonal(Matrix< MT, SO > &&matrix, RDAs... args)
Creating a view on the diagonal of the given temporary matrix.
Definition: Band.h:439
decltype(auto) band(Matrix< MT, SO > &&matrix, ptrdiff_t index, RBAs... args)
Creating a view on a specific band of the given temporary matrix.
Definition: Band.h:343
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
decltype(auto) noalias(const DenseMatrix< MT, SO > &dm)
Forces the non-aliased evaluation of the given dense matrix expression dm.
Definition: DMatNoAliasExpr.h:679
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:790
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Elementwise evaluation of the given binary operation on each single element of the dense matrices lhs...
Definition: DMatDMatMapExpr.h:1144
decltype(auto) nosimd(const DenseMatrix< MT, SO > &dm)
Disables the SIMD evaluation of the given dense matrix expression dm.
Definition: DMatNoSIMDExpr.h:717
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition: AlignmentFlag.h:63
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:1424
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
If_t< Less_t< T1, T2 >::value, T1, T2 > Min_t
Compile time value evaluation.
Definition: Min.h:73
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:181
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:158
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
typename RemoveReference< T >::Type RemoveReference_t
Auxiliary alias declaration for the RemoveReference type trait.
Definition: RemoveReference.h:95
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.
Definition: IntegralConstant.h:237
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
constexpr auto getCheck(const T &a, const Ts &... args) noexcept
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:205
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for all forward declarations for expression class templates.
Header file for the Size type trait.
Header file for the TransposeFlag type trait.
Header file for all forward declarations for views.
Header file for the default transpose flag for all vectors of the Blaze library.
Header file for basic type definitions.
Header file for the generic min algorithm.
Header file for the Min_t alias template.
Header file for the implementation of the Band base template.
Band specialization for dense matrices.
Band specialization for sparse matrices.