Elements.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_ELEMENTS_H_
36 #define _BLAZE_MATH_VIEWS_ELEMENTS_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <algorithm>
44 #include <array>
45 #include <numeric>
46 #include <vector>
47 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
73 #include <blaze/math/views/Check.h>
77 #include <blaze/util/Assert.h>
79 #include <blaze/util/SmallVector.h>
81 #include <blaze/util/TypeList.h>
82 #include <blaze/util/Types.h>
83 #include <blaze/util/Unused.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // GLOBAL FUNCTIONS
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
129 template< size_t I // First element index
130  , size_t... Is // Remaining element indices
131  , typename VT // Type of the vector
132  , bool TF // Transpose flag
133  , typename... REAs > // Optional arguments
134 inline decltype(auto) elements( Vector<VT,TF>& vector, REAs... args )
135 {
137 
138  using ReturnType = Elements_<VT,I,Is...>;
139  return ReturnType( ~vector, args... );
140 }
141 //*************************************************************************************************
142 
143 
144 //*************************************************************************************************
179 template< size_t I // First element index
180  , size_t... Is // Remaining element indices
181  , typename VT // Type of the vector
182  , bool TF // Transpose flag
183  , typename... REAs > // Optional arguments
184 inline decltype(auto) elements( const Vector<VT,TF>& vector, REAs... args )
185 {
187 
188  using ReturnType = const Elements_<const VT,I,Is...>;
189  return ReturnType( ~vector, args... );
190 }
191 //*************************************************************************************************
192 
193 
194 //*************************************************************************************************
208 template< size_t I // First element index
209  , size_t... Is // Remaining element indices
210  , typename VT // Type of the vector
211  , bool TF // Transpose flag
212  , typename... REAs > // Optional arguments
213 inline decltype(auto) elements( Vector<VT,TF>&& vector, REAs... args )
214 {
216 
217  using ReturnType = Elements_<VT,I,Is...>;
218  return ReturnType( ~vector, args... );
219 }
220 //*************************************************************************************************
221 
222 
223 //*************************************************************************************************
262 template< typename VT // Type of the vector
263  , bool TF // Transpose flag
264  , typename T // Type of the element indices
265  , typename... REAs > // Optional arguments
266 inline decltype(auto) elements( Vector<VT,TF>& vector, const T* indices, size_t n, REAs... args )
267 {
269 
270  using ReturnType = Elements_<VT>;
271  return ReturnType( ~vector, indices, n, args... );
272 }
273 //*************************************************************************************************
274 
275 
276 //*************************************************************************************************
315 template< typename VT // Type of the vector
316  , bool TF // Transpose flag
317  , typename T // Type of the element indices
318  , typename... REAs > // Optional arguments
319 inline decltype(auto) elements( const Vector<VT,TF>& vector, const T* indices, size_t n, REAs... args )
320 {
322 
323  using ReturnType = const Elements_<const VT>;
324  return ReturnType( ~vector, indices, n, args... );
325 }
326 //*************************************************************************************************
327 
328 
329 //*************************************************************************************************
345 template< typename VT // Type of the vector
346  , bool TF // Transpose flag
347  , typename T // Type of the element indices
348  , typename... REAs > // Optional arguments
349 inline decltype(auto) elements( Vector<VT,TF>&& vector, const T* indices, size_t n, REAs... args )
350 {
352 
353  using ReturnType = Elements_<VT>;
354  return ReturnType( ~vector, indices, n, args... );
355 }
356 //*************************************************************************************************
357 
358 
359 //*************************************************************************************************
375 template< typename VT // Type of the vector
376  , size_t... Is // Element indices
377  , typename... REAs > // Optional arguments
378 inline decltype(auto) elements( VT&& vector, index_sequence<Is...> indices, REAs... args )
379 {
381 
382  UNUSED_PARAMETER( indices );
383 
384  return elements<Is...>( std::forward<VT>( vector ), args... );
385 }
387 //*************************************************************************************************
388 
389 
390 //*************************************************************************************************
406 template< typename VT // Type of the vector
407  , typename T // Type of the element indices
408  , typename... REAs > // Optional arguments
409 inline decltype(auto) elements( VT&& vector, initializer_list<T> indices, REAs... args )
410 {
412 
413  return elements( std::forward<VT>( vector ), indices.begin(), indices.size(), args... );
414 }
416 //*************************************************************************************************
417 
418 
419 //*************************************************************************************************
435 template< typename VT // Type of the vector
436  , typename T // Type of the element indices
437  , size_t N // Number of indices
438  , typename... REAs > // Optional arguments
439 inline decltype(auto) elements( VT&& vector, const std::array<T,N>& indices, REAs... args )
440 {
442 
443  return elements( std::forward<VT>( vector ), indices.data(), N, args... );
444 }
446 //*************************************************************************************************
447 
448 
449 //*************************************************************************************************
465 template< typename VT // Type of the vector
466  , typename T // Type of the element indices
467  , typename... REAs > // Optional arguments
468 inline decltype(auto) elements( VT&& vector, const std::vector<T>& indices, REAs... args )
469 {
471 
472  return elements( std::forward<VT>( vector ), indices.data(), indices.size(), args... );
473 }
475 //*************************************************************************************************
476 
477 
478 //*************************************************************************************************
494 template< typename VT // Type of the vector
495  , typename T // Type of the element indices
496  , size_t N // Number of preallocated elements
497  , typename... REAs > // Optional arguments
498 inline decltype(auto) elements( VT&& vector, const SmallVector<T,N>& indices, REAs... args )
499 {
501 
502  return elements( std::forward<VT>( vector ), indices.data(), indices.size(), args... );
503 }
505 //*************************************************************************************************
506 
507 
508 
509 
510 //=================================================================================================
511 //
512 // GLOBAL RESTRUCTURING FUNCTIONS
513 //
514 //=================================================================================================
515 
516 //*************************************************************************************************
528 template< size_t... CEAs // Compile time element arguments
529  , typename VT // Vector base type of the expression
530  , typename... REAs > // Runtime element arguments
531 inline decltype(auto) elements( const VecVecAddExpr<VT>& vector, REAs... args )
532 {
534 
535  return elements<CEAs...>( (~vector).leftOperand(), args... ) +
536  elements<CEAs...>( (~vector).rightOperand(), args... );
537 }
539 //*************************************************************************************************
540 
541 
542 //*************************************************************************************************
554 template< size_t... CEAs // Compile time element arguments
555  , typename VT // Vector base type of the expression
556  , typename... REAs > // Runtime element arguments
557 inline decltype(auto) elements( const VecVecSubExpr<VT>& vector, REAs... args )
558 {
560 
561  return elements<CEAs...>( (~vector).leftOperand(), args... ) -
562  elements<CEAs...>( (~vector).rightOperand(), args... );
563 }
565 //*************************************************************************************************
566 
567 
568 //*************************************************************************************************
580 template< size_t... CEAs // Compile time element arguments
581  , typename VT // Vector base type of the expression
582  , typename... REAs > // Runtime element arguments
583 inline decltype(auto) elements( const VecVecMultExpr<VT>& vector, REAs... args )
584 {
586 
587  return elements<CEAs...>( (~vector).leftOperand(), args... ) *
588  elements<CEAs...>( (~vector).rightOperand(), args... );
589 }
591 //*************************************************************************************************
592 
593 
594 //*************************************************************************************************
606 template< size_t... CEAs // Compile time element arguments
607  , typename VT // Vector base type of the expression
608  , typename... REAs > // Runtime element arguments
609 inline decltype(auto) elements( const VecVecDivExpr<VT>& vector, REAs... args )
610 {
612 
613  return elements<CEAs...>( (~vector).leftOperand(), args... ) /
614  elements<CEAs...>( (~vector).rightOperand(), args... );
615 }
617 //*************************************************************************************************
618 
619 
620 //*************************************************************************************************
632 template< size_t... CEAs // Compile time element arguments
633  , typename VT // Vector base type of the expression
634  , typename... REAs > // Runtime element arguments
635 inline decltype(auto) elements( const CrossExpr<VT>& vector, REAs... args )
636 {
638 
639  using ReturnType = Elements_< VectorType_<VT>, CEAs... >;
640  return ReturnType( ~vector, args... );
641 }
643 //*************************************************************************************************
644 
645 
646 //*************************************************************************************************
658 template< size_t... CEAs // Compile time element arguments
659  , typename VT // Vector base type of the expression
660  , typename... REAs > // Runtime element arguments
661 inline decltype(auto) elements( const VecScalarMultExpr<VT>& vector, REAs... args )
662 {
664 
665  return elements<CEAs...>( (~vector).leftOperand(), args... ) * (~vector).rightOperand();
666 }
668 //*************************************************************************************************
669 
670 
671 //*************************************************************************************************
683 template< size_t... CEAs // Compile time element arguments
684  , typename VT // Vector base type of the expression
685  , typename... REAs > // Runtime element arguments
686 inline decltype(auto) elements( const VecScalarDivExpr<VT>& vector, REAs... args )
687 {
689 
690  return elements<CEAs...>( (~vector).leftOperand(), args... ) / (~vector).rightOperand();
691 }
693 //*************************************************************************************************
694 
695 
696 //*************************************************************************************************
708 template< size_t... CEAs // Compile time element arguments
709  , typename VT // Vector base type of the expression
710  , typename... REAs > // Runtime element arguments
711 inline decltype(auto) elements( const VecMapExpr<VT>& vector, REAs... args )
712 {
714 
715  return map( elements<CEAs...>( (~vector).operand(), args... ), (~vector).operation() );
716 }
718 //*************************************************************************************************
719 
720 
721 //*************************************************************************************************
733 template< size_t... CEAs // Compile time element arguments
734  , typename VT // Vector base type of the expression
735  , typename... REAs > // Runtime element arguments
736 inline decltype(auto) elements( const VecVecMapExpr<VT>& vector, REAs... args )
737 {
739 
740  return map( elements<CEAs...>( (~vector).leftOperand(), args... ),
741  elements<CEAs...>( (~vector).rightOperand(), args... ),
742  (~vector).operation() );
743 }
745 //*************************************************************************************************
746 
747 
748 //*************************************************************************************************
760 template< size_t... CEAs // Compile time element arguments
761  , typename VT // Vector base type of the expression
762  , typename... REAs > // Runtime element arguments
763 inline decltype(auto) elements( const VecEvalExpr<VT>& vector, REAs... args )
764 {
766 
767  return eval( elements<CEAs...>( (~vector).operand(), args... ) );
768 }
770 //*************************************************************************************************
771 
772 
773 //*************************************************************************************************
785 template< size_t... CEAs // Compile time element arguments
786  , typename VT // Vector base type of the expression
787  , typename... REAs > // Runtime element arguments
788 inline decltype(auto) elements( const VecSerialExpr<VT>& vector, REAs... args )
789 {
791 
792  return serial( elements<CEAs...>( (~vector).operand(), args... ) );
793 }
795 //*************************************************************************************************
796 
797 
798 //*************************************************************************************************
810 template< size_t... CEAs // Compile time element arguments
811  , typename VT // Vector base type of the expression
812  , typename... REAs > // Runtime element arguments
813 inline decltype(auto) elements( const VecTransExpr<VT>& vector, REAs... args )
814 {
816 
817  return trans( elements<CEAs...>( (~vector).operand(), args... ) );
818 }
820 //*************************************************************************************************
821 
822 
823 //*************************************************************************************************
835 template< size_t I1 // First required element index
836  , size_t... Is1 // Remaining required element indices
837  , typename VT // Type of the vector
838  , bool TF // Transpose flag
839  , bool DF // Density flag
840  , size_t I2 // First present element index
841  , size_t... Is2 // Remaining present element indices
842  , typename... REAs > // Optional element arguments
843 inline decltype(auto) elements( Elements<VT,TF,DF,I2,Is2...>& e, REAs... args )
844 {
846 
847  static constexpr size_t indices[] = { I2, Is2... };
848  return elements< indices[I1], indices[Is1]... >( e.operand(), args... );
849 }
851 //*************************************************************************************************
852 
853 
854 //*************************************************************************************************
866 template< size_t I1 // First required element index
867  , size_t... Is1 // Remaining required element indices
868  , typename VT // Type of the vector
869  , bool TF // Transpose flag
870  , bool DF // Density flag
871  , size_t I2 // First present element index
872  , size_t... Is2 // Remaining present element indices
873  , typename... REAs > // Optional element arguments
874 inline decltype(auto) elements( const Elements<VT,TF,DF,I2,Is2...>& e, REAs... args )
875 {
877 
878  static constexpr size_t indices[] = { I2, Is2... };
879  return elements< indices[I1], indices[Is1]... >( e.operand(), args... );
880 }
882 //*************************************************************************************************
883 
884 
885 //*************************************************************************************************
897 template< size_t I1 // First required element index
898  , size_t... Is1 // Remaining required element indices
899  , typename VT // Type of the vector
900  , bool TF // Transpose flag
901  , bool DF // Density flag
902  , size_t I2 // First present element index
903  , size_t... Is2 // Remaining present element indices
904  , typename... REAs > // Optional element arguments
905 inline decltype(auto) elements( Elements<VT,TF,DF,I2,Is2...>&& e, REAs... args )
906 {
908 
909  static constexpr size_t indices[] = { I2, Is2... };
910  return elements< indices[I1], indices[Is1]... >( e.operand(), args... );
911 }
913 //*************************************************************************************************
914 
915 
916 //*************************************************************************************************
929 template< size_t I // First element index
930  , size_t... Is // Remaining element indices
931  , typename VT // Type of the vector
932  , bool TF // Transpose flag
933  , bool DF // Density flag
934  , typename... REAs > // Optional element arguments
935 inline decltype(auto) elements( Elements<VT,TF,DF>& e, REAs... args )
936 {
938 
939  constexpr bool isChecked( !Contains< TypeList<REAs...>, Unchecked >::value );
940 
941  if( isChecked ) {
942  static constexpr size_t indices[] = { I, Is... };
943  for( size_t i=0UL; i<sizeof...(Is)+1UL; ++i ) {
944  if( e.size() <= indices[i] ) {
945  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
946  }
947  }
948  }
949 
950  decltype(auto) indices( e.idces() );
951  return elements( e.operand(), { indices[I], indices[Is]... }, args... );
952 }
954 //*************************************************************************************************
955 
956 
957 //*************************************************************************************************
970 template< size_t I // First element index
971  , size_t... Is // Remaining element indices
972  , typename VT // Type of the vector
973  , bool TF // Transpose flag
974  , bool DF // Density flag
975  , typename... REAs > // Optional element arguments
976 inline decltype(auto) elements( const Elements<VT,TF,DF>& e, REAs... args )
977 {
979 
980  constexpr bool isChecked( !Contains< TypeList<REAs...>, Unchecked >::value );
981 
982  if( isChecked ) {
983  static constexpr size_t indices[] = { I, Is... };
984  for( size_t i=0UL; i<sizeof...(Is)+1UL; ++i ) {
985  if( e.size() <= indices[i] ) {
986  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
987  }
988  }
989  }
990 
991  decltype(auto) indices( e.idces() );
992  return elements( e.operand(), { indices[I], indices[Is]... }, args... );
993 }
995 //*************************************************************************************************
996 
997 
998 //*************************************************************************************************
1011 template< size_t I // First element index
1012  , size_t... Is // Remaining element indices
1013  , typename VT // Type of the vector
1014  , bool TF // Transpose flag
1015  , bool DF // Density flag
1016  , typename... REAs > // Optional element arguments
1017 inline decltype(auto) elements( Elements<VT,TF,DF>&& e, REAs... args )
1018 {
1020 
1021  constexpr bool isChecked( !Contains< TypeList<REAs...>, Unchecked >::value );
1022 
1023  if( isChecked ) {
1024  static constexpr size_t indices[] = { I, Is... };
1025  for( size_t i=0UL; i<sizeof...(Is)+1UL; ++i ) {
1026  if( e.size() <= indices[i] ) {
1027  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
1028  }
1029  }
1030  }
1031 
1032  decltype(auto) indices( e.idces() );
1033  return elements( e.operand(), { indices[I], indices[Is]... }, args... );
1034 }
1036 //*************************************************************************************************
1037 
1038 
1039 //*************************************************************************************************
1054 template< typename VT // Type of the vector
1055  , bool TF // Transpose flag
1056  , bool DF // Density flag
1057  , size_t... CEAs // Compile time element arguments
1058  , typename T // Type of the element indices
1059  , typename... REAs > // Optional element arguments
1060 inline decltype(auto) elements( Elements<VT,TF,DF,CEAs...>& e,
1061  const T* indices, size_t n, REAs... args )
1062 {
1064 
1065  constexpr bool isChecked( !Contains< TypeList<REAs...>, Unchecked >::value );
1066 
1067  if( isChecked ) {
1068  for( size_t i=0UL; i<n; ++i ) {
1069  if( e.size() <= indices[i] ) {
1070  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
1071  }
1072  }
1073  }
1074 
1075  decltype(auto) oldIndices( e.idces() );
1076  SmallVector<size_t,128UL> newIndices;
1077  newIndices.reserve( n );
1078 
1079  for( size_t i=0UL; i<n; ++i ) {
1080  newIndices.pushBack( oldIndices[indices[i]] );
1081  }
1082 
1083  return elements( e.operand(), newIndices.data(), newIndices.size(), args... );
1084 }
1086 //*************************************************************************************************
1087 
1088 
1089 //*************************************************************************************************
1104 template< typename VT // Type of the vector
1105  , bool TF // Transpose flag
1106  , bool DF // Density flag
1107  , size_t... CEAs // Compile time element arguments
1108  , typename T // Type of the element indices
1109  , typename... REAs > // Optional element arguments
1110 inline decltype(auto) elements( const Elements<VT,TF,DF,CEAs...>& e,
1111  const T* indices, size_t n, REAs... args )
1112 {
1114 
1115  constexpr bool isChecked( !Contains< TypeList<REAs...>, Unchecked >::value );
1116 
1117  if( isChecked ) {
1118  for( size_t i=0UL; i<n; ++i ) {
1119  if( e.size() <= indices[i] ) {
1120  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
1121  }
1122  }
1123  }
1124 
1125  decltype(auto) oldIndices( e.idces() );
1126  SmallVector<size_t,128UL> newIndices;
1127  newIndices.reserve( n );
1128 
1129  for( size_t i=0UL; i<n; ++i ) {
1130  newIndices.pushBack( oldIndices[indices[i]] );
1131  }
1132 
1133  return elements( e.operand(), newIndices.data(), newIndices.size(), args... );
1134 }
1136 //*************************************************************************************************
1137 
1138 
1139 //*************************************************************************************************
1154 template< typename VT // Type of the vector
1155  , bool TF // Transpose flag
1156  , bool DF // Density flag
1157  , size_t... CEAs // Compile time element arguments
1158  , typename T // Type of the element indices
1159  , typename... REAs > // Optional element arguments
1160 inline decltype(auto) elements( Elements<VT,TF,DF,CEAs...>&& e,
1161  const T* indices, size_t n, REAs... args )
1162 {
1164 
1165  constexpr bool isChecked( !Contains< TypeList<REAs...>, Unchecked >::value );
1166 
1167  if( isChecked ) {
1168  for( size_t i=0UL; i<n; ++i ) {
1169  if( e.size() <= indices[i] ) {
1170  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
1171  }
1172  }
1173  }
1174 
1175  decltype(auto) oldIndices( e.idces() );
1176  SmallVector<size_t,128UL> newIndices;
1177  newIndices.reserve( n );
1178 
1179  for( size_t i=0UL; i<n; ++i ) {
1180  newIndices.pushBack( oldIndices[indices[i]] );
1181  }
1182 
1183  return elements( e.operand(), newIndices.data(), newIndices.size(), args... );
1184 }
1186 //*************************************************************************************************
1187 
1188 
1189 
1190 
1191 //=================================================================================================
1192 //
1193 // GLOBAL RESTRUCTURING FUNCTIONS (SUBVECTOR)
1194 //
1195 //=================================================================================================
1196 
1197 //*************************************************************************************************
1209 template< AlignmentFlag AF // Alignment flag
1210  , size_t I // Index of the first subvector element
1211  , size_t N // Size of the subvector
1212  , typename VT // Type of the vector
1213  , bool TF // Transpose flag
1214  , bool DF // Density flag
1215  , size_t... CEAs // Compile time element arguments
1216  , typename... RSAs > // Optional arguments
1217 inline decltype(auto) subvector( Elements<VT,TF,DF,CEAs...>& e, RSAs... args )
1218 {
1220 
1221  return elements( e, make_shifted_index_sequence<I,N>(), args... );
1222 }
1224 //*************************************************************************************************
1225 
1226 
1227 //*************************************************************************************************
1239 template< AlignmentFlag AF // Alignment flag
1240  , size_t I // Index of the first subvector element
1241  , size_t N // Size of the subvector
1242  , typename VT // Type of the vector
1243  , bool TF // Transpose flag
1244  , bool DF // Density flag
1245  , size_t... CEAs // Compile time element arguments
1246  , typename... RSAs > // Optional arguments
1247 inline decltype(auto) subvector( const Elements<VT,TF,DF,CEAs...>& e, RSAs... args )
1248 {
1250 
1251  return elements( e, make_shifted_index_sequence<I,N>(), args... );
1252 }
1254 //*************************************************************************************************
1255 
1256 
1257 //*************************************************************************************************
1269 template< AlignmentFlag AF // Alignment flag
1270  , size_t I // Index of the first subvector element
1271  , size_t N // Size of the subvector
1272  , typename VT // Type of the vector
1273  , bool TF // Transpose flag
1274  , bool DF // Density flag
1275  , size_t... CEAs // Compile time element arguments
1276  , typename... RSAs > // Optional arguments
1277 inline decltype(auto) subvector( Elements<VT,TF,DF,CEAs...>&& e, RSAs... args )
1278 {
1280 
1281  return elements( e, make_shifted_index_sequence<I,N>(), args... );
1282 }
1284 //*************************************************************************************************
1285 
1286 
1287 //*************************************************************************************************
1301 template< AlignmentFlag AF // Alignment flag
1302  , typename VT // Type of the vector
1303  , bool TF // Transpose flag
1304  , bool DF // Density flag
1305  , size_t... CEAs // Compile time element arguments
1306  , typename... RSAs > // Optional arguments
1307 inline decltype(auto)
1308  subvector( Elements<VT,TF,DF,CEAs...>& e, size_t index, size_t size, RSAs... args )
1309 {
1311 
1312  SmallVector<size_t,128UL> indices( size );
1313  std::iota( indices.begin(), indices.end(), index );
1314 
1315  return elements( e, indices.data(), indices.size(), args... );
1316 }
1318 //*************************************************************************************************
1319 
1320 
1321 //*************************************************************************************************
1335 template< AlignmentFlag AF // Alignment flag
1336  , typename VT // Type of the vector
1337  , bool TF // Transpose flag
1338  , bool DF // Density flag
1339  , size_t... CEAs // Compile time element arguments
1340  , typename... RSAs > // Optional arguments
1341 inline decltype(auto)
1342  subvector( const Elements<VT,TF,DF,CEAs...>& e, size_t index, size_t size, RSAs... args )
1343 {
1345 
1346  SmallVector<size_t,128UL> indices( size );
1347  std::iota( indices.begin(), indices.end(), index );
1348 
1349  return elements( e, indices.data(), indices.size(), args... );
1350 }
1352 //*************************************************************************************************
1353 
1354 
1355 //*************************************************************************************************
1369 template< AlignmentFlag AF // Alignment flag
1370  , typename VT // Type of the vector
1371  , bool TF // Transpose flag
1372  , bool DF // Density flag
1373  , size_t... CEAs // Compile time element arguments
1374  , typename... RSAs > // Optional arguments
1375 inline decltype(auto)
1376  subvector( Elements<VT,TF,DF,CEAs...>&& e, size_t index, size_t size, RSAs... args )
1377 {
1379 
1380  SmallVector<size_t,128UL> indices( size );
1381  std::iota( indices.begin(), indices.end(), index );
1382 
1383  return elements( std::move( e ), indices.data(), indices.size(), args... );
1384 }
1386 //*************************************************************************************************
1387 
1388 
1389 
1390 
1391 //=================================================================================================
1392 //
1393 // ELEMENTS OPERATORS
1394 //
1395 //=================================================================================================
1396 
1397 //*************************************************************************************************
1405 template< typename VT // Type of the vector
1406  , bool TF // Transpose flag
1407  , bool DF // Density flag
1408  , size_t... CEAs > // Compile time element arguments
1409 inline void reset( Elements<VT,TF,DF,CEAs...>& e )
1410 {
1411  e.reset();
1412 }
1414 //*************************************************************************************************
1415 
1416 
1417 //*************************************************************************************************
1425 template< typename VT // Type of the vector
1426  , bool TF // Transpose flag
1427  , bool DF // Density flag
1428  , size_t... CEAs > // Compile time element arguments
1429 inline void reset( Elements<VT,TF,DF,CEAs...>&& e )
1430 {
1431  e.reset();
1432 }
1434 //*************************************************************************************************
1435 
1436 
1437 //*************************************************************************************************
1445 template< typename VT // Type of the vector
1446  , bool TF // Transpose flag
1447  , bool DF // Density flag
1448  , size_t... CEAs > // Compile time element arguments
1449 inline void clear( Elements<VT,TF,DF,CEAs...>& e )
1450 {
1451  e.reset();
1452 }
1454 //*************************************************************************************************
1455 
1456 
1457 //*************************************************************************************************
1465 template< typename VT // Type of the vector
1466  , bool TF // Transpose flag
1467  , bool DF // Density flag
1468  , size_t... CEAs > // Compile time element arguments
1469 inline void clear( Elements<VT,TF,DF,CEAs...>&& e )
1470 {
1471  e.reset();
1472 }
1474 //*************************************************************************************************
1475 
1476 
1477 //*************************************************************************************************
1503 template< bool RF // Relaxation flag
1504  , typename VT // Type of the dense vector
1505  , bool TF // Transpose flag
1506  , size_t... CEAs > // Compile time element arguments
1507 inline bool isDefault( const Elements<VT,TF,true,CEAs...>& e )
1508 {
1509  using blaze::isDefault;
1510 
1511  for( size_t i=0UL; i<e.size(); ++i )
1512  if( !isDefault<RF>( e[i] ) ) return false;
1513  return true;
1514 }
1516 //*************************************************************************************************
1517 
1518 
1519 //*************************************************************************************************
1545 template< bool RF // Relaxation flag
1546  , typename VT // Type of the sparse vector
1547  , bool TF // Transpose flag
1548  , size_t... CEAs > // Compile time element arguments
1549 inline bool isDefault( const Elements<VT,TF,false,CEAs...>& e )
1550 {
1551  using blaze::isDefault;
1552 
1553  for( const auto& element : ~e )
1554  if( !isDefault<RF>( element.value() ) ) return false;
1555  return true;
1556 }
1558 //*************************************************************************************************
1559 
1560 
1561 //*************************************************************************************************
1579 template< typename VT // Type of the vector
1580  , bool TF // Transpose flag
1581  , bool DF // Density flag
1582  , size_t... CEAs > // Compile time element arguments
1583 inline bool isIntact( const Elements<VT,TF,DF,CEAs...>& e ) noexcept
1584 {
1585  return ( e.size() <= e.operand().size() && isIntact( e.operand() ) );
1586 }
1588 //*************************************************************************************************
1589 
1590 
1591 //*************************************************************************************************
1605 template< typename VT // Type of the vector
1606  , bool TF // Transpose flag
1607  , bool DF // Density flag
1608  , size_t... CEAs > // Compile time element arguments
1609 inline bool isSame( const Elements<VT,TF,DF,CEAs...>& a, const Vector<VT,TF>& b ) noexcept
1610 {
1611  if( !isSame( a.operand(), ~b ) || ( a.size() != (~b).size() ) )
1612  return false;
1613 
1614  decltype(auto) indices( a.idces() );
1615  for( size_t i=0UL; i<a.size(); ++i ) {
1616  if( indices[i] != i )
1617  return false;
1618  }
1619 
1620  return true;
1621 }
1623 //*************************************************************************************************
1624 
1625 
1626 //*************************************************************************************************
1640 template< typename VT // Type of the vector
1641  , bool TF // Transpose flag
1642  , bool DF // Density flag
1643  , size_t... CEAs > // Compile time element arguments
1644 inline bool isSame( const Vector<VT,TF>& a, const Elements<VT,TF,DF,CEAs...>& b ) noexcept
1645 {
1646  return isSame( b, a );
1647 }
1649 //*************************************************************************************************
1650 
1651 
1652 //*************************************************************************************************
1666 template< typename VT1 // Type of the left-hand side vector
1667  , bool TF // Transpose flag
1668  , bool DF // Density flag
1669  , size_t... CEAs // Compile time element arguments
1670  , typename VT2 // Type of the right-hand side vector
1671  , AlignmentFlag AF // Alignment flag
1672  , size_t... CSAs > // Compile time subvector arguments
1673 inline bool isSame( const Elements<VT1,TF,DF,CEAs...>& a, const Subvector<VT2,AF,TF,DF,CSAs...>& b ) noexcept
1674 {
1675  if( !isSame( a.operand(), b.operand() ) || ( a.size() != b.size() ) )
1676  return false;
1677 
1678  decltype(auto) indices( a.idces() );
1679  for( size_t i=0UL; i<a.size(); ++i ) {
1680  if( indices[i] != b.offset()+i )
1681  return false;
1682  }
1683 
1684  return true;
1685 }
1687 //*************************************************************************************************
1688 
1689 
1690 //*************************************************************************************************
1704 template< typename VT1 // Type of the left-hand side vector
1705  , AlignmentFlag AF // Alignment flag
1706  , bool TF // Transpose flag
1707  , bool DF // Density flag
1708  , size_t... CSAs // Compile time subvector arguments
1709  , typename VT2 // Type of the right-hand side vector
1710  , size_t... CEAs > // Compile time element arguments
1711 inline bool isSame( const Subvector<VT1,AF,TF,DF,CSAs...>& a, const Elements<VT2,TF,DF,CEAs...>& b ) noexcept
1712 {
1713  return isSame( b, a );
1714 }
1716 //*************************************************************************************************
1717 
1718 
1719 //*************************************************************************************************
1732 template< typename VT1 // Type of the vector of the left-hand side selection of elements
1733  , bool TF1 // Transpose flag of the left-hand side selection of elements
1734  , bool DF1 // Density flag of the left-hand side selection of elements
1735  , size_t... CEAs1 // Compile time element arguments of the left-hand side selection of elements
1736  , typename VT2 // Type of the vector of the right-hand side selection of elements
1737  , bool TF2 // Transpose flag of the right-hand side selection of elements
1738  , bool DF2 // Density flag of the right-hand side selection of elements
1739  , size_t... CEAs2 > // Compile time element arguments of the right-hand side selection of elements
1740 inline bool isSame( const Elements<VT1,TF1,DF1,CEAs1...>& a,
1741  const Elements<VT2,TF2,DF2,CEAs2...>& b ) noexcept
1742 {
1743  if( !isSame( a.operand(), b.operand() ) || a.size() != b.size() )
1744  return false;
1745 
1746  decltype(auto) indices1( a.idces() );
1747  decltype(auto) indices2( b.idces() );
1748 
1749  return std::equal( indices1.begin(), indices1.end(), indices2.begin() );
1750 }
1752 //*************************************************************************************************
1753 
1754 
1755 //*************************************************************************************************
1770 template< typename VT // Type of the vector
1771  , bool TF // Transpose flag
1772  , bool DF // Density flag
1773  , size_t... CEAs // Compile time element arguments
1774  , typename ET > // Type of the element
1775 inline bool trySet( const Elements<VT,TF,DF,CEAs...>& e, size_t index, const ET& value )
1776 {
1777  BLAZE_INTERNAL_ASSERT( index < e.size(), "Invalid vector access index" );
1778 
1779  return trySet( e.operand(), e.idx(index), value );
1780 }
1782 //*************************************************************************************************
1783 
1784 
1785 //*************************************************************************************************
1800 template< typename VT // Type of the vector
1801  , bool TF // Transpose flag
1802  , bool DF // Density flag
1803  , size_t... CEAs // Compile time element arguments
1804  , typename ET > // Type of the element
1805 inline bool tryAdd( const Elements<VT,TF,DF,CEAs...>& e, size_t index, const ET& value )
1806 {
1807  BLAZE_INTERNAL_ASSERT( index < e.size(), "Invalid vector access index" );
1808 
1809  return tryAdd( e.operand(), e.idx(index), value );
1810 }
1812 //*************************************************************************************************
1813 
1814 
1815 //*************************************************************************************************
1830 template< typename VT // Type of the vector
1831  , bool TF // Transpose flag
1832  , bool DF // Density flag
1833  , size_t... CEAs // Compile time element arguments
1834  , typename ET > // Type of the element
1835 inline bool trySub( const Elements<VT,TF,DF,CEAs...>& e, size_t index, const ET& value )
1836 {
1837  BLAZE_INTERNAL_ASSERT( index < e.size(), "Invalid vector access index" );
1838 
1839  return trySub( e.operand(), e.idx(index), value );
1840 }
1842 //*************************************************************************************************
1843 
1844 
1845 //*************************************************************************************************
1860 template< typename VT // Type of the vector
1861  , bool TF // Transpose flag
1862  , bool DF // Density flag
1863  , size_t... CEAs // Compile time element arguments
1864  , typename ET > // Type of the element
1865 inline bool tryMult( const Elements<VT,TF,DF,CEAs...>& e, size_t index, const ET& value )
1866 {
1867  BLAZE_INTERNAL_ASSERT( index < e.size(), "Invalid vector access index" );
1868 
1869  return tryMult( e.operand(), e.idx(index), value );
1870 }
1872 //*************************************************************************************************
1873 
1874 
1875 //*************************************************************************************************
1891 template< typename VT // Type of the vector
1892  , bool TF // Transpose flag
1893  , bool DF // Density flag
1894  , size_t... CEAs // Compile time element arguments
1895  , typename ET > // Type of the element
1897  tryMult( const Elements<VT,TF,DF,CEAs...>& e, size_t index, size_t size, const ET& value )
1898 {
1899  BLAZE_INTERNAL_ASSERT( index <= (~e).size(), "Invalid vector access index" );
1900  BLAZE_INTERNAL_ASSERT( index + size <= (~e).size(), "Invalid range size" );
1901 
1902  const size_t iend( index + size );
1903 
1904  for( size_t i=index; i<iend; ++i ) {
1905  if( !tryMult( e.operand(), e.idx(i), value ) )
1906  return false;
1907  }
1908 
1909  return true;
1910 }
1912 //*************************************************************************************************
1913 
1914 
1915 //*************************************************************************************************
1930 template< typename VT // Type of the vector
1931  , bool TF // Transpose flag
1932  , bool DF // Density flag
1933  , size_t... CEAs // Compile time element arguments
1934  , typename ET > // Type of the element
1935 inline bool tryDiv( const Elements<VT,TF,DF,CEAs...>& e, size_t index, const ET& value )
1936 {
1937  BLAZE_INTERNAL_ASSERT( index < e.size(), "Invalid vector access index" );
1938 
1939  return tryDiv( e.operand(), e.idx(index), value );
1940 }
1942 //*************************************************************************************************
1943 
1944 
1945 //*************************************************************************************************
1961 template< typename VT // Type of the vector
1962  , bool TF // Transpose flag
1963  , bool DF // Density flag
1964  , size_t... CEAs // Compile time element arguments
1965  , typename ET > // Type of the element
1967  tryDiv( const Elements<VT,TF,DF,CEAs...>& e, size_t index, size_t size, const ET& value )
1968 {
1969  BLAZE_INTERNAL_ASSERT( index <= (~e).size(), "Invalid vector access index" );
1970  BLAZE_INTERNAL_ASSERT( index + size <= (~e).size(), "Invalid range size" );
1971 
1972  const size_t iend( index + size );
1973 
1974  for( size_t i=index; i<iend; ++i ) {
1975  if( !tryDiv( e.operand(), e.idx(i), value ) )
1976  return false;
1977  }
1978 
1979  return true;
1980 }
1982 //*************************************************************************************************
1983 
1984 
1985 //*************************************************************************************************
2000 template< typename VT1 // Type of the vector
2001  , bool TF // Transpose flag
2002  , bool DF // Density flag
2003  , size_t... CEAs // Compile time element arguments
2004  , typename VT2 > // Type of the right-hand side vector
2005 inline bool tryAssign( const Elements<VT1,TF,DF,CEAs...>& lhs,
2006  const Vector<VT2,TF>& rhs, size_t index )
2007 {
2008  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2009  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2010 
2011  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2012  if( !trySet( lhs.operand(), lhs.idx(i+index), (~rhs)[i] ) )
2013  return false;
2014  }
2015 
2016  return true;
2017 }
2019 //*************************************************************************************************
2020 
2021 
2022 //*************************************************************************************************
2038 template< typename VT1 // Type of the vector
2039  , bool TF // Transpose flag
2040  , bool DF // Density flag
2041  , size_t... CEAs // Compile time element arguments
2042  , typename VT2 > // Type of the right-hand side vector
2043 inline bool tryAddAssign( const Elements<VT1,TF,DF,CEAs...>& lhs,
2044  const Vector<VT2,TF>& rhs, size_t index )
2045 {
2046  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2047  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2048 
2049  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2050  if( !tryAdd( lhs.operand(), lhs.idx(i+index), (~rhs)[i] ) )
2051  return false;
2052  }
2053 
2054  return true;
2055 }
2057 //*************************************************************************************************
2058 
2059 
2060 //*************************************************************************************************
2076 template< typename VT1 // Type of the vector
2077  , bool TF // Transpose flag
2078  , bool DF // Density flag
2079  , size_t... CEAs // Compile time element arguments
2080  , typename VT2 > // Type of the right-hand side vector
2081 inline bool trySubAssign( const Elements<VT1,TF,DF,CEAs...>& lhs,
2082  const Vector<VT2,TF>& rhs, size_t index )
2083 {
2084  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2085  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2086 
2087  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2088  if( !trySub( lhs.operand(), lhs.idx(i+index), (~rhs)[i] ) )
2089  return false;
2090  }
2091 
2092  return true;
2093 }
2095 //*************************************************************************************************
2096 
2097 
2098 //*************************************************************************************************
2114 template< typename VT1 // Type of the vector
2115  , bool TF // Transpose flag
2116  , bool DF // Density flag
2117  , size_t... CEAs // Compile time element arguments
2118  , typename VT2 > // Type of the right-hand side vector
2119 inline bool tryMultAssign( const Elements<VT1,TF,DF,CEAs...>& lhs,
2120  const Vector<VT2,TF>& rhs, size_t index )
2121 {
2122  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2123  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2124 
2125  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2126  if( !tryMult( lhs.operand(), lhs.idx(i+index), (~rhs)[i] ) )
2127  return false;
2128  }
2129 
2130  return true;
2131 }
2133 //*************************************************************************************************
2134 
2135 
2136 //*************************************************************************************************
2152 template< typename VT1 // Type of the vector
2153  , bool TF // Transpose flag
2154  , bool DF // Density flag
2155  , size_t... CEAs // Compile time element arguments
2156  , typename VT2 > // Type of the right-hand side vector
2157 inline bool tryDivAssign( const Elements<VT1,TF,DF,CEAs...>& lhs,
2158  const Vector<VT2,TF>& rhs, size_t index )
2159 {
2160  BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
2161  BLAZE_INTERNAL_ASSERT( index + (~rhs).size() <= lhs.size(), "Invalid vector size" );
2162 
2163  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2164  if( !tryDiv( lhs.operand(), lhs.idx(i+index), (~rhs)[i] ) )
2165  return false;
2166  }
2167 
2168  return true;
2169 }
2171 //*************************************************************************************************
2172 
2173 
2174 //*************************************************************************************************
2189 template< typename VT // Type of the vector
2190  , bool TF // Transpose flag
2191  , bool DF // Density flag
2192  , size_t I // First element index
2193  , size_t... Is > // Remaining element indices
2194 inline decltype(auto) derestrict( Elements<VT,TF,DF,I,Is...>& e )
2195 {
2196  return elements<I,Is...>( derestrict( e.operand() ), unchecked );
2197 }
2199 //*************************************************************************************************
2200 
2201 
2202 //*************************************************************************************************
2217 template< typename VT // Type of the vector
2218  , bool TF // Transpose flag
2219  , bool DF // Density flag
2220  , size_t I // First element index
2221  , size_t... Is > // Remaining element indices
2222 inline decltype(auto) derestrict( Elements<VT,TF,DF,I,Is...>&& e )
2223 {
2224  return elements<I,Is...>( derestrict( e.operand() ), unchecked );
2225 }
2227 //*************************************************************************************************
2228 
2229 
2230 //*************************************************************************************************
2245 template< typename VT // Type of the vector
2246  , bool TF // Transpose flag
2247  , bool DF > // Density flag
2248 inline decltype(auto) derestrict( Elements<VT,TF,DF>& e )
2249 {
2250  decltype(auto) indices( e.idces() );
2251  return elements( derestrict( e.operand() ), indices.data(), indices.size(), unchecked );
2252 }
2254 //*************************************************************************************************
2255 
2256 
2257 //*************************************************************************************************
2272 template< typename VT // Type of the vector
2273  , bool TF // Transpose flag
2274  , bool DF > // Density flag
2275 inline decltype(auto) derestrict( Elements<VT,TF,DF>&& e )
2276 {
2277  decltype(auto) indices( e.idces() );
2278  return elements( derestrict( e.operand() ), indices.data(), indices.size(), unchecked );
2279 }
2281 //*************************************************************************************************
2282 
2283 
2284 
2285 
2286 //=================================================================================================
2287 //
2288 // SIZE SPECIALIZATIONS
2289 //
2290 //=================================================================================================
2291 
2292 //*************************************************************************************************
2294 template< typename VT, bool TF, bool DF, size_t I, size_t... Is >
2295 struct Size< Elements<VT,TF,DF,I,Is...>, 0UL >
2296  : public PtrdiffT<1UL+sizeof...(Is)>
2297 {};
2299 //*************************************************************************************************
2300 
2301 
2302 
2303 
2304 //=================================================================================================
2305 //
2306 // ISRESTRICTED SPECIALIZATIONS
2307 //
2308 //=================================================================================================
2309 
2310 //*************************************************************************************************
2312 template< typename VT, bool TF, bool DF, size_t... CEAs >
2313 struct IsRestricted< Elements<VT,TF,DF,CEAs...> >
2314  : public IsRestricted<VT>
2315 {};
2317 //*************************************************************************************************
2318 
2319 
2320 
2321 
2322 //=================================================================================================
2323 //
2324 // HASCONSTDATAACCESS SPECIALIZATIONS
2325 //
2326 //=================================================================================================
2327 
2328 //*************************************************************************************************
2330 template< typename VT, bool TF, size_t... CEAs >
2331 struct HasConstDataAccess< Elements<VT,TF,true,CEAs...> >
2332  : public HasConstDataAccess<VT>
2333 {};
2335 //*************************************************************************************************
2336 
2337 
2338 
2339 
2340 //=================================================================================================
2341 //
2342 // HASMUTABLEDATAACCESS SPECIALIZATIONS
2343 //
2344 //=================================================================================================
2345 
2346 //*************************************************************************************************
2348 template< typename VT, bool TF, size_t... CEAs >
2349 struct HasMutableDataAccess< Elements<VT,TF,true,CEAs...> >
2350  : public HasMutableDataAccess<VT>
2351 {};
2353 //*************************************************************************************************
2354 
2355 
2356 
2357 
2358 //=================================================================================================
2359 //
2360 // SUBVECTORTRAIT SPECIALIZATIONS
2361 //
2362 //=================================================================================================
2363 
2364 //*************************************************************************************************
2366 template< typename VT, bool TF, bool DF, size_t... CEAs, size_t... CSAs >
2367 struct SubvectorTrait< Elements<VT,TF,DF,CEAs...>, CSAs... >
2368 {
2369  using Type = SubvectorTrait_< ResultType_< Elements<VT,TF,DF,CEAs...> >, CSAs... >;
2370 };
2372 //*************************************************************************************************
2373 
2374 
2375 
2376 
2377 //=================================================================================================
2378 //
2379 // ELEMENTSTRAIT SPECIALIZATIONS
2380 //
2381 //=================================================================================================
2382 
2383 //*************************************************************************************************
2385 template< typename VT, bool TF, bool DF, size_t... CEAs1, size_t... CEAs2 >
2386 struct ElementsTrait< Elements<VT,TF,DF,CEAs1...>, CEAs2... >
2387 {
2388  using Type = ElementsTrait_< ResultType_< Elements<VT,TF,DF,CEAs1...> >, CEAs2... >;
2389 };
2391 //*************************************************************************************************
2392 
2393 } // namespace blaze
2394 
2395 #endif
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:329
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Header file for the blaze::checked and blaze::unchecked instances.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Base class for all vector transposition expression templates.The VecTransExpr class serves as a tag f...
Definition: VecTransExpr.h:66
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
Header file for the VecVecDivExpr base class.
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:949
Header file for basic type definitions.
Base class for all vector evaluation expression templates.The VecEvalExpr class serves as a tag for a...
Definition: VecEvalExpr.h:66
constexpr bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:76
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Base class for all cross product expression templates.The CrossExpr class serves as a tag for all exp...
Definition: CrossExpr.h:66
Iterator end() noexcept
Returns an iterator just past the last element of the small vector.
Definition: SmallVector.h:620
Header file for the VecMapExpr base class.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
Implementation of a dynamic vector with small vector optimization.The SmallVector class template is a...
Definition: SmallVector.h:80
Base class for all vector serial evaluation expression templates.The VecSerialExpr class serves as a ...
Definition: VecSerialExpr.h:67
Header file for the VecScalarDivExpr base class.
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename ElementsTrait< VT, CEAs... >::Type ElementsTrait_
Auxiliary alias declaration for the ElementsTrait type trait.The ElementsTrait_ alias declaration pro...
Definition: ElementsTrait.h:144
Header file for the extended initializer_list functionality.
Base class for all vector/scalar division expression templates.The VecScalarDivExpr class serves as a...
Definition: VecScalarDivExpr.h:66
Index sequence type of the Blaze library.
Header file for the VecEvalExpr base class.
Header file for the VecScalarMultExpr base class.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the elements trait.
Header file for the VecVecMapExpr base class.
Elements specialization for sparse vectors.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: SmallVector.h:538
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Compile time assertion.
Header file for the VecVecAddExpr base class.
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:66
Header file for the subvector trait.
Header file for the implementation of the Elements base template.
decltype(shift< Offset >(make_index_sequence< N >())) make_shifted_index_sequence
Auxiliary alias declaration for the setup of shifted index sequences.The make_shifted_index_sequence ...
Definition: IntegerSequence.h:158
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:794
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:134
Base class for all unary vector map expression templates.The VecMapExpr class serves as a tag for all...
Definition: VecMapExpr.h:66
Header file for the exception macros of the math module.
Header file for the VecVecMultExpr base class.
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
Header file for the VecVecSubExpr base class.
Base class for all vector/vector addition expression templates.The VecVecAddExpr class serves as a ta...
Definition: VecVecAddExpr.h:66
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_ alias declaration p...
Definition: SubvectorTrait.h:145
Header file for the CrossExpr base class.
Header file for the HasConstDataAccess type trait.
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:67
Header file for the VecSerialExpr base class.
Header file for the VecTransExpr base class.
Header file for run time assertion macros.
Header file for the Unique class template.
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
#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
size_t size() const noexcept
Returns the current size/dimension of the small vector.
Definition: SmallVector.h:769
Header file for the isDefault shim.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: SmallVector.h:895
Header file for the integer_sequence and index_sequence aliases.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
Header file for the HasMutableDataAccess type trait.
Elements specialization for dense vectors.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Initializer list type of the Blaze library.
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Iterator begin() noexcept
Returns an iterator to the first element of the small vector.
Definition: SmallVector.h:572
Base class for all binary vector map expression templates.The VecVecMapExpr class serves as a tag for...
Definition: VecVecMapExpr.h:66
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Header file for the SmallVector implementation.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Searching a type list.The Contains class can be used to search the type list for a particular type Ty...
Definition: Contains.h:78
Base class for all vector/vector subtraction expression templates.The VecVecSubExpr class serves as a...
Definition: VecVecSubExpr.h:66
Header file for the IsRestricted type trait.
Header file for the Vector CRTP base class.
Header file for the Size type trait.
Base class for all vector/vector multiplication expression templates.The VecVecMultExpr class serves ...
Definition: VecVecMultExpr.h:66
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the function trace functionality.
Template for the blaze::checked and blaze::unchecked instances.blaze::Check is the template for the b...
Definition: Check.h:56
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs...
Definition: DMatDMatMapExpr.h:1134