Blaze  3.6
DynamicVector.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICVECTOR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <algorithm>
44 #include <utility>
45 #include <blaze/math/Aliases.h>
51 #include <blaze/math/Exception.h>
54 #include <blaze/math/Forward.h>
56 #include <blaze/math/shims/Clear.h>
60 #include <blaze/math/SIMD.h>
100 #include <blaze/system/CacheSize.h>
101 #include <blaze/system/Inline.h>
103 #include <blaze/system/Restrict.h>
104 #include <blaze/system/Thresholds.h>
108 #include <blaze/util/Assert.h>
114 #include <blaze/util/DisableIf.h>
115 #include <blaze/util/EnableIf.h>
117 #include <blaze/util/Memory.h>
118 #include <blaze/util/Types.h>
122 
123 
124 namespace blaze {
125 
126 //=================================================================================================
127 //
128 // CLASS DEFINITION
129 //
130 //=================================================================================================
131 
132 //*************************************************************************************************
196 template< typename Type // Data type of the vector
197  , bool TF = defaultTransposeFlag > // Transpose flag
199  : public DenseVector< DynamicVector<Type,TF>, TF >
200 {
201  public:
202  //**Type definitions****************************************************************************
205  using ResultType = This;
207  using ElementType = Type;
209  using ReturnType = const Type&;
210  using CompositeType = const DynamicVector&;
211 
212  using Reference = Type&;
213  using ConstReference = const Type&;
214  using Pointer = Type*;
215  using ConstPointer = const Type*;
216 
219  //**********************************************************************************************
220 
221  //**Rebind struct definition********************************************************************
224  template< typename NewType > // Data type of the other vector
225  struct Rebind {
227  };
228  //**********************************************************************************************
229 
230  //**Resize struct definition********************************************************************
233  template< size_t NewN > // Number of elements of the other vector
234  struct Resize {
236  };
237  //**********************************************************************************************
238 
239  //**Compilation flags***************************************************************************
241 
245  static constexpr bool simdEnabled = IsVectorizable_v<Type>;
246 
248 
251  static constexpr bool smpAssignable = !IsSMPAssignable_v<Type>;
252  //**********************************************************************************************
253 
254  //**Constructors********************************************************************************
257  explicit inline DynamicVector() noexcept;
258  explicit inline DynamicVector( size_t n );
259  explicit inline DynamicVector( size_t n, const Type& init );
260  inline DynamicVector( initializer_list<Type> list );
261 
262  template< typename Other >
263  explicit inline DynamicVector( size_t n, const Other* array );
264 
265  template< typename Other, size_t Dim >
266  explicit inline DynamicVector( const Other (&array)[Dim] );
267 
268  inline DynamicVector( const DynamicVector& v );
269  inline DynamicVector( DynamicVector&& v ) noexcept;
270  template< typename VT > inline DynamicVector( const Vector<VT,TF>& v );
272  //**********************************************************************************************
273 
274  //**Destructor**********************************************************************************
277  inline ~DynamicVector();
279  //**********************************************************************************************
280 
281  //**Data access functions***********************************************************************
284  inline Reference operator[]( size_t index ) noexcept;
285  inline ConstReference operator[]( size_t index ) const noexcept;
286  inline Reference at( size_t index );
287  inline ConstReference at( size_t index ) const;
288  inline Pointer data () noexcept;
289  inline ConstPointer data () const noexcept;
290  inline Iterator begin () noexcept;
291  inline ConstIterator begin () const noexcept;
292  inline ConstIterator cbegin() const noexcept;
293  inline Iterator end () noexcept;
294  inline ConstIterator end () const noexcept;
295  inline ConstIterator cend () const noexcept;
297  //**********************************************************************************************
298 
299  //**Assignment operators************************************************************************
302  inline DynamicVector& operator=( const Type& rhs );
303  inline DynamicVector& operator=( initializer_list<Type> list );
304 
305  template< typename Other, size_t Dim >
306  inline DynamicVector& operator=( const Other (&array)[Dim] );
307 
308  inline DynamicVector& operator=( const DynamicVector& rhs );
309  inline DynamicVector& operator=( DynamicVector&& rhs ) noexcept;
310 
311  template< typename VT > inline DynamicVector& operator= ( const Vector<VT,TF>& rhs );
312  template< typename VT > inline DynamicVector& operator+=( const Vector<VT,TF>& rhs );
313  template< typename VT > inline DynamicVector& operator-=( const Vector<VT,TF>& rhs );
314  template< typename VT > inline DynamicVector& operator*=( const Vector<VT,TF>& rhs );
315  template< typename VT > inline DynamicVector& operator/=( const DenseVector<VT,TF>& rhs );
316  template< typename VT > inline DynamicVector& operator%=( const Vector<VT,TF>& rhs );
318  //**********************************************************************************************
319 
320  //**Utility functions***************************************************************************
323  inline size_t size() const noexcept;
324  inline size_t spacing() const noexcept;
325  inline size_t capacity() const noexcept;
326  inline size_t nonZeros() const;
327  inline void reset();
328  inline void clear();
329  inline void resize( size_t n, bool preserve=true );
330  inline void extend( size_t n, bool preserve=true );
331  inline void reserve( size_t n );
332  inline void shrinkToFit();
333  inline void swap( DynamicVector& v ) noexcept;
335  //**********************************************************************************************
336 
337  //**Numeric functions***************************************************************************
340  template< typename Other > inline DynamicVector& scale( const Other& scalar );
342  //**********************************************************************************************
343 
344  private:
345  //**********************************************************************************************
347  template< typename VT >
349  static constexpr bool VectorizedAssign_v =
350  ( useOptimizedKernels &&
351  simdEnabled && VT::simdEnabled &&
352  IsSIMDCombinable_v< Type, ElementType_t<VT> > );
354  //**********************************************************************************************
355 
356  //**********************************************************************************************
358  template< typename VT >
360  static constexpr bool VectorizedAddAssign_v =
361  ( useOptimizedKernels &&
362  simdEnabled && VT::simdEnabled &&
363  IsSIMDCombinable_v< Type, ElementType_t<VT> > &&
364  HasSIMDAdd_v< Type, ElementType_t<VT> > );
366  //**********************************************************************************************
367 
368  //**********************************************************************************************
370  template< typename VT >
372  static constexpr bool VectorizedSubAssign_v =
373  ( useOptimizedKernels &&
374  simdEnabled && VT::simdEnabled &&
375  IsSIMDCombinable_v< Type, ElementType_t<VT> > &&
376  HasSIMDSub_v< Type, ElementType_t<VT> > );
378  //**********************************************************************************************
379 
380  //**********************************************************************************************
382  template< typename VT >
384  static constexpr bool VectorizedMultAssign_v =
385  ( useOptimizedKernels &&
386  simdEnabled && VT::simdEnabled &&
387  IsSIMDCombinable_v< Type, ElementType_t<VT> > &&
388  HasSIMDMult_v< Type, ElementType_t<VT> > );
390  //**********************************************************************************************
391 
392  //**********************************************************************************************
394  template< typename VT >
396  static constexpr bool VectorizedDivAssign_v =
397  ( useOptimizedKernels &&
398  simdEnabled && VT::simdEnabled &&
399  IsSIMDCombinable_v< Type, ElementType_t<VT> > &&
400  HasSIMDDiv_v< Type, ElementType_t<VT> > );
402  //**********************************************************************************************
403 
404  //**********************************************************************************************
406  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
407  //**********************************************************************************************
408 
409  public:
410  //**Debugging functions*************************************************************************
413  inline bool isIntact() const noexcept;
415  //**********************************************************************************************
416 
417  //**Expression template evaluation functions****************************************************
420  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
421  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
422 
423  inline bool isAligned () const noexcept;
424  inline bool canSMPAssign() const noexcept;
425 
426  BLAZE_ALWAYS_INLINE SIMDType load ( size_t index ) const noexcept;
427  BLAZE_ALWAYS_INLINE SIMDType loada( size_t index ) const noexcept;
428  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t index ) const noexcept;
429 
430  BLAZE_ALWAYS_INLINE void store ( size_t index, const SIMDType& value ) noexcept;
431  BLAZE_ALWAYS_INLINE void storea( size_t index, const SIMDType& value ) noexcept;
432  BLAZE_ALWAYS_INLINE void storeu( size_t index, const SIMDType& value ) noexcept;
433  BLAZE_ALWAYS_INLINE void stream( size_t index, const SIMDType& value ) noexcept;
434 
435  template< typename VT >
436  inline auto assign( const DenseVector<VT,TF>& rhs ) -> DisableIf_t< VectorizedAssign_v<VT> >;
437 
438  template< typename VT >
439  inline auto assign( const DenseVector<VT,TF>& rhs ) -> EnableIf_t< VectorizedAssign_v<VT> >;
440 
441  template< typename VT > inline void assign( const SparseVector<VT,TF>& rhs );
442 
443  template< typename VT >
444  inline auto addAssign( const DenseVector<VT,TF>& rhs ) -> DisableIf_t< VectorizedAddAssign_v<VT> >;
445 
446  template< typename VT >
447  inline auto addAssign( const DenseVector<VT,TF>& rhs ) -> EnableIf_t< VectorizedAddAssign_v<VT> >;
448 
449  template< typename VT > inline void addAssign( const SparseVector<VT,TF>& rhs );
450 
451  template< typename VT >
452  inline auto subAssign( const DenseVector<VT,TF>& rhs ) -> DisableIf_t< VectorizedSubAssign_v<VT> >;
453 
454  template< typename VT >
455  inline auto subAssign( const DenseVector<VT,TF>& rhs ) -> EnableIf_t< VectorizedSubAssign_v<VT> >;
456 
457  template< typename VT > inline void subAssign( const SparseVector<VT,TF>& rhs );
458 
459  template< typename VT >
460  inline auto multAssign( const DenseVector<VT,TF>& rhs ) -> DisableIf_t< VectorizedMultAssign_v<VT> >;
461 
462  template< typename VT >
463  inline auto multAssign( const DenseVector<VT,TF>& rhs ) -> EnableIf_t< VectorizedMultAssign_v<VT> >;
464 
465  template< typename VT > inline void multAssign( const SparseVector<VT,TF>& rhs );
466 
467  template< typename VT >
468  inline auto divAssign( const DenseVector<VT,TF>& rhs ) -> DisableIf_t< VectorizedDivAssign_v<VT> >;
469 
470  template< typename VT >
471  inline auto divAssign( const DenseVector<VT,TF>& rhs ) -> EnableIf_t< VectorizedDivAssign_v<VT> >;
473  //**********************************************************************************************
474 
475  private:
476  //**Utility functions***************************************************************************
479  inline size_t addPadding( size_t value ) const noexcept;
481  //**********************************************************************************************
482 
483  //**Member variables****************************************************************************
486  size_t size_;
487  size_t capacity_;
489 
495  //**********************************************************************************************
496 
497  //**Compile time checks*************************************************************************
504  //**********************************************************************************************
505 };
506 //*************************************************************************************************
507 
508 
509 
510 
511 //=================================================================================================
512 //
513 // CONSTRUCTORS
514 //
515 //=================================================================================================
516 
517 //*************************************************************************************************
520 template< typename Type // Data type of the vector
521  , bool TF > // Transpose flag
522 inline DynamicVector<Type,TF>::DynamicVector() noexcept
523  : size_ ( 0UL ) // The current size/dimension of the vector
524  , capacity_( 0UL ) // The maximum capacity of the vector
525  , v_ ( nullptr ) // The vector elements
526 {}
527 //*************************************************************************************************
528 
529 
530 //*************************************************************************************************
538 template< typename Type // Data type of the vector
539  , bool TF > // Transpose flag
541  : size_ ( n ) // The current size/dimension of the vector
542  , capacity_( addPadding( n ) ) // The maximum capacity of the vector
543  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
544 {
545  if( IsVectorizable_v<Type> ) {
546  for( size_t i=size_; i<capacity_; ++i )
547  v_[i] = Type();
548  }
549 
550  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
551 }
552 //*************************************************************************************************
553 
554 
555 //*************************************************************************************************
563 template< typename Type // Data type of the vector
564  , bool TF > // Transpose flag
565 inline DynamicVector<Type,TF>::DynamicVector( size_t n, const Type& init )
566  : DynamicVector( n )
567 {
568  for( size_t i=0UL; i<size_; ++i )
569  v_[i] = init;
570 
571  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
572 }
573 //*************************************************************************************************
574 
575 
576 //*************************************************************************************************
591 template< typename Type // Data type of the vector
592  , bool TF > // Transpose flag
594  : DynamicVector( list.size() )
595 {
596  std::fill( std::copy( list.begin(), list.end(), begin() ), end(), Type() );
597 
598  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
599 }
600 //*************************************************************************************************
601 
602 
603 //*************************************************************************************************
623 template< typename Type // Data type of the vector
624  , bool TF > // Transpose flag
625 template< typename Other > // Data type of the initialization array
626 inline DynamicVector<Type,TF>::DynamicVector( size_t n, const Other* array )
627  : DynamicVector( n )
628 {
629  for( size_t i=0UL; i<n; ++i )
630  v_[i] = array[i];
631 
632  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
633 }
634 //*************************************************************************************************
635 
636 
637 //*************************************************************************************************
654 template< typename Type // Data type of the vector
655  , bool TF > // Transpose flag
656 template< typename Other // Data type of the initialization array
657  , size_t Dim > // Dimension of the initialization array
658 inline DynamicVector<Type,TF>::DynamicVector( const Other (&array)[Dim] )
659  : DynamicVector( Dim )
660 {
661  for( size_t i=0UL; i<Dim; ++i )
662  v_[i] = array[i];
663 
664  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
665 }
666 //*************************************************************************************************
667 
668 
669 //*************************************************************************************************
677 template< typename Type // Data type of the vector
678  , bool TF > // Transpose flag
680  : DynamicVector( v.size_ )
681 {
682  BLAZE_INTERNAL_ASSERT( capacity_ <= v.capacity_, "Invalid capacity estimation" );
683 
684  smpAssign( *this, ~v );
685 
686  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
687 }
688 //*************************************************************************************************
689 
690 
691 //*************************************************************************************************
696 template< typename Type // Data type of the vector
697  , bool TF > // Transpose flag
699  : size_ ( v.size_ ) // The current size/dimension of the vector
700  , capacity_( v.capacity_ ) // The maximum capacity of the vector
701  , v_ ( v.v_ ) // The vector elements
702 {
703  v.size_ = 0UL;
704  v.capacity_ = 0UL;
705  v.v_ = nullptr;
706 }
707 //*************************************************************************************************
708 
709 
710 //*************************************************************************************************
715 template< typename Type // Data type of the vector
716  , bool TF > // Transpose flag
717 template< typename VT > // Type of the foreign vector
719  : DynamicVector( (~v).size() )
720 {
721  if( IsSparseVector_v<VT> ) {
722  for( size_t i=0UL; i<size_; ++i ) {
723  v_[i] = Type();
724  }
725  }
726 
727  smpAssign( *this, ~v );
728 
729  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
730 }
731 //*************************************************************************************************
732 
733 
734 
735 
736 //=================================================================================================
737 //
738 // DESTRUCTOR
739 //
740 //=================================================================================================
741 
742 //*************************************************************************************************
745 template< typename Type // Data type of the vector
746  , bool TF > // Transpose flag
748 {
749  deallocate( v_ );
750 }
751 //*************************************************************************************************
752 
753 
754 
755 
756 //=================================================================================================
757 //
758 // DATA ACCESS FUNCTIONS
759 //
760 //=================================================================================================
761 
762 //*************************************************************************************************
771 template< typename Type // Data type of the vector
772  , bool TF > // Transpose flag
773 inline typename DynamicVector<Type,TF>::Reference
774  DynamicVector<Type,TF>::operator[]( size_t index ) noexcept
775 {
776  BLAZE_USER_ASSERT( index < size_, "Invalid vector access index" );
777  return v_[index];
778 }
779 //*************************************************************************************************
780 
781 
782 //*************************************************************************************************
791 template< typename Type // Data type of the vector
792  , bool TF > // Transpose flag
794  DynamicVector<Type,TF>::operator[]( size_t index ) const noexcept
795 {
796  BLAZE_USER_ASSERT( index < size_, "Invalid vector access index" );
797  return v_[index];
798 }
799 //*************************************************************************************************
800 
801 
802 //*************************************************************************************************
812 template< typename Type // Data type of the vector
813  , bool TF > // Transpose flag
814 inline typename DynamicVector<Type,TF>::Reference
816 {
817  if( index >= size_ ) {
818  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
819  }
820  return (*this)[index];
821 }
822 //*************************************************************************************************
823 
824 
825 //*************************************************************************************************
835 template< typename Type // Data type of the vector
836  , bool TF > // Transpose flag
838  DynamicVector<Type,TF>::at( size_t index ) const
839 {
840  if( index >= size_ ) {
841  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
842  }
843  return (*this)[index];
844 }
845 //*************************************************************************************************
846 
847 
848 //*************************************************************************************************
855 template< typename Type // Data type of the vector
856  , bool TF > // Transpose flag
858 {
859  return v_;
860 }
861 //*************************************************************************************************
862 
863 
864 //*************************************************************************************************
871 template< typename Type // Data type of the vector
872  , bool TF > // Transpose flag
874 {
875  return v_;
876 }
877 //*************************************************************************************************
878 
879 
880 //*************************************************************************************************
885 template< typename Type // Data type of the vector
886  , bool TF > // Transpose flag
888 {
889  return Iterator( v_ );
890 }
891 //*************************************************************************************************
892 
893 
894 //*************************************************************************************************
899 template< typename Type // Data type of the vector
900  , bool TF > // Transpose flag
902 {
903  return ConstIterator( v_ );
904 }
905 //*************************************************************************************************
906 
907 
908 //*************************************************************************************************
913 template< typename Type // Data type of the vector
914  , bool TF > // Transpose flag
916 {
917  return ConstIterator( v_ );
918 }
919 //*************************************************************************************************
920 
921 
922 //*************************************************************************************************
927 template< typename Type // Data type of the vector
928  , bool TF > // Transpose flag
930 {
931  return Iterator( v_ + size_ );
932 }
933 //*************************************************************************************************
934 
935 
936 //*************************************************************************************************
941 template< typename Type // Data type of the vector
942  , bool TF > // Transpose flag
944 {
945  return ConstIterator( v_ + size_ );
946 }
947 //*************************************************************************************************
948 
949 
950 //*************************************************************************************************
955 template< typename Type // Data type of the vector
956  , bool TF > // Transpose flag
958 {
959  return ConstIterator( v_ + size_ );
960 }
961 //*************************************************************************************************
962 
963 
964 
965 
966 //=================================================================================================
967 //
968 // ASSIGNMENT OPERATORS
969 //
970 //=================================================================================================
971 
972 //*************************************************************************************************
978 template< typename Type // Data type of the vector
979  , bool TF > // Transpose flag
981 {
982  for( size_t i=0UL; i<size_; ++i )
983  v_[i] = rhs;
984  return *this;
985 }
986 //*************************************************************************************************
987 
988 
989 //*************************************************************************************************
1005 template< typename Type // Data type of the vector
1006  , bool TF > // Transpose flag
1008 {
1009  resize( list.size(), false );
1010  std::copy( list.begin(), list.end(), v_ );
1011 
1012  return *this;
1013 }
1014 //*************************************************************************************************
1015 
1016 
1017 //*************************************************************************************************
1035 template< typename Type // Data type of the vector
1036  , bool TF > // Transpose flag
1037 template< typename Other // Data type of the initialization array
1038  , size_t Dim > // Dimension of the initialization array
1039 inline DynamicVector<Type,TF>& DynamicVector<Type,TF>::operator=( const Other (&array)[Dim] )
1040 {
1041  resize( Dim, false );
1042 
1043  for( size_t i=0UL; i<Dim; ++i )
1044  v_[i] = array[i];
1045 
1046  return *this;
1047 }
1048 //*************************************************************************************************
1049 
1050 
1051 //*************************************************************************************************
1060 template< typename Type // Data type of the vector
1061  , bool TF > // Transpose flag
1063 {
1064  if( &rhs == this ) return *this;
1065 
1066  resize( rhs.size_, false );
1067  smpAssign( *this, ~rhs );
1068 
1069  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1070 
1071  return *this;
1072 }
1073 //*************************************************************************************************
1074 
1075 
1076 //*************************************************************************************************
1082 template< typename Type // Data type of the vector
1083  , bool TF > // Transpose flag
1085 {
1086  deallocate( v_ );
1087 
1088  size_ = rhs.size_;
1089  capacity_ = rhs.capacity_;
1090  v_ = rhs.v_;
1091 
1092  rhs.size_ = 0UL;
1093  rhs.capacity_ = 0UL;
1094  rhs.v_ = nullptr;
1095 
1096  return *this;
1097 }
1098 //*************************************************************************************************
1099 
1100 
1101 //*************************************************************************************************
1109 template< typename Type // Data type of the vector
1110  , bool TF > // Transpose flag
1111 template< typename VT > // Type of the right-hand side vector
1113 {
1114  if( (~rhs).canAlias( this ) ) {
1115  DynamicVector tmp( ~rhs );
1116  swap( tmp );
1117  }
1118  else {
1119  resize( (~rhs).size(), false );
1120  if( IsSparseVector_v<VT> )
1121  reset();
1122  smpAssign( *this, ~rhs );
1123  }
1124 
1125  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1126 
1127  return *this;
1128 }
1129 //*************************************************************************************************
1130 
1131 
1132 //*************************************************************************************************
1142 template< typename Type // Data type of the vector
1143  , bool TF > // Transpose flag
1144 template< typename VT > // Type of the right-hand side vector
1146 {
1147  if( (~rhs).size() != size_ ) {
1148  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1149  }
1150 
1151  if( (~rhs).canAlias( this ) ) {
1152  const ResultType_t<VT> tmp( ~rhs );
1153  smpAddAssign( *this, tmp );
1154  }
1155  else {
1156  smpAddAssign( *this, ~rhs );
1157  }
1158 
1159  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1160 
1161  return *this;
1162 }
1163 //*************************************************************************************************
1164 
1165 
1166 //*************************************************************************************************
1177 template< typename Type // Data type of the vector
1178  , bool TF > // Transpose flag
1179 template< typename VT > // Type of the right-hand side vector
1181 {
1182  if( (~rhs).size() != size_ ) {
1183  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1184  }
1185 
1186  if( (~rhs).canAlias( this ) ) {
1187  const ResultType_t<VT> tmp( ~rhs );
1188  smpSubAssign( *this, tmp );
1189  }
1190  else {
1191  smpSubAssign( *this, ~rhs );
1192  }
1193 
1194  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1195 
1196  return *this;
1197 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
1212 template< typename Type // Data type of the vector
1213  , bool TF > // Transpose flag
1214 template< typename VT > // Type of the right-hand side vector
1216 {
1217  if( (~rhs).size() != size_ ) {
1218  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1219  }
1220 
1221  if( IsSparseVector_v<VT> || (~rhs).canAlias( this ) ) {
1222  DynamicVector<Type,TF> tmp( *this * (~rhs) );
1223  swap( tmp );
1224  }
1225  else {
1226  smpMultAssign( *this, ~rhs );
1227  }
1228 
1229  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1230 
1231  return *this;
1232 }
1233 //*************************************************************************************************
1234 
1235 
1236 //*************************************************************************************************
1246 template< typename Type // Data type of the vector
1247  , bool TF > // Transpose flag
1248 template< typename VT > // Type of the right-hand side vector
1250 {
1251  if( (~rhs).size() != size_ ) {
1252  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1253  }
1254 
1255  if( (~rhs).canAlias( this ) ) {
1256  DynamicVector<Type,TF> tmp( *this / (~rhs) );
1257  swap( tmp );
1258  }
1259  else {
1260  smpDivAssign( *this, ~rhs );
1261  }
1262 
1263  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1264 
1265  return *this;
1266 }
1267 //*************************************************************************************************
1268 
1269 
1270 //*************************************************************************************************
1281 template< typename Type // Data type of the vector
1282  , bool TF > // Transpose flag
1283 template< typename VT > // Type of the right-hand side vector
1285 {
1286  using blaze::assign;
1287 
1290 
1291  using CrossType = CrossTrait_t< This, ResultType_t<VT> >;
1292 
1296 
1297  if( size_ != 3UL || (~rhs).size() != 3UL ) {
1298  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1299  }
1300 
1301  const CrossType tmp( *this % (~rhs) );
1302  assign( *this, tmp );
1303 
1304  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1305 
1306  return *this;
1307 }
1308 //*************************************************************************************************
1309 
1310 
1311 
1312 
1313 //=================================================================================================
1314 //
1315 // UTILITY FUNCTIONS
1316 //
1317 //=================================================================================================
1318 
1319 //*************************************************************************************************
1324 template< typename Type // Data type of the vector
1325  , bool TF > // Transpose flag
1326 inline size_t DynamicVector<Type,TF>::size() const noexcept
1327 {
1328  return size_;
1329 }
1330 //*************************************************************************************************
1331 
1332 
1333 //*************************************************************************************************
1341 template< typename Type // Data type of the vector
1342  , bool TF > // Transpose flag
1343 inline size_t DynamicVector<Type,TF>::spacing() const noexcept
1344 {
1345  return addPadding( size_ );
1346 }
1347 //*************************************************************************************************
1348 
1349 
1350 //*************************************************************************************************
1355 template< typename Type // Data type of the vector
1356  , bool TF > // Transpose flag
1357 inline size_t DynamicVector<Type,TF>::capacity() const noexcept
1358 {
1359  return capacity_;
1360 }
1361 //*************************************************************************************************
1362 
1363 
1364 //*************************************************************************************************
1372 template< typename Type // Data type of the vector
1373  , bool TF > // Transpose flag
1375 {
1376  size_t nonzeros( 0 );
1377 
1378  for( size_t i=0UL; i<size_; ++i ) {
1379  if( !isDefault( v_[i] ) )
1380  ++nonzeros;
1381  }
1382 
1383  return nonzeros;
1384 }
1385 //*************************************************************************************************
1386 
1387 
1388 //*************************************************************************************************
1393 template< typename Type // Data type of the vector
1394  , bool TF > // Transpose flag
1396 {
1397  using blaze::clear;
1398  for( size_t i=0UL; i<size_; ++i )
1399  clear( v_[i] );
1400 }
1401 //*************************************************************************************************
1402 
1403 
1404 //*************************************************************************************************
1411 template< typename Type // Data type of the vector
1412  , bool TF > // Transpose flag
1414 {
1415  resize( 0UL, false );
1416 }
1417 //*************************************************************************************************
1418 
1419 
1420 //*************************************************************************************************
1449 template< typename Type // Data type of the vector
1450  , bool TF > // Transpose flag
1451 inline void DynamicVector<Type,TF>::resize( size_t n, bool preserve )
1452 {
1453  using std::swap;
1454 
1455  if( n > capacity_ )
1456  {
1457  // Allocating a new array
1458  const size_t newCapacity( addPadding( n ) );
1459  Type* BLAZE_RESTRICT tmp = allocate<Type>( newCapacity );
1460 
1461  // Initializing the new array
1462  if( preserve ) {
1463  transfer( v_, v_+size_, tmp );
1464  }
1465 
1466  if( IsVectorizable_v<Type> ) {
1467  for( size_t i=size_; i<newCapacity; ++i )
1468  tmp[i] = Type();
1469  }
1470 
1471  // Replacing the old array
1472  swap( v_, tmp );
1473  deallocate( tmp );
1474  capacity_ = newCapacity;
1475  }
1476  else if( IsVectorizable_v<Type> && n < size_ )
1477  {
1478  for( size_t i=n; i<size_; ++i )
1479  v_[i] = Type();
1480  }
1481 
1482  size_ = n;
1483 }
1484 //*************************************************************************************************
1485 
1486 
1487 //*************************************************************************************************
1499 template< typename Type // Data type of the vector
1500  , bool TF > // Transpose flag
1501 inline void DynamicVector<Type,TF>::extend( size_t n, bool preserve )
1502 {
1503  resize( size_+n, preserve );
1504 }
1505 //*************************************************************************************************
1506 
1507 
1508 //*************************************************************************************************
1517 template< typename Type // Data type of the vector
1518  , bool TF > // Transpose flag
1519 inline void DynamicVector<Type,TF>::reserve( size_t n )
1520 {
1521  using std::swap;
1522 
1523  if( n > capacity_ )
1524  {
1525  // Allocating a new array
1526  const size_t newCapacity( addPadding( n ) );
1527  Type* BLAZE_RESTRICT tmp = allocate<Type>( newCapacity );
1528 
1529  // Initializing the new array
1530  transfer( v_, v_+size_, tmp );
1531 
1532  if( IsVectorizable_v<Type> ) {
1533  for( size_t i=size_; i<newCapacity; ++i )
1534  tmp[i] = Type();
1535  }
1536 
1537  // Replacing the old array
1538  swap( tmp, v_ );
1539  deallocate( tmp );
1540  capacity_ = newCapacity;
1541  }
1542 }
1543 //*************************************************************************************************
1544 
1545 
1546 //*************************************************************************************************
1556 template< typename Type // Data type of the vector
1557  , bool TF > // Transpose flag
1559 {
1560  if( spacing() < capacity_ ) {
1561  DynamicVector( *this ).swap( *this );
1562  }
1563 }
1564 //*************************************************************************************************
1565 
1566 
1567 //*************************************************************************************************
1573 template< typename Type // Data type of the vector
1574  , bool TF > // Transpose flag
1576 {
1577  using std::swap;
1578 
1579  swap( size_, v.size_ );
1580  swap( capacity_, v.capacity_ );
1581  swap( v_, v.v_ );
1582 }
1583 //*************************************************************************************************
1584 
1585 
1586 //*************************************************************************************************
1595 template< typename Type // Data type of the vector
1596  , bool TF > // Transpose flag
1597 inline size_t DynamicVector<Type,TF>::addPadding( size_t value ) const noexcept
1598 {
1599  if( usePadding && IsVectorizable_v<Type> )
1600  return nextMultiple<size_t>( value, SIMDSIZE );
1601  else return value;
1602 }
1603 //*************************************************************************************************
1604 
1605 
1606 
1607 
1608 //=================================================================================================
1609 //
1610 // NUMERIC FUNCTIONS
1611 //
1612 //=================================================================================================
1613 
1614 //*************************************************************************************************
1631 template< typename Type // Data type of the vector
1632  , bool TF > // Transpose flag
1633 template< typename Other > // Data type of the scalar value
1635 {
1636  for( size_t i=0UL; i<size_; ++i )
1637  v_[i] *= scalar;
1638  return *this;
1639 }
1640 //*************************************************************************************************
1641 
1642 
1643 
1644 
1645 //=================================================================================================
1646 //
1647 // DEBUGGING FUNCTIONS
1648 //
1649 //=================================================================================================
1650 
1651 //*************************************************************************************************
1660 template< typename Type // Data type of the vector
1661  , bool TF > // Transpose flag
1662 inline bool DynamicVector<Type,TF>::isIntact() const noexcept
1663 {
1664  if( size_ > capacity_ )
1665  return false;
1666 
1667  if( IsVectorizable_v<Type> ) {
1668  for( size_t i=size_; i<capacity_; ++i ) {
1669  if( v_[i] != Type() )
1670  return false;
1671  }
1672  }
1673 
1674  return true;
1675 }
1676 //*************************************************************************************************
1677 
1678 
1679 
1680 
1681 //=================================================================================================
1682 //
1683 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1684 //
1685 //=================================================================================================
1686 
1687 //*************************************************************************************************
1697 template< typename Type // Data type of the vector
1698  , bool TF > // Transpose flag
1699 template< typename Other > // Data type of the foreign expression
1700 inline bool DynamicVector<Type,TF>::canAlias( const Other* alias ) const noexcept
1701 {
1702  return static_cast<const void*>( this ) == static_cast<const void*>( alias );
1703 }
1704 //*************************************************************************************************
1705 
1706 
1707 //*************************************************************************************************
1717 template< typename Type // Data type of the vector
1718  , bool TF > // Transpose flag
1719 template< typename Other > // Data type of the foreign expression
1720 inline bool DynamicVector<Type,TF>::isAliased( const Other* alias ) const noexcept
1721 {
1722  return static_cast<const void*>( this ) == static_cast<const void*>( alias );
1723 }
1724 //*************************************************************************************************
1725 
1726 
1727 //*************************************************************************************************
1736 template< typename Type // Data type of the vector
1737  , bool TF > // Transpose flag
1738 inline bool DynamicVector<Type,TF>::isAligned() const noexcept
1739 {
1740  return true;
1741 }
1742 //*************************************************************************************************
1743 
1744 
1745 //*************************************************************************************************
1755 template< typename Type // Data type of the vector
1756  , bool TF > // Transpose flag
1757 inline bool DynamicVector<Type,TF>::canSMPAssign() const noexcept
1758 {
1759  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1760 }
1761 //*************************************************************************************************
1762 
1763 
1764 //*************************************************************************************************
1776 template< typename Type // Data type of the vector
1777  , bool TF > // Transpose flag
1779  DynamicVector<Type,TF>::load( size_t index ) const noexcept
1780 {
1781  return loada( index );
1782 }
1783 //*************************************************************************************************
1784 
1785 
1786 //*************************************************************************************************
1799 template< typename Type // Data type of the vector
1800  , bool TF > // Transpose flag
1802  DynamicVector<Type,TF>::loada( size_t index ) const noexcept
1803 {
1804  using blaze::loada;
1805 
1807 
1808  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1809  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1810  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
1811  BLAZE_INTERNAL_ASSERT( checkAlignment( v_+index ), "Invalid alignment detected" );
1812 
1813  return loada( v_+index );
1814 }
1815 //*************************************************************************************************
1816 
1817 
1818 //*************************************************************************************************
1831 template< typename Type // Data type of the vector
1832  , bool TF > // Transpose flag
1834  DynamicVector<Type,TF>::loadu( size_t index ) const noexcept
1835 {
1836  using blaze::loadu;
1837 
1839 
1840  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1841  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1842 
1843  return loadu( v_+index );
1844 }
1845 //*************************************************************************************************
1846 
1847 
1848 //*************************************************************************************************
1861 template< typename Type // Data type of the vector
1862  , bool TF > // Transpose flag
1864  DynamicVector<Type,TF>::store( size_t index, const SIMDType& value ) noexcept
1865 {
1866  storea( index, value );
1867 }
1868 //*************************************************************************************************
1869 
1870 
1871 //*************************************************************************************************
1884 template< typename Type // Data type of the vector
1885  , bool TF > // Transpose flag
1887  DynamicVector<Type,TF>::storea( size_t index, const SIMDType& value ) noexcept
1888 {
1889  using blaze::storea;
1890 
1892 
1893  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1894  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1895  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
1896  BLAZE_INTERNAL_ASSERT( checkAlignment( v_+index ), "Invalid alignment detected" );
1897 
1898  storea( v_+index, value );
1899 }
1900 //*************************************************************************************************
1901 
1902 
1903 //*************************************************************************************************
1916 template< typename Type // Data type of the vector
1917  , bool TF > // Transpose flag
1919  DynamicVector<Type,TF>::storeu( size_t index, const SIMDType& value ) noexcept
1920 {
1921  using blaze::storeu;
1922 
1924 
1925  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1926  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1927 
1928  storeu( v_+index, value );
1929 }
1930 //*************************************************************************************************
1931 
1932 
1933 //*************************************************************************************************
1947 template< typename Type // Data type of the vector
1948  , bool TF > // Transpose flag
1950  DynamicVector<Type,TF>::stream( size_t index, const SIMDType& value ) noexcept
1951 {
1952  using blaze::stream;
1953 
1955 
1956  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1957  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1958  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
1959  BLAZE_INTERNAL_ASSERT( checkAlignment( v_+index ), "Invalid alignment detected" );
1960 
1961  stream( v_+index, value );
1962 }
1963 //*************************************************************************************************
1964 
1965 
1966 //*************************************************************************************************
1977 template< typename Type // Data type of the vector
1978  , bool TF > // Transpose flag
1979 template< typename VT > // Type of the right-hand side dense vector
1982 {
1983  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1984 
1985  const size_t ipos( size_ & size_t(-2) );
1986  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
1987 
1988  for( size_t i=0UL; i<ipos; i+=2UL ) {
1989  v_[i ] = (~rhs)[i ];
1990  v_[i+1UL] = (~rhs)[i+1UL];
1991  }
1992  if( ipos < (~rhs).size() )
1993  v_[ipos] = (~rhs)[ipos];
1994 }
1995 //*************************************************************************************************
1996 
1997 
1998 //*************************************************************************************************
2009 template< typename Type // Data type of the vector
2010  , bool TF > // Transpose flag
2011 template< typename VT > // Type of the right-hand side dense vector
2012 inline auto DynamicVector<Type,TF>::assign( const DenseVector<VT,TF>& rhs )
2014 {
2016 
2017  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2018 
2019  constexpr bool remainder( !usePadding || !IsPadded_v<VT> );
2020 
2021  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2022  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2023 
2024  size_t i=0UL;
2025  Iterator left( begin() );
2026  ConstIterator_t<VT> right( (~rhs).begin() );
2027 
2028  if( useStreaming && size_ > ( cacheSize/( sizeof(Type) * 3UL ) ) && !(~rhs).isAliased( this ) )
2029  {
2030  for( ; i<ipos; i+=SIMDSIZE ) {
2031  left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2032  }
2033  for( ; remainder && i<size_; ++i ) {
2034  *left = *right; ++left; ++right;
2035  }
2036  }
2037  else
2038  {
2039  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2040  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2041  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2042  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2043  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2044  }
2045  for( ; i<ipos; i+=SIMDSIZE ) {
2046  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2047  }
2048  for( ; remainder && i<size_; ++i ) {
2049  *left = *right; ++left; ++right;
2050  }
2051  }
2052 }
2053 //*************************************************************************************************
2054 
2055 
2056 //*************************************************************************************************
2067 template< typename Type // Data type of the vector
2068  , bool TF > // Transpose flag
2069 template< typename VT > // Type of the right-hand side sparse vector
2071 {
2072  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2073 
2074  for( auto element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2075  v_[element->index()] = element->value();
2076 }
2077 //*************************************************************************************************
2078 
2079 
2080 //*************************************************************************************************
2091 template< typename Type // Data type of the vector
2092  , bool TF > // Transpose flag
2093 template< typename VT > // Type of the right-hand side dense vector
2096 {
2097  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2098 
2099  const size_t ipos( size_ & size_t(-2) );
2100  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2101 
2102  for( size_t i=0UL; i<ipos; i+=2UL ) {
2103  v_[i ] += (~rhs)[i ];
2104  v_[i+1UL] += (~rhs)[i+1UL];
2105  }
2106  if( ipos < (~rhs).size() )
2107  v_[ipos] += (~rhs)[ipos];
2108 }
2109 //*************************************************************************************************
2110 
2111 
2112 //*************************************************************************************************
2123 template< typename Type // Data type of the vector
2124  , bool TF > // Transpose flag
2125 template< typename VT > // Type of the right-hand side dense vector
2126 inline auto DynamicVector<Type,TF>::addAssign( const DenseVector<VT,TF>& rhs )
2128 {
2130 
2131  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2132 
2133  constexpr bool remainder( !usePadding || !IsPadded_v<VT> );
2134 
2135  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2136  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2137 
2138  size_t i( 0UL );
2139  Iterator left( begin() );
2140  ConstIterator_t<VT> right( (~rhs).begin() );
2141 
2142  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2143  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2144  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2145  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2146  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2147  }
2148  for( ; i<ipos; i+=SIMDSIZE ) {
2149  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2150  }
2151  for( ; remainder && i<size_; ++i ) {
2152  *left += *right; ++left; ++right;
2153  }
2154 }
2155 //*************************************************************************************************
2156 
2157 
2158 //*************************************************************************************************
2169 template< typename Type // Data type of the vector
2170  , bool TF > // Transpose flag
2171 template< typename VT > // Type of the right-hand side sparse vector
2173 {
2174  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2175 
2176  for( auto element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2177  v_[element->index()] += element->value();
2178 }
2179 //*************************************************************************************************
2180 
2181 
2182 //*************************************************************************************************
2193 template< typename Type // Data type of the vector
2194  , bool TF > // Transpose flag
2195 template< typename VT > // Type of the right-hand side dense vector
2198 {
2199  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2200 
2201  const size_t ipos( size_ & size_t(-2) );
2202  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2203 
2204  for( size_t i=0UL; i<ipos; i+=2UL ) {
2205  v_[i ] -= (~rhs)[i ];
2206  v_[i+1UL] -= (~rhs)[i+1UL];
2207  }
2208  if( ipos < (~rhs).size() )
2209  v_[ipos] -= (~rhs)[ipos];
2210 }
2211 //*************************************************************************************************
2212 
2213 
2214 //*************************************************************************************************
2225 template< typename Type // Data type of the vector
2226  , bool TF > // Transpose flag
2227 template< typename VT > // Type of the right-hand side dense vector
2228 inline auto DynamicVector<Type,TF>::subAssign( const DenseVector<VT,TF>& rhs )
2230 {
2232 
2233  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2234 
2235  constexpr bool remainder( !usePadding || !IsPadded_v<VT> );
2236 
2237  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2238  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2239 
2240  size_t i( 0UL );
2241  Iterator left( begin() );
2242  ConstIterator_t<VT> right( (~rhs).begin() );
2243 
2244  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2245  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2246  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2247  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2248  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2249  }
2250  for( ; i<ipos; i+=SIMDSIZE ) {
2251  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2252  }
2253  for( ; remainder && i<size_; ++i ) {
2254  *left -= *right; ++left; ++right;
2255  }
2256 }
2257 //*************************************************************************************************
2258 
2259 
2260 //*************************************************************************************************
2271 template< typename Type // Data type of the vector
2272  , bool TF > // Transpose flag
2273 template< typename VT > // Type of the right-hand side sparse vector
2275 {
2276  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2277 
2278  for( auto element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2279  v_[element->index()] -= element->value();
2280 }
2281 //*************************************************************************************************
2282 
2283 
2284 //*************************************************************************************************
2295 template< typename Type // Data type of the vector
2296  , bool TF > // Transpose flag
2297 template< typename VT > // Type of the right-hand side dense vector
2300 {
2301  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2302 
2303  const size_t ipos( size_ & size_t(-2) );
2304  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2305 
2306  for( size_t i=0UL; i<ipos; i+=2UL ) {
2307  v_[i ] *= (~rhs)[i ];
2308  v_[i+1UL] *= (~rhs)[i+1UL];
2309  }
2310  if( ipos < (~rhs).size() )
2311  v_[ipos] *= (~rhs)[ipos];
2312 }
2313 //*************************************************************************************************
2314 
2315 
2316 //*************************************************************************************************
2327 template< typename Type // Data type of the vector
2328  , bool TF > // Transpose flag
2329 template< typename VT > // Type of the right-hand side dense vector
2332 {
2334 
2335  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2336 
2337  constexpr bool remainder( !usePadding || !IsPadded_v<VT> );
2338 
2339  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2340  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2341 
2342  size_t i( 0UL );
2343  Iterator left( begin() );
2344  ConstIterator_t<VT> right( (~rhs).begin() );
2345 
2346  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2347  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2348  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2349  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2350  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2351  }
2352  for( ; i<ipos; i+=SIMDSIZE ) {
2353  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2354  }
2355  for( ; remainder && i<size_; ++i ) {
2356  *left *= *right; ++left; ++right;
2357  }
2358 }
2359 //*************************************************************************************************
2360 
2361 
2362 //*************************************************************************************************
2373 template< typename Type // Data type of the vector
2374  , bool TF > // Transpose flag
2375 template< typename VT > // Type of the right-hand side sparse vector
2377 {
2378  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2379 
2380  const DynamicVector tmp( serial( *this ) );
2381 
2382  reset();
2383 
2384  for( auto element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2385  v_[element->index()] = tmp[element->index()] * element->value();
2386 }
2387 //*************************************************************************************************
2388 
2389 
2390 //*************************************************************************************************
2401 template< typename Type // Data type of the vector
2402  , bool TF > // Transpose flag
2403 template< typename VT > // Type of the right-hand side dense vector
2406 {
2407  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2408 
2409  const size_t ipos( size_ & size_t(-2) );
2410  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2411 
2412  for( size_t i=0UL; i<ipos; i+=2UL ) {
2413  v_[i ] /= (~rhs)[i ];
2414  v_[i+1UL] /= (~rhs)[i+1UL];
2415  }
2416  if( ipos < (~rhs).size() )
2417  v_[ipos] /= (~rhs)[ipos];
2418 }
2419 //*************************************************************************************************
2420 
2421 
2422 //*************************************************************************************************
2433 template< typename Type // Data type of the vector
2434  , bool TF > // Transpose flag
2435 template< typename VT > // Type of the right-hand side dense vector
2436 inline auto DynamicVector<Type,TF>::divAssign( const DenseVector<VT,TF>& rhs )
2438 {
2440 
2441  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2442 
2443  const size_t ipos( size_ & size_t(-SIMDSIZE) );
2444  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2445 
2446  size_t i( 0UL );
2447  Iterator left( begin() );
2448  ConstIterator_t<VT> right( (~rhs).begin() );
2449 
2450  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2451  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2452  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2453  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2454  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2455  }
2456  for( ; i<ipos; i+=SIMDSIZE ) {
2457  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2458  }
2459  for( ; i<size_; ++i ) {
2460  *left /= *right; ++left; ++right;
2461  }
2462 }
2463 //*************************************************************************************************
2464 
2465 
2466 
2467 
2468 //=================================================================================================
2469 //
2470 // DYNAMICVECTOR OPERATORS
2471 //
2472 //=================================================================================================
2473 
2474 //*************************************************************************************************
2477 template< typename Type, bool TF >
2478 void reset( DynamicVector<Type,TF>& v );
2479 
2480 template< typename Type, bool TF >
2481 void clear( DynamicVector<Type,TF>& v );
2482 
2483 template< bool RF, typename Type, bool TF >
2484 bool isDefault( const DynamicVector<Type,TF>& v );
2485 
2486 template< typename Type, bool TF >
2487 bool isIntact( const DynamicVector<Type,TF>& v ) noexcept;
2488 
2489 template< typename Type, bool TF >
2490 void swap( DynamicVector<Type,TF>& a, DynamicVector<Type,TF>& b ) noexcept;
2492 //*************************************************************************************************
2493 
2494 
2495 //*************************************************************************************************
2502 template< typename Type // Data type of the vector
2503  , bool TF > // Transpose flag
2505 {
2506  v.reset();
2507 }
2508 //*************************************************************************************************
2509 
2510 
2511 //*************************************************************************************************
2518 template< typename Type // Data type of the vector
2519  , bool TF > // Transpose flag
2521 {
2522  v.clear();
2523 }
2524 //*************************************************************************************************
2525 
2526 
2527 //*************************************************************************************************
2551 template< bool RF // Relaxation flag
2552  , typename Type // Data type of the vector
2553  , bool TF > // Transpose flag
2554 inline bool isDefault( const DynamicVector<Type,TF>& v )
2555 {
2556  return ( v.size() == 0UL );
2557 }
2558 //*************************************************************************************************
2559 
2560 
2561 //*************************************************************************************************
2579 template< typename Type // Data type of the vector
2580  , bool TF > // Transpose flag
2581 inline bool isIntact( const DynamicVector<Type,TF>& v ) noexcept
2582 {
2583  return v.isIntact();
2584 }
2585 //*************************************************************************************************
2586 
2587 
2588 //*************************************************************************************************
2596 template< typename Type // Data type of the vector
2597  , bool TF > // Transpose flag
2599 {
2600  a.swap( b );
2601 }
2602 //*************************************************************************************************
2603 
2604 
2605 
2606 
2607 //=================================================================================================
2608 //
2609 // HASCONSTDATAACCESS SPECIALIZATIONS
2610 //
2611 //=================================================================================================
2612 
2613 //*************************************************************************************************
2615 template< typename T, bool TF >
2616 struct HasConstDataAccess< DynamicVector<T,TF> >
2617  : public TrueType
2618 {};
2620 //*************************************************************************************************
2621 
2622 
2623 
2624 
2625 //=================================================================================================
2626 //
2627 // HASMUTABLEDATAACCESS SPECIALIZATIONS
2628 //
2629 //=================================================================================================
2630 
2631 //*************************************************************************************************
2633 template< typename T, bool TF >
2634 struct HasMutableDataAccess< DynamicVector<T,TF> >
2635  : public TrueType
2636 {};
2638 //*************************************************************************************************
2639 
2640 
2641 
2642 
2643 //=================================================================================================
2644 //
2645 // ISALIGNED SPECIALIZATIONS
2646 //
2647 //=================================================================================================
2648 
2649 //*************************************************************************************************
2651 template< typename T, bool TF >
2652 struct IsAligned< DynamicVector<T,TF> >
2653  : public TrueType
2654 {};
2656 //*************************************************************************************************
2657 
2658 
2659 
2660 
2661 //=================================================================================================
2662 //
2663 // ISCONTIGUOUS SPECIALIZATIONS
2664 //
2665 //=================================================================================================
2666 
2667 //*************************************************************************************************
2669 template< typename T, bool TF >
2670 struct IsContiguous< DynamicVector<T,TF> >
2671  : public TrueType
2672 {};
2674 //*************************************************************************************************
2675 
2676 
2677 
2678 
2679 //=================================================================================================
2680 //
2681 // ISPADDED SPECIALIZATIONS
2682 //
2683 //=================================================================================================
2684 
2685 //*************************************************************************************************
2687 template< typename T, bool TF >
2688 struct IsPadded< DynamicVector<T,TF> >
2689  : public BoolConstant<usePadding>
2690 {};
2692 //*************************************************************************************************
2693 
2694 
2695 
2696 
2697 //=================================================================================================
2698 //
2699 // ISRESIZABLE SPECIALIZATIONS
2700 //
2701 //=================================================================================================
2702 
2703 //*************************************************************************************************
2705 template< typename T, bool TF >
2706 struct IsResizable< DynamicVector<T,TF> >
2707  : public TrueType
2708 {};
2710 //*************************************************************************************************
2711 
2712 
2713 
2714 
2715 //=================================================================================================
2716 //
2717 // ISSHRINKABLE SPECIALIZATIONS
2718 //
2719 //=================================================================================================
2720 
2721 //*************************************************************************************************
2723 template< typename T, bool TF >
2724 struct IsShrinkable< DynamicVector<T,TF> >
2725  : public TrueType
2726 {};
2728 //*************************************************************************************************
2729 
2730 
2731 
2732 
2733 //=================================================================================================
2734 //
2735 // ADDTRAIT SPECIALIZATIONS
2736 //
2737 //=================================================================================================
2738 
2739 //*************************************************************************************************
2741 template< typename T1, typename T2 >
2742 struct AddTraitEval2< T1, T2
2743  , EnableIf_t< IsVector_v<T1> &&
2744  IsVector_v<T2> &&
2745  ( IsDenseVector_v<T1> || IsDenseVector_v<T2> ) &&
2746  ( Size_v<T1,0UL> == DefaultSize_v ) &&
2747  ( Size_v<T2,0UL> == DefaultSize_v ) &&
2748  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) &&
2749  ( MaxSize_v<T2,0UL> == DefaultMaxSize_v ) > >
2750 {
2751  using ET1 = ElementType_t<T1>;
2752  using ET2 = ElementType_t<T2>;
2753 
2754  using Type = DynamicVector< AddTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2755 };
2757 //*************************************************************************************************
2758 
2759 
2760 
2761 
2762 //=================================================================================================
2763 //
2764 // SUBTRAIT SPECIALIZATIONS
2765 //
2766 //=================================================================================================
2767 
2768 //*************************************************************************************************
2770 template< typename T1, typename T2 >
2771 struct SubTraitEval2< T1, T2
2772  , EnableIf_t< IsVector_v<T1> &&
2773  IsVector_v<T2> &&
2774  ( IsDenseVector_v<T1> || IsDenseVector_v<T2> ) &&
2775  ( Size_v<T1,0UL> == DefaultSize_v ) &&
2776  ( Size_v<T2,0UL> == DefaultSize_v ) &&
2777  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) &&
2778  ( MaxSize_v<T2,0UL> == DefaultMaxSize_v ) > >
2779 {
2780  using ET1 = ElementType_t<T1>;
2781  using ET2 = ElementType_t<T2>;
2782 
2783  using Type = DynamicVector< SubTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2784 };
2786 //*************************************************************************************************
2787 
2788 
2789 
2790 
2791 //=================================================================================================
2792 //
2793 // MULTTRAIT SPECIALIZATIONS
2794 //
2795 //=================================================================================================
2796 
2797 //*************************************************************************************************
2799 template< typename T1, typename T2 >
2800 struct MultTraitEval2< T1, T2
2801  , EnableIf_t< IsDenseVector_v<T1> &&
2802  IsNumeric_v<T2> &&
2803  ( Size_v<T1,0UL> == DefaultSize_v ) &&
2804  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) > >
2805 {
2806  using ET1 = ElementType_t<T1>;
2807 
2808  using Type = DynamicVector< MultTrait_t<ET1,T2>, TransposeFlag_v<T1> >;
2809 };
2810 
2811 template< typename T1, typename T2 >
2812 struct MultTraitEval2< T1, T2
2813  , EnableIf_t< IsNumeric_v<T1> &&
2814  IsDenseVector_v<T2> &&
2815  ( Size_v<T2,0UL> == DefaultSize_v ) &&
2816  ( MaxSize_v<T2,0UL> == DefaultMaxSize_v ) > >
2817 {
2818  using ET2 = ElementType_t<T2>;
2819 
2820  using Type = DynamicVector< MultTrait_t<T1,ET2>, TransposeFlag_v<T2> >;
2821 };
2822 
2823 template< typename T1, typename T2 >
2824 struct MultTraitEval2< T1, T2
2825  , EnableIf_t< ( ( IsRowVector_v<T1> && IsRowVector_v<T2> ) ||
2826  ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
2827  IsDenseVector_v<T1> &&
2828  IsDenseVector_v<T2> &&
2829  ( Size_v<T1,0UL> == DefaultSize_v ) &&
2830  ( Size_v<T2,0UL> == DefaultSize_v ) &&
2831  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) &&
2832  ( MaxSize_v<T2,0UL> == DefaultMaxSize_v ) > >
2833 {
2834  using ET1 = ElementType_t<T1>;
2835  using ET2 = ElementType_t<T2>;
2836 
2837  using Type = DynamicVector< MultTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2838 };
2839 
2840 template< typename T1, typename T2 >
2841 struct MultTraitEval2< T1, T2
2842  , EnableIf_t< IsMatrix_v<T1> &&
2843  IsColumnVector_v<T2> &&
2844  ( IsDenseMatrix_v<T1> || IsDenseVector_v<T2> ) &&
2845  ( Size_v<T1,0UL> == DefaultSize_v &&
2846  ( !IsSquare_v<T1> || Size_v<T2,0UL> == DefaultSize_v ) ) &&
2847  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v &&
2848  ( !IsSquare_v<T1> || MaxSize_v<T2,0UL> == DefaultMaxSize_v ) ) > >
2849 {
2850  using ET1 = ElementType_t<T1>;
2851  using ET2 = ElementType_t<T2>;
2852 
2853  using Type = DynamicVector< MultTrait_t<ET1,ET2>, false >;
2854 };
2855 
2856 template< typename T1, typename T2 >
2857 struct MultTraitEval2< T1, T2
2858  , EnableIf_t< IsRowVector_v<T1> &&
2859  IsMatrix_v<T2> &&
2860  ( IsDenseVector_v<T1> || IsDenseMatrix_v<T2> ) &&
2861  ( Size_v<T2,1UL> == DefaultSize_v &&
2862  ( !IsSquare_v<T2> || Size_v<T1,0UL> == DefaultSize_v ) ) &&
2863  ( MaxSize_v<T2,1UL> == DefaultMaxSize_v &&
2864  ( !IsSquare_v<T2> || MaxSize_v<T1,0UL> == DefaultMaxSize_v ) ) > >
2865 {
2866  using ET1 = ElementType_t<T1>;
2867  using ET2 = ElementType_t<T2>;
2868 
2869  using Type = DynamicVector< MultTrait_t<ET1,ET2>, true >;
2870 };
2872 //*************************************************************************************************
2873 
2874 
2875 
2876 
2877 //=================================================================================================
2878 //
2879 // KRONTRAIT SPECIALIZATIONS
2880 //
2881 //=================================================================================================
2882 
2883 //*************************************************************************************************
2885 template< typename T1, typename T2 >
2886 struct KronTraitEval2< T1, T2
2887  , EnableIf_t< IsDenseVector_v<T1> &&
2888  IsDenseVector_v<T2> &&
2889  ( ( Size_v<T1,0UL> == DefaultSize_v ) ||
2890  ( Size_v<T2,0UL> == DefaultSize_v ) ) &&
2891  ( ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) ||
2892  ( MaxSize_v<T2,0UL> == DefaultMaxSize_v ) ) > >
2893 {
2894  using ET1 = ElementType_t<T1>;
2895  using ET2 = ElementType_t<T2>;
2896 
2897  using Type = DynamicVector< MultTrait_t<ET1,ET2>, TransposeFlag_v<T2> >;
2898 };
2900 //*************************************************************************************************
2901 
2902 
2903 
2904 
2905 //=================================================================================================
2906 //
2907 // DIVTRAIT SPECIALIZATIONS
2908 //
2909 //=================================================================================================
2910 
2911 //*************************************************************************************************
2913 template< typename T1, typename T2 >
2914 struct DivTraitEval2< T1, T2
2915  , EnableIf_t< IsDenseVector_v<T1> &&
2916  IsNumeric_v<T2> &&
2917  ( Size_v<T1,0UL> == DefaultSize_v ) &&
2918  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) > >
2919 {
2920  using ET1 = ElementType_t<T1>;
2921 
2922  using Type = DynamicVector< DivTrait_t<ET1,T2>, TransposeFlag_v<T1> >;
2923 };
2924 
2925 template< typename T1, typename T2 >
2926 struct DivTraitEval2< T1, T2
2927  , EnableIf_t< IsDenseVector_v<T1> &&
2928  IsDenseVector_v<T2> &&
2929  ( Size_v<T1,0UL> == DefaultSize_v ) &&
2930  ( Size_v<T2,0UL> == DefaultSize_v ) &&
2931  ( MaxSize_v<T1,0UL> == DefaultMaxSize_v ) &&
2932  ( MaxSize_v<T2,0UL> == DefaultMaxSize_v ) > >
2933 {
2934  using ET1 = ElementType_t<T1>;
2935  using ET2 = ElementType_t<T2>;
2936 
2937  using Type = DynamicVector< DivTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2938 };
2940 //*************************************************************************************************
2941 
2942 
2943 
2944 
2945 //=================================================================================================
2946 //
2947 // MAPTRAIT SPECIALIZATIONS
2948 //
2949 //=================================================================================================
2950 
2951 //*************************************************************************************************
2953 template< typename T, typename OP >
2954 struct UnaryMapTraitEval2< T, OP
2955  , EnableIf_t< IsDenseVector_v<T> &&
2956  Size_v<T,0UL> == DefaultSize_v &&
2957  MaxSize_v<T,0UL> == DefaultMaxSize_v > >
2958 {
2959  using ET = ElementType_t<T>;
2960 
2961  using Type = DynamicVector< MapTrait_t<ET,OP>, TransposeFlag_v<T> >;
2962 };
2964 //*************************************************************************************************
2965 
2966 
2967 //*************************************************************************************************
2969 template< typename T1, typename T2, typename OP >
2970 struct BinaryMapTraitEval2< T1, T2, OP
2971  , EnableIf_t< IsVector_v<T1> &&
2972  IsVector_v<T2> &&
2973  Size_v<T1,0UL> == DefaultSize_v &&
2974  Size_v<T2,0UL> == DefaultSize_v &&
2975  MaxSize_v<T1,0UL> == DefaultMaxSize_v &&
2976  MaxSize_v<T2,0UL> == DefaultMaxSize_v > >
2977 {
2978  using ET1 = ElementType_t<T1>;
2979  using ET2 = ElementType_t<T2>;
2980 
2981  using Type = DynamicVector< MapTrait_t<ET1,ET2,OP>, TransposeFlag_v<T1> >;
2982 };
2984 //*************************************************************************************************
2985 
2986 
2987 
2988 
2989 //=================================================================================================
2990 //
2991 // REDUCETRAIT SPECIALIZATIONS
2992 //
2993 //=================================================================================================
2994 
2995 //*************************************************************************************************
2997 template< typename T, typename OP, size_t RF >
2998 struct PartialReduceTraitEval2< T, OP, RF
2999  , EnableIf_t< IsMatrix_v<T> &&
3000  ( Size_v<T,0UL> == DefaultSize_v ||
3001  Size_v<T,1UL> == DefaultSize_v ) &&
3002  ( MaxSize_v<T,0UL> == DefaultMaxSize_v ||
3003  MaxSize_v<T,1UL> == DefaultMaxSize_v ) > >
3004 {
3005  using ET = ElementType_t<T>;
3006  using RT = decltype( std::declval<OP>()( std::declval<ET>(), std::declval<ET>() ) );
3007 
3008  static constexpr bool TF = ( RF == 0UL );
3009 
3010  using Type = DynamicVector<RT,TF>;
3011 };
3013 //*************************************************************************************************
3014 
3015 
3016 
3017 
3018 //=================================================================================================
3019 //
3020 // HIGHTYPE SPECIALIZATIONS
3021 //
3022 //=================================================================================================
3023 
3024 //*************************************************************************************************
3026 template< typename T1, bool TF, typename T2 >
3027 struct HighType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3028 {
3029  using Type = DynamicVector< typename HighType<T1,T2>::Type, TF >;
3030 };
3032 //*************************************************************************************************
3033 
3034 
3035 
3036 
3037 //=================================================================================================
3038 //
3039 // LOWTYPE SPECIALIZATIONS
3040 //
3041 //=================================================================================================
3042 
3043 //*************************************************************************************************
3045 template< typename T1, bool TF, typename T2 >
3046 struct LowType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3047 {
3048  using Type = DynamicVector< typename LowType<T1,T2>::Type, TF >;
3049 };
3051 //*************************************************************************************************
3052 
3053 
3054 
3055 
3056 //=================================================================================================
3057 //
3058 // SUBVECTORTRAIT SPECIALIZATIONS
3059 //
3060 //=================================================================================================
3061 
3062 //*************************************************************************************************
3064 template< typename VT >
3065 struct SubvectorTraitEval2< VT, inf, inf
3066  , EnableIf_t< IsDenseVector_v<VT> &&
3067  Size_v<VT,0UL> == DefaultSize_v &&
3068  MaxSize_v<VT,0UL> == DefaultMaxSize_v > >
3069 {
3070  using Type = DynamicVector< RemoveConst_t< ElementType_t<VT> >, TransposeFlag_v<VT> >;
3071 };
3073 //*************************************************************************************************
3074 
3075 
3076 
3077 
3078 //=================================================================================================
3079 //
3080 // ELEMENTSTRAIT SPECIALIZATIONS
3081 //
3082 //=================================================================================================
3083 
3084 //*************************************************************************************************
3086 template< typename VT >
3087 struct ElementsTraitEval2< VT, 0UL
3088  , EnableIf_t< IsDenseVector_v<VT> &&
3089  Size_v<VT,0UL> == DefaultSize_v &&
3090  MaxSize_v<VT,0UL> == DefaultMaxSize_v > >
3091 {
3092  using Type = DynamicVector< RemoveConst_t< ElementType_t<VT> >, TransposeFlag_v<VT> >;
3093 };
3095 //*************************************************************************************************
3096 
3097 
3098 
3099 
3100 //=================================================================================================
3101 //
3102 // ROWTRAIT SPECIALIZATIONS
3103 //
3104 //=================================================================================================
3105 
3106 //*************************************************************************************************
3108 template< typename MT, size_t I >
3109 struct RowTraitEval2< MT, I
3110  , EnableIf_t< IsDenseMatrix_v<MT> &&
3111  Size_v<MT,1UL> == DefaultSize_v &&
3112  MaxSize_v<MT,1UL> == DefaultMaxSize_v > >
3113 {
3114  using Type = DynamicVector< RemoveConst_t< ElementType_t<MT> >, true >;
3115 };
3117 //*************************************************************************************************
3118 
3119 
3120 
3121 
3122 //=================================================================================================
3123 //
3124 // COLUMNTRAIT SPECIALIZATIONS
3125 //
3126 //=================================================================================================
3127 
3128 //*************************************************************************************************
3130 template< typename MT, size_t I >
3131 struct ColumnTraitEval2< MT, I
3132  , EnableIf_t< IsDenseMatrix_v<MT> &&
3133  Size_v<MT,0UL> == DefaultSize_v &&
3134  MaxSize_v<MT,0UL> == DefaultMaxSize_v > >
3135 {
3136  using Type = DynamicVector< RemoveConst_t< ElementType_t<MT> >, false >;
3137 };
3139 //*************************************************************************************************
3140 
3141 
3142 
3143 
3144 //=================================================================================================
3145 //
3146 // BANDTRAIT SPECIALIZATIONS
3147 //
3148 //=================================================================================================
3149 
3150 //*************************************************************************************************
3152 template< typename MT, ptrdiff_t I >
3153 struct BandTraitEval2< MT, I
3154  , EnableIf_t< IsDenseMatrix_v<MT> &&
3155  ( Size_v<MT,0UL> == DefaultSize_v ||
3156  Size_v<MT,1UL> == DefaultSize_v ) &&
3157  ( MaxSize_v<MT,0UL> == DefaultMaxSize_v ||
3158  MaxSize_v<MT,1UL> == DefaultMaxSize_v ) > >
3159 {
3160  using Type = DynamicVector< RemoveConst_t< ElementType_t<MT> >, defaultTransposeFlag >;
3161 };
3163 //*************************************************************************************************
3164 
3165 } // namespace blaze
3166 
3167 #endif
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
Definition: Const.h:79
#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
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: DynamicVector.h:1950
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DynamicVector.h:1864
Header file for auxiliary alias declarations.
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:488
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
Header file for the nextMultiple shim.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for the alignment flag values.
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:214
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1887
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1326
Header file for the row trait.
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: DynamicVector.h:1343
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.The IsRowVector_v variable template provid...
Definition: IsRowVector.h:142
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
void clear()
Clearing the vector.
Definition: DynamicVector.h:1413
Header file for the serial shim.
auto assign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > >
Default implementation of the assignment of a dense vector.
Definition: DynamicVector.h:1980
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
bool isIntact() const noexcept
Returns whether the invariants of the dynamic vector are intact.
Definition: DynamicVector.h:1662
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1757
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: DynamicVector.h:251
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
auto addAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAddAssign_v< VT > >
Default implementation of the addition assignment of a dense vector.
Definition: DynamicVector.h:2094
Header file for the IsRowVector type trait.
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
Header file for the DenseVector base class.
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1919
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:915
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:187
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 all forward declarations of the math module.
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:198
Header file for memory allocation and deallocation functionality.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Header file for the reduce trait.
Header file for the MaxSize type trait.
Header file for the elements trait.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
Header file for the band trait.
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1802
Constraint on the data type.
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.The IsDenseMatrix_v variable template pr...
Definition: IsDenseMatrix.h:138
Header file for the IsMatrix type trait.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:253
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:747
Iterator begin() noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:887
Header file for the IsSquare type trait.
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1834
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the LowType type trait.
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1451
Header file for the multiplication trait.
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
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
auto subAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedSubAssign_v< VT > >
Default implementation of the subtraction assignment of a dense vector.
Definition: DynamicVector.h:2196
Header file for the IsShrinkable type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Header file for the IsSMPAssignable type trait.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:187
DynamicVector() noexcept
The default constructor for DynamicVector.
Definition: DynamicVector.h:522
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1357
auto multAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedMultAssign_v< VT > >
Default implementation of the multiplication assignment of a dense vector.
Definition: DynamicVector.h:2298
Header file for the HasSIMDAdd type trait.
Header file for the DenseIterator class template.
Header file for the subvector trait.
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Header file for all SIMD functionality.
Constraint on the data type.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
void reset()
Reset to the default initial values.
Definition: DynamicVector.h:1395
Resize mechanism to obtain a DynamicVector with a different fixed number of elements.
Definition: DynamicVector.h:234
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:774
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1738
Header file for the IsAligned type trait.
Constraint on the data type.
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:957
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:486
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
#define BLAZE_RESTRICT
Platform dependent setup of the restrict keyword.
Definition: Restrict.h:81
Header file for the Kron product trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type,...
Definition: Vectorizable.h:61
Header file for the TransposeFlag type trait.
Constraint on the data type.
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: DynamicVector.h:245
Header file for the exception macros of the math module.
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:171
Constraint on the data type.
Header file for the IsVector type trait.
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the IsPadded type trait.
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: DynamicVector.h:1779
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_t alias declaration prov...
Definition: CrossTrait.h:164
Header file for the IsVectorizable type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:487
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:209
Header file for the RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
SIMDTrait_t< ElementType > SIMDType
SIMD type of the vector elements.
Definition: DynamicVector.h:208
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:203
Header file for run time assertion macros.
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:213
Header file for the addition trait.
Header file for the cross product trait.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DynamicVector.h:406
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the division trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: DynamicVector.h:857
Headerfile for the generic transfer algorithm.
Type & Reference
Reference to a non-constant vector value.
Definition: DynamicVector.h:212
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1501
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.The IsVector_v variable template provides a c...
Definition: IsVector.h:139
size_t addPadding(size_t value) const noexcept
Add the necessary amount of padding to the given value.
Definition: DynamicVector.h:1597
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
Header file for the cache size of the target architecture.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type,...
Definition: Reference.h:79
Rebind mechanism to obtain a DynamicVector with different data/element type.
Definition: DynamicVector.h:225
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:282
System settings for the restrict keyword.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Constraint on the data type.
Header file for the HasSIMDSub type trait.
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.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1519
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
void swap(DynamicVector &v) noexcept
Swapping the contents of two vectors.
Definition: DynamicVector.h:1575
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1374
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
Header file for the IsDenseVector type trait.
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
auto divAssign(const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedDivAssign_v< VT > >
Default implementation of the division assignment of a dense vector.
Definition: DynamicVector.h:2404
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type,...
Definition: DenseVector.h:61
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1720
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:207
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: DynamicVector.h:1558
Iterator end() noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:929
Header file for the HasSIMDDiv type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:198
EnableIf_t< IsBuiltin_v< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:224
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:188
Header file for the alignment check function.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:215
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.The IsDenseVector_v variable template pr...
Definition: IsDenseVector.h:138
DynamicVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: DynamicVector.h:980
Header file for the IntegralConstant class template.
constexpr Infinity inf
Global Infinity instance.The blaze::inf instance can be used wherever a built-in data type is expecte...
Definition: Infinity.h:1080
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
void swap(DynamicVector< Type, TF > &a, DynamicVector< Type, TF > &b) noexcept
Swapping the contents of two vectors.
Definition: DynamicVector.h:2598
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the IsColumnVector type trait.
OutputIterator transfer(InputIterator first, InputIterator last, OutputIterator dest)
Transfers the elements from the given source range to the destination range.
Definition: Transfer.h:70
Reference at(size_t index)
Checked access to the vector elements.
Definition: DynamicVector.h:815
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
EnableIf_t< IsBuiltin_v< T >, T * > allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:156
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: DynamicVector.h:1700
#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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
Header file for the HighType type trait.
Header file for the clear shim.