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