Blaze  3.6
Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_ELEMENTS_DENSE_H_
36 #define _BLAZE_MATH_VIEWS_ELEMENTS_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
53 #include <blaze/math/Exception.h>
58 #include <blaze/math/shims/Clear.h>
60 #include <blaze/math/shims/Reset.h>
67 #include <blaze/math/views/Check.h>
71 #include <blaze/util/Assert.h>
72 #include <blaze/util/mpl/If.h>
73 #include <blaze/util/TypeList.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS TEMPLATE SPECIALIZATION FOR DENSE VECTORS
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename VT // Type of the dense vector
94  , bool TF // Transpose flag
95  , typename... CEAs > // Compile time element arguments
96 class Elements<VT,TF,true,CEAs...>
97  : public View< DenseVector< Elements<VT,TF,true,CEAs...>, TF > >
98  , private ElementsData<CEAs...>
99 {
100  private:
101  //**Type definitions****************************************************************************
102  using DataType = ElementsData<CEAs...>;
103  using Operand = If_t< IsExpression_v<VT>, VT, VT& >;
104  //**********************************************************************************************
105 
106  //**Compile time flags**************************************************************************
107  using DataType::N;
108  //**********************************************************************************************
109 
110  public:
111  //**Type definitions****************************************************************************
113  using This = Elements<VT,TF,true,CEAs...>;
114 
115  using BaseType = DenseVector<This,TF>;
116  using ViewedType = VT;
117  using ResultType = ElementsTrait_t<VT,N>;
118  using TransposeType = TransposeType_t<ResultType>;
119  using ElementType = ElementType_t<VT>;
120  using ReturnType = ReturnType_t<VT>;
121  using CompositeType = const Elements&;
122 
124  using ConstReference = ConstReference_t<VT>;
125 
127  using Reference = If_t< IsConst_v<VT>, ConstReference, Reference_t<VT> >;
128 
130  using ConstPointer = ConstPointer_t<VT>;
131 
133  using Pointer = If_t< IsConst_v<VT> || !HasMutableDataAccess_v<VT>, ConstPointer, Pointer_t<VT> >;
134  //**********************************************************************************************
135 
136  //**ElementsIterator class definition***********************************************************
139  template< typename ElementsType // Type of the element selection
140  , typename IteratorType > // Type of the dense vector iterator
141  class ElementsIterator
142  {
143  public:
144  //**Type definitions*************************************************************************
146  using IteratorCategory = typename std::iterator_traits<IteratorType>::iterator_category;
147 
149  using ValueType = typename std::iterator_traits<IteratorType>::value_type;
150 
152  using PointerType = typename std::iterator_traits<IteratorType>::pointer;
153 
155  using ReferenceType = typename std::iterator_traits<IteratorType>::reference;
156 
158  using DifferenceType = typename std::iterator_traits<IteratorType>::difference_type;
159 
160  // STL iterator requirements
161  using iterator_category = IteratorCategory;
162  using value_type = ValueType;
163  using pointer = PointerType;
164  using reference = ReferenceType;
165  using difference_type = DifferenceType;
166  //*******************************************************************************************
167 
168  //**Constructor******************************************************************************
171  inline ElementsIterator()
172  : elements_( nullptr ) // Pointer to the element selection
173  , index_ ( 0UL ) // Index of the current element of the element selection
174  , pos_ () // Iterator to the current element
175  {}
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
184  inline ElementsIterator( ElementsType* elements, size_t index )
185  : elements_( elements ) // Pointer to the element selection
186  , index_ ( index ) // Index of the current element of the element selection
187  , pos_ () // Iterator to the current element
188  {
189  if( index_ < elements_->size() )
190  pos_ = elements_->operand().begin() + elements_->idx( index_ );
191  }
192  //*******************************************************************************************
193 
194  //**Constructor******************************************************************************
199  template< typename ElementsType2, typename IteratorType2 >
200  inline ElementsIterator( const ElementsIterator<ElementsType2,IteratorType2>& it )
201  : elements_( it.elements_ ) // Pointer to the element selection
202  , index_ ( it.index_ ) // Index of the current element of the element selection
203  , pos_ ( it.pos_ ) // Iterator to the current element
204  {}
205  //*******************************************************************************************
206 
207  //**Addition assignment operator*************************************************************
213  inline ElementsIterator& operator+=( size_t inc ) {
214  using blaze::reset;
215  index_ += inc;
216  if( index_ < elements_->size() )
217  pos_ = elements_->operand().begin() + elements_->idx( index_ );
218  else reset( pos_ );
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Subtraction assignment operator**********************************************************
229  inline ElementsIterator& operator-=( size_t dec ) {
230  using blaze::reset;
231  index_ -= dec;
232  if( index_ < elements_->size() )
233  pos_ = elements_->operand().begin() + elements_->idx( index_ );
234  else reset( pos_ );
235  return *this;
236  }
237  //*******************************************************************************************
238 
239  //**Prefix increment operator****************************************************************
244  inline ElementsIterator& operator++() {
245  using blaze::reset;
246  ++index_;
247  if( index_ < elements_->size() )
248  pos_ = elements_->operand().begin() + elements_->idx( index_ );
249  else reset( pos_ );
250  return *this;
251  }
252  //*******************************************************************************************
253 
254  //**Postfix increment operator***************************************************************
259  inline const ElementsIterator operator++( int ) {
260  const ElementsIterator tmp( *this );
261  ++(*this);
262  return tmp;
263  }
264  //*******************************************************************************************
265 
266  //**Prefix decrement operator****************************************************************
271  inline ElementsIterator& operator--() {
272  using blaze::reset;
273  --index_;
274  if( index_ < elements_->size() )
275  pos_ = elements_->operand().begin() + elements_->idx( index_ );
276  else reset( pos_ );
277  return *this;
278  }
279  //*******************************************************************************************
280 
281  //**Postfix decrement operator***************************************************************
286  inline const ElementsIterator operator--( int ) {
287  const ElementsIterator tmp( *this );
288  --(*this);
289  return tmp;
290  }
291  //*******************************************************************************************
292 
293  //**Subscript operator***********************************************************************
299  inline ReferenceType operator[]( size_t index ) const {
300  const IteratorType pos( elements_->operand().begin() + elements_->idx( index_ + index ) );
301  return *pos;
302  }
303  //*******************************************************************************************
304 
305  //**Element access operator******************************************************************
310  inline ReferenceType operator*() const {
311  return *pos_;
312  }
313  //*******************************************************************************************
314 
315  //**Element access operator******************************************************************
320  inline PointerType operator->() const {
321  return pos_;
322  }
323  //*******************************************************************************************
324 
325  //**Equality operator************************************************************************
331  inline bool operator==( const ElementsIterator& rhs ) const {
332  return index_ == rhs.index_;
333  }
334  //*******************************************************************************************
335 
336  //**Inequality operator**********************************************************************
342  inline bool operator!=( const ElementsIterator& rhs ) const {
343  return index_ != rhs.index_;
344  }
345  //*******************************************************************************************
346 
347  //**Less-than operator***********************************************************************
353  inline bool operator<( const ElementsIterator& rhs ) const {
354  return index_ < rhs.index_;
355  }
356  //*******************************************************************************************
357 
358  //**Greater-than operator********************************************************************
364  inline bool operator>( const ElementsIterator& rhs ) const {
365  return index_ > rhs.index_;
366  }
367  //*******************************************************************************************
368 
369  //**Less-or-equal-than operator**************************************************************
375  inline bool operator<=( const ElementsIterator& rhs ) const {
376  return index_ <= rhs.index_;
377  }
378  //*******************************************************************************************
379 
380  //**Greater-or-equal-than operator***********************************************************
386  inline bool operator>=( const ElementsIterator& rhs ) const {
387  return index_ >= rhs.index_;
388  }
389  //*******************************************************************************************
390 
391  //**Subtraction operator*********************************************************************
397  inline DifferenceType operator-( const ElementsIterator& rhs ) const {
398  return index_ - rhs.index_;
399  }
400  //*******************************************************************************************
401 
402  //**Addition operator************************************************************************
409  friend inline const ElementsIterator operator+( const ElementsIterator& it, size_t inc ) {
410  return ElementsIterator( it.elements_, it.index_ + inc );
411  }
412  //*******************************************************************************************
413 
414  //**Addition operator************************************************************************
421  friend inline const ElementsIterator operator+( size_t inc, const ElementsIterator& it ) {
422  return ElementsIterator( it.elements_, it.index_ + inc );
423  }
424  //*******************************************************************************************
425 
426  //**Subtraction operator*********************************************************************
433  friend inline const ElementsIterator operator-( const ElementsIterator& it, size_t dec ) {
434  return ElementsIterator( it.elements_, it.index_ - dec );
435  }
436  //*******************************************************************************************
437 
438  private:
439  //**Member variables*************************************************************************
440  ElementsType* elements_;
441  size_t index_;
442  IteratorType pos_;
443  //*******************************************************************************************
444 
445  //**Friend declarations**********************************************************************
446  template< typename ElementsType2, typename IteratorType2 > friend class ElementsIterator;
447  //*******************************************************************************************
448  };
449  //**********************************************************************************************
450 
451  //**Type definitions****************************************************************************
453  using ConstIterator = ElementsIterator< const This, ConstIterator_t<VT> >;
454 
456  using Iterator = If_t< IsConst_v<VT>, ConstIterator, ElementsIterator< This, Iterator_t<VT> > >;
457  //**********************************************************************************************
458 
459  //**Compilation flags***************************************************************************
461  static constexpr bool simdEnabled = false;
462 
464  static constexpr bool smpAssignable = VT::smpAssignable;
465 
467  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
468  //**********************************************************************************************
469 
470  //**Constructors********************************************************************************
473  template< typename... REAs >
474  explicit inline Elements( VT& vector, REAs... args );
475 
476  Elements( const Elements& ) = default;
477  Elements( Elements&& ) = default;
479  //**********************************************************************************************
480 
481  //**Destructor**********************************************************************************
484  ~Elements() = default;
486  //**********************************************************************************************
487 
488  //**Data access functions***********************************************************************
491  inline Reference operator[]( size_t index );
492  inline ConstReference operator[]( size_t index ) const;
493  inline Reference at( size_t index );
494  inline ConstReference at( size_t index ) const;
495  inline Pointer data () noexcept;
496  inline ConstPointer data () const noexcept;
497  inline Iterator begin ();
498  inline ConstIterator begin () const;
499  inline ConstIterator cbegin() const;
500  inline Iterator end ();
501  inline ConstIterator end () const;
502  inline ConstIterator cend () const;
504  //**********************************************************************************************
505 
506  //**Assignment operators************************************************************************
509  inline Elements& operator= ( const ElementType& rhs );
510  inline Elements& operator= ( initializer_list<ElementType> list );
511  inline Elements& operator= ( const Elements& rhs );
512  template< typename VT2 > inline Elements& operator= ( const Vector<VT2,TF>& rhs );
513  template< typename VT2 > inline Elements& operator+=( const Vector<VT2,TF>& rhs );
514  template< typename VT2 > inline Elements& operator-=( const Vector<VT2,TF>& rhs );
515  template< typename VT2 > inline Elements& operator*=( const Vector<VT2,TF>& rhs );
516  template< typename VT2 > inline Elements& operator/=( const DenseVector<VT2,TF>& rhs );
517  template< typename VT2 > inline Elements& operator%=( const Vector<VT2,TF>& rhs );
519  //**********************************************************************************************
520 
521  //**Utility functions***************************************************************************
524  using DataType::idces;
525  using DataType::idx;
526  using DataType::size;
527 
528  inline VT& operand() noexcept;
529  inline const VT& operand() const noexcept;
530 
531  inline size_t spacing() const noexcept;
532  inline size_t capacity() const noexcept;
533  inline size_t nonZeros() const;
534  inline void reset();
536  //**********************************************************************************************
537 
538  //**Numeric functions***************************************************************************
541  template< typename Other > inline Elements& scale( const Other& scalar );
543  //**********************************************************************************************
544 
545  //**Expression template evaluation functions****************************************************
548  template< typename Other >
549  inline bool canAlias( const Other* alias ) const noexcept;
550 
551  template< typename Other >
552  inline bool isAliased( const Other* alias ) const noexcept;
553 
554  inline bool isAligned () const noexcept;
555  inline bool canSMPAssign() const noexcept;
556 
557  template< typename VT2 > inline void assign ( const DenseVector <VT2,TF>& rhs );
558  template< typename VT2 > inline void assign ( const SparseVector<VT2,TF>& rhs );
559  template< typename VT2 > inline void addAssign ( const DenseVector <VT2,TF>& rhs );
560  template< typename VT2 > inline void addAssign ( const SparseVector<VT2,TF>& rhs );
561  template< typename VT2 > inline void subAssign ( const DenseVector <VT2,TF>& rhs );
562  template< typename VT2 > inline void subAssign ( const SparseVector<VT2,TF>& rhs );
563  template< typename VT2 > inline void multAssign( const DenseVector <VT2,TF>& rhs );
564  template< typename VT2 > inline void multAssign( const SparseVector<VT2,TF>& rhs );
565  template< typename VT2 > inline void divAssign ( const DenseVector <VT2,TF>& rhs );
567  //**********************************************************************************************
568 
569  private:
570  //**Member variables****************************************************************************
573  Operand vector_;
574 
575  //**********************************************************************************************
576 
577  //**Compile time checks*************************************************************************
584  //**********************************************************************************************
585 };
587 //*************************************************************************************************
588 
589 
590 
591 
592 //=================================================================================================
593 //
594 // CONSTRUCTORS
595 //
596 //=================================================================================================
597 
598 //*************************************************************************************************
611 template< typename VT // Type of the dense vector
612  , bool TF // Transpose flag
613  , typename... CEAs > // Compile time element arguments
614 template< typename... REAs > // Optional arguments
615 inline Elements<VT,TF,true,CEAs...>::Elements( VT& vector, REAs... args )
616  : DataType( args... ) // Base class initialization
617  , vector_ ( vector ) // The vector containing the elements
618 {
619  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
620  for( size_t i=0UL; i<size(); ++i ) {
621  if( vector_.size() <= idx(i) ) {
622  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
623  }
624  }
625  }
626 }
628 //*************************************************************************************************
629 
630 
631 
632 
633 //=================================================================================================
634 //
635 // DATA ACCESS FUNCTIONS
636 //
637 //=================================================================================================
638 
639 //*************************************************************************************************
649 template< typename VT // Type of the dense vector
650  , bool TF // Transpose flag
651  , typename... CEAs > // Compile time element arguments
652 inline typename Elements<VT,TF,true,CEAs...>::Reference
653  Elements<VT,TF,true,CEAs...>::operator[]( size_t index )
654 {
655  BLAZE_USER_ASSERT( index < size(), "Invalid element access index" );
656  return vector_[idx(index)];
657 }
659 //*************************************************************************************************
660 
661 
662 //*************************************************************************************************
672 template< typename VT // Type of the dense vector
673  , bool TF // Transpose flag
674  , typename... CEAs > // Compile time element arguments
675 inline typename Elements<VT,TF,true,CEAs...>::ConstReference
676  Elements<VT,TF,true,CEAs...>::operator[]( size_t index ) const
677 {
678  BLAZE_USER_ASSERT( index < size(), "Invalid element access index" );
679  return const_cast<const VT&>( vector_ )[idx(index)];
680 }
682 //*************************************************************************************************
683 
684 
685 //*************************************************************************************************
696 template< typename VT // Type of the dense vector
697  , bool TF // Transpose flag
698  , typename... CEAs > // Compile time element arguments
699 inline typename Elements<VT,TF,true,CEAs...>::Reference
700  Elements<VT,TF,true,CEAs...>::at( size_t index )
701 {
702  if( index >= size() ) {
703  BLAZE_THROW_OUT_OF_RANGE( "Invalid element access index" );
704  }
705  return (*this)[index];
706 }
708 //*************************************************************************************************
709 
710 
711 //*************************************************************************************************
722 template< typename VT // Type of the dense vector
723  , bool TF // Transpose flag
724  , typename... CEAs > // Compile time element arguments
725 inline typename Elements<VT,TF,true,CEAs...>::ConstReference
726  Elements<VT,TF,true,CEAs...>::at( size_t index ) const
727 {
728  if( index >= size() ) {
729  BLAZE_THROW_OUT_OF_RANGE( "Invalid element access index" );
730  }
731  return (*this)[index];
732 }
734 //*************************************************************************************************
735 
736 
737 //*************************************************************************************************
745 template< typename VT // Type of the dense vector
746  , bool TF // Transpose flag
747  , typename... CEAs > // Compile time element arguments
748 inline typename Elements<VT,TF,true,CEAs...>::Pointer
750 {
751  return vector_.data() + idx(0UL);
752 }
754 //*************************************************************************************************
755 
756 
757 //*************************************************************************************************
765 template< typename VT // Type of the dense vector
766  , bool TF // Transpose flag
767  , typename... CEAs > // Compile time element arguments
768 inline typename Elements<VT,TF,true,CEAs...>::ConstPointer
769  Elements<VT,TF,true,CEAs...>::data() const noexcept
770 {
771  return vector_.data() + idx(0UL);
772 }
774 //*************************************************************************************************
775 
776 
777 //*************************************************************************************************
785 template< typename VT // Type of the dense vector
786  , bool TF // Transpose flag
787  , typename... CEAs > // Compile time element arguments
788 inline typename Elements<VT,TF,true,CEAs...>::Iterator
790 {
791  return Iterator( this, 0UL );
792 }
794 //*************************************************************************************************
795 
796 
797 //*************************************************************************************************
805 template< typename VT // Type of the dense vector
806  , bool TF // Transpose flag
807  , typename... CEAs > // Compile time element arguments
808 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
810 {
811  return ConstIterator( this, 0UL );
812 }
814 //*************************************************************************************************
815 
816 
817 //*************************************************************************************************
825 template< typename VT // Type of the dense vector
826  , bool TF // Transpose flag
827  , typename... CEAs > // Compile time element arguments
828 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
830 {
831  return ConstIterator( this, 0UL );
832 }
834 //*************************************************************************************************
835 
836 
837 //*************************************************************************************************
845 template< typename VT // Type of the dense vector
846  , bool TF // Transpose flag
847  , typename... CEAs > // Compile time element arguments
848 inline typename Elements<VT,TF,true,CEAs...>::Iterator
850 {
851  return Iterator( this, size() );
852 }
854 //*************************************************************************************************
855 
856 
857 //*************************************************************************************************
865 template< typename VT // Type of the dense vector
866  , bool TF // Transpose flag
867  , typename... CEAs > // Compile time element arguments
868 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
870 {
871  return ConstIterator( this, size() );
872 }
874 //*************************************************************************************************
875 
876 
877 //*************************************************************************************************
885 template< typename VT // Type of the dense vector
886  , bool TF // Transpose flag
887  , typename... CEAs > // Compile time element arguments
888 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
890 {
891  return ConstIterator( this, size() );
892 }
894 //*************************************************************************************************
895 
896 
897 
898 
899 //=================================================================================================
900 //
901 // ASSIGNMENT OPERATORS
902 //
903 //=================================================================================================
904 
905 //*************************************************************************************************
912 template< typename VT // Type of the dense vector
913  , bool TF // Transpose flag
914  , typename... CEAs > // Compile time element arguments
915 inline Elements<VT,TF,true,CEAs...>&
916  Elements<VT,TF,true,CEAs...>::operator=( const ElementType& rhs )
917 {
918  decltype(auto) left( derestrict( vector_ ) );
919 
920  for( size_t i=0UL; i<size(); ++i ) {
921  const size_t index( idx(i) );
922  if( !IsRestricted_v<VT> || trySet( vector_, index, rhs ) )
923  left[index] = rhs;
924  }
925 
926  return *this;
927 }
929 //*************************************************************************************************
930 
931 
932 //*************************************************************************************************
948 template< typename VT // Type of the dense vector
949  , bool TF // Transpose flag
950  , typename... CEAs > // Compile time element arguments
951 inline Elements<VT,TF,true,CEAs...>&
952  Elements<VT,TF,true,CEAs...>::operator=( initializer_list<ElementType> list )
953 {
954  if( list.size() > size() ) {
955  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to elements" );
956  }
957 
958  const InitializerVector<ElementType,TF> tmp( list, size() );
959 
960  if( IsRestricted_v<VT> ) {
961  for( size_t i=0UL; i<size(); ++i ) {
962  if( !trySet( vector_, idx(i), tmp[i] ) ) {
963  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
964  }
965  }
966  }
967 
968  decltype(auto) left( derestrict( vector_ ) );
969  for( size_t i=0UL; i<size(); ++i ) {
970  left[idx(i)] = tmp[i];
971  }
972 
973  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
974 
975  return *this;
976 }
978 //*************************************************************************************************
979 
980 
981 //*************************************************************************************************
993 template< typename VT // Type of the dense vector
994  , bool TF // Transpose flag
995  , typename... CEAs > // Compile time element arguments
996 inline Elements<VT,TF,true,CEAs...>&
997  Elements<VT,TF,true,CEAs...>::operator=( const Elements& rhs )
998 {
1001 
1002  if( &rhs == this || ( &vector_ == &rhs.vector_ && compareIndices( *this, rhs ) ) )
1003  return *this;
1004 
1005  if( size() != rhs.size() ) {
1006  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1007  }
1008 
1009  if( IsRestricted_v<VT> ) {
1010  for( size_t i=0UL; i<size(); ++i ) {
1011  if( !trySet( vector_, idx(i), rhs[i] ) ) {
1012  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1013  }
1014  }
1015  }
1016 
1017  decltype(auto) left( derestrict( *this ) );
1018 
1019  if( rhs.canAlias( &vector_ ) ) {
1020  const ResultType tmp( rhs );
1021  smpAssign( left, tmp );
1022  }
1023  else {
1024  smpAssign( left, rhs );
1025  }
1026 
1027  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1028 
1029  return *this;
1030 }
1032 //*************************************************************************************************
1033 
1034 
1035 //*************************************************************************************************
1047 template< typename VT // Type of the dense vector
1048  , bool TF // Transpose flag
1049  , typename... CEAs > // Compile time element arguments
1050 template< typename VT2 > // Type of the right-hand side vector
1051 inline Elements<VT,TF,true,CEAs...>&
1052  Elements<VT,TF,true,CEAs...>::operator=( const Vector<VT2,TF>& rhs )
1053 {
1054  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1055  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1056 
1057  if( size() != (~rhs).size() ) {
1058  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1059  }
1060 
1061  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1062  Right right( ~rhs );
1063 
1064  if( IsRestricted_v<VT> ) {
1065  for( size_t i=0UL; i<size(); ++i ) {
1066  if( !trySet( vector_, idx(i), right[i] ) ) {
1067  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1068  }
1069  }
1070  }
1071 
1072  decltype(auto) left( derestrict( *this ) );
1073 
1074  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1075  const ResultType_t<VT2> tmp( right );
1076  smpAssign( left, tmp );
1077  }
1078  else {
1079  if( IsSparseVector_v<VT2> )
1080  reset();
1081  smpAssign( left, right );
1082  }
1083 
1084  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1085 
1086  return *this;
1087 }
1089 //*************************************************************************************************
1090 
1091 
1092 //*************************************************************************************************
1104 template< typename VT // Type of the dense vector
1105  , bool TF // Transpose flag
1106  , typename... CEAs > // Compile time element arguments
1107 template< typename VT2 > // Type of the right-hand side vector
1108 inline Elements<VT,TF,true,CEAs...>&
1109  Elements<VT,TF,true,CEAs...>::operator+=( const Vector<VT2,TF>& rhs )
1110 {
1111  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1112  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1113 
1114  if( size() != (~rhs).size() ) {
1115  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1116  }
1117 
1118  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1119  Right right( ~rhs );
1120 
1121  if( IsRestricted_v<VT> ) {
1122  for( size_t i=0UL; i<size(); ++i ) {
1123  if( !tryAdd( vector_, idx(i), right[i] ) ) {
1124  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1125  }
1126  }
1127  }
1128 
1129  decltype(auto) left( derestrict( *this ) );
1130 
1131  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1132  const ResultType_t<VT2> tmp( right );
1133  smpAddAssign( left, tmp );
1134  }
1135  else {
1136  smpAddAssign( left, right );
1137  }
1138 
1139  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1140 
1141  return *this;
1142 }
1144 //*************************************************************************************************
1145 
1146 
1147 //*************************************************************************************************
1159 template< typename VT // Type of the dense vector
1160  , bool TF // Transpose flag
1161  , typename... CEAs > // Compile time element arguments
1162 template< typename VT2 > // Type of the right-hand side vector
1163 inline Elements<VT,TF,true,CEAs...>&
1164  Elements<VT,TF,true,CEAs...>::operator-=( const Vector<VT2,TF>& rhs )
1165 {
1166  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1167  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1168 
1169  if( size() != (~rhs).size() ) {
1170  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1171  }
1172 
1173  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1174  Right right( ~rhs );
1175 
1176  if( IsRestricted_v<VT> ) {
1177  for( size_t i=0UL; i<size(); ++i ) {
1178  if( !trySub( vector_, idx(i), right[i] ) ) {
1179  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1180  }
1181  }
1182  }
1183 
1184  decltype(auto) left( derestrict( *this ) );
1185 
1186  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1187  const ResultType_t<VT2> tmp( right );
1188  smpSubAssign( left, tmp );
1189  }
1190  else {
1191  smpSubAssign( left, right );
1192  }
1193 
1194  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1195 
1196  return *this;
1197 }
1199 //*************************************************************************************************
1200 
1201 
1202 //*************************************************************************************************
1215 template< typename VT // Type of the dense vector
1216  , bool TF // Transpose flag
1217  , typename... CEAs > // Compile time element arguments
1218 template< typename VT2 > // Type of the right-hand side vector
1219 inline Elements<VT,TF,true,CEAs...>&
1220  Elements<VT,TF,true,CEAs...>::operator*=( const Vector<VT2,TF>& rhs )
1221 {
1222  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1223  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1224 
1225  if( size() != (~rhs).size() ) {
1226  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1227  }
1228 
1229  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1230  Right right( ~rhs );
1231 
1232  if( IsRestricted_v<VT> ) {
1233  for( size_t i=0UL; i<size(); ++i ) {
1234  if( !tryMult( vector_, idx(i), right[i] ) ) {
1235  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1236  }
1237  }
1238  }
1239 
1240  decltype(auto) left( derestrict( *this ) );
1241 
1242  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1243  const ResultType_t<VT2> tmp( right );
1244  smpMultAssign( left, tmp );
1245  }
1246  else {
1247  smpMultAssign( left, right );
1248  }
1249 
1250  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1251 
1252  return *this;
1253 }
1255 //*************************************************************************************************
1256 
1257 
1258 //*************************************************************************************************
1270 template< typename VT // Type of the dense vector
1271  , bool TF // Transpose flag
1272  , typename... CEAs > // Compile time element arguments
1273 template< typename VT2 > // Type of the right-hand side dense vector
1274 inline Elements<VT,TF,true,CEAs...>&
1275  Elements<VT,TF,true,CEAs...>::operator/=( const DenseVector<VT2,TF>& rhs )
1276 {
1277  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1278  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1279 
1280  if( size() != (~rhs).size() ) {
1281  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1282  }
1283 
1284  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1285  Right right( ~rhs );
1286 
1287  if( IsRestricted_v<VT> ) {
1288  for( size_t i=0UL; i<size(); ++i ) {
1289  if( !tryDiv( vector_, idx(i), right[i] ) ) {
1290  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1291  }
1292  }
1293  }
1294 
1295  decltype(auto) left( derestrict( *this ) );
1296 
1297  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1298  const ResultType_t<VT2> tmp( right );
1299  smpDivAssign( left, tmp );
1300  }
1301  else {
1302  smpDivAssign( left, right );
1303  }
1304 
1305  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1306 
1307  return *this;
1308 }
1310 //*************************************************************************************************
1311 
1312 
1313 //*************************************************************************************************
1326 template< typename VT // Type of the dense vector
1327  , bool TF // Transpose flag
1328  , typename... CEAs > // Compile time element arguments
1329 template< typename VT2 > // Type of the right-hand side vector
1330 inline Elements<VT,TF,true,CEAs...>&
1331  Elements<VT,TF,true,CEAs...>::operator%=( const Vector<VT2,TF>& rhs )
1332 {
1333  using blaze::assign;
1334 
1335  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1336  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1337 
1338  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
1339 
1343 
1344  if( size() != 3UL || (~rhs).size() != 3UL ) {
1345  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1346  }
1347 
1348  const CrossType tmp( *this % (~rhs) );
1349 
1350  if( IsRestricted_v<VT> ) {
1351  for( size_t i=0UL; i<size(); ++i ) {
1352  if( !trySet( vector_, idx(i), tmp[i] ) ) {
1353  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1354  }
1355  }
1356  }
1357 
1358  decltype(auto) left( derestrict( *this ) );
1359 
1360  assign( left, tmp );
1361 
1362  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1363 
1364  return *this;
1365 }
1367 //*************************************************************************************************
1368 
1369 
1370 
1371 
1372 //=================================================================================================
1373 //
1374 // UTILITY FUNCTIONS
1375 //
1376 //=================================================================================================
1377 
1378 //*************************************************************************************************
1384 template< typename VT // Type of the dense vector
1385  , bool TF // Transpose flag
1386  , typename... CEAs > // Compile time element arguments
1387 inline VT& Elements<VT,TF,true,CEAs...>::operand() noexcept
1388 {
1389  return vector_;
1390 }
1392 //*************************************************************************************************
1393 
1394 
1395 //*************************************************************************************************
1401 template< typename VT // Type of the dense vector
1402  , bool TF // Transpose flag
1403  , typename... CEAs > // Compile time element arguments
1404 inline const VT& Elements<VT,TF,true,CEAs...>::operand() const noexcept
1405 {
1406  return vector_;
1407 }
1409 //*************************************************************************************************
1410 
1411 
1412 //*************************************************************************************************
1418 template< typename VT // Type of the dense vector
1419  , bool TF // Transpose flag
1420  , typename... CEAs > // Compile time element arguments
1421 inline size_t Elements<VT,TF,true,CEAs...>::spacing() const noexcept
1422 {
1423  return size();
1424 }
1426 //*************************************************************************************************
1427 
1428 
1429 //*************************************************************************************************
1435 template< typename VT // Type of the dense vector
1436  , bool TF // Transpose flag
1437  , typename... CEAs > // Compile time element arguments
1438 inline size_t Elements<VT,TF,true,CEAs...>::capacity() const noexcept
1439 {
1440  return size();
1441 }
1443 //*************************************************************************************************
1444 
1445 
1446 //*************************************************************************************************
1455 template< typename VT // Type of the dense vector
1456  , bool TF // Transpose flag
1457  , typename... CEAs > // Compile time element arguments
1458 inline size_t Elements<VT,TF,true,CEAs...>::nonZeros() const
1459 {
1460  size_t nonzeros( 0 );
1461 
1462  for( size_t i=0UL; i<size(); ++i ) {
1463  if( !isDefault( vector_[idx(i)] ) )
1464  ++nonzeros;
1465  }
1466 
1467  return nonzeros;
1468 }
1470 //*************************************************************************************************
1471 
1472 
1473 //*************************************************************************************************
1479 template< typename VT // Type of the dense vector
1480  , bool TF // Transpose flag
1481  , typename... CEAs > // Compile time element arguments
1483 {
1484  using blaze::clear;
1485 
1486  for( size_t i=0UL; i<size(); ++i )
1487  clear( vector_[idx(i)] );
1488 }
1490 //*************************************************************************************************
1491 
1492 
1493 
1494 
1495 //=================================================================================================
1496 //
1497 // NUMERIC FUNCTIONS
1498 //
1499 //=================================================================================================
1500 
1501 //*************************************************************************************************
1512 template< typename VT // Type of the dense vector
1513  , bool TF // Transpose flag
1514  , typename... CEAs > // Compile time element arguments
1515 template< typename Other > // Data type of the scalar value
1516 inline Elements<VT,TF,true,CEAs...>&
1517  Elements<VT,TF,true,CEAs...>::scale( const Other& scalar )
1518 {
1519  for( size_t i=0UL; i<size(); ++i )
1520  vector_[idx(i)] *= scalar;
1521  return *this;
1522 }
1524 //*************************************************************************************************
1525 
1526 
1527 
1528 
1529 //=================================================================================================
1530 //
1531 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1532 //
1533 //=================================================================================================
1534 
1535 //*************************************************************************************************
1546 template< typename VT // Type of the dense vector
1547  , bool TF // Transpose flag
1548  , typename... CEAs > // Compile time element arguments
1549 template< typename Other > // Data type of the foreign expression
1550 inline bool Elements<VT,TF,true,CEAs...>::canAlias( const Other* alias ) const noexcept
1551 {
1552  return vector_.isAliased( alias );
1553 }
1555 //*************************************************************************************************
1556 
1557 
1558 //*************************************************************************************************
1569 template< typename VT // Type of the dense vector
1570  , bool TF // Transpose flag
1571  , typename... CEAs > // Compile time element arguments
1572 template< typename Other > // Data type of the foreign expression
1573 inline bool Elements<VT,TF,true,CEAs...>::isAliased( const Other* alias ) const noexcept
1574 {
1575  return vector_.isAliased( alias );
1576 }
1578 //*************************************************************************************************
1579 
1580 
1581 //*************************************************************************************************
1591 template< typename VT // Type of the dense vector
1592  , bool TF // Transpose flag
1593  , typename... CEAs > // Compile time element arguments
1594 inline bool Elements<VT,TF,true,CEAs...>::isAligned() const noexcept
1595 {
1596  return false;
1597 }
1599 //*************************************************************************************************
1600 
1601 
1602 //*************************************************************************************************
1613 template< typename VT // Type of the dense vector
1614  , bool TF // Transpose flag
1615  , typename... CEAs > // Compile time element arguments
1616 inline bool Elements<VT,TF,true,CEAs...>::canSMPAssign() const noexcept
1617 {
1618  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1619 }
1621 //*************************************************************************************************
1622 
1623 
1624 //*************************************************************************************************
1636 template< typename VT // Type of the dense vector
1637  , bool TF // Transpose flag
1638  , typename... CEAs > // Compile time element arguments
1639 template< typename VT2 > // Type of the right-hand side dense vector
1640 inline void Elements<VT,TF,true,CEAs...>::assign( const DenseVector<VT2,TF>& rhs )
1641 {
1642  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1643 
1644  const size_t ipos( size() & size_t(-2) );
1645  for( size_t i=0UL; i<ipos; i+=2UL ) {
1646  vector_[idx(i )] = (~rhs)[i ];
1647  vector_[idx(i+1UL)] = (~rhs)[i+1UL];
1648  }
1649  if( ipos < size() ) {
1650  vector_[idx(ipos)] = (~rhs)[ipos];
1651  }
1652 }
1654 //*************************************************************************************************
1655 
1656 
1657 //*************************************************************************************************
1669 template< typename VT // Type of the dense vector
1670  , bool TF // Transpose flag
1671  , typename... CEAs > // Compile time element arguments
1672 template< typename VT2 > // Type of the right-hand side sparse vector
1673 inline void Elements<VT,TF,true,CEAs...>::assign( const SparseVector<VT2,TF>& rhs )
1674 {
1675  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1676 
1677  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1678  vector_[idx(element->index())] = element->value();
1679 }
1681 //*************************************************************************************************
1682 
1683 
1684 //*************************************************************************************************
1696 template< typename VT // Type of the dense vector
1697  , bool TF // Transpose flag
1698  , typename... CEAs > // Compile time element arguments
1699 template< typename VT2 > // Type of the right-hand side dense vector
1700 inline void Elements<VT,TF,true,CEAs...>::addAssign( const DenseVector<VT2,TF>& rhs )
1701 {
1702  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1703 
1704  const size_t ipos( size() & size_t(-2) );
1705  for( size_t i=0UL; i<ipos; i+=2UL ) {
1706  vector_[idx(i )] += (~rhs)[i ];
1707  vector_[idx(i+1UL)] += (~rhs)[i+1UL];
1708  }
1709  if( ipos < size() ) {
1710  vector_[idx(ipos)] += (~rhs)[ipos];
1711  }
1712 }
1714 //*************************************************************************************************
1715 
1716 
1717 //*************************************************************************************************
1729 template< typename VT // Type of the dense vector
1730  , bool TF // Transpose flag
1731  , typename... CEAs > // Compile time element arguments
1732 template< typename VT2 > // Type of the right-hand side sparse vector
1733 inline void Elements<VT,TF,true,CEAs...>::addAssign( const SparseVector<VT2,TF>& rhs )
1734 {
1735  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1736 
1737  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1738  vector_[idx(element->index())] += element->value();
1739 }
1741 //*************************************************************************************************
1742 
1743 
1744 //*************************************************************************************************
1756 template< typename VT // Type of the dense vector
1757  , bool TF // Transpose flag
1758  , typename... CEAs > // Compile time element arguments
1759 template< typename VT2 > // Type of the right-hand side dense vector
1760 inline void Elements<VT,TF,true,CEAs...>::subAssign( const DenseVector<VT2,TF>& rhs )
1761 {
1762  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1763 
1764  const size_t ipos( size() & size_t(-2) );
1765  for( size_t i=0UL; i<ipos; i+=2UL ) {
1766  vector_[idx(i )] -= (~rhs)[i ];
1767  vector_[idx(i+1UL)] -= (~rhs)[i+1UL];
1768  }
1769  if( ipos < size() ) {
1770  vector_[idx(ipos)] -= (~rhs)[ipos];
1771  }
1772 }
1774 //*************************************************************************************************
1775 
1776 
1777 //*************************************************************************************************
1789 template< typename VT // Type of the dense vector
1790  , bool TF // Transpose flag
1791  , typename... CEAs > // Compile time element arguments
1792 template< typename VT2 > // Type of the right-hand side sparse vector
1793 inline void Elements<VT,TF,true,CEAs...>::subAssign( const SparseVector<VT2,TF>& rhs )
1794 {
1795  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1796 
1797  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1798  vector_[idx(element->index())] -= element->value();
1799 }
1801 //*************************************************************************************************
1802 
1803 
1804 //*************************************************************************************************
1816 template< typename VT // Type of the dense vector
1817  , bool TF // Transpose flag
1818  , typename... CEAs > // Compile time element arguments
1819 template< typename VT2 > // Type of the right-hand side dense vector
1820 inline void Elements<VT,TF,true,CEAs...>::multAssign( const DenseVector<VT2,TF>& rhs )
1821 {
1822  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1823 
1824  const size_t ipos( size() & size_t(-2) );
1825  for( size_t i=0UL; i<ipos; i+=2UL ) {
1826  vector_[idx(i )] *= (~rhs)[i ];
1827  vector_[idx(i+1UL)] *= (~rhs)[i+1UL];
1828  }
1829  if( ipos < size() ) {
1830  vector_[idx(ipos)] *= (~rhs)[ipos];
1831  }
1832 }
1834 //*************************************************************************************************
1835 
1836 
1837 //*************************************************************************************************
1849 template< typename VT // Type of the dense vector
1850  , bool TF // Transpose flag
1851  , typename... CEAs > // Compile time element arguments
1852 template< typename VT2 > // Type of the right-hand side sparse vector
1853 inline void Elements<VT,TF,true,CEAs...>::multAssign( const SparseVector<VT2,TF>& rhs )
1854 {
1855  using blaze::reset;
1856 
1857  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1858 
1859  size_t i( 0UL );
1860 
1861  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
1862  const size_t index( element->index() );
1863  for( ; i<index; ++i )
1864  reset( vector_[idx(i)] );
1865  vector_[idx(i)] *= element->value();
1866  ++i;
1867  }
1868 
1869  for( ; i<size(); ++i ) {
1870  reset( vector_[idx(i)] );
1871  }
1872 }
1874 //*************************************************************************************************
1875 
1876 
1877 //*************************************************************************************************
1889 template< typename VT // Type of the dense vector
1890  , bool TF // Transpose flag
1891  , typename... CEAs > // Compile time element arguments
1892 template< typename VT2 > // Type of the right-hand side dense vector
1893 inline void Elements<VT,TF,true,CEAs...>::divAssign( const DenseVector<VT2,TF>& rhs )
1894 {
1895  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1896 
1897  const size_t ipos( size() & size_t(-2) );
1898  for( size_t i=0UL; i<ipos; i+=2UL ) {
1899  vector_[idx(i )] /= (~rhs)[i ];
1900  vector_[idx(i+1UL)] /= (~rhs)[i+1UL];
1901  }
1902  if( ipos < size() ) {
1903  vector_[idx(ipos)] /= (~rhs)[ipos];
1904  }
1905 }
1907 //*************************************************************************************************
1908 
1909 
1910 
1911 
1912 
1913 
1914 
1915 
1916 //=================================================================================================
1917 //
1918 // CLASS TEMPLATE SPECIALIZATION FOR DVECDVECCROSSEXPR
1919 //
1920 //=================================================================================================
1921 
1922 //*************************************************************************************************
1930 template< typename VT1 // Type of the left-hand side dense vector
1931  , typename VT2 // Type of the right-hand side dense vector
1932  , bool TF // Transpose flag
1933  , typename... CEAs > // Compile time element arguments
1934 class Elements< const DVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
1935  : public View< DenseVector< Elements< const DVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
1936  , private ElementsData<CEAs...>
1937 {
1938  private:
1939  //**Type definitions****************************************************************************
1940  using CPE = DVecDVecCrossExpr<VT1,VT2,TF>;
1941  using RT = ResultType_t<CPE>;
1942  using DataType = ElementsData<CEAs...>;
1943  //**********************************************************************************************
1944 
1945  //**Compile time flags**************************************************************************
1946  using DataType::N;
1947  //**********************************************************************************************
1948 
1949  public:
1950  //**Type definitions****************************************************************************
1952  using This = Elements<const CPE,TF,true,CEAs...>;
1953 
1954  using BaseType = DenseVector<This,TF>;
1955  using ViewedType = CPE;
1956  using ResultType = ElementsTrait_t<RT,N>;
1957  using TransposeType = TransposeType_t<ResultType>;
1958  using ElementType = ElementType_t<CPE>;
1959  using ReturnType = ReturnType_t<CPE>;
1960  using CompositeType = const ResultType;
1961  //**********************************************************************************************
1962 
1963  //**Compilation flags***************************************************************************
1965  static constexpr bool simdEnabled = false;
1966 
1968  static constexpr bool smpAssignable = false;
1969 
1971  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
1972  //**********************************************************************************************
1973 
1974  //**Constructor*********************************************************************************
1981  template< typename... REAs > // Optional element arguments
1982  explicit inline Elements( const CPE& vector, REAs... args )
1983  : DataType( args... ) // Base class initialization
1984  , vector_ ( vector ) // The dense vector/dense vector cross product expression
1985  {
1986  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
1987  for( size_t i=0UL; i<size(); ++i ) {
1988  if( vector_.size() <= idx(i) ) {
1989  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
1990  }
1991  }
1992  }
1993  }
1994  //**********************************************************************************************
1995 
1996  //**Subscript operator**************************************************************************
2002  inline ReturnType operator[]( size_t index ) const {
2003  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2004  return vector_[idx(index)];
2005  }
2006  //**********************************************************************************************
2007 
2008  //**At function*********************************************************************************
2015  inline ReturnType at( size_t index ) const {
2016  if( index >= size() ) {
2017  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2018  }
2019  return (*this)[index];
2020  }
2021  //**********************************************************************************************
2022 
2023  //**********************************************************************************************
2024  using DataType::idces;
2025  using DataType::idx;
2026  using DataType::size;
2027  //**********************************************************************************************
2028 
2029  //**Operand access******************************************************************************
2034  inline CPE operand() const noexcept {
2035  return vector_;
2036  }
2037  //**********************************************************************************************
2038 
2039  //**********************************************************************************************
2045  template< typename T >
2046  inline bool canAlias( const T* alias ) const noexcept {
2047  return vector_.canAlias( alias );
2048  }
2049  //**********************************************************************************************
2050 
2051  //**********************************************************************************************
2057  template< typename T >
2058  inline bool isAliased( const T* alias ) const noexcept {
2059  return vector_.isAliased( alias );
2060  }
2061  //**********************************************************************************************
2062 
2063  private:
2064  //**Member variables****************************************************************************
2065  CPE vector_;
2066  //**********************************************************************************************
2067 };
2069 //*************************************************************************************************
2070 
2071 
2072 
2073 
2074 
2075 
2076 
2077 
2078 //=================================================================================================
2079 //
2080 // CLASS TEMPLATE SPECIALIZATION FOR DVECSVECCROSSEXPR
2081 //
2082 //=================================================================================================
2083 
2084 //*************************************************************************************************
2092 template< typename VT1 // Type of the left-hand side dense vector
2093  , typename VT2 // Type of the right-hand side sparse vector
2094  , bool TF // Transpose flag
2095  , typename... CEAs > // Compile time element arguments
2096 class Elements< const DVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
2097  : public View< DenseVector< Elements< const DVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
2098  , private ElementsData<CEAs...>
2099 {
2100  private:
2101  //**Type definitions****************************************************************************
2102  using CPE = DVecSVecCrossExpr<VT1,VT2,TF>;
2103  using RT = ResultType_t<CPE>;
2104  using DataType = ElementsData<CEAs...>;
2105  //**********************************************************************************************
2106 
2107  //**Compile time flags**************************************************************************
2108  using DataType::N;
2109  //**********************************************************************************************
2110 
2111  public:
2112  //**Type definitions****************************************************************************
2114  using This = Elements<const CPE,TF,true,CEAs...>;
2115 
2116  using BaseType = DenseVector<This,TF>;
2117  using ViewedType = CPE;
2118  using ResultType = ElementsTrait_t<RT,N>;
2119  using TransposeType = TransposeType_t<ResultType>;
2120  using ElementType = ElementType_t<CPE>;
2121  using ReturnType = ReturnType_t<CPE>;
2122  using CompositeType = const ResultType;
2123  //**********************************************************************************************
2124 
2125  //**Compilation flags***************************************************************************
2127  static constexpr bool simdEnabled = false;
2128 
2130  static constexpr bool smpAssignable = false;
2131 
2133  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
2134  //**********************************************************************************************
2135 
2136  //**Constructor*********************************************************************************
2143  template< typename... REAs > // Optional element arguments
2144  explicit inline Elements( const CPE& vector, REAs... args )
2145  : DataType( args... ) // Base class initialization
2146  , vector_ ( vector ) // The dense vector/sparse vector cross product expression
2147  {
2148  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
2149  for( size_t i=0UL; i<size(); ++i ) {
2150  if( vector_.size() <= idx(i) ) {
2151  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
2152  }
2153  }
2154  }
2155  }
2156  //**********************************************************************************************
2157 
2158  //**Subscript operator**************************************************************************
2164  inline ReturnType operator[]( size_t index ) const {
2165  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2166  return vector_[idx(index)];
2167  }
2168  //**********************************************************************************************
2169 
2170  //**At function*********************************************************************************
2177  inline ReturnType at( size_t index ) const {
2178  if( index >= size() ) {
2179  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2180  }
2181  return (*this)[index];
2182  }
2183  //**********************************************************************************************
2184 
2185  //**********************************************************************************************
2186  using DataType::idces;
2187  using DataType::idx;
2188  using DataType::size;
2189  //**********************************************************************************************
2190 
2191  //**Operand access******************************************************************************
2196  inline CPE operand() const noexcept {
2197  return vector_;
2198  }
2199  //**********************************************************************************************
2200 
2201  //**********************************************************************************************
2207  template< typename T >
2208  inline bool canAlias( const T* alias ) const noexcept {
2209  return vector_.canAlias( alias );
2210  }
2211  //**********************************************************************************************
2212 
2213  //**********************************************************************************************
2219  template< typename T >
2220  inline bool isAliased( const T* alias ) const noexcept {
2221  return vector_.isAliased( alias );
2222  }
2223  //**********************************************************************************************
2224 
2225  private:
2226  //**Member variables****************************************************************************
2227  CPE vector_;
2228  //**********************************************************************************************
2229 };
2231 //*************************************************************************************************
2232 
2233 
2234 
2235 
2236 
2237 
2238 
2239 
2240 //=================================================================================================
2241 //
2242 // CLASS TEMPLATE SPECIALIZATION FOR SVECDVECCROSSEXPR
2243 //
2244 //=================================================================================================
2245 
2246 //*************************************************************************************************
2254 template< typename VT1 // Type of the left-hand side sparse vector
2255  , typename VT2 // Type of the right-hand side dense vector
2256  , bool TF // Transpose flag
2257  , typename... CEAs > // Compile time element arguments
2258 class Elements< const SVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
2259  : public View< DenseVector< Elements< const SVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
2260  , private ElementsData<CEAs...>
2261 {
2262  private:
2263  //**Type definitions****************************************************************************
2264  using CPE = SVecDVecCrossExpr<VT1,VT2,TF>;
2265  using RT = ResultType_t<CPE>;
2266  using DataType = ElementsData<CEAs...>;
2267  //**********************************************************************************************
2268 
2269  //**Compile time flags**************************************************************************
2270  using DataType::N;
2271  //**********************************************************************************************
2272 
2273  public:
2274  //**Type definitions****************************************************************************
2276  using This = Elements<const CPE,TF,true,CEAs...>;
2277 
2278  using BaseType = DenseVector<This,TF>;
2279  using ViewedType = CPE;
2280  using ResultType = ElementsTrait_t<RT,N>;
2281  using TransposeType = TransposeType_t<ResultType>;
2282  using ElementType = ElementType_t<CPE>;
2283  using ReturnType = ReturnType_t<CPE>;
2284  using CompositeType = const ResultType;
2285  //**********************************************************************************************
2286 
2287  //**Compilation flags***************************************************************************
2289  static constexpr bool simdEnabled = false;
2290 
2292  static constexpr bool smpAssignable = false;
2293 
2295  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
2296  //**********************************************************************************************
2297 
2298  //**Constructor*********************************************************************************
2305  template< typename... REAs > // Optional element arguments
2306  explicit inline Elements( const CPE& vector, REAs... args )
2307  : DataType( args... ) // Base class initialization
2308  , vector_ ( vector ) // The sparse vector/dense vector cross product expression
2309  {
2310  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
2311  for( size_t i=0UL; i<size(); ++i ) {
2312  if( vector_.size() <= idx(i) ) {
2313  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
2314  }
2315  }
2316  }
2317  }
2318  //**********************************************************************************************
2319 
2320  //**Subscript operator**************************************************************************
2326  inline ReturnType operator[]( size_t index ) const {
2327  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2328  return vector_[idx(index)];
2329  }
2330  //**********************************************************************************************
2331 
2332  //**At function*********************************************************************************
2339  inline ReturnType at( size_t index ) const {
2340  if( index >= size() ) {
2341  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2342  }
2343  return (*this)[index];
2344  }
2345  //**********************************************************************************************
2346 
2347  //**********************************************************************************************
2348  using DataType::idces;
2349  using DataType::idx;
2350  using DataType::size;
2351  //**********************************************************************************************
2352 
2353  //**Operand access******************************************************************************
2358  inline CPE operand() const noexcept {
2359  return vector_;
2360  }
2361  //**********************************************************************************************
2362 
2363  //**********************************************************************************************
2369  template< typename T >
2370  inline bool canAlias( const T* alias ) const noexcept {
2371  return vector_.canAlias( alias );
2372  }
2373  //**********************************************************************************************
2374 
2375  //**********************************************************************************************
2381  template< typename T >
2382  inline bool isAliased( const T* alias ) const noexcept {
2383  return vector_.isAliased( alias );
2384  }
2385  //**********************************************************************************************
2386 
2387  private:
2388  //**Member variables****************************************************************************
2389  CPE vector_;
2390  //**********************************************************************************************
2391 };
2393 //*************************************************************************************************
2394 
2395 
2396 
2397 
2398 
2399 
2400 
2401 
2402 //=================================================================================================
2403 //
2404 // CLASS TEMPLATE SPECIALIZATION FOR SVECSVECCROSSEXPR
2405 //
2406 //=================================================================================================
2407 
2408 //*************************************************************************************************
2416 template< typename VT1 // Type of the left-hand side sparse vector
2417  , typename VT2 // Type of the right-hand side sparse vector
2418  , bool TF // Transpose flag
2419  , typename... CEAs > // Compile time element arguments
2420 class Elements< const SVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
2421  : public View< DenseVector< Elements< const SVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
2422  , private ElementsData<CEAs...>
2423 {
2424  private:
2425  //**Type definitions****************************************************************************
2426  using CPE = SVecSVecCrossExpr<VT1,VT2,TF>;
2427  using RT = ResultType_t<CPE>;
2428  using DataType = ElementsData<CEAs...>;
2429  //**********************************************************************************************
2430 
2431  //**Compile time flags**************************************************************************
2432  using DataType::N;
2433  //**********************************************************************************************
2434 
2435  public:
2436  //**Type definitions****************************************************************************
2438  using This = Elements<const CPE,TF,true,CEAs...>;
2439 
2440  using BaseType = DenseVector<This,TF>;
2441  using ViewedType = CPE;
2442  using ResultType = ElementsTrait_t<RT,N>;
2443  using TransposeType = TransposeType_t<ResultType>;
2444  using ElementType = ElementType_t<CPE>;
2445  using ReturnType = ReturnType_t<CPE>;
2446  using CompositeType = const ResultType;
2447  //**********************************************************************************************
2448 
2449  //**Compilation flags***************************************************************************
2451  static constexpr bool simdEnabled = false;
2452 
2454  static constexpr bool smpAssignable = false;
2455 
2457  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
2458  //**********************************************************************************************
2459 
2460  //**Constructor*********************************************************************************
2467  template< typename... REAs > // Optional element arguments
2468  explicit inline Elements( const CPE& vector, REAs... args )
2469  : DataType( args... ) // Base class initialization
2470  , vector_ ( vector ) // The sparse vector/sparse vector cross product expression
2471  {
2472  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
2473  for( size_t i=0UL; i<size(); ++i ) {
2474  if( vector_.size() <= idx(i) ) {
2475  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
2476  }
2477  }
2478  }
2479  }
2480  //**********************************************************************************************
2481 
2482  //**Subscript operator**************************************************************************
2488  inline ReturnType operator[]( size_t index ) const {
2489  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2490  return vector_[idx(index)];
2491  }
2492  //**********************************************************************************************
2493 
2494  //**At function*********************************************************************************
2501  inline ReturnType at( size_t index ) const {
2502  if( index >= size() ) {
2503  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2504  }
2505  return (*this)[index];
2506  }
2507  //**********************************************************************************************
2508 
2509  //**********************************************************************************************
2510  using DataType::idces;
2511  using DataType::idx;
2512  using DataType::size;
2513  //**********************************************************************************************
2514 
2515  //**Operand access******************************************************************************
2520  inline CPE operand() const noexcept {
2521  return vector_;
2522  }
2523  //**********************************************************************************************
2524 
2525  //**********************************************************************************************
2531  template< typename T >
2532  inline bool canAlias( const T* alias ) const noexcept {
2533  return vector_.canAlias( alias );
2534  }
2535  //**********************************************************************************************
2536 
2537  //**********************************************************************************************
2543  template< typename T >
2544  inline bool isAliased( const T* alias ) const noexcept {
2545  return vector_.isAliased( alias );
2546  }
2547  //**********************************************************************************************
2548 
2549  private:
2550  //**Member variables****************************************************************************
2551  CPE vector_;
2552  //**********************************************************************************************
2553 };
2555 //*************************************************************************************************
2556 
2557 } // namespace blaze
2558 
2559 #endif
#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
Constraint on the data type.
Header file for auxiliary alias declarations.
Header file for the blaze::checked and blaze::unchecked instances.
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:170
Header file for the View base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
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
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the DenseVector base class.
Constraint on the data type.
constexpr bool IsReference_v
Auxiliary variable template for the IsReference type trait.The IsReference_v variable template provid...
Definition: IsReference.h:95
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
Header file for the reset shim.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i....
Definition: TransExpr.h:81
Header file for the extended initializer_list functionality.
Header file for the elements trait.
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
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
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:253
Constraint on the data type.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
decltype(auto) operator *(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:9091
#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
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:446
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:138
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ELEMENTS_TYPE(T)
Constraint on the data type.In case the given data type T is an element selection (i....
Definition: Elements.h:81
Constraint on the data type.
Header file for the implementation of the Elements base template.
Constraint on the data type.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:139
Constraint on the data type.
Header file for the exception macros of the math module.
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Constraint on the data type.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:558
Header file for the IsSparseVector type trait.
Header file for the IsConst type trait.
Header file for run time assertion macros.
Header file for the cross product trait.
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 Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance,...
Definition: Check.h:96
Header file for all forward declarations for expression class templates.
Header file for the isDefault shim.
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
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
Header file for the HasMutableDataAccess type trait.
#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
Header file for the IsReference type trait.
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
#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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBVECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is a subvector type (i.e....
Definition: Subvector.h:81
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
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
Header file for the implementation of the ElementsData class template.
auto operator *=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:494
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
Header file for the IsRestricted type trait.
#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.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
Header file for the clear shim.
Header file for the IsExpression type trait class.