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 <stdexcept>
48 #include <blaze/math/Forward.h>
49 #include <blaze/math/Intrinsics.h>
50 #include <blaze/math/shims/Clear.h>
65 #include <blaze/system/CacheSize.h>
66 #include <blaze/system/Inline.h>
67 #include <blaze/system/Restrict.h>
68 #include <blaze/system/Streaming.h>
71 #include <blaze/util/Assert.h>
78 #include <blaze/util/DisableIf.h>
79 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/Memory.h>
81 #include <blaze/util/Null.h>
82 #include <blaze/util/Template.h>
83 #include <blaze/util/Types.h>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS DEFINITION
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
161 template< typename Type // Data type of the vector
162  , bool TF = defaultTransposeFlag > // Transpose flag
163 class DynamicVector : public DenseVector< DynamicVector<Type,TF>, TF >
164 {
165  private:
166  //**Type definitions****************************************************************************
168  //**********************************************************************************************
169 
170  public:
171  //**Type definitions****************************************************************************
173  typedef This ResultType;
175  typedef Type ElementType;
176  typedef typename IT::Type IntrinsicType;
177  typedef const Type& ReturnType;
178  typedef const DynamicVector& CompositeType;
179  typedef Type& Reference;
180  typedef const Type& ConstReference;
181  typedef Type* Pointer;
182  typedef const Type* ConstPointer;
185  //**********************************************************************************************
186 
187  //**Rebind struct definition********************************************************************
190  template< typename ET > // Data type of the other vector
191  struct Rebind {
193  };
194  //**********************************************************************************************
195 
196  //**Compilation flags***************************************************************************
198 
202  enum { vectorizable = IsVectorizable<Type>::value };
203 
205 
208  enum { smpAssignable = !IsSMPAssignable<Type>::value };
209  //**********************************************************************************************
210 
211  //**Constructors********************************************************************************
214  explicit inline DynamicVector();
215  explicit inline DynamicVector( size_t n );
216  explicit inline DynamicVector( size_t n, const Type& init );
217  template< typename Other > explicit inline DynamicVector( size_t n, const Other* array );
218 
219  template< typename Other, size_t N >
220  explicit inline DynamicVector( const Other (&array)[N] );
221 
222  inline DynamicVector( const DynamicVector& v );
223  template< typename VT > inline DynamicVector( const Vector<VT,TF>& v );
225  //**********************************************************************************************
226 
227  //**Destructor**********************************************************************************
230  inline ~DynamicVector();
232  //**********************************************************************************************
233 
234  //**Data access functions***********************************************************************
237  inline Reference operator[]( size_t index );
238  inline ConstReference operator[]( size_t index ) const;
239  inline Pointer data ();
240  inline ConstPointer data () const;
241  inline Iterator begin ();
242  inline ConstIterator begin () const;
243  inline ConstIterator cbegin() const;
244  inline Iterator end ();
245  inline ConstIterator end () const;
246  inline ConstIterator cend () const;
248  //**********************************************************************************************
249 
250  //**Assignment operators************************************************************************
253  template< typename Other, size_t N >
254  inline DynamicVector& operator=( const Other (&array)[N] );
255 
256  inline DynamicVector& operator= ( const Type& rhs );
257  inline DynamicVector& operator= ( const DynamicVector& rhs );
258  template< typename VT > inline DynamicVector& operator= ( const Vector<VT,TF>& rhs );
259  template< typename VT > inline DynamicVector& operator+=( const Vector<VT,TF>& rhs );
260  template< typename VT > inline DynamicVector& operator-=( const Vector<VT,TF>& rhs );
261  template< typename VT > inline DynamicVector& operator*=( const Vector<VT,TF>& rhs );
262 
263  template< typename Other >
264  inline typename EnableIf< IsNumeric<Other>, DynamicVector >::Type&
265  operator*=( Other rhs );
266 
267  template< typename Other >
268  inline typename EnableIf< IsNumeric<Other>, DynamicVector >::Type&
269  operator/=( Other rhs );
271  //**********************************************************************************************
272 
273  //**Utility functions***************************************************************************
276  inline size_t size() const;
277  inline size_t capacity() const;
278  inline size_t nonZeros() const;
279  inline void reset();
280  inline void clear();
281  inline void resize( size_t n, bool preserve=true );
282  inline void extend( size_t n, bool preserve=true );
283  inline void reserve( size_t n );
284  template< typename Other > inline DynamicVector& scale( const Other& scalar );
285  inline void swap( DynamicVector& v ) /* throw() */;
287  //**********************************************************************************************
288 
289  private:
290  //**********************************************************************************************
292  template< typename VT >
294  struct VectorizedAssign {
295  enum { value = vectorizable && VT::vectorizable &&
296  IsSame<Type,typename VT::ElementType>::value };
297  };
299  //**********************************************************************************************
300 
301  //**********************************************************************************************
303  template< typename VT >
305  struct VectorizedAddAssign {
306  enum { value = vectorizable && VT::vectorizable &&
307  IsSame<Type,typename VT::ElementType>::value &&
308  IntrinsicTrait<Type>::addition };
309  };
311  //**********************************************************************************************
312 
313  //**********************************************************************************************
315  template< typename VT >
317  struct VectorizedSubAssign {
318  enum { value = vectorizable && VT::vectorizable &&
319  IsSame<Type,typename VT::ElementType>::value &&
320  IntrinsicTrait<Type>::subtraction };
321  };
323  //**********************************************************************************************
324 
325  //**********************************************************************************************
327  template< typename VT >
329  struct VectorizedMultAssign {
330  enum { value = vectorizable && VT::vectorizable &&
331  IsSame<Type,typename VT::ElementType>::value &&
332  IntrinsicTrait<Type>::multiplication };
333  };
335  //**********************************************************************************************
336 
337  public:
338  //**Expression template evaluation functions****************************************************
341  template< typename Other > inline bool canAlias ( const Other* alias ) const;
342  template< typename Other > inline bool isAliased( const Other* alias ) const;
343 
344  inline bool isAligned () const;
345  inline bool canSMPAssign() const;
346 
347  BLAZE_ALWAYS_INLINE IntrinsicType load ( size_t index ) const;
348  BLAZE_ALWAYS_INLINE IntrinsicType loadu( size_t index ) const;
349 
350  BLAZE_ALWAYS_INLINE void store ( size_t index, const IntrinsicType& value );
351  BLAZE_ALWAYS_INLINE void storeu( size_t index, const IntrinsicType& value );
352  BLAZE_ALWAYS_INLINE void stream( size_t index, const IntrinsicType& value );
353 
354  template< typename VT >
355  inline typename DisableIf< VectorizedAssign<VT> >::Type
356  assign( const DenseVector<VT,TF>& rhs );
357 
358  template< typename VT >
359  inline typename EnableIf< VectorizedAssign<VT> >::Type
360  assign( const DenseVector<VT,TF>& rhs );
361 
362  template< typename VT > inline void assign( const SparseVector<VT,TF>& rhs );
363 
364  template< typename VT >
365  inline typename DisableIf< VectorizedAddAssign<VT> >::Type
366  addAssign( const DenseVector<VT,TF>& rhs );
367 
368  template< typename VT >
369  inline typename EnableIf< VectorizedAddAssign<VT> >::Type
370  addAssign( const DenseVector<VT,TF>& rhs );
371 
372  template< typename VT > inline void addAssign( const SparseVector<VT,TF>& rhs );
373 
374  template< typename VT >
375  inline typename DisableIf< VectorizedSubAssign<VT> >::Type
376  subAssign( const DenseVector<VT,TF>& rhs );
377 
378  template< typename VT >
379  inline typename EnableIf< VectorizedSubAssign<VT> >::Type
380  subAssign( const DenseVector<VT,TF>& rhs );
381 
382  template< typename VT > inline void subAssign( const SparseVector<VT,TF>& rhs );
383 
384  template< typename VT >
385  inline typename DisableIf< VectorizedMultAssign<VT> >::Type
386  multAssign( const DenseVector<VT,TF>& rhs );
387 
388  template< typename VT >
389  inline typename EnableIf< VectorizedMultAssign<VT> >::Type
390  multAssign( const DenseVector<VT,TF>& rhs );
391 
392  template< typename VT > inline void multAssign( const SparseVector<VT,TF>& rhs );
394  //**********************************************************************************************
395 
396  private:
397  //**Utility functions***************************************************************************
400  inline size_t adjustCapacity( size_t minCapacity ) const;
402  //**********************************************************************************************
403 
404  //**Member variables****************************************************************************
407  size_t size_;
408  size_t capacity_;
410 
416  //**********************************************************************************************
417 
418  //**Compile time checks*************************************************************************
425  //**********************************************************************************************
426 };
427 //*************************************************************************************************
428 
429 
430 
431 
432 //=================================================================================================
433 //
434 // CONSTRUCTORS
435 //
436 //=================================================================================================
437 
438 //*************************************************************************************************
441 template< typename Type // Data type of the vector
442  , bool TF > // Transpose flag
444  : size_ ( 0UL ) // The current size/dimension of the vector
445  , capacity_( 0UL ) // The maximum capacity of the vector
446  , v_ ( NULL ) // The vector elements
447 {}
448 //*************************************************************************************************
449 
450 
451 //*************************************************************************************************
459 template< typename Type // Data type of the vector
460  , bool TF > // Transpose flag
462  : size_ ( n ) // The current size/dimension of the vector
463  , capacity_( adjustCapacity( n ) ) // The maximum capacity of the vector
464  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
465 {
467  for( size_t i=size_; i<capacity_; ++i )
468  v_[i] = Type();
469  }
470 }
471 //*************************************************************************************************
472 
473 
474 //*************************************************************************************************
482 template< typename Type // Data type of the vector
483  , bool TF > // Transpose flag
484 inline DynamicVector<Type,TF>::DynamicVector( size_t n, const Type& init )
485  : size_ ( n ) // The current size/dimension of the vector
486  , capacity_( adjustCapacity( n ) ) // The maximum capacity of the vector
487  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
488 {
489  for( size_t i=0UL; i<size_; ++i )
490  v_[i] = init;
491 
493  for( size_t i=size_; i<capacity_; ++i )
494  v_[i] = Type();
495  }
496 }
497 //*************************************************************************************************
498 
499 
500 //*************************************************************************************************
520 template< typename Type // Data type of the vector
521  , bool TF > // Transpose flag
522 template< typename Other > // Data type of the initialization array
523 inline DynamicVector<Type,TF>::DynamicVector( size_t n, const Other* array )
524  : size_ ( n ) // The current size/dimension of the vector
525  , capacity_( adjustCapacity( n ) ) // The maximum capacity of the vector
526  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
527 {
528  for( size_t i=0UL; i<n; ++i )
529  v_[i] = array[i];
530 
532  for( size_t i=n; i<capacity_; ++i )
533  v_[i] = Type();
534  }
535 }
536 //*************************************************************************************************
537 
538 
539 //*************************************************************************************************
556 template< typename Type // Data type of the vector
557  , bool TF > // Transpose flag
558 template< typename Other // Data type of the initialization array
559  , size_t N > // Dimension of the initialization array
560 inline DynamicVector<Type,TF>::DynamicVector( const Other (&array)[N] )
561  : size_ ( N ) // The current size/dimension of the vector
562  , capacity_( adjustCapacity( N ) ) // The maximum capacity of the vector
563  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
564 {
565  for( size_t i=0UL; i<N; ++i )
566  v_[i] = array[i];
567 
569  for( size_t i=N; i<capacity_; ++i )
570  v_[i] = Type();
571  }
572 }
573 //*************************************************************************************************
574 
575 
576 //*************************************************************************************************
584 template< typename Type // Data type of the vector
585  , bool TF > // Transpose flag
587  : size_ ( v.size_ ) // The current size/dimension of the vector
588  , capacity_( adjustCapacity( v.size_ ) ) // The maximum capacity of the vector
589  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
590 {
591  BLAZE_INTERNAL_ASSERT( capacity_ <= v.capacity_, "Invalid capacity estimation" );
592 
593  for( size_t i=0UL; i<capacity_; ++i )
594  v_[i] = v.v_[i];
595 }
596 //*************************************************************************************************
597 
598 
599 //*************************************************************************************************
604 template< typename Type // Data type of the vector
605  , bool TF > // Transpose flag
606 template< typename VT > // Type of the foreign vector
608  : size_ ( (~v).size() ) // The current size/dimension of the vector
609  , capacity_( adjustCapacity( size_ ) ) // The maximum capacity of the vector
610  , v_ ( allocate<Type>( capacity_ ) ) // The vector elements
611 {
612  for( size_t i=( IsSparseVector<VT>::value ? 0UL : size_ );
613  i<( IsVectorizable<Type>::value ? capacity_ : size_ ); ++i ) {
614  v_[i] = Type();
615  }
616 
617  smpAssign( *this, ~v );
618 }
619 //*************************************************************************************************
620 
621 
622 
623 
624 //=================================================================================================
625 //
626 // DESTRUCTOR
627 //
628 //=================================================================================================
629 
630 //*************************************************************************************************
633 template< typename Type // Data type of the vector
634  , bool TF > // Transpose flag
636 {
637  deallocate( v_ );
638 }
639 //*************************************************************************************************
640 
641 
642 
643 
644 //=================================================================================================
645 //
646 // DATA ACCESS FUNCTIONS
647 //
648 //=================================================================================================
649 
650 //*************************************************************************************************
656 template< typename Type // Data type of the vector
657  , bool TF > // Transpose flag
658 inline typename DynamicVector<Type,TF>::Reference
660 {
661  BLAZE_USER_ASSERT( index < size_, "Invalid vector access index" );
662  return v_[index];
663 }
664 //*************************************************************************************************
665 
666 
667 //*************************************************************************************************
673 template< typename Type // Data type of the vector
674  , bool TF > // Transpose flag
677 {
678  BLAZE_USER_ASSERT( index < size_, "Invalid vector access index" );
679  return v_[index];
680 }
681 //*************************************************************************************************
682 
683 
684 //*************************************************************************************************
691 template< typename Type // Data type of the vector
692  , bool TF > // Transpose flag
694 {
695  return v_;
696 }
697 //*************************************************************************************************
698 
699 
700 //*************************************************************************************************
707 template< typename Type // Data type of the vector
708  , bool TF > // Transpose flag
710 {
711  return v_;
712 }
713 //*************************************************************************************************
714 
715 
716 //*************************************************************************************************
721 template< typename Type // Data type of the vector
722  , bool TF > // Transpose flag
724 {
725  return Iterator( v_ );
726 }
727 //*************************************************************************************************
728 
729 
730 //*************************************************************************************************
735 template< typename Type // Data type of the vector
736  , bool TF > // Transpose flag
738 {
739  return ConstIterator( v_ );
740 }
741 //*************************************************************************************************
742 
743 
744 //*************************************************************************************************
749 template< typename Type // Data type of the vector
750  , bool TF > // Transpose flag
752 {
753  return ConstIterator( v_ );
754 }
755 //*************************************************************************************************
756 
757 
758 //*************************************************************************************************
763 template< typename Type // Data type of the vector
764  , bool TF > // Transpose flag
766 {
767  return Iterator( v_ + size_ );
768 }
769 //*************************************************************************************************
770 
771 
772 //*************************************************************************************************
777 template< typename Type // Data type of the vector
778  , bool TF > // Transpose flag
780 {
781  return ConstIterator( v_ + size_ );
782 }
783 //*************************************************************************************************
784 
785 
786 //*************************************************************************************************
791 template< typename Type // Data type of the vector
792  , bool TF > // Transpose flag
794 {
795  return ConstIterator( v_ + size_ );
796 }
797 //*************************************************************************************************
798 
799 
800 
801 
802 //=================================================================================================
803 //
804 // ASSIGNMENT OPERATORS
805 //
806 //=================================================================================================
807 
808 //*************************************************************************************************
826 template< typename Type // Data type of the vector
827  , bool TF > // Transpose flag
828 template< typename Other // Data type of the initialization array
829  , size_t N > // Dimension of the initialization array
831 {
832  resize( N, false );
833 
834  for( size_t i=0UL; i<N; ++i )
835  v_[i] = array[i];
836 
837  return *this;
838 }
839 //*************************************************************************************************
840 
841 
842 //*************************************************************************************************
848 template< typename Type // Data type of the vector
849  , bool TF > // Transpose flag
851 {
852  for( size_t i=0UL; i<size_; ++i )
853  v_[i] = rhs;
854  return *this;
855 }
856 //*************************************************************************************************
857 
858 
859 //*************************************************************************************************
868 template< typename Type // Data type of the vector
869  , bool TF > // Transpose flag
871 {
872  if( &rhs == this ) return *this;
873 
874  resize( rhs.size_, false );
875  smpAssign( *this, ~rhs );
876 
877  return *this;
878 }
879 //*************************************************************************************************
880 
881 
882 //*************************************************************************************************
890 template< typename Type // Data type of the vector
891  , bool TF > // Transpose flag
892 template< typename VT > // Type of the right-hand side vector
894 {
895  if( (~rhs).canAlias( this ) ) {
896  DynamicVector tmp( ~rhs );
897  swap( tmp );
898  }
899  else {
900  resize( (~rhs).size(), false );
902  reset();
903  smpAssign( *this, ~rhs );
904  }
905 
906  return *this;
907 }
908 //*************************************************************************************************
909 
910 
911 //*************************************************************************************************
921 template< typename Type // Data type of the vector
922  , bool TF > // Transpose flag
923 template< typename VT > // Type of the right-hand side vector
925 {
926  if( (~rhs).size() != size_ )
927  throw std::invalid_argument( "Vector sizes do not match" );
928 
929  if( (~rhs).canAlias( this ) ) {
930  typename VT::ResultType tmp( ~rhs );
931  smpAddAssign( *this, tmp );
932  }
933  else {
934  smpAddAssign( *this, ~rhs );
935  }
936 
937  return *this;
938 }
939 //*************************************************************************************************
940 
941 
942 //*************************************************************************************************
953 template< typename Type // Data type of the vector
954  , bool TF > // Transpose flag
955 template< typename VT > // Type of the right-hand side vector
957 {
958  if( (~rhs).size() != size_ )
959  throw std::invalid_argument( "Vector sizes do not match" );
960 
961  if( (~rhs).canAlias( this ) ) {
962  typename VT::ResultType tmp( ~rhs );
963  smpSubAssign( *this, tmp );
964  }
965  else {
966  smpSubAssign( *this, ~rhs );
967  }
968 
969  return *this;
970 }
971 //*************************************************************************************************
972 
973 
974 //*************************************************************************************************
985 template< typename Type // Data type of the vector
986  , bool TF > // Transpose flag
987 template< typename VT > // Type of the right-hand side vector
989 {
990  if( (~rhs).size() != size_ )
991  throw std::invalid_argument( "Vector sizes do not match" );
992 
993  if( (~rhs).canAlias( this ) || IsSparseVector<VT>::value ) {
994  DynamicVector<Type,TF> tmp( *this * (~rhs) );
995  swap( tmp );
996  }
997  else {
998  smpMultAssign( *this, ~rhs );
999  }
1000 
1001  return *this;
1002 }
1003 //*************************************************************************************************
1004 
1005 
1006 //*************************************************************************************************
1013 template< typename Type // Data type of the vector
1014  , bool TF > // Transpose flag
1015 template< typename Other > // Data type of the right-hand side scalar
1016 inline typename EnableIf< IsNumeric<Other>, DynamicVector<Type,TF> >::Type&
1018 {
1019  smpAssign( *this, (*this) * rhs );
1020  return *this;
1021 }
1022 //*************************************************************************************************
1023 
1024 
1025 //*************************************************************************************************
1034 template< typename Type // Data type of the vector
1035  , bool TF > // Transpose flag
1036 template< typename Other > // Data type of the right-hand side scalar
1037 inline typename EnableIf< IsNumeric<Other>, DynamicVector<Type,TF> >::Type&
1039 {
1040  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1041 
1042  smpAssign( *this, (*this) / rhs );
1043  return *this;
1044 }
1045 //*************************************************************************************************
1046 
1047 
1048 
1049 
1050 //=================================================================================================
1051 //
1052 // UTILITY FUNCTIONS
1053 //
1054 //=================================================================================================
1055 
1056 //*************************************************************************************************
1061 template< typename Type // Data type of the vector
1062  , bool TF > // Transpose flag
1063 inline size_t DynamicVector<Type,TF>::size() const
1064 {
1065  return size_;
1066 }
1067 //*************************************************************************************************
1068 
1069 
1070 //*************************************************************************************************
1075 template< typename Type // Data type of the vector
1076  , bool TF > // Transpose flag
1078 {
1079  return capacity_;
1080 }
1081 //*************************************************************************************************
1082 
1083 
1084 //*************************************************************************************************
1092 template< typename Type // Data type of the vector
1093  , bool TF > // Transpose flag
1095 {
1096  size_t nonzeros( 0 );
1097 
1098  for( size_t i=0UL; i<size_; ++i ) {
1099  if( !isDefault( v_[i] ) )
1100  ++nonzeros;
1101  }
1102 
1103  return nonzeros;
1104 }
1105 //*************************************************************************************************
1106 
1107 
1108 //*************************************************************************************************
1113 template< typename Type // Data type of the vector
1114  , bool TF > // Transpose flag
1116 {
1117  using blaze::clear;
1118  for( size_t i=0UL; i<size_; ++i )
1119  clear( v_[i] );
1120 }
1121 //*************************************************************************************************
1122 
1123 
1124 //*************************************************************************************************
1131 template< typename Type // Data type of the vector
1132  , bool TF > // Transpose flag
1134 {
1135  resize( 0UL, false );
1136 }
1137 //*************************************************************************************************
1138 
1139 
1140 //*************************************************************************************************
1169 template< typename Type // Data type of the vector
1170  , bool TF > // Transpose flag
1171 inline void DynamicVector<Type,TF>::resize( size_t n, bool preserve )
1172 {
1173  if( n > capacity_ )
1174  {
1175  // Allocating a new array
1176  const size_t newCapacity( adjustCapacity( n ) );
1177  Type* BLAZE_RESTRICT tmp = allocate<Type>( newCapacity );
1178 
1179  // Initializing the new array
1180  if( preserve ) {
1181  std::copy( v_, v_+size_, tmp );
1182  }
1183 
1185  for( size_t i=size_; i<newCapacity; ++i )
1186  tmp[i] = Type();
1187  }
1188 
1189  // Replacing the old array
1190  std::swap( v_, tmp );
1191  deallocate( tmp );
1192  capacity_ = newCapacity;
1193  }
1194  else if( IsVectorizable<Type>::value && n < size_ )
1195  {
1196  for( size_t i=n; i<size_; ++i )
1197  v_[i] = Type();
1198  }
1199 
1200  size_ = n;
1201 }
1202 //*************************************************************************************************
1203 
1204 
1205 //*************************************************************************************************
1217 template< typename Type // Data type of the vector
1218  , bool TF > // Transpose flag
1219 inline void DynamicVector<Type,TF>::extend( size_t n, bool preserve )
1220 {
1221  resize( size_+n, preserve );
1222 }
1223 //*************************************************************************************************
1224 
1225 
1226 //*************************************************************************************************
1235 template< typename Type // Data type of the vector
1236  , bool TF > // Transpose flag
1237 inline void DynamicVector<Type,TF>::reserve( size_t n )
1238 {
1239  if( n > capacity_ )
1240  {
1241  // Allocating a new array
1242  const size_t newCapacity( adjustCapacity( n ) );
1243  Type* BLAZE_RESTRICT tmp = allocate<Type>( newCapacity );
1244 
1245  // Initializing the new array
1246  std::copy( v_, v_+size_, tmp );
1247 
1249  for( size_t i=size_; i<newCapacity; ++i )
1250  tmp[i] = Type();
1251  }
1252 
1253  // Replacing the old array
1254  std::swap( tmp, v_ );
1255  deallocate( tmp );
1256  capacity_ = newCapacity;
1257  }
1258 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1268 template< typename Type // Data type of the vector
1269  , bool TF > // Transpose flag
1270 template< typename Other > // Data type of the scalar value
1272 {
1273  for( size_t i=0UL; i<size_; ++i )
1274  v_[i] *= scalar;
1275  return *this;
1276 }
1277 //*************************************************************************************************
1278 
1279 
1280 //*************************************************************************************************
1287 template< typename Type // Data type of the vector
1288  , bool TF > // Transpose flag
1289 inline void DynamicVector<Type,TF>::swap( DynamicVector& v ) /* throw() */
1290 {
1291  std::swap( size_, v.size_ );
1293  std::swap( v_, v.v_ );
1294 }
1295 //*************************************************************************************************
1296 
1297 
1298 //*************************************************************************************************
1304 template< typename Type // Data type of the vector
1305  , bool TF > // Transpose flag
1306 inline size_t DynamicVector<Type,TF>::adjustCapacity( size_t minCapacity ) const
1307 {
1309  return minCapacity + ( IT::size - ( minCapacity % IT::size ) ) % IT::size;
1310  else return minCapacity;
1311 }
1312 //*************************************************************************************************
1313 
1314 
1315 
1316 
1317 //=================================================================================================
1318 //
1319 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1320 //
1321 //=================================================================================================
1322 
1323 //*************************************************************************************************
1333 template< typename Type // Data type of the vector
1334  , bool TF > // Transpose flag
1335 template< typename Other > // Data type of the foreign expression
1336 inline bool DynamicVector<Type,TF>::canAlias( const Other* alias ) const
1337 {
1338  return static_cast<const void*>( this ) == static_cast<const void*>( alias );
1339 }
1340 //*************************************************************************************************
1341 
1342 
1343 //*************************************************************************************************
1353 template< typename Type // Data type of the vector
1354  , bool TF > // Transpose flag
1355 template< typename Other > // Data type of the foreign expression
1356 inline bool DynamicVector<Type,TF>::isAliased( const Other* alias ) const
1357 {
1358  return static_cast<const void*>( this ) == static_cast<const void*>( alias );
1359 }
1360 //*************************************************************************************************
1361 
1362 
1363 //*************************************************************************************************
1372 template< typename Type // Data type of the vector
1373  , bool TF > // Transpose flag
1375 {
1376  return true;
1377 }
1378 //*************************************************************************************************
1379 
1380 
1381 //*************************************************************************************************
1391 template< typename Type // Data type of the vector
1392  , bool TF > // Transpose flag
1394 {
1395  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1396 }
1397 //*************************************************************************************************
1398 
1399 
1400 //*************************************************************************************************
1413 template< typename Type // Data type of the vector
1414  , bool TF > // Transpose flag
1416  DynamicVector<Type,TF>::load( size_t index ) const
1417 {
1418  using blaze::load;
1419 
1421 
1422  BLAZE_INTERNAL_ASSERT( index < size_ , "Invalid vector access index" );
1423  BLAZE_INTERNAL_ASSERT( index + IT::size <= capacity_, "Invalid vector access index" );
1424  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL , "Invalid vector access index" );
1425 
1426  return load( v_+index );
1427 }
1428 //*************************************************************************************************
1429 
1430 
1431 //*************************************************************************************************
1444 template< typename Type // Data type of the vector
1445  , bool TF > // Transpose flag
1447  DynamicVector<Type,TF>::loadu( size_t index ) const
1448 {
1449  using blaze::loadu;
1450 
1452 
1453  BLAZE_INTERNAL_ASSERT( index < size_ , "Invalid vector access index" );
1454  BLAZE_INTERNAL_ASSERT( index + IT::size <= capacity_, "Invalid vector access index" );
1455 
1456  return loadu( v_+index );
1457 }
1458 //*************************************************************************************************
1459 
1460 
1461 //*************************************************************************************************
1475 template< typename Type // Data type of the vector
1476  , bool TF > // Transpose flag
1477 BLAZE_ALWAYS_INLINE void DynamicVector<Type,TF>::store( size_t index, const IntrinsicType& value )
1478 {
1479  using blaze::store;
1480 
1482 
1483  BLAZE_INTERNAL_ASSERT( index < size_ , "Invalid vector access index" );
1484  BLAZE_INTERNAL_ASSERT( index + IT::size <= capacity_, "Invalid vector access index" );
1485  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL , "Invalid vector access index" );
1486 
1487  store( v_+index, value );
1488 }
1489 //*************************************************************************************************
1490 
1491 
1492 //*************************************************************************************************
1506 template< typename Type // Data type of the vector
1507  , bool TF > // Transpose flag
1508 BLAZE_ALWAYS_INLINE void DynamicVector<Type,TF>::storeu( size_t index, const IntrinsicType& value )
1509 {
1510  using blaze::storeu;
1511 
1513 
1514  BLAZE_INTERNAL_ASSERT( index < size_ , "Invalid vector access index" );
1515  BLAZE_INTERNAL_ASSERT( index + IT::size <= capacity_, "Invalid vector access index" );
1516 
1517  storeu( v_+index, value );
1518 }
1519 //*************************************************************************************************
1520 
1521 
1522 //*************************************************************************************************
1536 template< typename Type // Data type of the vector
1537  , bool TF > // Transpose flag
1538 BLAZE_ALWAYS_INLINE void DynamicVector<Type,TF>::stream( size_t index, const IntrinsicType& value )
1539 {
1540  using blaze::stream;
1541 
1543 
1544  BLAZE_INTERNAL_ASSERT( index < size_ , "Invalid vector access index" );
1545  BLAZE_INTERNAL_ASSERT( index + IT::size <= capacity_, "Invalid vector access index" );
1546  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL , "Invalid vector access index" );
1547 
1548  stream( v_+index, value );
1549 }
1550 //*************************************************************************************************
1551 
1552 
1553 //*************************************************************************************************
1564 template< typename Type // Data type of the vector
1565  , bool TF > // Transpose flag
1566 template< typename VT > // Type of the right-hand side dense vector
1567 inline typename DisableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1569 {
1570  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1571 
1572  const size_t ipos( size_ & size_t(-2) );
1573  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
1574 
1575  for( size_t i=0UL; i<ipos; i+=2UL ) {
1576  v_[i ] = (~rhs)[i ];
1577  v_[i+1UL] = (~rhs)[i+1UL];
1578  }
1579  if( ipos < (~rhs).size() )
1580  v_[ipos] = (~rhs)[ipos];
1581 }
1582 //*************************************************************************************************
1583 
1584 
1585 //*************************************************************************************************
1596 template< typename Type // Data type of the vector
1597  , bool TF > // Transpose flag
1598 template< typename VT > // Type of the right-hand side dense vector
1599 inline typename EnableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedAssign<VT> >::Type
1601 {
1602  using blaze::store;
1603  using blaze::stream;
1604 
1605  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1606 
1608 
1609  if( useStreaming && size_ > ( cacheSize/( sizeof(Type) * 3UL ) ) && !(~rhs).isAliased( this ) )
1610  {
1611  for( size_t i=0UL; i<size_; i+=IT::size ) {
1612  stream( v_+i, (~rhs).load(i) );
1613  }
1614  }
1615  else
1616  {
1617  const size_t ipos( size_ & size_t(-IT::size*4) );
1618  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (IT::size*4UL) ) ) == ipos, "Invalid end calculation" );
1619 
1620  typename VT::ConstIterator it( (~rhs).begin() );
1621  for( size_t i=0UL; i<ipos; i+=IT::size*4UL ) {
1622  store( v_+i , it.load() ); it += IT::size;
1623  store( v_+i+IT::size , it.load() ); it += IT::size;
1624  store( v_+i+IT::size*2UL, it.load() ); it += IT::size;
1625  store( v_+i+IT::size*3UL, it.load() ); it += IT::size;
1626  }
1627  for( size_t i=ipos; i<size_; i+=IT::size, it+=IT::size ) {
1628  store( v_+i, it.load() );
1629  }
1630  }
1631 }
1632 //*************************************************************************************************
1633 
1634 
1635 //*************************************************************************************************
1646 template< typename Type // Data type of the vector
1647  , bool TF > // Transpose flag
1648 template< typename VT > // Type of the right-hand side sparse vector
1650 {
1651  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1652 
1653  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1654  v_[element->index()] = element->value();
1655 }
1656 //*************************************************************************************************
1657 
1658 
1659 //*************************************************************************************************
1670 template< typename Type // Data type of the vector
1671  , bool TF > // Transpose flag
1672 template< typename VT > // Type of the right-hand side dense vector
1673 inline typename DisableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1675 {
1676  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1677 
1678  const size_t ipos( size_ & size_t(-2) );
1679  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
1680 
1681  for( size_t i=0UL; i<ipos; i+=2UL ) {
1682  v_[i ] += (~rhs)[i ];
1683  v_[i+1UL] += (~rhs)[i+1UL];
1684  }
1685  if( ipos < (~rhs).size() )
1686  v_[ipos] += (~rhs)[ipos];
1687 }
1688 //*************************************************************************************************
1689 
1690 
1691 //*************************************************************************************************
1702 template< typename Type // Data type of the vector
1703  , bool TF > // Transpose flag
1704 template< typename VT > // Type of the right-hand side dense vector
1705 inline typename EnableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedAddAssign<VT> >::Type
1707 {
1708  using blaze::load;
1709  using blaze::store;
1710 
1711  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1712 
1714 
1715  const size_t ipos( size_ & size_t(-IT::size*4) );
1716  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (IT::size*4UL) ) ) == ipos, "Invalid end calculation" );
1717 
1718  typename VT::ConstIterator it( (~rhs).begin() );
1719  for( size_t i=0UL; i<ipos; i+=IT::size*4UL ) {
1720  store( v_+i , load(v_+i ) + it.load() ); it += IT::size;
1721  store( v_+i+IT::size , load(v_+i+IT::size ) + it.load() ); it += IT::size;
1722  store( v_+i+IT::size*2UL, load(v_+i+IT::size*2UL) + it.load() ); it += IT::size;
1723  store( v_+i+IT::size*3UL, load(v_+i+IT::size*3UL) + it.load() ); it += IT::size;
1724  }
1725  for( size_t i=ipos; i<size_; i+=IT::size, it+=IT::size ) {
1726  store( v_+i, load(v_+i) + it.load() );
1727  }
1728 }
1729 //*************************************************************************************************
1730 
1731 
1732 //*************************************************************************************************
1743 template< typename Type // Data type of the vector
1744  , bool TF > // Transpose flag
1745 template< typename VT > // Type of the right-hand side sparse vector
1747 {
1748  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1749 
1750  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1751  v_[element->index()] += element->value();
1752 }
1753 //*************************************************************************************************
1754 
1755 
1756 //*************************************************************************************************
1767 template< typename Type // Data type of the vector
1768  , bool TF > // Transpose flag
1769 template< typename VT > // Type of the right-hand side dense vector
1770 inline typename DisableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1772 {
1773  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1774 
1775  const size_t ipos( size_ & size_t(-2) );
1776  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
1777 
1778  for( size_t i=0UL; i<ipos; i+=2UL ) {
1779  v_[i ] -= (~rhs)[i ];
1780  v_[i+1UL] -= (~rhs)[i+1UL];
1781  }
1782  if( ipos < (~rhs).size() )
1783  v_[ipos] -= (~rhs)[ipos];
1784 }
1785 //*************************************************************************************************
1786 
1787 
1788 //*************************************************************************************************
1799 template< typename Type // Data type of the vector
1800  , bool TF > // Transpose flag
1801 template< typename VT > // Type of the right-hand side dense vector
1802 inline typename EnableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedSubAssign<VT> >::Type
1804 {
1805  using blaze::load;
1806  using blaze::store;
1807 
1808  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1809 
1811 
1812  const size_t ipos( size_ & size_t(-IT::size*4) );
1813  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (IT::size*4UL) ) ) == ipos, "Invalid end calculation" );
1814 
1815  typename VT::ConstIterator it( (~rhs).begin() );
1816  for( size_t i=0UL; i<ipos; i+=IT::size*4UL ) {
1817  store( v_+i , load(v_+i ) - it.load() ); it += IT::size;
1818  store( v_+i+IT::size , load(v_+i+IT::size ) - it.load() ); it += IT::size;
1819  store( v_+i+IT::size*2UL, load(v_+i+IT::size*2UL) - it.load() ); it += IT::size;
1820  store( v_+i+IT::size*3UL, load(v_+i+IT::size*3UL) - it.load() ); it += IT::size;
1821  }
1822  for( size_t i=ipos; i<size_; i+=IT::size, it+=IT::size ) {
1823  store( v_+i, load(v_+i) - it.load() );
1824  }
1825 }
1826 //*************************************************************************************************
1827 
1828 
1829 //*************************************************************************************************
1840 template< typename Type // Data type of the vector
1841  , bool TF > // Transpose flag
1842 template< typename VT > // Type of the right-hand side sparse vector
1844 {
1845  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1846 
1847  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1848  v_[element->index()] -= element->value();
1849 }
1850 //*************************************************************************************************
1851 
1852 
1853 //*************************************************************************************************
1864 template< typename Type // Data type of the vector
1865  , bool TF > // Transpose flag
1866 template< typename VT > // Type of the right-hand side dense vector
1867 inline typename DisableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1869 {
1870  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1871 
1872  const size_t ipos( size_ & size_t(-2) );
1873  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % 2UL ) ) == ipos, "Invalid end calculation" );
1874 
1875  for( size_t i=0UL; i<ipos; i+=2UL ) {
1876  v_[i ] *= (~rhs)[i ];
1877  v_[i+1UL] *= (~rhs)[i+1UL];
1878  }
1879  if( ipos < (~rhs).size() )
1880  v_[ipos] *= (~rhs)[ipos];
1881 }
1882 //*************************************************************************************************
1883 
1884 
1885 //*************************************************************************************************
1896 template< typename Type // Data type of the vector
1897  , bool TF > // Transpose flag
1898 template< typename VT > // Type of the right-hand side dense vector
1899 inline typename EnableIf< typename DynamicVector<Type,TF>::BLAZE_TEMPLATE VectorizedMultAssign<VT> >::Type
1901 {
1902  using blaze::load;
1903  using blaze::store;
1904 
1905  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1906 
1908 
1909  const size_t ipos( size_ & size_t(-IT::size*4) );
1910  BLAZE_INTERNAL_ASSERT( ( size_ - ( size_ % (IT::size*4UL) ) ) == ipos, "Invalid end calculation" );
1911 
1912  typename VT::ConstIterator it( (~rhs).begin() );
1913  for( size_t i=0UL; i<ipos; i+=IT::size*4UL ) {
1914  store( v_+i , load(v_+i ) * it.load() ); it += IT::size;
1915  store( v_+i+IT::size , load(v_+i+IT::size ) * it.load() ); it += IT::size;
1916  store( v_+i+IT::size*2UL, load(v_+i+IT::size*2UL) * it.load() ); it += IT::size;
1917  store( v_+i+IT::size*3UL, load(v_+i+IT::size*3UL) * it.load() ); it += IT::size;
1918  }
1919  for( size_t i=ipos; i<size_; i+=IT::size, it+=IT::size ) {
1920  store( v_+i, load(v_+i) * it.load() );
1921  }
1922 }
1923 //*************************************************************************************************
1924 
1925 
1926 //*************************************************************************************************
1937 template< typename Type // Data type of the vector
1938  , bool TF > // Transpose flag
1939 template< typename VT > // Type of the right-hand side sparse vector
1941 {
1942  BLAZE_INTERNAL_ASSERT( size_ == (~rhs).size(), "Invalid vector sizes" );
1943 
1944  const DynamicVector tmp( serial( *this ) );
1945 
1946  reset();
1947 
1948  for( typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1949  v_[element->index()] = tmp[element->index()] * element->value();
1950 }
1951 //*************************************************************************************************
1952 
1953 
1954 
1955 
1956 //=================================================================================================
1957 //
1958 // DYNAMICVECTOR OPERATORS
1959 //
1960 //=================================================================================================
1961 
1962 //*************************************************************************************************
1965 template< typename Type, bool TF >
1966 inline void reset( DynamicVector<Type,TF>& v );
1967 
1968 template< typename Type, bool TF >
1969 inline void clear( DynamicVector<Type,TF>& v );
1970 
1971 template< typename Type, bool TF >
1972 inline bool isDefault( const DynamicVector<Type,TF>& v );
1973 
1974 template< typename Type, bool TF >
1975 inline void swap( DynamicVector<Type,TF>& a, DynamicVector<Type,TF>& b ) /* throw() */;
1976 
1977 template< typename Type, bool TF >
1978 inline void move( DynamicVector<Type,TF>& dst, DynamicVector<Type,TF>& src ) /* throw() */;
1980 //*************************************************************************************************
1981 
1982 
1983 //*************************************************************************************************
1990 template< typename Type // Data type of the vector
1991  , bool TF > // Transpose flag
1993 {
1994  v.reset();
1995 }
1996 //*************************************************************************************************
1997 
1998 
1999 //*************************************************************************************************
2006 template< typename Type // Data type of the vector
2007  , bool TF > // Transpose flag
2009 {
2010  v.clear();
2011 }
2012 //*************************************************************************************************
2013 
2014 
2015 //*************************************************************************************************
2032 template< typename Type // Data type of the vector
2033  , bool TF > // Transpose flag
2034 inline bool isDefault( const DynamicVector<Type,TF>& v )
2035 {
2036  return ( v.size() == 0UL );
2037 }
2038 //*************************************************************************************************
2039 
2040 
2041 //*************************************************************************************************
2050 template< typename Type // Data type of the vector
2051  , bool TF > // Transpose flag
2052 inline void swap( DynamicVector<Type,TF>& a, DynamicVector<Type,TF>& b ) /* throw() */
2053 {
2054  a.swap( b );
2055 }
2056 //*************************************************************************************************
2057 
2058 
2059 //*************************************************************************************************
2068 template< typename Type // Data type of the vector
2069  , bool TF > // Transpose flag
2070 inline void move( DynamicVector<Type,TF>& dst, DynamicVector<Type,TF>& src ) /* throw() */
2071 {
2072  dst.swap( src );
2073 }
2074 //*************************************************************************************************
2075 
2076 
2077 
2078 
2079 //=================================================================================================
2080 //
2081 // HASCONSTDATAACCESS SPECIALIZATIONS
2082 //
2083 //=================================================================================================
2084 
2085 //*************************************************************************************************
2087 template< typename T, bool TF >
2088 struct HasConstDataAccess< DynamicVector<T,TF> > : public TrueType
2089 {
2090  enum { value = 1 };
2091  typedef TrueType Type;
2092 };
2094 //*************************************************************************************************
2095 
2096 
2097 
2098 
2099 //=================================================================================================
2100 //
2101 // HASMUTABLEDATAACCESS SPECIALIZATIONS
2102 //
2103 //=================================================================================================
2104 
2105 //*************************************************************************************************
2107 template< typename T, bool TF >
2108 struct HasMutableDataAccess< DynamicVector<T,TF> > : public TrueType
2109 {
2110  enum { value = 1 };
2111  typedef TrueType Type;
2112 };
2114 //*************************************************************************************************
2115 
2116 
2117 
2118 
2119 //=================================================================================================
2120 //
2121 // ISRESIZABLE SPECIALIZATIONS
2122 //
2123 //=================================================================================================
2124 
2125 //*************************************************************************************************
2127 template< typename T, bool TF >
2128 struct IsResizable< DynamicVector<T,TF> > : public TrueType
2129 {
2130  enum { value = 1 };
2131  typedef TrueType Type;
2132 };
2134 //*************************************************************************************************
2135 
2136 
2137 
2138 
2139 //=================================================================================================
2140 //
2141 // ADDTRAIT SPECIALIZATIONS
2142 //
2143 //=================================================================================================
2144 
2145 //*************************************************************************************************
2147 template< typename T1, bool TF, typename T2, size_t N >
2148 struct AddTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2149 {
2150  typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2151 };
2152 
2153 template< typename T1, size_t N, bool TF, typename T2 >
2154 struct AddTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2155 {
2156  typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2157 };
2158 
2159 template< typename T1, bool TF, typename T2, size_t N >
2160 struct AddTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2161 {
2162  typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2163 };
2164 
2165 template< typename T1, size_t N, bool TF, typename T2 >
2166 struct AddTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2167 {
2168  typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
2169 };
2170 
2171 template< typename T1, bool TF, typename T2 >
2172 struct AddTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2173 {
2174  typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
2175 };
2177 //*************************************************************************************************
2178 
2179 
2180 
2181 
2182 //=================================================================================================
2183 //
2184 // SUBTRAIT SPECIALIZATIONS
2185 //
2186 //=================================================================================================
2187 
2188 //*************************************************************************************************
2190 template< typename T1, bool TF, typename T2, size_t N >
2191 struct SubTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2192 {
2193  typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2194 };
2195 
2196 template< typename T1, size_t N, bool TF, typename T2 >
2197 struct SubTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2198 {
2199  typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2200 };
2201 
2202 template< typename T1, bool TF, typename T2, size_t N >
2203 struct SubTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2204 {
2205  typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2206 };
2207 
2208 template< typename T1, size_t N, bool TF, typename T2 >
2209 struct SubTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2210 {
2211  typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
2212 };
2213 
2214 template< typename T1, bool TF, typename T2 >
2215 struct SubTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2216 {
2217  typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
2218 };
2220 //*************************************************************************************************
2221 
2222 
2223 
2224 
2225 //=================================================================================================
2226 //
2227 // MULTTRAIT SPECIALIZATIONS
2228 //
2229 //=================================================================================================
2230 
2231 //*************************************************************************************************
2233 template< typename T1, bool TF, typename T2 >
2234 struct MultTrait< DynamicVector<T1,TF>, T2 >
2235 {
2236  typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2238 };
2239 
2240 template< typename T1, typename T2, bool TF >
2241 struct MultTrait< T1, DynamicVector<T2,TF> >
2242 {
2243  typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2245 };
2246 
2247 template< typename T1, bool TF, typename T2, size_t N >
2248 struct MultTrait< DynamicVector<T1,TF>, StaticVector<T2,N,TF> >
2249 {
2250  typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2251 };
2252 
2253 template< typename T1, typename T2, size_t N >
2254 struct MultTrait< DynamicVector<T1,false>, StaticVector<T2,N,true> >
2255 {
2256  typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, false > Type;
2257 };
2258 
2259 template< typename T1, typename T2, size_t N >
2260 struct MultTrait< DynamicVector<T1,true>, StaticVector<T2,N,false> >
2261 {
2262  typedef typename MultTrait<T1,T2>::Type Type;
2263 };
2264 
2265 template< typename T1, size_t N, bool TF, typename T2 >
2266 struct MultTrait< StaticVector<T1,N,TF>, DynamicVector<T2,TF> >
2267 {
2268  typedef StaticVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2269 };
2270 
2271 template< typename T1, size_t N, typename T2 >
2272 struct MultTrait< StaticVector<T1,N,false>, DynamicVector<T2,true> >
2273 {
2274  typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, false > Type;
2275 };
2276 
2277 template< typename T1, size_t N, typename T2 >
2278 struct MultTrait< StaticVector<T1,N,true>, DynamicVector<T2,false> >
2279 {
2280  typedef typename MultTrait<T1,T2>::Type Type;
2281 };
2282 
2283 template< typename T1, bool TF, typename T2, size_t N >
2284 struct MultTrait< DynamicVector<T1,TF>, HybridVector<T2,N,TF> >
2285 {
2286  typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2287 };
2288 
2289 template< typename T1, typename T2, size_t N >
2290 struct MultTrait< DynamicVector<T1,false>, HybridVector<T2,N,true> >
2291 {
2292  typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, false > Type;
2293 };
2294 
2295 template< typename T1, typename T2, size_t N >
2296 struct MultTrait< DynamicVector<T1,true>, HybridVector<T2,N,false> >
2297 {
2298  typedef typename MultTrait<T1,T2>::Type Type;
2299 };
2300 
2301 template< typename T1, size_t N, bool TF, typename T2 >
2302 struct MultTrait< HybridVector<T1,N,TF>, DynamicVector<T2,TF> >
2303 {
2304  typedef HybridVector< typename MultTrait<T1,T2>::Type, N, TF > Type;
2305 };
2306 
2307 template< typename T1, size_t N, typename T2 >
2308 struct MultTrait< HybridVector<T1,N,false>, DynamicVector<T2,true> >
2309 {
2310  typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, false > Type;
2311 };
2312 
2313 template< typename T1, size_t N, typename T2 >
2314 struct MultTrait< HybridVector<T1,N,true>, DynamicVector<T2,false> >
2315 {
2316  typedef typename MultTrait<T1,T2>::Type Type;
2317 };
2318 
2319 template< typename T1, bool TF, typename T2 >
2320 struct MultTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2321 {
2322  typedef DynamicVector< typename MultTrait<T1,T2>::Type, TF > Type;
2323 };
2324 
2325 template< typename T1, typename T2 >
2326 struct MultTrait< DynamicVector<T1,false>, DynamicVector<T2,true> >
2327 {
2328  typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, false > Type;
2329 };
2330 
2331 template< typename T1, typename T2 >
2332 struct MultTrait< DynamicVector<T1,true>, DynamicVector<T2,false> >
2333 {
2334  typedef typename MultTrait<T1,T2>::Type Type;
2335 };
2337 //*************************************************************************************************
2338 
2339 
2340 
2341 
2342 //=================================================================================================
2343 //
2344 // CROSSTRAIT SPECIALIZATIONS
2345 //
2346 //=================================================================================================
2347 
2348 //*************************************************************************************************
2350 template< typename T1, typename T2 >
2351 struct CrossTrait< DynamicVector<T1,false>, StaticVector<T2,3UL,false> >
2352 {
2353  private:
2354  typedef typename MultTrait<T1,T2>::Type T;
2355 
2356  public:
2357  typedef StaticVector< typename SubTrait<T,T>::Type, 3UL, false > Type;
2358 };
2359 
2360 template< typename T1, typename T2 >
2361 struct CrossTrait< StaticVector<T1,3UL,false>, DynamicVector<T2,false> >
2362 {
2363  private:
2364  typedef typename MultTrait<T1,T2>::Type T;
2365 
2366  public:
2367  typedef StaticVector< typename SubTrait<T,T>::Type, 3UL, false > Type;
2368 };
2369 
2370 template< typename T1, typename T2, size_t N >
2371 struct CrossTrait< DynamicVector<T1,false>, HybridVector<T2,N,false> >
2372 {
2373  private:
2374  typedef typename MultTrait<T1,T2>::Type T;
2375 
2376  public:
2377  typedef StaticVector< typename SubTrait<T,T>::Type, 3UL, false > Type;
2378 };
2379 
2380 template< typename T1, size_t N, typename T2 >
2381 struct CrossTrait< HybridVector<T1,N,false>, DynamicVector<T2,false> >
2382 {
2383  private:
2384  typedef typename MultTrait<T1,T2>::Type T;
2385 
2386  public:
2387  typedef StaticVector< typename SubTrait<T,T>::Type, 3UL, false > Type;
2388 };
2389 
2390 template< typename T1, typename T2 >
2391 struct CrossTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
2392 {
2393  private:
2394  typedef typename MultTrait<T1,T2>::Type T;
2395 
2396  public:
2397  typedef StaticVector< typename SubTrait<T,T>::Type, 3UL, false > Type;
2398 };
2400 //*************************************************************************************************
2401 
2402 
2403 
2404 
2405 //=================================================================================================
2406 //
2407 // DIVTRAIT SPECIALIZATIONS
2408 //
2409 //=================================================================================================
2410 
2411 //*************************************************************************************************
2413 template< typename T1, bool TF, typename T2 >
2414 struct DivTrait< DynamicVector<T1,TF>, T2 >
2415 {
2416  typedef DynamicVector< typename DivTrait<T1,T2>::Type, TF > Type;
2418 };
2420 //*************************************************************************************************
2421 
2422 
2423 
2424 
2425 //=================================================================================================
2426 //
2427 // MATHTRAIT SPECIALIZATIONS
2428 //
2429 //=================================================================================================
2430 
2431 //*************************************************************************************************
2433 template< typename T1, bool TF, typename T2 >
2434 struct MathTrait< DynamicVector<T1,TF>, DynamicVector<T2,TF> >
2435 {
2436  typedef DynamicVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2437  typedef DynamicVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2438 };
2440 //*************************************************************************************************
2441 
2442 
2443 
2444 
2445 //=================================================================================================
2446 //
2447 // SUBVECTORTRAIT SPECIALIZATIONS
2448 //
2449 //=================================================================================================
2450 
2451 //*************************************************************************************************
2453 template< typename T1, bool TF >
2454 struct SubvectorTrait< DynamicVector<T1,TF> >
2455 {
2456  typedef DynamicVector<T1,TF> Type;
2457 };
2459 //*************************************************************************************************
2460 
2461 } // namespace blaze
2462 
2463 #endif
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:108
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:116
const bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.This value specifies the default tran...
Definition: TransposeFlag.h:56
Type *BLAZE_RESTRICT v_
The dynamically allocated vector elements.
Definition: DynamicVector.h:409
Constraint on the data type.
#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 subtraction trait.
Pointer data()
Low-level data access to the vector elements.
Definition: DynamicVector.h:693
Header file for basic type definitions.
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type stream(T *address, const sse_int16_t &value)
Aligned, non-temporal store of a vector of 2-byte integral values.
Definition: Stream.h:76
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: DynamicVector.h:1094
BLAZE_ALWAYS_INLINE void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1508
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
void swap(DynamicVector &v)
Swapping the contents of two vectors.
Definition: DynamicVector.h:1289
Iterator begin()
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:723
void clear()
Clearing the vector.
Definition: DynamicVector.h:1133
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DynamicVector.h:176
Header file for the IsSame and IsStrictlySame type traits.
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
const Type * ConstPointer
Pointer to a constant vector value.
Definition: DynamicVector.h:182
Header file for the DenseVector base class.
#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:116
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:163
Header file for memory allocation and deallocation functionality.
BLAZE_ALWAYS_INLINE void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense vector.
Definition: DynamicVector.h:1538
EnableIf< IsBuiltin< T >, T * >::Type allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:151
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2667
~DynamicVector()
The destructor for DynamicVector.
Definition: DynamicVector.h:635
ConstIterator cbegin() const
Returns an iterator to the first element of the dynamic vector.
Definition: DynamicVector.h:751
DynamicVector< ET, TF > Other
The type of the other DynamicVector.
Definition: DynamicVector.h:192
Header file for the DisableIf class template.
This ResultType
Result type for expression template evaluations.
Definition: DynamicVector.h:173
void resize(size_t n, bool preserve=true)
Changing the size of the vector.
Definition: DynamicVector.h:1171
Header file for the multiplication 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
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:76
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4807
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: DynamicVector.h:1374
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicVector.h:177
#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:116
Header file for the IsSMPAssignable type trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type store(T *address, const sse_int16_t &value)
Aligned store of a vector of 2-byte integral values.
Definition: Store.h:80
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1447
EnableIf< IsBuiltin< T > >::Type deallocate(T *address)
Deallocation of memory for built-in data types.
Definition: Memory.h:226
Header file for the DenseIterator class template.
Header file for the subvector trait.
Constraint on the data type.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h: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:1115
size_t size() const
Returns the current size/dimension of the vector.
Definition: DynamicVector.h:1063
DenseIterator< Type > Iterator
Iterator over non-constant elements.
Definition: DynamicVector.h:183
size_t size_
The current size/dimension of the vector.
Definition: DynamicVector.h:407
#define BLAZE_RESTRICT
Platform dependent setup of the restrict keyword.
Definition: Restrict.h:81
Type & Reference
Reference to a non-constant vector value.
Definition: DynamicVector.h:179
#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:79
const Type & ConstReference
Reference to a constant vector value.
Definition: DynamicVector.h:180
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:120
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:535
size_t adjustCapacity(size_t minCapacity) const
Adjusting the new capacity of the vector according to its data type Type.
Definition: DynamicVector.h:1306
System settings for streaming (non-temporal stores)
DynamicVector()
The default constructor for DynamicVector.
Definition: DynamicVector.h:443
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
Header file for the serial shim.
Header file for the IsVectorizable type trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type load(const T *address)
Loads a vector of 2-byte integral values.
Definition: Load.h:79
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
size_t capacity_
The maximum capacity of the vector.
Definition: DynamicVector.h:408
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DynamicVector.h:1356
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DynamicVector.h:1416
EnableIf< IsDenseMatrix< MT1 > >::Type 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:160
Header file for the IsSparseVector type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
ConstIterator cend() const
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:793
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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:98
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
IntrinsicTrait< Type > IT
Intrinsic trait for the vector element type.
Definition: DynamicVector.h:167
Constraint on the data type.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
const DynamicVector & CompositeType
Data type for composite expression templates.
Definition: DynamicVector.h:178
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
void extend(size_t n, bool preserve=true)
Extending the size of the vector.
Definition: DynamicVector.h:1219
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storeu(T *address, const sse_int16_t &value)
Unaligned store of a vector of 2-byte integral values.
Definition: Storeu.h:77
void move(DynamicMatrix< Type, SO > &dst, DynamicMatrix< Type, SO > &src)
Moving the contents of one dynamic matrix to another.
Definition: DynamicMatrix.h:4934
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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Rebind mechanism to obtain a DynamicVector with different data/element type.
Definition: DynamicVector.h:191
Header file for the isDefault shim.
System settings for the restrict keyword.
Type ElementType
Type of the vector elements.
Definition: DynamicVector.h:175
Type * Pointer
Pointer to a non-constant vector value.
Definition: DynamicVector.h:181
size_t capacity() const
Returns the maximum capacity of the vector.
Definition: DynamicVector.h:1077
Constraint on the data type.
Header file for the HasMutableDataAccess type trait.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: DynamicVector.h:1237
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
Header file for all intrinsic functionality.
Header file for the mathematical trait.
bool canAlias(const Other *alias) const
Returns whether the vector can alias with the given address alias.
Definition: DynamicVector.h:1336
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
Header file for the default transpose flag for all vectors of the Blaze library.
EnableIf< IsDenseMatrix< MT1 > >::Type 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:129
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
bool canSMPAssign() const
Returns whether the vector can be used in SMP assignments.
Definition: DynamicVector.h:1393
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
BLAZE_ALWAYS_INLINE void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the vector.
Definition: DynamicVector.h:1477
Iterator end()
Returns an iterator just past the last element of the dynamic vector.
Definition: DynamicVector.h:765
const size_t SMP_DVECASSIGN_THRESHOLD
SMP dense vector assignment threshold.This threshold specifies when an assignment of a simple dense v...
Definition: Thresholds.h:207
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
Header file for the IsResizable type trait.
DenseIterator< const Type > ConstIterator
Iterator over constant elements.
Definition: DynamicVector.h:184
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type 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:189
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: DynamicVector.h:659
DynamicVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicVector.h:174
Header file for a safe C++ NULL pointer implementation.
DynamicVector< Type, TF > This
Type of this DynamicVector instance.
Definition: DynamicVector.h:172