Blaze  3.6
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>
74 #include <blaze/math/views/Check.h>
79 #include <blaze/util/Assert.h>
80 #include <blaze/util/DisableIf.h>
81 #include <blaze/util/EnableIf.h>
84 #include <blaze/util/mpl/If.h>
85 #include <blaze/util/mpl/Min.h>
86 #include <blaze/util/Types.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // GLOBAL FUNCTIONS
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
133 template< ptrdiff_t I // Band index
134  , typename MT // Type of the matrix
135  , bool SO // Storage order
136  , typename... RBAs > // Optional band arguments
137 inline decltype(auto) band( Matrix<MT,SO>& matrix, RBAs... args )
138 {
140 
141  using ReturnType = Band_<MT,I>;
142  return ReturnType( ~matrix, args... );
143 }
144 //*************************************************************************************************
145 
146 
147 //*************************************************************************************************
182 template< ptrdiff_t I // Band index
183  , typename MT // Type of the matrix
184  , bool SO // Storage order
185  , typename... RBAs > // Optional band arguments
186 inline decltype(auto) band( const Matrix<MT,SO>& matrix, RBAs... args )
187 {
189 
190  using ReturnType = const Band_<const MT,I>;
191  return ReturnType( ~matrix, args... );
192 }
193 //*************************************************************************************************
194 
195 
196 //*************************************************************************************************
210 template< ptrdiff_t I // Band index
211  , typename MT // Type of the matrix
212  , bool SO // Storage order
213  , typename... RBAs > // Optional band arguments
214 inline decltype(auto) band( Matrix<MT,SO>&& matrix, RBAs... args )
215 {
217 
218  using ReturnType = Band_<MT,I>;
219  return ReturnType( ~matrix, args... );
220 }
221 //*************************************************************************************************
222 
223 
224 //*************************************************************************************************
260 template< typename MT // Type of the matrix
261  , bool SO // Storage order
262  , typename... RBAs > // Optional band arguments
263 inline decltype(auto) band( Matrix<MT,SO>& matrix, ptrdiff_t index, RBAs... args )
264 {
266 
267  using ReturnType = Band_<MT>;
268  return ReturnType( ~matrix, index, args... );
269 }
270 //*************************************************************************************************
271 
272 
273 //*************************************************************************************************
309 template< typename MT // Type of the matrix
310  , bool SO // Storage order
311  , typename... RBAs > // Optional band arguments
312 inline decltype(auto) band( const Matrix<MT,SO>& matrix, ptrdiff_t index, RBAs... args )
313 {
315 
316  using ReturnType = const Band_<const MT>;
317  return ReturnType( ~matrix, index, args... );
318 }
319 //*************************************************************************************************
320 
321 
322 //*************************************************************************************************
337 template< typename MT // Type of the matrix
338  , bool SO // Storage order
339  , typename... RBAs > // Optional band arguments
340 inline decltype(auto) band( Matrix<MT,SO>&& matrix, ptrdiff_t index, RBAs... args )
341 {
343 
344  using ReturnType = Band_<MT>;
345  return ReturnType( ~matrix, index, args... );
346 }
347 //*************************************************************************************************
348 
349 
350 //*************************************************************************************************
374 template< typename MT // Type of the matrix
375  , bool SO // Storage order
376  , typename... RDAs > // Optional diagonal arguments
377 inline decltype(auto) diagonal( Matrix<MT,SO>& matrix, RDAs... args )
378 {
380 
381  return band<0L>( ~matrix, unchecked, args... );
382 }
383 //*************************************************************************************************
384 
385 
386 //*************************************************************************************************
409 template< typename MT // Type of the matrix
410  , bool SO // Storage order
411  , typename... RDAs > // Optional diagonal arguments
412 inline decltype(auto) diagonal( const Matrix<MT,SO>& matrix, RDAs... args )
413 {
415 
416  return band<0L>( ~matrix, unchecked, args... );
417 }
418 //*************************************************************************************************
419 
420 
421 //*************************************************************************************************
433 template< typename MT // Type of the matrix
434  , bool SO // Storage order
435  , typename... RDAs > // Optional diagonal arguments
436 inline decltype(auto) diagonal( Matrix<MT,SO>&& matrix, RDAs... args )
437 {
439 
440  return band<0L>( ~matrix, unchecked, args... );
441 }
442 //*************************************************************************************************
443 
444 
445 
446 
447 //=================================================================================================
448 //
449 // GLOBAL RESTRUCTURING FUNCTIONS
450 //
451 //=================================================================================================
452 
453 //*************************************************************************************************
465 template< ptrdiff_t... CBAs // Compile time band arguments
466  , typename MT // Type of the matrix
467  , typename... RBAs > // Runtime band arguments
468 inline decltype(auto) band( const MatMatAddExpr<MT>& matrix, RBAs... args )
469 {
471 
472  return band<CBAs...>( (~matrix).leftOperand(), args... ) +
473  band<CBAs...>( (~matrix).rightOperand(), args... );
474 }
476 //*************************************************************************************************
477 
478 
479 //*************************************************************************************************
491 template< ptrdiff_t... CBAs // Compile time band arguments
492  , typename MT // Type of the matrix
493  , typename... RBAs > // Runtime band arguments
494 inline decltype(auto) band( const MatMatSubExpr<MT>& matrix, RBAs... args )
495 {
497 
498  return band<CBAs...>( (~matrix).leftOperand(), args... ) -
499  band<CBAs...>( (~matrix).rightOperand(), args... );
500 }
502 //*************************************************************************************************
503 
504 
505 //*************************************************************************************************
516 template< ptrdiff_t... CBAs // Compile time band arguments
517  , typename MT // Type of the matrix
518  , typename... RBAs > // Runtime band arguments
519 inline decltype(auto) band( const SchurExpr<MT>& matrix, RBAs... args )
520 {
522 
523  return band<CBAs...>( (~matrix).leftOperand(), args... ) *
524  band<CBAs...>( (~matrix).rightOperand(), args... );
525 }
527 //*************************************************************************************************
528 
529 
530 //*************************************************************************************************
542 template< ptrdiff_t... CBAs // Compile time band arguments
543  , typename MT // Type of the matrix
544  , typename... RBAs > // Runtime band arguments
545 inline decltype(auto) band( const MatMatKronExpr<MT>& matrix, RBAs... args )
546 {
548 
549  const BandData<CBAs...> bd( args... );
550 
551  const size_t row ( bd.band() < 0L ? -bd.band() : 0UL );
552  const size_t column( bd.band() >= 0L ? bd.band() : 0UL );
553  const size_t n ( min( (~matrix).rows() - row, (~matrix).columns() - column ) );
554 
555  return diagonal( submatrix( ~matrix, row, column, n, n, args... ) );
556 }
558 //*************************************************************************************************
559 
560 
561 //*************************************************************************************************
572 template< ptrdiff_t... CBAs // Compile time band arguments
573  , typename MT // Type of the matrix
574  , typename... RBAs > // Runtime band arguments
575 inline decltype(auto) band( const VecTVecMultExpr<MT>& matrix, RBAs... args )
576 {
578 
579  const BandData<CBAs...> bd( args... );
580 
581  decltype(auto) leftOperand ( (~matrix).leftOperand() );
582  decltype(auto) rightOperand( (~matrix).rightOperand() );
583 
584  const size_t row ( bd.band() < 0L ? -bd.band() : 0UL );
585  const size_t column( bd.band() >= 0L ? bd.band() : 0UL );
586  const size_t size ( min( leftOperand.size() - row, rightOperand.size() - column ) );
587 
588  return transTo<defaultTransposeFlag>( subvector( leftOperand , row , size ) ) *
589  transTo<defaultTransposeFlag>( subvector( rightOperand, column, size ) );
590 }
592 //*************************************************************************************************
593 
594 
595 //*************************************************************************************************
607 template< ptrdiff_t... CBAs // Compile time band arguments
608  , typename MT // Type of the matrix
609  , typename... RBAs > // Runtime band arguments
610 inline decltype(auto) band( const MatScalarMultExpr<MT>& matrix, RBAs... args )
611 {
613 
614  return band<CBAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
615 }
617 //*************************************************************************************************
618 
619 
620 //*************************************************************************************************
632 template< ptrdiff_t... CBAs // Compile time band arguments
633  , typename MT // Type of the matrix
634  , typename... RBAs > // Runtime band arguments
635 inline decltype(auto) band( const MatScalarDivExpr<MT>& matrix, RBAs... args )
636 {
638 
639  return band<CBAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
640 }
642 //*************************************************************************************************
643 
644 
645 //*************************************************************************************************
657 template< ptrdiff_t... CBAs // Compile time band arguments
658  , typename MT // Type of the matrix
659  , typename... RBAs > // Runtime band arguments
660 inline decltype(auto) band( const MatMapExpr<MT>& matrix, RBAs... args )
661 {
663 
664  return map( band<CBAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
665 }
667 //*************************************************************************************************
668 
669 
670 //*************************************************************************************************
682 template< ptrdiff_t... CBAs // Compile time band arguments
683  , typename MT // Type of the matrix
684  , typename... RBAs > // Runtime band arguments
685 inline decltype(auto) band( const MatMatMapExpr<MT>& matrix, RBAs... args )
686 {
688 
689  return map( band<CBAs...>( (~matrix).leftOperand(), args... ),
690  band<CBAs...>( (~matrix).rightOperand(), args... ),
691  (~matrix).operation() );
692 }
694 //*************************************************************************************************
695 
696 
697 //*************************************************************************************************
709 template< ptrdiff_t... CBAs // Compile time band arguments
710  , typename MT // Type of the matrix
711  , typename... RBAs > // Runtime band arguments
712 inline decltype(auto) band( const MatEvalExpr<MT>& matrix, RBAs... args )
713 {
715 
716  return eval( band<CBAs...>( (~matrix).operand(), args... ) );
717 }
719 //*************************************************************************************************
720 
721 
722 //*************************************************************************************************
734 template< ptrdiff_t... CBAs // Compile time band arguments
735  , typename MT // Type of the matrix
736  , typename... RBAs > // Runtime band arguments
737 inline decltype(auto) band( const MatSerialExpr<MT>& matrix, RBAs... args )
738 {
740 
741  return serial( band<CBAs...>( (~matrix).operand(), args... ) );
742 }
744 //*************************************************************************************************
745 
746 
747 //*************************************************************************************************
759 template< ptrdiff_t... CBAs // Compile time band arguments
760  , typename MT // Type of the matrix
761  , typename... RBAs > // Runtime band arguments
762 inline decltype(auto) band( const DeclExpr<MT>& matrix, RBAs... args )
763 {
765 
766  return band<CBAs...>( (~matrix).operand(), args... );
767 }
769 //*************************************************************************************************
770 
771 
772 //*************************************************************************************************
784 template< ptrdiff_t... CBAs // Compile time band arguments
785  , typename MT // Type of the matrix
786  , typename... RBAs > // Runtime band arguments
787 inline decltype(auto) band( const MatTransExpr<MT>& matrix, RBAs... args )
788 {
790 
791  return band<-CBAs...>( (~matrix).operand(), -args... );
792 }
794 //*************************************************************************************************
795 
796 
797 //*************************************************************************************************
809 template< ptrdiff_t... CBAs // Compile time band arguments
810  , typename MT // Type of the matrix
811  , size_t... CEAs // Compile time expansion arguments
812  , typename... RBAs > // Runtime band arguments
813 inline decltype(auto) band( const VecExpandExpr<MT,CEAs...>& matrix, RBAs... args )
814 {
816 
817  using VT = VectorType_t< RemoveReference_t< decltype( (~matrix).operand() ) > >;
818 
819  constexpr bool TF( TransposeFlag_v<VT> );
820 
821  const BandData<CBAs...> bd( args... );
822 
823  const size_t index( TF ? bd.column() : bd.row() );
824  const size_t size ( min( (~matrix).rows() - bd.row(), (~matrix).columns() - bd.column() ) );
825 
826  return subvector( transTo<defaultTransposeFlag>( (~matrix).operand() ), index, size, args... );
827 }
829 //*************************************************************************************************
830 
831 
832 
833 
834 //=================================================================================================
835 //
836 // GLOBAL RESTRUCTURING FUNCTIONS (SUBVECTOR)
837 //
838 //=================================================================================================
839 
840 //*************************************************************************************************
851 template< AlignmentFlag AF // Alignment flag
852  , size_t I // Index of the first subvector element
853  , size_t N // Size of the subvector
854  , typename VT // Type of the vector
855  , typename... RSAs // Optional subvector arguments
856  , EnableIf_t< IsBand_v< RemoveReference_t<VT> > &&
857  RemoveReference_t<VT>::compileTimeArgs >* = nullptr >
858 inline decltype(auto) subvector( VT&& b, RSAs... args )
859 {
861 
862  constexpr ptrdiff_t I2 = RemoveReference_t<VT>::band();
863 
864  constexpr size_t row ( ( I2 >= 0L ? 0UL : -I2 ) + I );
865  constexpr size_t column( ( I2 >= 0L ? I2 : 0UL ) + I );
866 
867  return diagonal( submatrix<AF,row,column,N,N>( b.operand(), args... ), unchecked );
868 }
870 //*************************************************************************************************
871 
872 
873 //*************************************************************************************************
884 template< AlignmentFlag AF // Alignment flag
885  , size_t... CSAs // Compile time subvector arguments
886  , typename VT // Type of the vector
887  , typename... RSAs // Optional subvector arguments
888  , EnableIf_t< IsBand_v< RemoveReference_t<VT> > &&
889  ( sizeof...( CSAs ) == 0UL || !RemoveReference_t<VT>::compileTimeArgs ) >* = nullptr >
890 inline decltype(auto) subvector( VT&& b, RSAs... args )
891 {
893 
894  const SubvectorData<CSAs...> sd( args... );
895 
896  const size_t row ( b.row() + sd.offset() );
897  const size_t column( b.column() + sd.offset() );
898 
899  return diagonal( submatrix<AF>( b.operand(), row, column, sd.size(), sd.size(), args... ), unchecked );
900 }
902 //*************************************************************************************************
903 
904 
905 
906 
907 //=================================================================================================
908 //
909 // BAND OPERATORS
910 //
911 //=================================================================================================
912 
913 //*************************************************************************************************
921 template< typename MT // Type of the matrix
922  , bool TF // Transpose flag
923  , bool DF // Density flag
924  , bool MF // Multiplication flag
925  , ptrdiff_t... CBAs > // Compile time band arguments
926 inline void reset( Band<MT,TF,DF,MF,CBAs...>& band )
927 {
928  band.reset();
929 }
931 //*************************************************************************************************
932 
933 
934 //*************************************************************************************************
942 template< typename MT // Type of the matrix
943  , bool TF // Transpose flag
944  , bool DF // Density flag
945  , bool MF // Multiplication flag
946  , ptrdiff_t... CBAs > // Compile time band arguments
947 inline void reset( Band<MT,TF,DF,MF,CBAs...>&& band )
948 {
949  band.reset();
950 }
952 //*************************************************************************************************
953 
954 
955 //*************************************************************************************************
965 template< typename MT // Type of the matrix
966  , bool TF // Transpose flag
967  , bool DF // Density flag
968  , bool MF // Multiplication flag
969  , ptrdiff_t... CBAs > // Compile time band arguments
970 inline void clear( Band<MT,TF,DF,MF,CBAs...>& band )
971 {
972  band.reset();
973 }
975 //*************************************************************************************************
976 
977 
978 //*************************************************************************************************
988 template< typename MT // Type of the matrix
989  , bool TF // Transpose flag
990  , bool DF // Density flag
991  , bool MF // Multiplication flag
992  , ptrdiff_t... CBAs > // Compile time band arguments
993 inline void clear( Band<MT,TF,DF,MF,CBAs...>&& band )
994 {
995  band.reset();
996 }
998 //*************************************************************************************************
999 
1000 
1001 //*************************************************************************************************
1027 template< bool RF // Relaxation flag
1028  , typename MT // Type of the dense matrix
1029  , bool TF // Transpose flag
1030  , bool MF // Multiplication flag
1031  , ptrdiff_t... CBAs > // Compile time band arguments
1032 inline bool isDefault( const Band<MT,TF,true,MF,CBAs...>& band )
1033 {
1034  using blaze::isDefault;
1035 
1036  for( size_t i=0UL; i<band.size(); ++i )
1037  if( !isDefault<RF>( band[i] ) ) return false;
1038  return true;
1039 }
1041 //*************************************************************************************************
1042 
1043 
1044 //*************************************************************************************************
1070 template< bool RF // Relaxation flag
1071  , typename MT // Type of the sparse matrix
1072  , bool TF // Transpose flag
1073  , bool MF // Multiplication flag
1074  , ptrdiff_t... CBAs > // Compile time band arguments
1075 inline bool isDefault( const Band<MT,TF,false,MF,CBAs...>& band )
1076 {
1077  using blaze::isDefault;
1078 
1079  for( const auto& element : band )
1080  if( !isDefault<RF>( element.value() ) ) return false;
1081  return true;
1082 }
1084 //*************************************************************************************************
1085 
1086 
1087 //*************************************************************************************************
1105 template< typename MT // Type of the matrix
1106  , bool TF // Transpose flag
1107  , bool DF // Density flag
1108  , bool MF // Multiplication flag
1109  , ptrdiff_t... CBAs > // Compile time band arguments
1110 inline bool isIntact( const Band<MT,TF,DF,MF,CBAs...>& band ) noexcept
1111 {
1112  const ptrdiff_t index( band.band() );
1113 
1114  return ( ( index >= 0L || size_t( -index ) < band.operand().rows() ) &&
1115  ( index <= 0L || size_t( index ) < band.operand().columns() ) &&
1116  isIntact( band.operand() ) );
1117 }
1119 //*************************************************************************************************
1120 
1121 
1122 //*************************************************************************************************
1135 template< typename MT1 // Type of the matrix of the left-hand side band
1136  , bool TF // Transpose flag
1137  , bool DF // Density flag
1138  , bool MF // Multiplication flag
1139  , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1140  , typename MT2 // Type of the matrix of the right-hand side band
1141  , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1142 inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1143  const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1144  -> DisableIf_t< IsSubmatrix_v<MT1> || IsSubmatrix_v<MT2>, bool >
1145 {
1146  return ( isSame( a.operand(), b.operand() ) && ( a.band() == b.band() ) );
1147 }
1149 //*************************************************************************************************
1150 
1151 
1152 //*************************************************************************************************
1165 template< typename MT1 // Type of the submatrix of the left-hand side band
1166  , bool TF // Transpose flag
1167  , bool DF // Density flag
1168  , bool MF // Multiplication flag
1169  , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1170  , typename MT2 // Type of the matrix of the right-hand side band
1171  , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1172 inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1173  const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1174  -> EnableIf_t< IsSubmatrix_v<MT1> && !IsSubmatrix_v<MT2>, bool >
1175 {
1176  return ( isSame( a.operand().operand(), b.operand() ) &&
1177  ( a.size() == b.size() ) &&
1178  ( a.row() + a.operand().row() == b.row() ) &&
1179  ( a.column() + a.operand().column() == b.column() ) );
1180 }
1182 //*************************************************************************************************
1183 
1184 
1185 //*************************************************************************************************
1198 template< typename MT1 // Type of the matrix of the left-hand side band
1199  , bool TF // Transpose flag
1200  , bool DF // Density flag
1201  , bool MF // Multiplication flag
1202  , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1203  , typename MT2 // Type of the submatrix of the right-hand side band
1204  , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1205 inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1206  const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1207  -> EnableIf_t< !IsSubmatrix_v<MT1> && IsSubmatrix_v<MT2>, bool >
1208 {
1209  return ( isSame( a.operand(), b.operand().operand() ) &&
1210  ( a.size() == b.size() ) &&
1211  ( a.row() == b.row() + b.operand().row() ) &&
1212  ( a.column() == b.column() + b.operand().column() ) );
1213 }
1215 //*************************************************************************************************
1216 
1217 
1218 //*************************************************************************************************
1231 template< typename MT1 // Type of the submatrix of the left-hand side band
1232  , bool TF // Transpose flag
1233  , bool DF // Density flag
1234  , bool MF // Multiplication flag
1235  , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1236  , typename MT2 // Type of the submatrix of the right-hand side band
1237  , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1238 inline auto isSame_backend( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1239  const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1240  -> EnableIf_t< IsSubmatrix_v<MT1> && IsSubmatrix_v<MT2>, bool >
1241 {
1242  return ( isSame( a.operand().operand(), b.operand().operand() ) &&
1243  ( a.size() == b.size() ) &&
1244  ( a.row() + a.operand().row() == b.row() + b.operand().row() ) &&
1245  ( a.column() + a.operand().column() == b.column() + b.operand().column() ) );
1246 }
1248 //*************************************************************************************************
1249 
1250 
1251 //*************************************************************************************************
1264 template< typename MT1 // Type of the matrix of the left-hand side band
1265  , bool TF // Transpose flag
1266  , bool DF // Density flag
1267  , bool MF // Multiplication flag
1268  , ptrdiff_t... CBAs1 // Compile time band arguments of the left-hand side band
1269  , typename MT2 // Type of the matrix of the right-hand side band
1270  , ptrdiff_t... CBAs2 > // Compile time band arguments of the right-hand side band
1271 inline bool isSame( const Band<MT1,TF,DF,MF,CBAs1...>& a,
1272  const Band<MT2,TF,DF,MF,CBAs2...>& b ) noexcept
1273 {
1274  return isSame_backend( a, b );
1275 }
1277 //*************************************************************************************************
1278 
1279 
1280 //*************************************************************************************************
1295 template< typename MT // Type of the matrix
1296  , bool TF // Transpose flag
1297  , bool DF // Density flag
1298  , bool MF // Multiplication flag
1299  , ptrdiff_t... CBAs // Compile time band arguments
1300  , typename ET > // Type of the element
1301 inline bool trySet( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1302 {
1303  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1304 
1305  return trySet( band.operand(), band.row()+index, band.column()+index, value );
1306 }
1308 //*************************************************************************************************
1309 
1310 
1311 //*************************************************************************************************
1327 template< typename MT // Type of the matrix
1328  , bool TF // Transpose flag
1329  , bool DF // Density flag
1330  , bool MF // Multiplication flag
1331  , ptrdiff_t... CBAs // Compile time band arguments
1332  , typename ET > // Type of the element
1334  trySet( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1335 {
1336  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1337  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1338 
1339  const size_t iend( index + size );
1340 
1341  for( size_t i=index; i<iend; ++i ) {
1342  if( !trySet( band.operand(), band.row()+i, band.column()+i, value ) )
1343  return false;
1344  }
1345 
1346  return true;
1347 }
1349 //*************************************************************************************************
1350 
1351 
1352 //*************************************************************************************************
1367 template< typename MT // Type of the matrix
1368  , bool TF // Transpose flag
1369  , bool DF // Density flag
1370  , bool MF // Multiplication flag
1371  , ptrdiff_t... CBAs // Compile time band arguments
1372  , typename ET > // Type of the element
1373 inline bool tryAdd( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1374 {
1375  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1376 
1377  return tryAdd( band.operand(), band.row()+index, band.column()+index, value );
1378 }
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1399 template< typename MT // Type of the matrix
1400  , bool TF // Transpose flag
1401  , bool DF // Density flag
1402  , bool MF // Multiplication flag
1403  , ptrdiff_t... CBAs // Compile time band arguments
1404  , typename ET > // Type of the element
1406  tryAdd( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1407 {
1408  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1409  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1410 
1411  const size_t iend( index + size );
1412 
1413  for( size_t i=index; i<iend; ++i ) {
1414  if( !tryAdd( band.operand(), band.row()+i, band.column()+i, value ) )
1415  return false;
1416  }
1417 
1418  return true;
1419 }
1421 //*************************************************************************************************
1422 
1423 
1424 //*************************************************************************************************
1439 template< typename MT // Type of the matrix
1440  , bool TF // Transpose flag
1441  , bool DF // Density flag
1442  , bool MF // Multiplication flag
1443  , ptrdiff_t... CBAs // Compile time band arguments
1444  , typename ET > // Type of the element
1445 inline bool trySub( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1446 {
1447  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1448 
1449  return trySub( band.operand(), band.row()+index, band.column()+index, value );
1450 }
1452 //*************************************************************************************************
1453 
1454 
1455 //*************************************************************************************************
1471 template< typename MT // Type of the matrix
1472  , bool TF // Transpose flag
1473  , bool DF // Density flag
1474  , bool MF // Multiplication flag
1475  , ptrdiff_t... CBAs // Compile time band arguments
1476  , typename ET > // Type of the element
1478  trySub( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1479 {
1480  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1481  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1482 
1483  const size_t iend( index + size );
1484 
1485  for( size_t i=index; i<iend; ++i ) {
1486  if( !trySub( band.operand(), band.row()+i, band.column()+i, value ) )
1487  return false;
1488  }
1489 
1490  return true;
1491 }
1493 //*************************************************************************************************
1494 
1495 
1496 //*************************************************************************************************
1511 template< typename MT // Type of the matrix
1512  , bool TF // Transpose flag
1513  , bool DF // Density flag
1514  , bool MF // Multiplication flag
1515  , ptrdiff_t... CBAs // Compile time band arguments
1516  , typename ET > // Type of the element
1517 inline bool tryMult( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1518 {
1519  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1520 
1521  return tryMult( band.operand(), band.row()+index, band.column()+index, value );
1522 }
1524 //*************************************************************************************************
1525 
1526 
1527 //*************************************************************************************************
1543 template< typename MT // Type of the matrix
1544  , bool TF // Transpose flag
1545  , bool DF // Density flag
1546  , bool MF // Multiplication flag
1547  , ptrdiff_t... CBAs // Compile time band arguments
1548  , typename ET > // Type of the element
1550  tryMult( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1551 {
1552  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1553  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1554 
1555  const size_t iend( index + size );
1556 
1557  for( size_t i=index; i<iend; ++i ) {
1558  if( !tryMult( band.operand(), band.row()+i, band.column()+i, value ) )
1559  return false;
1560  }
1561 
1562  return true;
1563 }
1565 //*************************************************************************************************
1566 
1567 
1568 //*************************************************************************************************
1583 template< typename MT // Type of the matrix
1584  , bool TF // Transpose flag
1585  , bool DF // Density flag
1586  , bool MF // Multiplication flag
1587  , ptrdiff_t... CBAs // Compile time band arguments
1588  , typename ET > // Type of the element
1589 inline bool tryDiv( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1590 {
1591  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1592 
1593  return tryDiv( band.operand(), band.row()+index, band.column()+index, value );
1594 }
1596 //*************************************************************************************************
1597 
1598 
1599 //*************************************************************************************************
1615 template< typename MT // Type of the matrix
1616  , bool TF // Transpose flag
1617  , bool DF // Density flag
1618  , bool MF // Multiplication flag
1619  , ptrdiff_t... CBAs // Compile time band arguments
1620  , typename ET > // Type of the element
1622  tryDiv( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1623 {
1624  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1625  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1626 
1627  const size_t iend( index + size );
1628 
1629  for( size_t i=index; i<iend; ++i ) {
1630  if( !tryDiv( band.operand(), band.row()+i, band.column()+i, value ) )
1631  return false;
1632  }
1633 
1634  return true;
1635 }
1637 //*************************************************************************************************
1638 
1639 
1640 //*************************************************************************************************
1655 template< typename MT // Type of the matrix
1656  , bool TF // Transpose flag
1657  , bool DF // Density flag
1658  , bool MF // Multiplication flag
1659  , ptrdiff_t... CBAs > // Compile time band arguments
1660 inline bool tryShift( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, int count )
1661 {
1662  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1663 
1664  return tryShift( band.operand(), band.row()+index, band.column()+index, count );
1665 }
1667 //*************************************************************************************************
1668 
1669 
1670 //*************************************************************************************************
1686 template< typename MT // Type of the matrix
1687  , bool TF // Transpose flag
1688  , bool DF // Density flag
1689  , bool MF // Multiplication flag
1690  , ptrdiff_t... CBAs > // Compile time band arguments
1692  tryShift( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, int count )
1693 {
1694  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1695  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1696 
1697  const size_t iend( index + size );
1698 
1699  for( size_t i=index; i<iend; ++i ) {
1700  if( !tryShift( band.operand(), band.row()+i, band.column()+i, count ) )
1701  return false;
1702  }
1703 
1704  return true;
1705 }
1707 //*************************************************************************************************
1708 
1709 
1710 //*************************************************************************************************
1725 template< typename MT // Type of the matrix
1726  , bool TF // Transpose flag
1727  , bool DF // Density flag
1728  , bool MF // Multiplication flag
1729  , ptrdiff_t... CBAs // Compile time band arguments
1730  , typename ET > // Type of the element
1731 inline bool tryBitand( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1732 {
1733  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1734 
1735  return tryBitand( band.operand(), band.row()+index, band.column()+index, value );
1736 }
1738 //*************************************************************************************************
1739 
1740 
1741 //*************************************************************************************************
1757 template< typename MT // Type of the matrix
1758  , bool TF // Transpose flag
1759  , bool DF // Density flag
1760  , bool MF // Multiplication flag
1761  , ptrdiff_t... CBAs // Compile time band arguments
1762  , typename ET > // Type of the element
1764  tryBitand( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1765 {
1766  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1767  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1768 
1769  const size_t iend( index + size );
1770 
1771  for( size_t i=index; i<iend; ++i ) {
1772  if( !tryBitand( band.operand(), band.row()+i, band.column()+i, value ) )
1773  return false;
1774  }
1775 
1776  return true;
1777 }
1779 //*************************************************************************************************
1780 
1781 
1782 //*************************************************************************************************
1797 template< typename MT // Type of the matrix
1798  , bool TF // Transpose flag
1799  , bool DF // Density flag
1800  , bool MF // Multiplication flag
1801  , ptrdiff_t... CBAs // Compile time band arguments
1802  , typename ET > // Type of the element
1803 inline bool tryBitor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1804 {
1805  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1806 
1807  return tryBitor( band.operand(), band.row()+index, band.column()+index, value );
1808 }
1810 //*************************************************************************************************
1811 
1812 
1813 //*************************************************************************************************
1829 template< typename MT // Type of the matrix
1830  , bool TF // Transpose flag
1831  , bool DF // Density flag
1832  , bool MF // Multiplication flag
1833  , ptrdiff_t... CBAs // Compile time band arguments
1834  , typename ET > // Type of the element
1836  tryBitor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1837 {
1838  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1839  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1840 
1841  const size_t iend( index + size );
1842 
1843  for( size_t i=index; i<iend; ++i ) {
1844  if( !tryBitor( band.operand(), band.row()+i, band.column()+i, value ) )
1845  return false;
1846  }
1847 
1848  return true;
1849 }
1851 //*************************************************************************************************
1852 
1853 
1854 //*************************************************************************************************
1869 template< typename MT // Type of the matrix
1870  , bool TF // Transpose flag
1871  , bool DF // Density flag
1872  , bool MF // Multiplication flag
1873  , ptrdiff_t... CBAs // Compile time band arguments
1874  , typename ET > // Type of the element
1875 inline bool tryBitxor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, const ET& value )
1876 {
1877  BLAZE_INTERNAL_ASSERT( index < band.size(), "Invalid vector access index" );
1878 
1879  return tryBitxor( band.operand(), band.row()+index, band.column()+index, value );
1880 }
1882 //*************************************************************************************************
1883 
1884 
1885 //*************************************************************************************************
1901 template< typename MT // Type of the matrix
1902  , bool TF // Transpose flag
1903  , bool DF // Density flag
1904  , bool MF // Multiplication flag
1905  , ptrdiff_t... CBAs // Compile time band arguments
1906  , typename ET > // Type of the element
1908  tryBitxor( const Band<MT,TF,DF,MF,CBAs...>& band, size_t index, size_t size, const ET& value )
1909 {
1910  BLAZE_INTERNAL_ASSERT( index <= (~band).size(), "Invalid vector access index" );
1911  BLAZE_INTERNAL_ASSERT( index + size <= (~band).size(), "Invalid range size" );
1912 
1913  const size_t iend( index + size );
1914 
1915  for( size_t i=index; i<iend; ++i ) {
1916  if( !tryBitxor( band.operand(), band.row()+i, band.column()+i, value ) )
1917  return false;
1918  }
1919 
1920  return true;
1921 }
1923 //*************************************************************************************************
1924 
1925 
1926 //*************************************************************************************************
1941 template< typename MT // Type of the matrix
1942  , bool TF // Transpose flag
1943  , bool DF // Density flag
1944  , bool MF // Multiplication flag
1945  , ptrdiff_t... CBAs // Compile time band arguments
1946  , typename VT > // Type of the right-hand side vector
1947 inline bool tryAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
1948  const Vector<VT,TF>& rhs, size_t index )
1949 {
1950  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1951  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1952 
1953  return tryAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
1954 }
1956 //*************************************************************************************************
1957 
1958 
1959 //*************************************************************************************************
1974 template< typename MT // Type of the matrix
1975  , bool TF // Transpose flag
1976  , bool DF // Density flag
1977  , bool MF // Multiplication flag
1978  , ptrdiff_t... CBAs // Compile time band arguments
1979  , typename VT > // Type of the right-hand side vector
1980 inline bool tryAddAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
1981  const Vector<VT,TF>& rhs, size_t index )
1982 {
1983  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
1984  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
1985 
1986  return tryAddAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
1987 }
1989 //*************************************************************************************************
1990 
1991 
1992 //*************************************************************************************************
2007 template< typename MT // Type of the matrix
2008  , bool TF // Transpose flag
2009  , bool DF // Density flag
2010  , bool MF // Multiplication flag
2011  , ptrdiff_t... CBAs // Compile time band arguments
2012  , typename VT > // Type of the right-hand side vector
2013 inline bool trySubAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2014  const Vector<VT,TF>& rhs, size_t index )
2015 {
2016  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2017  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2018 
2019  return trySubAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2020 }
2022 //*************************************************************************************************
2023 
2024 
2025 //*************************************************************************************************
2040 template< typename MT // Type of the matrix
2041  , bool TF // Transpose flag
2042  , bool DF // Density flag
2043  , bool MF // Multiplication flag
2044  , ptrdiff_t... CBAs // Compile time band arguments
2045  , typename VT > // Type of the right-hand side vector
2046 inline bool tryMultAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2047  const Vector<VT,TF>& rhs, size_t index )
2048 {
2049  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2050  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2051 
2052  return tryMultAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2053 }
2055 //*************************************************************************************************
2056 
2057 
2058 //*************************************************************************************************
2073 template< typename MT // Type of the matrix
2074  , bool TF // Transpose flag
2075  , bool DF // Density flag
2076  , bool MF // Multiplication flag
2077  , ptrdiff_t... CBAs // Compile time band arguments
2078  , typename VT > // Type of the right-hand side vector
2079 inline bool tryDivAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2080  const Vector<VT,TF>& rhs, size_t index )
2081 {
2082  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2083  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2084 
2085  return tryDivAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2086 }
2088 //*************************************************************************************************
2089 
2090 
2091 //*************************************************************************************************
2106 template< typename MT // Type of the matrix
2107  , bool TF // Transpose flag
2108  , bool DF // Density flag
2109  , bool MF // Multiplication flag
2110  , ptrdiff_t... CBAs // Compile time band arguments
2111  , typename VT > // Type of the right-hand side vector
2112 inline bool tryShiftAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2113  const Vector<VT,TF>& rhs, size_t index )
2114 {
2115  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2116  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2117 
2118  return tryShiftAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2119 }
2121 //*************************************************************************************************
2122 
2123 
2124 //*************************************************************************************************
2139 template< typename MT // Type of the matrix
2140  , bool TF // Transpose flag
2141  , bool DF // Density flag
2142  , bool MF // Multiplication flag
2143  , ptrdiff_t... CBAs // Compile time band arguments
2144  , typename VT > // Type of the right-hand side vector
2145 inline bool tryBitandAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2146  const Vector<VT,TF>& rhs, size_t index )
2147 {
2148  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2149  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2150 
2151  return tryBitandAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2152 }
2154 //*************************************************************************************************
2155 
2156 
2157 //*************************************************************************************************
2172 template< typename MT // Type of the matrix
2173  , bool TF // Transpose flag
2174  , bool DF // Density flag
2175  , bool MF // Multiplication flag
2176  , ptrdiff_t... CBAs // Compile time band arguments
2177  , typename VT > // Type of the right-hand side vector
2178 inline bool tryBitorAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2179  const Vector<VT,TF>& rhs, size_t index )
2180 {
2181  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2182  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2183 
2184  return tryBitorAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2185 }
2187 //*************************************************************************************************
2188 
2189 
2190 //*************************************************************************************************
2205 template< typename MT // Type of the matrix
2206  , bool TF // Transpose flag
2207  , bool DF // Density flag
2208  , bool MF // Multiplication flag
2209  , ptrdiff_t... CBAs // Compile time band arguments
2210  , typename VT > // Type of the right-hand side vector
2211 inline bool tryBitxorAssign( const Band<MT,TF,DF,MF,CBAs...>& lhs,
2212  const Vector<VT,TF>& rhs, size_t index )
2213 {
2214  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2215  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2216 
2217  return tryBitxorAssign( lhs.operand(), ~rhs, lhs.band(), lhs.row()+index, lhs.column()+index );
2218 }
2220 //*************************************************************************************************
2221 
2222 
2223 //*************************************************************************************************
2238 template< typename MT // Type of the matrix
2239  , bool TF // Transpose flag
2240  , bool DF // Density flag
2241  , bool MF // Multiplication flag
2242  , ptrdiff_t I > // Band index
2243 inline decltype(auto) derestrict( Band<MT,TF,DF,MF,I>& b )
2244 {
2245  return band<I>( derestrict( b.operand() ), unchecked );
2246 }
2248 //*************************************************************************************************
2249 
2250 
2251 //*************************************************************************************************
2266 template< typename MT // Type of the matrix
2267  , bool TF // Transpose flag
2268  , bool DF // Density flag
2269  , bool MF // Multiplication flag
2270  , ptrdiff_t I > // Band index
2271 inline decltype(auto) derestrict( Band<MT,TF,DF,MF,I>&& b )
2272 {
2273  return band<I>( derestrict( b.operand() ), unchecked );
2274 }
2276 //*************************************************************************************************
2277 
2278 
2279 //*************************************************************************************************
2294 template< typename MT // Type of the matrix
2295  , bool TF // Transpose flag
2296  , bool DF // Density flag
2297  , bool MF > // Multiplication flag
2298 inline decltype(auto) derestrict( Band<MT,TF,DF,MF>& b )
2299 {
2300  return band( derestrict( b.operand() ), b.band(), unchecked );
2301 }
2303 //*************************************************************************************************
2304 
2305 
2306 //*************************************************************************************************
2321 template< typename MT // Type of the matrix
2322  , bool TF // Transpose flag
2323  , bool DF // Density flag
2324  , bool MF > // Multiplication flag
2325 inline decltype(auto) derestrict( Band<MT,TF,DF,MF>&& b )
2326 {
2327  return band( derestrict( b.operand() ), b.band(), unchecked );
2328 }
2330 //*************************************************************************************************
2331 
2332 
2333 
2334 
2335 //=================================================================================================
2336 //
2337 // SIZE SPECIALIZATIONS
2338 //
2339 //=================================================================================================
2340 
2341 //*************************************************************************************************
2343 template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t I >
2344 struct Size< Band<MT,TF,DF,MF,I>, 0UL >
2345  : public If_t< ( Size_v<MT,0UL> >= 0L && Size_v<MT,1UL> >= 0L )
2346  , Min_t< Ptrdiff_t< Size_v<MT,0UL> - ( I >= 0L ? 0L : -I ) >
2347  , Ptrdiff_t< Size_v<MT,1UL> - ( I >= 0L ? I : 0L ) > >
2348  , Ptrdiff_t<-1L> >
2349 {};
2351 //*************************************************************************************************
2352 
2353 
2354 
2355 
2356 //=================================================================================================
2357 //
2358 // MAXSIZE SPECIALIZATIONS
2359 //
2360 //=================================================================================================
2361 
2362 //*************************************************************************************************
2364 template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t I >
2365 struct MaxSize< Band<MT,TF,DF,MF,I>, 0UL >
2366  : public If_t< ( MaxSize_v<MT,0UL> >= 0L && MaxSize_v<MT,1UL> >= 0L )
2367  , Min_t< Ptrdiff_t< MaxSize_v<MT,0UL> - ( I >= 0L ? 0L : -I ) >
2368  , Ptrdiff_t< MaxSize_v<MT,1UL> - ( I >= 0L ? I : 0L ) > >
2369  , Ptrdiff_t<-1L> >
2370 {};
2372 //*************************************************************************************************
2373 
2374 
2375 
2376 
2377 //=================================================================================================
2378 //
2379 // ISRESTRICTED SPECIALIZATIONS
2380 //
2381 //=================================================================================================
2382 
2383 //*************************************************************************************************
2385 template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t... CBAs >
2386 struct IsRestricted< Band<MT,TF,DF,MF,CBAs...> >
2387  : public IsRestricted<MT>
2388 {};
2390 //*************************************************************************************************
2391 
2392 
2393 
2394 
2395 //=================================================================================================
2396 //
2397 // HASCONSTDATAACCESS SPECIALIZATIONS
2398 //
2399 //=================================================================================================
2400 
2401 //*************************************************************************************************
2403 template< typename MT, bool TF, bool MF, ptrdiff_t... CBAs >
2404 struct HasConstDataAccess< Band<MT,TF,true,MF,CBAs...> >
2405  : public HasConstDataAccess<MT>
2406 {};
2408 //*************************************************************************************************
2409 
2410 
2411 
2412 
2413 //=================================================================================================
2414 //
2415 // HASMUTABLEDATAACCESS SPECIALIZATIONS
2416 //
2417 //=================================================================================================
2418 
2419 //*************************************************************************************************
2421 template< typename MT, bool TF, bool MF, ptrdiff_t... CBAs >
2422 struct HasMutableDataAccess< Band<MT,TF,true,MF,CBAs...> >
2423  : public HasMutableDataAccess<MT>
2424 {};
2426 //*************************************************************************************************
2427 
2428 
2429 
2430 
2431 //=================================================================================================
2432 //
2433 // ISOPPOSEDVIEW SPECIALIZATIONS
2434 //
2435 //=================================================================================================
2436 
2437 //*************************************************************************************************
2439 template< typename MT, bool TF, bool DF, bool MF, ptrdiff_t... CBAs >
2440 struct IsOpposedView< Band<MT,TF,DF,MF,CBAs...> >
2441  : public TrueType
2442 {};
2444 //*************************************************************************************************
2445 
2446 } // namespace blaze
2447 
2448 #endif
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:992
Header file for basic type definitions.
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:178
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.The Ptrdiff_t alias template represents an integ...
Definition: IntegralConstant.h:237
Header file for the MatTransExpr base class.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Header file for the MatEvalExpr base class.
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:154
typename RemoveReference< T >::Type RemoveReference_t
Auxiliary alias declaration for the RemoveReference type trait.The RemoveReference_t alias declaratio...
Definition: RemoveReference.h:95
Header file for the implementation of the Band base template.
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for the MaxSize type trait.
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:340
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
Header file for the MatMatKronExpr base class.
Header file for the MatMapExpr base class.
Band specialization for sparse matrices.
Header file for the DisableIf class template.
Header file for the Min_t alias template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
Header file for the IsSubmatrix type trait.
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:1162
Header file for the implementation of the SubvectorData class template.
Header file for the MatMatSubExpr base class.
Header file for the IsBand type trait.
decltype(auto) transTo(const DenseVector< VT, TF > &dv)
Conditional calculation of the transpose of the given dense vector.
Definition: DVecTransExpr.h:781
Header file for the IsOpposedView type trait.
Header file for the TransposeFlag type trait.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:786
decltype(auto) diagonal(Matrix< MT, SO > &matrix, RDAs... args)
Creating a view on the diagonal of the given matrix.
Definition: Band.h:377
Header file for the MatSerialExpr base class.
Header file for the VecTVecMultExpr base class.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:137
Header file for the HasConstDataAccess type trait.
Header file for the DeclExpr base class.
Header file for the Matrix base class.
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
If_t< Less_t< T1, T2 >::value, T1, T2 > Min_t
Compile time value evaluation.The Min_t alias template selects the smaller of the two given template ...
Definition: Min.h:73
Header file for the SchurExpr base class.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
Header file for the isDefault shim.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:114
typename T::VectorType VectorType_t
Alias declaration for nested VectorType type definitions.The VectorType_t alias declaration provides ...
Definition: Aliases.h:510
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Header file for the HasMutableDataAccess type trait.
Header file for the MatMatAddExpr base class.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
Header file for the RemoveReference type trait.
Header file for the VecExpandExpr base class.
Band specialization for dense matrices.
Header file for the MatMatMapExpr base class.
Header file for the default transpose flag for all vectors of the Blaze library.
Header file for all forward declarations for views.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
Header file for the MatScalarDivExpr base class.
Header file for the IsRestricted type trait.
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,...
Definition: Assert.h:101
Header file for the implementation of the BandData class template.
Header file for the function trace functionality.
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:1121