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>
55 #include <blaze/math/Functions.h>
57 #include <blaze/math/shims/Clear.h>
60 #include <blaze/math/SIMD.h>
84 #include <blaze/system/CacheSize.h>
85 #include <blaze/system/Inline.h>
87 #include <blaze/system/Restrict.h>
92 #include <blaze/util/Assert.h>
98 #include <blaze/util/DisableIf.h>
99 #include <blaze/util/EnableIf.h>
101 #include <blaze/util/Memory.h>
102 #include <blaze/util/Template.h>
103 #include <blaze/util/TrueType.h>
104 #include <blaze/util/Types.h>
107 
108 
109 namespace blaze {
110 
111 //=================================================================================================
112 //
113 // CLASS DEFINITION
114 //
115 //=================================================================================================
116 
117 //*************************************************************************************************
181 template< typename Type // Data type of the vector
182  , bool TF = defaultTransposeFlag > // Transpose flag
184  : public DenseVector< DynamicVector<Type,TF>, TF >
185 {
186  public:
187  //**Type definitions****************************************************************************
190  using ResultType = This;
192  using ElementType = Type;
194  using ReturnType = const Type&;
195  using CompositeType = const DynamicVector&;
196 
197  using Reference = Type&;
198  using ConstReference = const Type&;
199  using Pointer = Type*;
200  using ConstPointer = const Type*;
201 
204  //**********************************************************************************************
205 
206  //**Rebind struct definition********************************************************************
209  template< typename NewType > // Data type of the other vector
210  struct Rebind {
212  };
213  //**********************************************************************************************
214 
215  //**Resize struct definition********************************************************************
218  template< size_t NewN > // Number of elements of the other vector
219  struct Resize {
221  };
222  //**********************************************************************************************
223 
224  //**Compilation flags***************************************************************************
226 
230  enum : bool { simdEnabled = IsVectorizable<Type>::value };
231 
233 
236  enum : bool { smpAssignable = !IsSMPAssignable<Type>::value };
237  //**********************************************************************************************
238 
239  //**Constructors********************************************************************************
242  explicit inline DynamicVector() noexcept;
243  explicit inline DynamicVector( size_t n );
244  explicit inline DynamicVector( size_t n, const Type& init );
245  explicit inline DynamicVector( initializer_list<Type> list );
246 
247  template< typename Other >
248  explicit inline DynamicVector( size_t n, const Other* array );
249 
250  template< typename Other, size_t Dim >
251  explicit inline DynamicVector( const Other (&array)[Dim] );
252 
253  inline DynamicVector( const DynamicVector& v );
254  inline DynamicVector( DynamicVector&& v ) noexcept;
255  template< typename VT > inline DynamicVector( const Vector<VT,TF>& v );
257  //**********************************************************************************************
258 
259  //**Destructor**********************************************************************************
262  inline ~DynamicVector();
264  //**********************************************************************************************
265 
266  //**Data access functions***********************************************************************
269  inline Reference operator[]( size_t index ) noexcept;
270  inline ConstReference operator[]( size_t index ) const noexcept;
271  inline Reference at( size_t index );
272  inline ConstReference at( size_t index ) const;
273  inline Pointer data () noexcept;
274  inline ConstPointer data () const noexcept;
275  inline Iterator begin () noexcept;
276  inline ConstIterator begin () const noexcept;
277  inline ConstIterator cbegin() const noexcept;
278  inline Iterator end () noexcept;
279  inline ConstIterator end () const noexcept;
280  inline ConstIterator cend () const noexcept;
282  //**********************************************************************************************
283 
284  //**Assignment operators************************************************************************
287  inline DynamicVector& operator=( const Type& rhs );
288  inline DynamicVector& operator=( initializer_list<Type> list );
289 
290  template< typename Other, size_t Dim >
291  inline DynamicVector& operator=( const Other (&array)[Dim] );
292 
293  inline DynamicVector& operator=( const DynamicVector& rhs );
294  inline DynamicVector& operator=( DynamicVector&& rhs ) noexcept;
295 
296  template< typename VT > inline DynamicVector& operator= ( const Vector<VT,TF>& rhs );
297  template< typename VT > inline DynamicVector& operator+=( const Vector<VT,TF>& rhs );
298  template< typename VT > inline DynamicVector& operator-=( const Vector<VT,TF>& rhs );
299  template< typename VT > inline DynamicVector& operator*=( const Vector<VT,TF>& rhs );
300  template< typename VT > inline DynamicVector& operator/=( const DenseVector<VT,TF>& rhs );
301  template< typename VT > inline DynamicVector& operator%=( const Vector<VT,TF>& rhs );
302 
303  template< typename Other >
304  inline EnableIf_<IsNumeric<Other>, DynamicVector >& operator*=( Other rhs );
305 
306  template< typename Other >
307  inline EnableIf_<IsNumeric<Other>, DynamicVector >& operator/=( Other rhs );
309  //**********************************************************************************************
310 
311  //**Utility functions***************************************************************************
314  inline size_t size() const noexcept;
315  inline size_t spacing() const noexcept;
316  inline size_t capacity() const noexcept;
317  inline size_t nonZeros() const;
318  inline void reset();
319  inline void clear();
320  inline void resize( size_t n, bool preserve=true );
321  inline void extend( size_t n, bool preserve=true );
322  inline void reserve( size_t n );
323  inline void shrinkToFit();
324  inline void swap( DynamicVector& v ) noexcept;
326  //**********************************************************************************************
327 
328  //**Numeric functions***************************************************************************
331  template< typename Other > inline DynamicVector& scale( const Other& scalar );
333  //**********************************************************************************************
334 
335  private:
336  //**********************************************************************************************
338  template< typename VT >
340  struct VectorizedAssign {
341  enum : bool { value = useOptimizedKernels &&
342  simdEnabled && VT::simdEnabled &&
344  };
346  //**********************************************************************************************
347 
348  //**********************************************************************************************
350  template< typename VT >
352  struct VectorizedAddAssign {
353  enum : bool { value = useOptimizedKernels &&
354  simdEnabled && VT::simdEnabled &&
357  };
359  //**********************************************************************************************
360 
361  //**********************************************************************************************
363  template< typename VT >
365  struct VectorizedSubAssign {
366  enum : bool { value = useOptimizedKernels &&
367  simdEnabled && VT::simdEnabled &&
370  };
372  //**********************************************************************************************
373 
374  //**********************************************************************************************
376  template< typename VT >
378  struct VectorizedMultAssign {
379  enum : bool { value = useOptimizedKernels &&
380  simdEnabled && VT::simdEnabled &&
383  };
385  //**********************************************************************************************
386 
387  //**********************************************************************************************
389  template< typename VT >
391  struct VectorizedDivAssign {
392  enum : bool { value = useOptimizedKernels &&
393  simdEnabled && VT::simdEnabled &&
396  };
398  //**********************************************************************************************
399 
400  //**********************************************************************************************
402  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
403  //**********************************************************************************************
404 
405  public:
406  //**Debugging functions*************************************************************************
409  inline bool isIntact() const noexcept;
411  //**********************************************************************************************
412 
413  //**Expression template evaluation functions****************************************************
416  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
417  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
418 
419  inline bool isAligned () const noexcept;
420  inline bool canSMPAssign() const noexcept;
421 
422  BLAZE_ALWAYS_INLINE SIMDType load ( size_t index ) const noexcept;
423  BLAZE_ALWAYS_INLINE SIMDType loada( size_t index ) const noexcept;
424  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t index ) const noexcept;
425 
426  BLAZE_ALWAYS_INLINE void store ( size_t index, const SIMDType& value ) noexcept;
427  BLAZE_ALWAYS_INLINE void storea( size_t index, const SIMDType& value ) noexcept;
428  BLAZE_ALWAYS_INLINE void storeu( size_t index, const SIMDType& value ) noexcept;
429  BLAZE_ALWAYS_INLINE void stream( size_t index, const SIMDType& value ) noexcept;
430 
431  template< typename VT >
432  inline DisableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
433 
434  template< typename VT >
435  inline EnableIf_<VectorizedAssign<VT> > assign( const DenseVector<VT,TF>& rhs );
436 
437  template< typename VT > inline void assign( const SparseVector<VT,TF>& rhs );
438 
439  template< typename VT >
440  inline DisableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
441 
442  template< typename VT >
443  inline EnableIf_<VectorizedAddAssign<VT> > addAssign( const DenseVector<VT,TF>& rhs );
444 
445  template< typename VT > inline void addAssign( const SparseVector<VT,TF>& rhs );
446 
447  template< typename VT >
448  inline DisableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
449 
450  template< typename VT >
451  inline EnableIf_<VectorizedSubAssign<VT> > subAssign( const DenseVector<VT,TF>& rhs );
452 
453  template< typename VT > inline void subAssign( const SparseVector<VT,TF>& rhs );
454 
455  template< typename VT >
456  inline DisableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
457 
458  template< typename VT >
459  inline EnableIf_<VectorizedMultAssign<VT> > multAssign( const DenseVector<VT,TF>& rhs );
460 
461  template< typename VT > inline void multAssign( const SparseVector<VT,TF>& rhs );
462 
463  template< typename VT >
464  inline DisableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
465 
466  template< typename VT >
467  inline EnableIf_<VectorizedDivAssign<VT> > divAssign( const DenseVector<VT,TF>& rhs );
469  //**********************************************************************************************
470 
471  private:
472  //**Utility functions***************************************************************************
475  inline size_t addPadding( size_t value ) const noexcept;
477  //**********************************************************************************************
478 
479  //**Member variables****************************************************************************
482  size_t size_;
483  size_t capacity_;
485 
491  //**********************************************************************************************
492 
493  //**Compile time checks*************************************************************************
500  //**********************************************************************************************
501 };
502 //*************************************************************************************************
503 
504 
505 
506 
507 //=================================================================================================
508 //
509 // CONSTRUCTORS
510 //
511 //=================================================================================================
512 
513 //*************************************************************************************************
516 template< typename Type // Data type of the vector
517  , bool TF > // Transpose flag
519  : size_ ( 0UL ) // The current size/dimension of the vector
520  , capacity_( 0UL ) // The maximum capacity of the vector
521  , v_ ( nullptr ) // The vector elements
522 {}
523 //*************************************************************************************************
524 
525 
526 //*************************************************************************************************
534 template< typename Type // Data type of the vector
535  , bool TF > // Transpose flag
537  : size_ ( n ) // The current size/dimension of the vector
538  , capacity_( addPadding( n ) ) // The maximum capacity of the vector
539  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
540 {
542  for( size_t i=size_; i<capacity_; ++i )
543  v_[i] = Type();
544  }
545 
546  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
547 }
548 //*************************************************************************************************
549 
550 
551 //*************************************************************************************************
559 template< typename Type // Data type of the vector
560  , bool TF > // Transpose flag
561 inline DynamicVector<Type,TF>::DynamicVector( size_t n, const Type& init )
562  : size_ ( n ) // The current size/dimension of the vector
563  , capacity_( addPadding( n ) ) // The maximum capacity of the vector
564  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
565 {
566  for( size_t i=0UL; i<size_; ++i )
567  v_[i] = init;
568 
570  for( size_t i=size_; i<capacity_; ++i )
571  v_[i] = Type();
572  }
573 
574  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
575 }
576 //*************************************************************************************************
577 
578 
579 //*************************************************************************************************
594 template< typename Type // Data type of the vector
595  , bool TF > // Transpose flag
597  : size_ ( list.size() ) // The current size/dimension of the vector
598  , capacity_( addPadding( size_ ) ) // The maximum capacity of the vector
599  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
600 {
601  std::fill( std::copy( list.begin(), list.end(), v_ ), v_+capacity_, Type() );
602 
603  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
604 }
605 //*************************************************************************************************
606 
607 
608 //*************************************************************************************************
628 template< typename Type // Data type of the vector
629  , bool TF > // Transpose flag
630 template< typename Other > // Data type of the initialization array
631 inline DynamicVector<Type,TF>::DynamicVector( size_t n, const Other* array )
632  : size_ ( n ) // The current size/dimension of the vector
633  , capacity_( addPadding( n ) ) // The maximum capacity of the vector
634  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
635 {
636  for( size_t i=0UL; i<n; ++i )
637  v_[i] = array[i];
638 
640  for( size_t i=n; i<capacity_; ++i )
641  v_[i] = Type();
642  }
643 
644  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
645 }
646 //*************************************************************************************************
647 
648 
649 //*************************************************************************************************
666 template< typename Type // Data type of the vector
667  , bool TF > // Transpose flag
668 template< typename Other // Data type of the initialization array
669  , size_t Dim > // Dimension of the initialization array
670 inline DynamicVector<Type,TF>::DynamicVector( const Other (&array)[Dim] )
671  : size_ ( Dim ) // The current size/dimension of the vector
672  , capacity_( addPadding( Dim ) ) // The maximum capacity of the vector
673  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
674 {
675  for( size_t i=0UL; i<Dim; ++i )
676  v_[i] = array[i];
677 
679  for( size_t i=Dim; i<capacity_; ++i )
680  v_[i] = Type();
681  }
682 
683  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
684 }
685 //*************************************************************************************************
686 
687 
688 //*************************************************************************************************
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_( addPadding( v.size_ ) ) // The maximum capacity of the vector
701  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
702 {
703  BLAZE_INTERNAL_ASSERT( capacity_ <= v.capacity_, "Invalid capacity estimation" );
704 
705  for( size_t i=0UL; i<capacity_; ++i )
706  v_[i] = v.v_[i];
707 
708  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
709 }
710 //*************************************************************************************************
711 
712 
713 //*************************************************************************************************
718 template< typename Type // Data type of the vector
719  , bool TF > // Transpose flag
721  : size_ ( v.size_ ) // The current size/dimension of the vector
722  , capacity_( v.capacity_ ) // The maximum capacity of the vector
723  , v_ ( v.v_ ) // The vector elements
724 {
725  v.size_ = 0UL;
726  v.capacity_ = 0UL;
727  v.v_ = nullptr;
728 }
729 //*************************************************************************************************
730 
731 
732 //*************************************************************************************************
737 template< typename Type // Data type of the vector
738  , bool TF > // Transpose flag
739 template< typename VT > // Type of the foreign vector
741  : size_ ( (~v).size() ) // The current size/dimension of the vector
742  , capacity_( addPadding( size_ ) ) // The maximum capacity of the vector
743  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
744 {
745  for( size_t i=( IsSparseVector<VT>::value ? 0UL : size_ );
746  i<( IsVectorizable<Type>::value ? capacity_ : size_ ); ++i ) {
747  v_[i] = Type();
748  }
749 
750  smpAssign( *this, ~v );
751 
752  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
753 }
754 //*************************************************************************************************
755 
756 
757 
758 
759 //=================================================================================================
760 //
761 // DESTRUCTOR
762 //
763 //=================================================================================================
764 
765 //*************************************************************************************************
768 template< typename Type // Data type of the vector
769  , bool TF > // Transpose flag
771 {
772  deallocate( v_ );
773 }
774 //*************************************************************************************************
775 
776 
777 
778 
779 //=================================================================================================
780 //
781 // DATA ACCESS FUNCTIONS
782 //
783 //=================================================================================================
784 
785 //*************************************************************************************************
794 template< typename Type // Data type of the vector
795  , bool TF > // Transpose flag
796 inline typename DynamicVector<Type,TF>::Reference
797  DynamicVector<Type,TF>::operator[]( size_t index ) noexcept
798 {
799  BLAZE_USER_ASSERT( index < size_, "Invalid vector access index" );
800  return v_[index];
801 }
802 //*************************************************************************************************
803 
804 
805 //*************************************************************************************************
814 template< typename Type // Data type of the vector
815  , bool TF > // Transpose flag
817  DynamicVector<Type,TF>::operator[]( size_t index ) const noexcept
818 {
819  BLAZE_USER_ASSERT( index < size_, "Invalid vector access index" );
820  return v_[index];
821 }
822 //*************************************************************************************************
823 
824 
825 //*************************************************************************************************
835 template< typename Type // Data type of the vector
836  , bool TF > // Transpose flag
837 inline typename DynamicVector<Type,TF>::Reference
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 //*************************************************************************************************
858 template< typename Type // Data type of the vector
859  , bool TF > // Transpose flag
861  DynamicVector<Type,TF>::at( size_t index ) const
862 {
863  if( index >= size_ ) {
864  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
865  }
866  return (*this)[index];
867 }
868 //*************************************************************************************************
869 
870 
871 //*************************************************************************************************
878 template< typename Type // Data type of the vector
879  , bool TF > // Transpose flag
881 {
882  return v_;
883 }
884 //*************************************************************************************************
885 
886 
887 //*************************************************************************************************
894 template< typename Type // Data type of the vector
895  , bool TF > // Transpose flag
897 {
898  return v_;
899 }
900 //*************************************************************************************************
901 
902 
903 //*************************************************************************************************
908 template< typename Type // Data type of the vector
909  , bool TF > // Transpose flag
911 {
912  return Iterator( v_ );
913 }
914 //*************************************************************************************************
915 
916 
917 //*************************************************************************************************
922 template< typename Type // Data type of the vector
923  , bool TF > // Transpose flag
925 {
926  return ConstIterator( v_ );
927 }
928 //*************************************************************************************************
929 
930 
931 //*************************************************************************************************
936 template< typename Type // Data type of the vector
937  , bool TF > // Transpose flag
939 {
940  return ConstIterator( v_ );
941 }
942 //*************************************************************************************************
943 
944 
945 //*************************************************************************************************
950 template< typename Type // Data type of the vector
951  , bool TF > // Transpose flag
953 {
954  return Iterator( v_ + size_ );
955 }
956 //*************************************************************************************************
957 
958 
959 //*************************************************************************************************
964 template< typename Type // Data type of the vector
965  , bool TF > // Transpose flag
967 {
968  return ConstIterator( v_ + size_ );
969 }
970 //*************************************************************************************************
971 
972 
973 //*************************************************************************************************
978 template< typename Type // Data type of the vector
979  , bool TF > // Transpose flag
981 {
982  return ConstIterator( v_ + size_ );
983 }
984 //*************************************************************************************************
985 
986 
987 
988 
989 //=================================================================================================
990 //
991 // ASSIGNMENT OPERATORS
992 //
993 //=================================================================================================
994 
995 //*************************************************************************************************
1001 template< typename Type // Data type of the vector
1002  , bool TF > // Transpose flag
1004 {
1005  for( size_t i=0UL; i<size_; ++i )
1006  v_[i] = rhs;
1007  return *this;
1008 }
1009 //*************************************************************************************************
1010 
1011 
1012 //*************************************************************************************************
1028 template< typename Type // Data type of the vector
1029  , bool TF > // Transpose flag
1031 {
1032  resize( list.size(), false );
1033  std::copy( list.begin(), list.end(), v_ );
1034 
1035  return *this;
1036 }
1037 //*************************************************************************************************
1038 
1039 
1040 //*************************************************************************************************
1058 template< typename Type // Data type of the vector
1059  , bool TF > // Transpose flag
1060 template< typename Other // Data type of the initialization array
1061  , size_t Dim > // Dimension of the initialization array
1062 inline DynamicVector<Type,TF>& DynamicVector<Type,TF>::operator=( const Other (&array)[Dim] )
1063 {
1064  resize( Dim, false );
1065 
1066  for( size_t i=0UL; i<Dim; ++i )
1067  v_[i] = array[i];
1068 
1069  return *this;
1070 }
1071 //*************************************************************************************************
1072 
1073 
1074 //*************************************************************************************************
1083 template< typename Type // Data type of the vector
1084  , bool TF > // Transpose flag
1086 {
1087  if( &rhs == this ) return *this;
1088 
1089  resize( rhs.size_, false );
1090  smpAssign( *this, ~rhs );
1091 
1092  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1093 
1094  return *this;
1095 }
1096 //*************************************************************************************************
1097 
1098 
1099 //*************************************************************************************************
1105 template< typename Type // Data type of the vector
1106  , bool TF > // Transpose flag
1108 {
1109  deallocate( v_ );
1110 
1111  size_ = rhs.size_;
1112  capacity_ = rhs.capacity_;
1113  v_ = rhs.v_;
1114 
1115  rhs.size_ = 0UL;
1116  rhs.capacity_ = 0UL;
1117  rhs.v_ = nullptr;
1118 
1119  return *this;
1120 }
1121 //*************************************************************************************************
1122 
1123 
1124 //*************************************************************************************************
1132 template< typename Type // Data type of the vector
1133  , bool TF > // Transpose flag
1134 template< typename VT > // Type of the right-hand side vector
1136 {
1137  if( (~rhs).canAlias( this ) ) {
1138  DynamicVector tmp( ~rhs );
1139  swap( tmp );
1140  }
1141  else {
1142  resize( (~rhs).size(), false );
1144  reset();
1145  smpAssign( *this, ~rhs );
1146  }
1147 
1148  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1149 
1150  return *this;
1151 }
1152 //*************************************************************************************************
1153 
1154 
1155 //*************************************************************************************************
1165 template< typename Type // Data type of the vector
1166  , bool TF > // Transpose flag
1167 template< typename VT > // Type of the right-hand side vector
1169 {
1170  if( (~rhs).size() != size_ ) {
1171  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1172  }
1173 
1174  if( (~rhs).canAlias( this ) ) {
1175  const ResultType_<VT> tmp( ~rhs );
1176  smpAddAssign( *this, tmp );
1177  }
1178  else {
1179  smpAddAssign( *this, ~rhs );
1180  }
1181 
1182  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1183 
1184  return *this;
1185 }
1186 //*************************************************************************************************
1187 
1188 
1189 //*************************************************************************************************
1200 template< typename Type // Data type of the vector
1201  , bool TF > // Transpose flag
1202 template< typename VT > // Type of the right-hand side vector
1204 {
1205  if( (~rhs).size() != size_ ) {
1206  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1207  }
1208 
1209  if( (~rhs).canAlias( this ) ) {
1210  const ResultType_<VT> tmp( ~rhs );
1211  smpSubAssign( *this, tmp );
1212  }
1213  else {
1214  smpSubAssign( *this, ~rhs );
1215  }
1216 
1217  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1218 
1219  return *this;
1220 }
1221 //*************************************************************************************************
1222 
1223 
1224 //*************************************************************************************************
1235 template< typename Type // Data type of the vector
1236  , bool TF > // Transpose flag
1237 template< typename VT > // Type of the right-hand side vector
1239 {
1240  if( (~rhs).size() != size_ ) {
1241  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1242  }
1243 
1244  if( IsSparseVector<VT>::value || (~rhs).canAlias( this ) ) {
1245  DynamicVector<Type,TF> tmp( *this * (~rhs) );
1246  swap( tmp );
1247  }
1248  else {
1249  smpMultAssign( *this, ~rhs );
1250  }
1251 
1252  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1253 
1254  return *this;
1255 }
1256 //*************************************************************************************************
1257 
1258 
1259 //*************************************************************************************************
1269 template< typename Type // Data type of the vector
1270  , bool TF > // Transpose flag
1271 template< typename VT > // Type of the right-hand side vector
1273 {
1274  if( (~rhs).size() != size_ ) {
1275  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1276  }
1277 
1278  if( (~rhs).canAlias( this ) ) {
1279  DynamicVector<Type,TF> tmp( *this / (~rhs) );
1280  swap( tmp );
1281  }
1282  else {
1283  smpDivAssign( *this, ~rhs );
1284  }
1285 
1286  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1287 
1288  return *this;
1289 }
1290 //*************************************************************************************************
1291 
1292 
1293 //*************************************************************************************************
1304 template< typename Type // Data type of the vector
1305  , bool TF > // Transpose flag
1306 template< typename VT > // Type of the right-hand side vector
1308 {
1309  using blaze::assign;
1310 
1313 
1314  using CrossType = CrossTrait_< This, ResultType_<VT> >;
1315 
1319 
1320  if( size_ != 3UL || (~rhs).size() != 3UL ) {
1321  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1322  }
1323 
1324  const CrossType tmp( *this % (~rhs) );
1325  assign( *this, tmp );
1326 
1327  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1328 
1329  return *this;
1330 }
1331 //*************************************************************************************************
1332 
1333 
1334 //*************************************************************************************************
1341 template< typename Type // Data type of the vector
1342  , bool TF > // Transpose flag
1343 template< typename Other > // Data type of the right-hand side scalar
1346 {
1347  smpAssign( *this, (*this) * rhs );
1348 
1349  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1350 
1351  return *this;
1352 }
1353 //*************************************************************************************************
1354 
1355 
1356 //*************************************************************************************************
1365 template< typename Type // Data type of the vector
1366  , bool TF > // Transpose flag
1367 template< typename Other > // Data type of the right-hand side scalar
1368 inline EnableIf_<IsNumeric<Other>, DynamicVector<Type,TF> >&
1370 {
1371  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1372 
1373  smpAssign( *this, (*this) / rhs );
1374 
1375  BLAZE_INTERNAL_ASSERT( isIntact(), "Invariant violation detected" );
1376 
1377  return *this;
1378 }
1379 //*************************************************************************************************
1380 
1381 
1382 
1383 
1384 //=================================================================================================
1385 //
1386 // UTILITY FUNCTIONS
1387 //
1388 //=================================================================================================
1389 
1390 //*************************************************************************************************
1395 template< typename Type // Data type of the vector
1396  , bool TF > // Transpose flag
1397 inline size_t DynamicVector<Type,TF>::size() const noexcept
1398 {
1399  return size_;
1400 }
1401 //*************************************************************************************************
1402 
1403 
1404 //*************************************************************************************************
1412 template< typename Type // Data type of the vector
1413  , bool TF > // Transpose flag
1414 inline size_t DynamicVector<Type,TF>::spacing() const noexcept
1415 {
1416  return addPadding( size_ );
1417 }
1418 //*************************************************************************************************
1419 
1420 
1421 //*************************************************************************************************
1426 template< typename Type // Data type of the vector
1427  , bool TF > // Transpose flag
1428 inline size_t DynamicVector<Type,TF>::capacity() const noexcept
1429 {
1430  return capacity_;
1431 }
1432 //*************************************************************************************************
1433 
1434 
1435 //*************************************************************************************************
1443 template< typename Type // Data type of the vector
1444  , bool TF > // Transpose flag
1446 {
1447  size_t nonzeros( 0 );
1448 
1449  for( size_t i=0UL; i<size_; ++i ) {
1450  if( !isDefault( v_[i] ) )
1451  ++nonzeros;
1452  }
1453 
1454  return nonzeros;
1455 }
1456 //*************************************************************************************************
1457 
1458 
1459 //*************************************************************************************************
1464 template< typename Type // Data type of the vector
1465  , bool TF > // Transpose flag
1467 {
1468  using blaze::clear;
1469  for( size_t i=0UL; i<size_; ++i )
1470  clear( v_[i] );
1471 }
1472 //*************************************************************************************************
1473 
1474 
1475 //*************************************************************************************************
1482 template< typename Type // Data type of the vector
1483  , bool TF > // Transpose flag
1485 {
1486  resize( 0UL, false );
1487 }
1488 //*************************************************************************************************
1489 
1490 
1491 //*************************************************************************************************
1520 template< typename Type // Data type of the vector
1521  , bool TF > // Transpose flag
1522 inline void DynamicVector<Type,TF>::resize( size_t n, bool preserve )
1523 {
1524  if( n > capacity_ )
1525  {
1526  // Allocating a new array
1527  const size_t newCapacity( addPadding( n ) );
1528  Type* BLAZE_RESTRICT tmp = allocate<Type>( newCapacity );
1529 
1530  // Initializing the new array
1531  if( preserve ) {
1532  transfer( v_, v_+size_, tmp );
1533  }
1534 
1536  for( size_t i=size_; i<newCapacity; ++i )
1537  tmp[i] = Type();
1538  }
1539 
1540  // Replacing the old array
1541  std::swap( v_, tmp );
1542  deallocate( tmp );
1543  capacity_ = newCapacity;
1544  }
1545  else if( IsVectorizable<Type>::value && n < size_ )
1546  {
1547  for( size_t i=n; i<size_; ++i )
1548  v_[i] = Type();
1549  }
1550 
1551  size_ = n;
1552 }
1553 //*************************************************************************************************
1554 
1555 
1556 //*************************************************************************************************
1568 template< typename Type // Data type of the vector
1569  , bool TF > // Transpose flag
1570 inline void DynamicVector<Type,TF>::extend( size_t n, bool preserve )
1571 {
1572  resize( size_+n, preserve );
1573 }
1574 //*************************************************************************************************
1575 
1576 
1577 //*************************************************************************************************
1586 template< typename Type // Data type of the vector
1587  , bool TF > // Transpose flag
1588 inline void DynamicVector<Type,TF>::reserve( size_t n )
1589 {
1590  if( n > capacity_ )
1591  {
1592  // Allocating a new array
1593  const size_t newCapacity( addPadding( n ) );
1594  Type* BLAZE_RESTRICT tmp = allocate<Type>( newCapacity );
1595 
1596  // Initializing the new array
1597  transfer( v_, v_+size_, tmp );
1598 
1600  for( size_t i=size_; i<newCapacity; ++i )
1601  tmp[i] = Type();
1602  }
1603 
1604  // Replacing the old array
1605  std::swap( tmp, v_ );
1606  deallocate( tmp );
1607  capacity_ = newCapacity;
1608  }
1609 }
1610 //*************************************************************************************************
1611 
1612 
1613 //*************************************************************************************************
1623 template< typename Type // Data type of the vector
1624  , bool TF > // Transpose flag
1626 {
1627  if( spacing() < capacity_ ) {
1628  DynamicVector( *this ).swap( *this );
1629  }
1630 }
1631 //*************************************************************************************************
1632 
1633 
1634 //*************************************************************************************************
1640 template< typename Type // Data type of the vector
1641  , bool TF > // Transpose flag
1643 {
1644  std::swap( size_, v.size_ );
1645  std::swap( capacity_, v.capacity_ );
1646  std::swap( v_, v.v_ );
1647 }
1648 //*************************************************************************************************
1649 
1650 
1651 //*************************************************************************************************
1660 template< typename Type // Data type of the vector
1661  , bool TF > // Transpose flag
1662 inline size_t DynamicVector<Type,TF>::addPadding( size_t value ) const noexcept
1663 {
1664  if( usePadding && IsVectorizable<Type>::value )
1665  return nextMultiple<size_t>( value, SIMDSIZE );
1666  else return value;
1667 }
1668 //*************************************************************************************************
1669 
1670 
1671 
1672 
1673 //=================================================================================================
1674 //
1675 // NUMERIC FUNCTIONS
1676 //
1677 //=================================================================================================
1678 
1679 //*************************************************************************************************
1696 template< typename Type // Data type of the vector
1697  , bool TF > // Transpose flag
1698 template< typename Other > // Data type of the scalar value
1700 {
1701  for( size_t i=0UL; i<size_; ++i )
1702  v_[i] *= scalar;
1703  return *this;
1704 }
1705 //*************************************************************************************************
1706 
1707 
1708 
1709 
1710 //=================================================================================================
1711 //
1712 // DEBUGGING FUNCTIONS
1713 //
1714 //=================================================================================================
1715 
1716 //*************************************************************************************************
1725 template< typename Type // Data type of the vector
1726  , bool TF > // Transpose flag
1727 inline bool DynamicVector<Type,TF>::isIntact() const noexcept
1728 {
1729  if( size_ > capacity_ )
1730  return false;
1731 
1732  if( IsNumeric<Type>::value ) {
1733  for( size_t i=size_; i<capacity_; ++i ) {
1734  if( v_[i] != Type() )
1735  return false;
1736  }
1737  }
1738 
1739  return true;
1740 }
1741 //*************************************************************************************************
1742 
1743 
1744 
1745 
1746 //=================================================================================================
1747 //
1748 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1749 //
1750 //=================================================================================================
1751 
1752 //*************************************************************************************************
1762 template< typename Type // Data type of the vector
1763  , bool TF > // Transpose flag
1764 template< typename Other > // Data type of the foreign expression
1765 inline bool DynamicVector<Type,TF>::canAlias( const Other* alias ) const noexcept
1766 {
1767  return static_cast<const void*>( this ) == static_cast<const void*>( alias );
1768 }
1769 //*************************************************************************************************
1770 
1771 
1772 //*************************************************************************************************
1782 template< typename Type // Data type of the vector
1783  , bool TF > // Transpose flag
1784 template< typename Other > // Data type of the foreign expression
1785 inline bool DynamicVector<Type,TF>::isAliased( const Other* alias ) const noexcept
1786 {
1787  return static_cast<const void*>( this ) == static_cast<const void*>( alias );
1788 }
1789 //*************************************************************************************************
1790 
1791 
1792 //*************************************************************************************************
1801 template< typename Type // Data type of the vector
1802  , bool TF > // Transpose flag
1803 inline bool DynamicVector<Type,TF>::isAligned() const noexcept
1804 {
1805  return true;
1806 }
1807 //*************************************************************************************************
1808 
1809 
1810 //*************************************************************************************************
1820 template< typename Type // Data type of the vector
1821  , bool TF > // Transpose flag
1822 inline bool DynamicVector<Type,TF>::canSMPAssign() const noexcept
1823 {
1824  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1825 }
1826 //*************************************************************************************************
1827 
1828 
1829 //*************************************************************************************************
1841 template< typename Type // Data type of the vector
1842  , bool TF > // Transpose flag
1844  DynamicVector<Type,TF>::load( size_t index ) const noexcept
1845 {
1846  return loada( index );
1847 }
1848 //*************************************************************************************************
1849 
1850 
1851 //*************************************************************************************************
1864 template< typename Type // Data type of the vector
1865  , bool TF > // Transpose flag
1867  DynamicVector<Type,TF>::loada( size_t index ) const noexcept
1868 {
1869  using blaze::loada;
1870 
1872 
1873  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1874  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1875  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
1876  BLAZE_INTERNAL_ASSERT( checkAlignment( v_+index ), "Invalid alignment detected" );
1877 
1878  return loada( v_+index );
1879 }
1880 //*************************************************************************************************
1881 
1882 
1883 //*************************************************************************************************
1896 template< typename Type // Data type of the vector
1897  , bool TF > // Transpose flag
1899  DynamicVector<Type,TF>::loadu( size_t index ) const noexcept
1900 {
1901  using blaze::loadu;
1902 
1904 
1905  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1906  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1907 
1908  return loadu( v_+index );
1909 }
1910 //*************************************************************************************************
1911 
1912 
1913 //*************************************************************************************************
1926 template< typename Type // Data type of the vector
1927  , bool TF > // Transpose flag
1929  DynamicVector<Type,TF>::store( size_t index, const SIMDType& value ) noexcept
1930 {
1931  storea( index, value );
1932 }
1933 //*************************************************************************************************
1934 
1935 
1936 //*************************************************************************************************
1949 template< typename Type // Data type of the vector
1950  , bool TF > // Transpose flag
1952  DynamicVector<Type,TF>::storea( size_t index, const SIMDType& value ) noexcept
1953 {
1954  using blaze::storea;
1955 
1957 
1958  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1959  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1960  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
1961  BLAZE_INTERNAL_ASSERT( checkAlignment( v_+index ), "Invalid alignment detected" );
1962 
1963  storea( v_+index, value );
1964 }
1965 //*************************************************************************************************
1966 
1967 
1968 //*************************************************************************************************
1981 template< typename Type // Data type of the vector
1982  , bool TF > // Transpose flag
1984  DynamicVector<Type,TF>::storeu( size_t index, const SIMDType& value ) noexcept
1985 {
1986  using blaze::storeu;
1987 
1989 
1990  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
1991  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
1992 
1993  storeu( v_+index, value );
1994 }
1995 //*************************************************************************************************
1996 
1997 
1998 //*************************************************************************************************
2012 template< typename Type // Data type of the vector
2013  , bool TF > // Transpose flag
2015  DynamicVector<Type,TF>::stream( size_t index, const SIMDType& value ) noexcept
2016 {
2017  using blaze::stream;
2018 
2020 
2021  BLAZE_INTERNAL_ASSERT( index < size_, "Invalid vector access index" );
2022  BLAZE_INTERNAL_ASSERT( index + SIMDSIZE <= capacity_, "Invalid vector access index" );
2023  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
2024  BLAZE_INTERNAL_ASSERT( checkAlignment( v_+index ), "Invalid alignment detected" );
2025 
2026  stream( v_+index, value );
2027 }
2028 //*************************************************************************************************
2029 
2030 
2031 //*************************************************************************************************
2042 template< typename Type // Data type of the vector
2043  , bool TF > // Transpose flag
2044 template< typename VT > // Type of the right-hand side dense vector
2047 {
2048  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2049 
2050  const size_t ipos( size_ & size_t(-2) );
2051  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2052 
2053  for( size_t i=0UL; i<ipos; i+=2UL ) {
2054  v_[i ] = (~rhs)[i ];
2055  v_[i+1UL] = (~rhs)[i+1UL];
2056  }
2057  if( ipos < (~rhs).size() )
2058  v_[ipos] = (~rhs)[ipos];
2059 }
2060 //*************************************************************************************************
2061 
2062 
2063 //*************************************************************************************************
2074 template< typename Type // Data type of the vector
2075  , bool TF > // Transpose flag
2076 template< typename VT > // Type of the right-hand side dense vector
2079 {
2081 
2082  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2083 
2084  constexpr bool remainder( !usePadding || !IsPadded<VT>::value );
2085 
2086  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2087  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2088 
2089  size_t i=0UL;
2090  Iterator left( begin() );
2091  ConstIterator_<VT> right( (~rhs).begin() );
2092 
2093  if( useStreaming && size_ > ( cacheSize/( sizeof(Type) * 3UL ) ) && !(~rhs).isAliased( this ) )
2094  {
2095  for( ; i<ipos; i+=SIMDSIZE ) {
2096  left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2097  }
2098  for( ; remainder && i<size_; ++i ) {
2099  *left = *right; ++left; ++right;
2100  }
2101  }
2102  else
2103  {
2104  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2105  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2106  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2107  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2108  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2109  }
2110  for( ; i<ipos; i+=SIMDSIZE ) {
2111  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2112  }
2113  for( ; remainder && i<size_; ++i ) {
2114  *left = *right; ++left; ++right;
2115  }
2116  }
2117 }
2118 //*************************************************************************************************
2119 
2120 
2121 //*************************************************************************************************
2132 template< typename Type // Data type of the vector
2133  , bool TF > // Transpose flag
2134 template< typename VT > // Type of the right-hand side sparse vector
2136 {
2137  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2138 
2139  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2140  v_[element->index()] = element->value();
2141 }
2142 //*************************************************************************************************
2143 
2144 
2145 //*************************************************************************************************
2156 template< typename Type // Data type of the vector
2157  , bool TF > // Transpose flag
2158 template< typename VT > // Type of the right-hand side dense vector
2159 inline DisableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >
2161 {
2162  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2163 
2164  const size_t ipos( size_ & size_t(-2) );
2165  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2166 
2167  for( size_t i=0UL; i<ipos; i+=2UL ) {
2168  v_[i ] += (~rhs)[i ];
2169  v_[i+1UL] += (~rhs)[i+1UL];
2170  }
2171  if( ipos < (~rhs).size() )
2172  v_[ipos] += (~rhs)[ipos];
2173 }
2174 //*************************************************************************************************
2175 
2176 
2177 //*************************************************************************************************
2188 template< typename Type // Data type of the vector
2189  , bool TF > // Transpose flag
2190 template< typename VT > // Type of the right-hand side dense vector
2191 inline EnableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >
2193 {
2195 
2196  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2197 
2198  constexpr bool remainder( !usePadding || !IsPadded<VT>::value );
2199 
2200  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2201  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2202 
2203  size_t i( 0UL );
2204  Iterator left( begin() );
2205  ConstIterator_<VT> right( (~rhs).begin() );
2206 
2207  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2208  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2209  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2210  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2211  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2212  }
2213  for( ; i<ipos; i+=SIMDSIZE ) {
2214  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2215  }
2216  for( ; remainder && i<size_; ++i ) {
2217  *left += *right; ++left; ++right;
2218  }
2219 }
2220 //*************************************************************************************************
2221 
2222 
2223 //*************************************************************************************************
2234 template< typename Type // Data type of the vector
2235  , bool TF > // Transpose flag
2236 template< typename VT > // Type of the right-hand side sparse vector
2238 {
2239  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2240 
2241  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2242  v_[element->index()] += element->value();
2243 }
2244 //*************************************************************************************************
2245 
2246 
2247 //*************************************************************************************************
2258 template< typename Type // Data type of the vector
2259  , bool TF > // Transpose flag
2260 template< typename VT > // Type of the right-hand side dense vector
2261 inline DisableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >
2263 {
2264  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2265 
2266  const size_t ipos( size_ & size_t(-2) );
2267  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2268 
2269  for( size_t i=0UL; i<ipos; i+=2UL ) {
2270  v_[i ] -= (~rhs)[i ];
2271  v_[i+1UL] -= (~rhs)[i+1UL];
2272  }
2273  if( ipos < (~rhs).size() )
2274  v_[ipos] -= (~rhs)[ipos];
2275 }
2276 //*************************************************************************************************
2277 
2278 
2279 //*************************************************************************************************
2290 template< typename Type // Data type of the vector
2291  , bool TF > // Transpose flag
2292 template< typename VT > // Type of the right-hand side dense vector
2293 inline EnableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >
2295 {
2297 
2298  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2299 
2300  constexpr bool remainder( !usePadding || !IsPadded<VT>::value );
2301 
2302  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2303  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2304 
2305  size_t i( 0UL );
2306  Iterator left( begin() );
2307  ConstIterator_<VT> right( (~rhs).begin() );
2308 
2309  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2310  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2311  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2312  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2313  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2314  }
2315  for( ; i<ipos; i+=SIMDSIZE ) {
2316  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2317  }
2318  for( ; remainder && i<size_; ++i ) {
2319  *left -= *right; ++left; ++right;
2320  }
2321 }
2322 //*************************************************************************************************
2323 
2324 
2325 //*************************************************************************************************
2336 template< typename Type // Data type of the vector
2337  , bool TF > // Transpose flag
2338 template< typename VT > // Type of the right-hand side sparse vector
2340 {
2341  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2342 
2343  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2344  v_[element->index()] -= element->value();
2345 }
2346 //*************************************************************************************************
2347 
2348 
2349 //*************************************************************************************************
2360 template< typename Type // Data type of the vector
2361  , bool TF > // Transpose flag
2362 template< typename VT > // Type of the right-hand side dense vector
2363 inline DisableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >
2365 {
2366  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2367 
2368  const size_t ipos( size_ & size_t(-2) );
2369  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2370 
2371  for( size_t i=0UL; i<ipos; i+=2UL ) {
2372  v_[i ] *= (~rhs)[i ];
2373  v_[i+1UL] *= (~rhs)[i+1UL];
2374  }
2375  if( ipos < (~rhs).size() )
2376  v_[ipos] *= (~rhs)[ipos];
2377 }
2378 //*************************************************************************************************
2379 
2380 
2381 //*************************************************************************************************
2392 template< typename Type // Data type of the vector
2393  , bool TF > // Transpose flag
2394 template< typename VT > // Type of the right-hand side dense vector
2395 inline EnableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >
2397 {
2399 
2400  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2401 
2402  constexpr bool remainder( !usePadding || !IsPadded<VT>::value );
2403 
2404  const size_t ipos( ( remainder )?( size_ & size_t(-SIMDSIZE) ):( size_ ) );
2405  BLAZE_INTERNAL_ASSERT( !remainder || ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2406 
2407  size_t i( 0UL );
2408  Iterator left( begin() );
2409  ConstIterator_<VT> right( (~rhs).begin() );
2410 
2411  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2412  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2413  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2414  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2415  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2416  }
2417  for( ; i<ipos; i+=SIMDSIZE ) {
2418  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2419  }
2420  for( ; remainder && i<size_; ++i ) {
2421  *left *= *right; ++left; ++right;
2422  }
2423 }
2424 //*************************************************************************************************
2425 
2426 
2427 //*************************************************************************************************
2438 template< typename Type // Data type of the vector
2439  , bool TF > // Transpose flag
2440 template< typename VT > // Type of the right-hand side sparse vector
2442 {
2443  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2444 
2445  const DynamicVector tmp( serial( *this ) );
2446 
2447  reset();
2448 
2449  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2450  v_[element->index()] = tmp[element->index()] * element->value();
2451 }
2452 //*************************************************************************************************
2453 
2454 
2455 //*************************************************************************************************
2466 template< typename Type // Data type of the vector
2467  , bool TF > // Transpose flag
2468 template< typename VT > // Type of the right-hand side dense vector
2469 inline DisableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedDivAssign<VT> >
2471 {
2472  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2473 
2474  const size_t ipos( size_ & size_t(-2) );
2475  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
2476 
2477  for( size_t i=0UL; i<ipos; i+=2UL ) {
2478  v_[i ] /= (~rhs)[i ];
2479  v_[i+1UL] /= (~rhs)[i+1UL];
2480  }
2481  if( ipos < (~rhs).size() )
2482  v_[ipos] /= (~rhs)[ipos];
2483 }
2484 //*************************************************************************************************
2485 
2486 
2487 //*************************************************************************************************
2498 template< typename Type // Data type of the vector
2499  , bool TF > // Transpose flag
2500 template< typename VT > // Type of the right-hand side dense vector
2501 inline EnableIf_<typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedDivAssign<VT> >
2503 {
2505 
2506  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
2507 
2508  const size_t ipos( size_ & size_t(-SIMDSIZE) );
2509  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2510 
2511  size_t i( 0UL );
2512  Iterator left( begin() );
2513  ConstIterator_<VT> right( (~rhs).begin() );
2514 
2515  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2516  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2517  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2518  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2519  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2520  }
2521  for( ; i<ipos; i+=SIMDSIZE ) {
2522  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2523  }
2524  for( ; i<size_; ++i ) {
2525  *left /= *right; ++left; ++right;
2526  }
2527 }
2528 //*************************************************************************************************
2529 
2530 
2531 
2532 
2533 //=================================================================================================
2534 //
2535 // DYNAMICVECTOR OPERATORS
2536 //
2537 //=================================================================================================
2538 
2539 //*************************************************************************************************
2542 template< typename Type, bool TF >
2543 inline void reset( DynamicVector<Type,TF>& v );
2544 
2545 template< typename Type, bool TF >
2546 inline void clear( DynamicVector<Type,TF>& v );
2547 
2548 template< bool RF, typename Type, bool TF >
2549 inline bool isDefault( const DynamicVector<Type,TF>& v );
2550 
2551 template< typename Type, bool TF >
2552 inline bool isIntact( const DynamicVector<Type,TF>& v ) noexcept;
2553 
2554 template< typename Type, bool TF >
2555 inline void swap( DynamicVector<Type,TF>& a, DynamicVector<Type,TF>& b ) noexcept;
2557 //*************************************************************************************************
2558 
2559 
2560 //*************************************************************************************************
2567 template< typename Type // Data type of the vector
2568  , bool TF > // Transpose flag
2570 {
2571  v.reset();
2572 }
2573 //*************************************************************************************************
2574 
2575 
2576 //*************************************************************************************************
2583 template< typename Type // Data type of the vector
2584  , bool TF > // Transpose flag
2586 {
2587  v.clear();
2588 }
2589 //*************************************************************************************************
2590 
2591 
2592 //*************************************************************************************************
2616 template< bool RF // Relaxation flag
2617  , typename Type // Data type of the vector
2618  , bool TF > // Transpose flag
2619 inline bool isDefault( const DynamicVector<Type,TF>& v )
2620 {
2621  return ( v.size() == 0UL );
2622 }
2623 //*************************************************************************************************
2624 
2625 
2626 //*************************************************************************************************
2644 template< typename Type // Data type of the vector
2645  , bool TF > // Transpose flag
2646 inline bool isIntact( const DynamicVector<Type,TF>& v ) noexcept
2647 {
2648  return v.isIntact();
2649 }
2650 //*************************************************************************************************
2651 
2652 
2653 //*************************************************************************************************
2661 template< typename Type // Data type of the vector
2662  , bool TF > // Transpose flag
2664 {
2665  a.swap( b );
2666 }
2667 //*************************************************************************************************
2668 
2669 
2670 
2671 
2672 //=================================================================================================
2673 //
2674 // HASCONSTDATAACCESS SPECIALIZATIONS
2675 //
2676 //=================================================================================================
2677 
2678 //*************************************************************************************************
2680 template< typename T, bool TF >
2681 struct HasConstDataAccess< DynamicVector<T,TF> >
2682  : public TrueType
2683 {};
2685 //*************************************************************************************************
2686 
2687 
2688 
2689 
2690 //=================================================================================================
2691 //
2692 // HASMUTABLEDATAACCESS SPECIALIZATIONS
2693 //
2694 //=================================================================================================
2695 
2696 //*************************************************************************************************
2698 template< typename T, bool TF >
2699 struct HasMutableDataAccess< DynamicVector<T,TF> >
2700  : public TrueType
2701 {};
2703 //*************************************************************************************************
2704 
2705 
2706 
2707 
2708 //=================================================================================================
2709 //
2710 // ISALIGNED SPECIALIZATIONS
2711 //
2712 //=================================================================================================
2713 
2714 //*************************************************************************************************
2716 template< typename T, bool TF >
2717 struct IsAligned< DynamicVector<T,TF> >
2718  : public TrueType
2719 {};
2721 //*************************************************************************************************
2722 
2723 
2724 
2725 
2726 //=================================================================================================
2727 //
2728 // ISPADDED SPECIALIZATIONS
2729 //
2730 //=================================================================================================
2731 
2732 //*************************************************************************************************
2734 template< typename T, bool TF >
2735 struct IsPadded< DynamicVector<T,TF> >
2736  : public BoolConstant<usePadding>
2737 {};
2739 //*************************************************************************************************
2740 
2741 
2742 
2743 
2744 //=================================================================================================
2745 //
2746 // ISRESIZABLE SPECIALIZATIONS
2747 //
2748 //=================================================================================================
2749 
2750 //*************************************************************************************************
2752 template< typename T, bool TF >
2753 struct IsResizable< DynamicVector<T,TF> >
2754  : public TrueType
2755 {};
2757 //*************************************************************************************************
2758 
2759 
2760 
2761 
2762 //=================================================================================================
2763 //
2764 // ISSHRINKABLE SPECIALIZATIONS
2765 //
2766 //=================================================================================================
2767 
2768 //*************************************************************************************************
2770 template< typename T, bool TF >
2771 struct IsShrinkable< DynamicVector<T,TF> >
2772  : public TrueType
2773 {};
2775 //*************************************************************************************************
2776 
2777 
2778 
2779 
2780 //=================================================================================================
2781 //
2782 // ADDTRAIT SPECIALIZATIONS
2783 //
2784 //=================================================================================================
2785 
2786 //*************************************************************************************************
2788 template< typename T1, bool TF, typename T2, size_t N >
2789 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2790 {
2791  using Type = StaticVector< AddTrait_<T1,T2>, N, TF >;
2792 };
2793 
2794 template< typename T1, size_t N, bool TF, typename T2 >
2795 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2796 {
2797  using Type = StaticVector< AddTrait_<T1,T2>, N, TF >;
2798 };
2799 
2800 template< typename T1, bool TF, typename T2, size_t N >
2801 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2802 {
2803  using Type = HybridVector< AddTrait_<T1,T2>, N, TF >;
2804 };
2805 
2806 template< typename T1, size_t N, bool TF, typename T2 >
2807 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2808 {
2809  using Type = HybridVector< AddTrait_<T1,T2>, N, TF >;
2810 };
2811 
2812 template< typename T1, bool TF, typename T2 >
2813 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2814 {
2815  using Type = DynamicVector< AddTrait_<T1,T2>, TF >;
2816 };
2818 //*************************************************************************************************
2819 
2820 
2821 
2822 
2823 //=================================================================================================
2824 //
2825 // SUBTRAIT SPECIALIZATIONS
2826 //
2827 //=================================================================================================
2828 
2829 //*************************************************************************************************
2831 template< typename T1, bool TF, typename T2, size_t N >
2832 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2833 {
2834  using Type = StaticVector< SubTrait_<T1,T2>, N, TF >;
2835 };
2836 
2837 template< typename T1, size_t N, bool TF, typename T2 >
2838 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2839 {
2840  using Type = StaticVector< SubTrait_<T1,T2>, N, TF >;
2841 };
2842 
2843 template< typename T1, bool TF, typename T2, size_t N >
2844 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2845 {
2846  using Type = HybridVector< SubTrait_<T1,T2>, N, TF >;
2847 };
2848 
2849 template< typename T1, size_t N, bool TF, typename T2 >
2850 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2851 {
2852  using Type = HybridVector< SubTrait_<T1,T2>, N, TF >;
2853 };
2854 
2855 template< typename T1, bool TF, typename T2 >
2856 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2857 {
2858  using Type = DynamicVector< SubTrait_<T1,T2>, TF >;
2859 };
2861 //*************************************************************************************************
2862 
2863 
2864 
2865 
2866 //=================================================================================================
2867 //
2868 // MULTTRAIT SPECIALIZATIONS
2869 //
2870 //=================================================================================================
2871 
2872 //*************************************************************************************************
2874 template< typename T1, bool TF, typename T2 >
2875 struct MultTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2876 {
2877  using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
2878 };
2879 
2880 template< typename T1, typename T2, bool TF >
2881 struct MultTrait< T1, DynamicVector<T2,TF>, EnableIf_<IsNumeric<T1> > >
2882 {
2883  using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
2884 };
2885 
2886 template< typename T1, bool TF, typename T2, size_t N >
2887 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2888 {
2889  using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
2890 };
2891 
2892 template< typename T1, typename T2, size_t N >
2893 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2894 {
2895  using Type = DynamicMatrix< MultTrait_<T1,T2>, false >;
2896 };
2897 
2898 template< typename T1, typename T2, size_t N >
2899 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2900 {
2901  using Type = MultTrait_<T1,T2>;
2902 };
2903 
2904 template< typename T1, size_t N, bool TF, typename T2 >
2905 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2906 {
2907  using Type = StaticVector< MultTrait_<T1,T2>, N, TF >;
2908 };
2909 
2910 template< typename T1, size_t N, typename T2 >
2911 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2912 {
2913  using Type = DynamicMatrix< MultTrait_<T1,T2>, false >;
2914 };
2915 
2916 template< typename T1, size_t N, typename T2 >
2917 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2918 {
2919  using Type = MultTrait_<T1,T2>;
2920 };
2921 
2922 template< typename T1, bool TF, typename T2, size_t N >
2923 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2924 {
2925  using Type = HybridVector< MultTrait_<T1,T2>, N, TF >;
2926 };
2927 
2928 template< typename T1, typename T2, size_t N >
2929 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2930 {
2931  using Type = DynamicMatrix< MultTrait_<T1,T2>, false >;
2932 };
2933 
2934 template< typename T1, typename T2, size_t N >
2935 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2936 {
2937  using Type = MultTrait_<T1,T2>;
2938 };
2939 
2940 template< typename T1, size_t N, bool TF, typename T2 >
2941 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2942 {
2943  using Type = HybridVector< MultTrait_<T1,T2>, N, TF >;
2944 };
2945 
2946 template< typename T1, size_t N, typename T2 >
2947 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2948 {
2949  using Type = DynamicMatrix< MultTrait_<T1,T2>, false >;
2950 };
2951 
2952 template< typename T1, size_t N, typename T2 >
2953 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2954 {
2955  using Type = MultTrait_<T1,T2>;
2956 };
2957 
2958 template< typename T1, bool TF, typename T2 >
2959 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2960 {
2961  using Type = DynamicVector< MultTrait_<T1,T2>, TF >;
2962 };
2963 
2964 template< typename T1, typename T2 >
2965 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2966 {
2967  using Type = DynamicMatrix< MultTrait_<T1,T2>, false >;
2968 };
2969 
2970 template< typename T1, typename T2 >
2971 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2972 {
2973  using Type = MultTrait_<T1,T2>;
2974 };
2976 //*************************************************************************************************
2977 
2978 
2979 
2980 
2981 //=================================================================================================
2982 //
2983 // DIVTRAIT SPECIALIZATIONS
2984 //
2985 //=================================================================================================
2986 
2987 //*************************************************************************************************
2989 template< typename T1, bool TF, typename T2 >
2990 struct DivTrait< DynamicVector<T1,TF>, T2, EnableIf_<IsNumeric<T2> > >
2991 {
2992  using Type = DynamicVector< DivTrait_<T1,T2>, TF >;
2993 };
2994 
2995 template< typename T1, bool TF, typename T2, size_t N >
2996 struct DivTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2997 {
2998  using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
2999 };
3000 
3001 template< typename T1, size_t N, bool TF, typename T2 >
3002 struct DivTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
3003 {
3004  using Type = StaticVector< DivTrait_<T1,T2>, N, TF >;
3005 };
3006 
3007 template< typename T1, bool TF, typename T2, size_t N >
3008 struct DivTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
3009 {
3010  using Type = HybridVector< DivTrait_<T1,T2>, N, TF >;
3011 };
3012 
3013 template< typename T1, size_t N, bool TF, typename T2 >
3014 struct DivTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
3015 {
3016  using Type = HybridVector< DivTrait_<T1,T2>, N, TF >;
3017 };
3018 
3019 template< typename T1, bool TF, typename T2 >
3020 struct DivTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3021 {
3022  using Type = DynamicVector< DivTrait_<T1,T2>, TF >;
3023 };
3025 //*************************************************************************************************
3026 
3027 
3028 
3029 
3030 //=================================================================================================
3031 //
3032 // CROSSTRAIT SPECIALIZATIONS
3033 //
3034 //=================================================================================================
3035 
3036 //*************************************************************************************************
3038 template< typename T1, bool TF, typename T2 >
3039 struct CrossTrait< DynamicVector<T1,TF>, StaticVector<T2,3UL,TF> >
3040 {
3041  private:
3042  using T = MultTrait_<T1,T2>;
3043 
3044  public:
3045  using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
3046 };
3047 
3048 template< typename T1, bool TF, typename T2 >
3049 struct CrossTrait< StaticVector<T1,3UL,TF>, DynamicVector<T2,TF> >
3050 {
3051  private:
3052  using T = MultTrait_<T1,T2>;
3053 
3054  public:
3055  using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
3056 };
3057 
3058 template< typename T1, bool TF, typename T2, size_t N >
3059 struct CrossTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
3060 {
3061  private:
3062  using T = MultTrait_<T1,T2>;
3063 
3064  public:
3065  using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
3066 };
3067 
3068 template< typename T1, size_t N, bool TF, typename T2 >
3069 struct CrossTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
3070 {
3071  private:
3072  using T = MultTrait_<T1,T2>;
3073 
3074  public:
3075  using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
3076 };
3077 
3078 template< typename T1, bool TF, typename T2 >
3079 struct CrossTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3080 {
3081  private:
3082  using T = MultTrait_<T1,T2>;
3083 
3084  public:
3085  using Type = StaticVector< SubTrait_<T,T>, 3UL, TF >;
3086 };
3088 //*************************************************************************************************
3089 
3090 
3091 
3092 
3093 //=================================================================================================
3094 //
3095 // UNARYMAPTRAIT SPECIALIZATIONS
3096 //
3097 //=================================================================================================
3098 
3099 //*************************************************************************************************
3101 template< typename T, bool TF, typename OP >
3102 struct UnaryMapTrait< DynamicVector<T,TF>, OP >
3103 {
3104  using Type = DynamicVector< UnaryMapTrait_<T,OP>, TF >;
3105 };
3107 //*************************************************************************************************
3108 
3109 
3110 
3111 
3112 //=================================================================================================
3113 //
3114 // BINARYMAPTRAIT SPECIALIZATIONS
3115 //
3116 //=================================================================================================
3117 
3118 //*************************************************************************************************
3120 template< typename T1, bool TF, typename T2, size_t N, typename OP >
3121 struct BinaryMapTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF>, OP >
3122 {
3123  using Type = StaticVector< BinaryMapTrait_<T1,T2,OP>, N, TF >;
3124 };
3125 
3126 template< typename T1, size_t N, bool TF, typename T2, typename OP >
3127 struct BinaryMapTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF>, OP >
3128 {
3129  using Type = StaticVector< BinaryMapTrait_<T1,T2,OP>, N, TF >;
3130 };
3131 
3132 template< typename T1, bool TF, typename T2, size_t N, typename OP >
3133 struct BinaryMapTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF>, OP >
3134 {
3135  using Type = HybridVector< BinaryMapTrait_<T1,T2,OP>, N, TF >;
3136 };
3137 
3138 template< typename T1, size_t N, bool TF, typename T2, typename OP >
3139 struct BinaryMapTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF>, OP >
3140 {
3141  using Type = HybridVector< BinaryMapTrait_<T1,T2,OP>, N, TF >;
3142 };
3143 
3144 template< typename T1, bool TF, typename T2, typename OP >
3145 struct BinaryMapTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF>, OP >
3146 {
3147  using Type = DynamicVector< BinaryMapTrait_<T1,T2,OP>, TF >;
3148 };
3150 //*************************************************************************************************
3151 
3152 
3153 
3154 
3155 //=================================================================================================
3156 //
3157 // HIGHTYPE SPECIALIZATIONS
3158 //
3159 //=================================================================================================
3160 
3161 //*************************************************************************************************
3163 template< typename T1, bool TF, typename T2 >
3164 struct HighType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3165 {
3167 };
3169 //*************************************************************************************************
3170 
3171 
3172 
3173 
3174 //=================================================================================================
3175 //
3176 // LOWTYPE SPECIALIZATIONS
3177 //
3178 //=================================================================================================
3179 
3180 //*************************************************************************************************
3182 template< typename T1, bool TF, typename T2 >
3183 struct LowType< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
3184 {
3186 };
3188 //*************************************************************************************************
3189 
3190 
3191 
3192 
3193 //=================================================================================================
3194 //
3195 // SUBVECTORTRAIT SPECIALIZATIONS
3196 //
3197 //=================================================================================================
3198 
3199 //*************************************************************************************************
3201 template< typename T, bool TF >
3202 struct SubvectorTrait< DynamicVector<T,TF> >
3203 {
3204  using Type = DynamicVector<T,TF>;
3205 };
3207 //*************************************************************************************************
3208 
3209 } // namespace blaze
3210 
3211 #endif
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
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, a compilation error is created.
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:2015
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DynamicVector.h:1929
Header file for auxiliary alias declarations.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:484
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:171
Header file for mathematical functions.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:199
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: DynamicVector.h:1952
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:1397
const SIMDType load() const noexcept
Load of the SIMD element at the current iterator position.
Definition: DenseIterator.h:403
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: DynamicVector.h:1414
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
void clear()
Clearing the vector.
Definition: DynamicVector.h:1484
Header file for the serial shim.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
bool isIntact() const noexcept
Returns whether the invariants of the dynamic vector are intact.
Definition: DynamicVector.h:1727
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1822
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
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:1984
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:171
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:938
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:183
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:212
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1867
Constraint on the data type.
Base template for the CrossTrait class.
Definition: CrossTrait.h:116
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Header file for the std::initializer_list aliases.
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:120
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:770
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Iterator begin() noexcept
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:910
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
EnableIf_< IsBuiltin< T >, T *> allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:155
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: DynamicVector.h:1899
Header file for the DisableIf class template.
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1522
Header file for the multiplication trait.
Header file for the unary map trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5924
Header file for the IsShrinkable type trait.
Header file for all forward declarations of the math module.
#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.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
DynamicVector() noexcept
The default constructor for DynamicVector.
Definition: DynamicVector.h:518
#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:1428
Header file for the HasSIMDAdd type trait.
Header file for the DenseIterator class template.
void stream(const SIMDType &value) const noexcept
Aligned, non-temporal store of the SIMD element at the current iterator position. ...
Definition: DenseIterator.h:531
Header file for the subvector trait.
Header file for all SIMD functionality.
Constraint on the data type.
void store(const SIMDType &value) const noexcept
Store of the SIMD element at the current iterator position.
Definition: DenseIterator.h:468
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:150
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
void reset()
Reset to the default initial values.
Definition: DynamicVector.h:1466
Resize mechanism to obtain a DynamicVector with a different fixed number of elements.
Definition: DynamicVector.h:219
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1803
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:797
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:980
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:482
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
#define BLAZE_RESTRICT
Platform dependent setup of the restrict keyword.
Definition: Restrict.h:81
#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
Constraint on the data type.
Header file for the exception macros of the math module.
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:119
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:159
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
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:1844
Header file for the IsVectorizable type trait.
Compile time check for shrinkable data types.This type trait tests whether the given data type is a s...
Definition: IsShrinkable.h:75
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:483
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:194
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< 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:75
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: DynamicVector.h:193
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
Header file for the HasSIMDMult type trait.
Header file for the binary map trait.
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:188
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:198
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: DynamicVector.h:880
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
Headerfile for the generic transfer algorithm.
Type & Reference
Reference to a non-constant vector value.
Definition: DynamicVector.h:197
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1570
size_t addPadding(size_t value) const noexcept
Add the necessary amount of padding to the given value.
Definition: DynamicVector.h:1662
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
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, a compilation error is created.
Definition: Reference.h:79
Rebind mechanism to obtain a DynamicVector with different data/element type.
Definition: DynamicVector.h:210
Header file for the isDefault shim.
System settings for the restrict keyword.
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:819
Header file for the HasMutableDataAccess type trait.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1588
#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
DenseIterator< const Type, aligned > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:203
void swap(DynamicVector &v) noexcept
Swapping the contents of two vectors.
Definition: DynamicVector.h:1642
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1445
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Base template for the DivTrait class.
Definition: DivTrait.h:139
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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:1785
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:192
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: DynamicVector.h:1625
Iterator end() noexcept
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:952
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:177
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
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:130
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:200
DynamicVector & operator=(const Type &rhs)
Homogenous assignment to all vector elements.
Definition: DynamicVector.h:1003
Header file for the IntegralConstant class template.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
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:838
DenseIterator< Type, aligned > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:202
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
System settings for the inline keywords.
#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:1765
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.