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>
52 #include <blaze/math/Exception.h>
57 #include <blaze/math/shims/Clear.h>
59 #include <blaze/math/shims/Reset.h>
66 #include <blaze/math/views/Check.h>
70 #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  //**********************************************************************************************
466 
467  //**Constructors********************************************************************************
470  template< typename... REAs >
471  explicit inline Elements( VT& vector, REAs... args );
472 
473  Elements( const Elements& ) = default;
474  Elements( Elements&& ) = default;
476  //**********************************************************************************************
477 
478  //**Destructor**********************************************************************************
481  ~Elements() = default;
483  //**********************************************************************************************
484 
485  //**Data access functions***********************************************************************
488  inline Reference operator[]( size_t index );
489  inline ConstReference operator[]( size_t index ) const;
490  inline Reference at( size_t index );
491  inline ConstReference at( size_t index ) const;
492  inline Pointer data () noexcept;
493  inline ConstPointer data () const noexcept;
494  inline Iterator begin ();
495  inline ConstIterator begin () const;
496  inline ConstIterator cbegin() const;
497  inline Iterator end ();
498  inline ConstIterator end () const;
499  inline ConstIterator cend () const;
501  //**********************************************************************************************
502 
503  //**Assignment operators************************************************************************
506  inline Elements& operator= ( const ElementType& rhs );
507  inline Elements& operator= ( initializer_list<ElementType> list );
508  inline Elements& operator= ( const Elements& rhs );
509  template< typename VT2 > inline Elements& operator= ( const Vector<VT2,TF>& rhs );
510  template< typename VT2 > inline Elements& operator+=( const Vector<VT2,TF>& rhs );
511  template< typename VT2 > inline Elements& operator-=( const Vector<VT2,TF>& rhs );
512  template< typename VT2 > inline Elements& operator*=( const Vector<VT2,TF>& rhs );
513  template< typename VT2 > inline Elements& operator/=( const DenseVector<VT2,TF>& rhs );
514  template< typename VT2 > inline Elements& operator%=( const Vector<VT2,TF>& rhs );
516  //**********************************************************************************************
517 
518  //**Utility functions***************************************************************************
521  using DataType::idces;
522  using DataType::idx;
523  using DataType::size;
524 
525  inline VT& operand() noexcept;
526  inline const VT& operand() const noexcept;
527 
528  inline size_t spacing() const noexcept;
529  inline size_t capacity() const noexcept;
530  inline size_t nonZeros() const;
531  inline void reset();
533  //**********************************************************************************************
534 
535  //**Numeric functions***************************************************************************
538  template< typename Other > inline Elements& scale( const Other& scalar );
540  //**********************************************************************************************
541 
542  //**Expression template evaluation functions****************************************************
545  template< typename Other >
546  inline bool canAlias( const Other* alias ) const noexcept;
547 
548  template< typename Other >
549  inline bool isAliased( const Other* alias ) const noexcept;
550 
551  inline bool isAligned () const noexcept;
552  inline bool canSMPAssign() const noexcept;
553 
554  template< typename VT2 > inline void assign ( const DenseVector <VT2,TF>& rhs );
555  template< typename VT2 > inline void assign ( const SparseVector<VT2,TF>& rhs );
556  template< typename VT2 > inline void addAssign ( const DenseVector <VT2,TF>& rhs );
557  template< typename VT2 > inline void addAssign ( const SparseVector<VT2,TF>& rhs );
558  template< typename VT2 > inline void subAssign ( const DenseVector <VT2,TF>& rhs );
559  template< typename VT2 > inline void subAssign ( const SparseVector<VT2,TF>& rhs );
560  template< typename VT2 > inline void multAssign( const DenseVector <VT2,TF>& rhs );
561  template< typename VT2 > inline void multAssign( const SparseVector<VT2,TF>& rhs );
562  template< typename VT2 > inline void divAssign ( const DenseVector <VT2,TF>& rhs );
564  //**********************************************************************************************
565 
566  private:
567  //**Member variables****************************************************************************
570  Operand vector_;
571 
572  //**********************************************************************************************
573 
574  //**Compile time checks*************************************************************************
580  //**********************************************************************************************
581 };
583 //*************************************************************************************************
584 
585 
586 
587 
588 //=================================================================================================
589 //
590 // CONSTRUCTORS
591 //
592 //=================================================================================================
593 
594 //*************************************************************************************************
607 template< typename VT // Type of the dense vector
608  , bool TF // Transpose flag
609  , typename... CEAs > // Compile time element arguments
610 template< typename... REAs > // Optional arguments
611 inline Elements<VT,TF,true,CEAs...>::Elements( VT& vector, REAs... args )
612  : DataType( args... ) // Base class initialization
613  , vector_ ( vector ) // The vector containing the elements
614 {
615  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
616  for( size_t i=0UL; i<size(); ++i ) {
617  if( vector_.size() <= idx(i) ) {
618  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
619  }
620  }
621  }
622 }
624 //*************************************************************************************************
625 
626 
627 
628 
629 //=================================================================================================
630 //
631 // DATA ACCESS FUNCTIONS
632 //
633 //=================================================================================================
634 
635 //*************************************************************************************************
645 template< typename VT // Type of the dense vector
646  , bool TF // Transpose flag
647  , typename... CEAs > // Compile time element arguments
648 inline typename Elements<VT,TF,true,CEAs...>::Reference
649  Elements<VT,TF,true,CEAs...>::operator[]( size_t index )
650 {
651  BLAZE_USER_ASSERT( index < size(), "Invalid element access index" );
652  return vector_[idx(index)];
653 }
655 //*************************************************************************************************
656 
657 
658 //*************************************************************************************************
668 template< typename VT // Type of the dense vector
669  , bool TF // Transpose flag
670  , typename... CEAs > // Compile time element arguments
671 inline typename Elements<VT,TF,true,CEAs...>::ConstReference
672  Elements<VT,TF,true,CEAs...>::operator[]( size_t index ) const
673 {
674  BLAZE_USER_ASSERT( index < size(), "Invalid element access index" );
675  return const_cast<const VT&>( vector_ )[idx(index)];
676 }
678 //*************************************************************************************************
679 
680 
681 //*************************************************************************************************
692 template< typename VT // Type of the dense vector
693  , bool TF // Transpose flag
694  , typename... CEAs > // Compile time element arguments
695 inline typename Elements<VT,TF,true,CEAs...>::Reference
696  Elements<VT,TF,true,CEAs...>::at( size_t index )
697 {
698  if( index >= size() ) {
699  BLAZE_THROW_OUT_OF_RANGE( "Invalid element access index" );
700  }
701  return (*this)[index];
702 }
704 //*************************************************************************************************
705 
706 
707 //*************************************************************************************************
718 template< typename VT // Type of the dense vector
719  , bool TF // Transpose flag
720  , typename... CEAs > // Compile time element arguments
721 inline typename Elements<VT,TF,true,CEAs...>::ConstReference
722  Elements<VT,TF,true,CEAs...>::at( size_t index ) const
723 {
724  if( index >= size() ) {
725  BLAZE_THROW_OUT_OF_RANGE( "Invalid element access index" );
726  }
727  return (*this)[index];
728 }
730 //*************************************************************************************************
731 
732 
733 //*************************************************************************************************
741 template< typename VT // Type of the dense vector
742  , bool TF // Transpose flag
743  , typename... CEAs > // Compile time element arguments
744 inline typename Elements<VT,TF,true,CEAs...>::Pointer
746 {
747  return vector_.data() + idx(0UL);
748 }
750 //*************************************************************************************************
751 
752 
753 //*************************************************************************************************
761 template< typename VT // Type of the dense vector
762  , bool TF // Transpose flag
763  , typename... CEAs > // Compile time element arguments
764 inline typename Elements<VT,TF,true,CEAs...>::ConstPointer
765  Elements<VT,TF,true,CEAs...>::data() const noexcept
766 {
767  return vector_.data() + idx(0UL);
768 }
770 //*************************************************************************************************
771 
772 
773 //*************************************************************************************************
781 template< typename VT // Type of the dense vector
782  , bool TF // Transpose flag
783  , typename... CEAs > // Compile time element arguments
784 inline typename Elements<VT,TF,true,CEAs...>::Iterator
786 {
787  return Iterator( this, 0UL );
788 }
790 //*************************************************************************************************
791 
792 
793 //*************************************************************************************************
801 template< typename VT // Type of the dense vector
802  , bool TF // Transpose flag
803  , typename... CEAs > // Compile time element arguments
804 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
806 {
807  return ConstIterator( this, 0UL );
808 }
810 //*************************************************************************************************
811 
812 
813 //*************************************************************************************************
821 template< typename VT // Type of the dense vector
822  , bool TF // Transpose flag
823  , typename... CEAs > // Compile time element arguments
824 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
826 {
827  return ConstIterator( this, 0UL );
828 }
830 //*************************************************************************************************
831 
832 
833 //*************************************************************************************************
841 template< typename VT // Type of the dense vector
842  , bool TF // Transpose flag
843  , typename... CEAs > // Compile time element arguments
844 inline typename Elements<VT,TF,true,CEAs...>::Iterator
846 {
847  return Iterator( this, size() );
848 }
850 //*************************************************************************************************
851 
852 
853 //*************************************************************************************************
861 template< typename VT // Type of the dense vector
862  , bool TF // Transpose flag
863  , typename... CEAs > // Compile time element arguments
864 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
866 {
867  return ConstIterator( this, size() );
868 }
870 //*************************************************************************************************
871 
872 
873 //*************************************************************************************************
881 template< typename VT // Type of the dense vector
882  , bool TF // Transpose flag
883  , typename... CEAs > // Compile time element arguments
884 inline typename Elements<VT,TF,true,CEAs...>::ConstIterator
886 {
887  return ConstIterator( this, size() );
888 }
890 //*************************************************************************************************
891 
892 
893 
894 
895 //=================================================================================================
896 //
897 // ASSIGNMENT OPERATORS
898 //
899 //=================================================================================================
900 
901 //*************************************************************************************************
908 template< typename VT // Type of the dense vector
909  , bool TF // Transpose flag
910  , typename... CEAs > // Compile time element arguments
911 inline Elements<VT,TF,true,CEAs...>&
912  Elements<VT,TF,true,CEAs...>::operator=( const ElementType& rhs )
913 {
914  decltype(auto) left( derestrict( vector_ ) );
915 
916  for( size_t i=0UL; i<size(); ++i ) {
917  const size_t index( idx(i) );
918  if( !IsRestricted_v<VT> || trySet( vector_, index, rhs ) )
919  left[index] = rhs;
920  }
921 
922  return *this;
923 }
925 //*************************************************************************************************
926 
927 
928 //*************************************************************************************************
944 template< typename VT // Type of the dense vector
945  , bool TF // Transpose flag
946  , typename... CEAs > // Compile time element arguments
947 inline Elements<VT,TF,true,CEAs...>&
948  Elements<VT,TF,true,CEAs...>::operator=( initializer_list<ElementType> list )
949 {
950  if( list.size() > size() ) {
951  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to elements" );
952  }
953 
954  const InitializerVector<ElementType,TF> tmp( list, size() );
955 
956  if( IsRestricted_v<VT> ) {
957  for( size_t i=0UL; i<size(); ++i ) {
958  if( !trySet( vector_, idx(i), tmp[i] ) ) {
959  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
960  }
961  }
962  }
963 
964  decltype(auto) left( derestrict( vector_ ) );
965  for( size_t i=0UL; i<size(); ++i ) {
966  left[idx(i)] = tmp[i];
967  }
968 
969  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
970 
971  return *this;
972 }
974 //*************************************************************************************************
975 
976 
977 //*************************************************************************************************
989 template< typename VT // Type of the dense vector
990  , bool TF // Transpose flag
991  , typename... CEAs > // Compile time element arguments
992 inline Elements<VT,TF,true,CEAs...>&
993  Elements<VT,TF,true,CEAs...>::operator=( const Elements& rhs )
994 {
997 
998  if( &rhs == this || ( &vector_ == &rhs.vector_ && compareIndices( *this, rhs ) ) )
999  return *this;
1000 
1001  if( size() != rhs.size() ) {
1002  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1003  }
1004 
1005  if( IsRestricted_v<VT> ) {
1006  for( size_t i=0UL; i<size(); ++i ) {
1007  if( !trySet( vector_, idx(i), rhs[i] ) ) {
1008  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1009  }
1010  }
1011  }
1012 
1013  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1014 
1015  if( rhs.canAlias( &vector_ ) ) {
1016  const ResultType tmp( rhs );
1017  smpAssign( left, tmp );
1018  }
1019  else {
1020  smpAssign( left, rhs );
1021  }
1022 
1023  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1024 
1025  return *this;
1026 }
1028 //*************************************************************************************************
1029 
1030 
1031 //*************************************************************************************************
1043 template< typename VT // Type of the dense vector
1044  , bool TF // Transpose flag
1045  , typename... CEAs > // Compile time element arguments
1046 template< typename VT2 > // Type of the right-hand side vector
1047 inline Elements<VT,TF,true,CEAs...>&
1048  Elements<VT,TF,true,CEAs...>::operator=( const Vector<VT2,TF>& rhs )
1049 {
1050  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1051  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1052 
1053  if( size() != (~rhs).size() ) {
1054  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1055  }
1056 
1057  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1058  Right right( ~rhs );
1059 
1060  if( IsRestricted_v<VT> ) {
1061  for( size_t i=0UL; i<size(); ++i ) {
1062  if( !trySet( vector_, idx(i), right[i] ) ) {
1063  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1064  }
1065  }
1066  }
1067 
1068  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1069 
1070  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1071  const ResultType_t<VT2> tmp( right );
1072  smpAssign( left, tmp );
1073  }
1074  else {
1075  if( IsSparseVector_v<VT2> )
1076  reset();
1077  smpAssign( left, right );
1078  }
1079 
1080  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1081 
1082  return *this;
1083 }
1085 //*************************************************************************************************
1086 
1087 
1088 //*************************************************************************************************
1100 template< typename VT // Type of the dense vector
1101  , bool TF // Transpose flag
1102  , typename... CEAs > // Compile time element arguments
1103 template< typename VT2 > // Type of the right-hand side vector
1104 inline Elements<VT,TF,true,CEAs...>&
1105  Elements<VT,TF,true,CEAs...>::operator+=( const Vector<VT2,TF>& rhs )
1106 {
1107  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1108  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1109 
1110  if( size() != (~rhs).size() ) {
1111  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1112  }
1113 
1114  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1115  Right right( ~rhs );
1116 
1117  if( IsRestricted_v<VT> ) {
1118  for( size_t i=0UL; i<size(); ++i ) {
1119  if( !tryAdd( vector_, idx(i), right[i] ) ) {
1120  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1121  }
1122  }
1123  }
1124 
1125  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1126 
1127  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1128  const ResultType_t<VT2> tmp( right );
1129  smpAddAssign( left, tmp );
1130  }
1131  else {
1132  smpAddAssign( left, right );
1133  }
1134 
1135  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1136 
1137  return *this;
1138 }
1140 //*************************************************************************************************
1141 
1142 
1143 //*************************************************************************************************
1155 template< typename VT // Type of the dense vector
1156  , bool TF // Transpose flag
1157  , typename... CEAs > // Compile time element arguments
1158 template< typename VT2 > // Type of the right-hand side vector
1159 inline Elements<VT,TF,true,CEAs...>&
1160  Elements<VT,TF,true,CEAs...>::operator-=( const Vector<VT2,TF>& rhs )
1161 {
1162  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1163  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1164 
1165  if( size() != (~rhs).size() ) {
1166  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1167  }
1168 
1169  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1170  Right right( ~rhs );
1171 
1172  if( IsRestricted_v<VT> ) {
1173  for( size_t i=0UL; i<size(); ++i ) {
1174  if( !trySub( vector_, idx(i), right[i] ) ) {
1175  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1176  }
1177  }
1178  }
1179 
1180  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1181 
1182  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1183  const ResultType_t<VT2> tmp( right );
1184  smpSubAssign( left, tmp );
1185  }
1186  else {
1187  smpSubAssign( left, right );
1188  }
1189 
1190  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1191 
1192  return *this;
1193 }
1195 //*************************************************************************************************
1196 
1197 
1198 //*************************************************************************************************
1211 template< typename VT // Type of the dense vector
1212  , bool TF // Transpose flag
1213  , typename... CEAs > // Compile time element arguments
1214 template< typename VT2 > // Type of the right-hand side vector
1215 inline Elements<VT,TF,true,CEAs...>&
1216  Elements<VT,TF,true,CEAs...>::operator*=( const Vector<VT2,TF>& rhs )
1217 {
1218  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1219  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1220 
1221  if( size() != (~rhs).size() ) {
1222  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1223  }
1224 
1225  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1226  Right right( ~rhs );
1227 
1228  if( IsRestricted_v<VT> ) {
1229  for( size_t i=0UL; i<size(); ++i ) {
1230  if( !tryMult( vector_, idx(i), right[i] ) ) {
1231  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1232  }
1233  }
1234  }
1235 
1236  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1237 
1238  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1239  const ResultType_t<VT2> tmp( right );
1240  smpMultAssign( left, tmp );
1241  }
1242  else {
1243  smpMultAssign( left, right );
1244  }
1245 
1246  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1247 
1248  return *this;
1249 }
1251 //*************************************************************************************************
1252 
1253 
1254 //*************************************************************************************************
1266 template< typename VT // Type of the dense vector
1267  , bool TF // Transpose flag
1268  , typename... CEAs > // Compile time element arguments
1269 template< typename VT2 > // Type of the right-hand side dense vector
1270 inline Elements<VT,TF,true,CEAs...>&
1271  Elements<VT,TF,true,CEAs...>::operator/=( const DenseVector<VT2,TF>& rhs )
1272 {
1273  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1274  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1275 
1276  if( size() != (~rhs).size() ) {
1277  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1278  }
1279 
1280  using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>, const VT2& >;
1281  Right right( ~rhs );
1282 
1283  if( IsRestricted_v<VT> ) {
1284  for( size_t i=0UL; i<size(); ++i ) {
1285  if( !tryDiv( vector_, idx(i), right[i] ) ) {
1286  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1287  }
1288  }
1289  }
1290 
1291  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1292 
1293  if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1294  const ResultType_t<VT2> tmp( right );
1295  smpDivAssign( left, tmp );
1296  }
1297  else {
1298  smpDivAssign( left, right );
1299  }
1300 
1301  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1302 
1303  return *this;
1304 }
1306 //*************************************************************************************************
1307 
1308 
1309 //*************************************************************************************************
1322 template< typename VT // Type of the dense vector
1323  , bool TF // Transpose flag
1324  , typename... CEAs > // Compile time element arguments
1325 template< typename VT2 > // Type of the right-hand side vector
1326 inline Elements<VT,TF,true,CEAs...>&
1327  Elements<VT,TF,true,CEAs...>::operator%=( const Vector<VT2,TF>& rhs )
1328 {
1329  using blaze::assign;
1330 
1331  BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG( ResultType_t<VT2>, TF );
1332  BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ResultType_t<VT2> );
1333 
1334  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
1335 
1339 
1340  if( size() != 3UL || (~rhs).size() != 3UL ) {
1341  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1342  }
1343 
1344  const CrossType tmp( *this % (~rhs) );
1345 
1346  if( IsRestricted_v<VT> ) {
1347  for( size_t i=0UL; i<size(); ++i ) {
1348  if( !trySet( vector_, idx(i), tmp[i] ) ) {
1349  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted vector" );
1350  }
1351  }
1352  }
1353 
1354  BLAZE_DECLTYPE_AUTO( left, derestrict( *this ) );
1355 
1356  assign( left, tmp );
1357 
1358  BLAZE_INTERNAL_ASSERT( isIntact( vector_ ), "Invariant violation detected" );
1359 
1360  return *this;
1361 }
1363 //*************************************************************************************************
1364 
1365 
1366 
1367 
1368 //=================================================================================================
1369 //
1370 // UTILITY FUNCTIONS
1371 //
1372 //=================================================================================================
1373 
1374 //*************************************************************************************************
1380 template< typename VT // Type of the dense vector
1381  , bool TF // Transpose flag
1382  , typename... CEAs > // Compile time element arguments
1383 inline VT& Elements<VT,TF,true,CEAs...>::operand() noexcept
1384 {
1385  return vector_;
1386 }
1388 //*************************************************************************************************
1389 
1390 
1391 //*************************************************************************************************
1397 template< typename VT // Type of the dense vector
1398  , bool TF // Transpose flag
1399  , typename... CEAs > // Compile time element arguments
1400 inline const VT& Elements<VT,TF,true,CEAs...>::operand() const noexcept
1401 {
1402  return vector_;
1403 }
1405 //*************************************************************************************************
1406 
1407 
1408 //*************************************************************************************************
1414 template< typename VT // Type of the dense vector
1415  , bool TF // Transpose flag
1416  , typename... CEAs > // Compile time element arguments
1417 inline size_t Elements<VT,TF,true,CEAs...>::spacing() const noexcept
1418 {
1419  return size();
1420 }
1422 //*************************************************************************************************
1423 
1424 
1425 //*************************************************************************************************
1431 template< typename VT // Type of the dense vector
1432  , bool TF // Transpose flag
1433  , typename... CEAs > // Compile time element arguments
1434 inline size_t Elements<VT,TF,true,CEAs...>::capacity() const noexcept
1435 {
1436  return size();
1437 }
1439 //*************************************************************************************************
1440 
1441 
1442 //*************************************************************************************************
1451 template< typename VT // Type of the dense vector
1452  , bool TF // Transpose flag
1453  , typename... CEAs > // Compile time element arguments
1454 inline size_t Elements<VT,TF,true,CEAs...>::nonZeros() const
1455 {
1456  size_t nonzeros( 0 );
1457 
1458  for( size_t i=0UL; i<size(); ++i ) {
1459  if( !isDefault( vector_[idx(i)] ) )
1460  ++nonzeros;
1461  }
1462 
1463  return nonzeros;
1464 }
1466 //*************************************************************************************************
1467 
1468 
1469 //*************************************************************************************************
1475 template< typename VT // Type of the dense vector
1476  , bool TF // Transpose flag
1477  , typename... CEAs > // Compile time element arguments
1479 {
1480  using blaze::clear;
1481 
1482  for( size_t i=0UL; i<size(); ++i )
1483  clear( vector_[idx(i)] );
1484 }
1486 //*************************************************************************************************
1487 
1488 
1489 
1490 
1491 //=================================================================================================
1492 //
1493 // NUMERIC FUNCTIONS
1494 //
1495 //=================================================================================================
1496 
1497 //*************************************************************************************************
1508 template< typename VT // Type of the dense vector
1509  , bool TF // Transpose flag
1510  , typename... CEAs > // Compile time element arguments
1511 template< typename Other > // Data type of the scalar value
1512 inline Elements<VT,TF,true,CEAs...>&
1513  Elements<VT,TF,true,CEAs...>::scale( const Other& scalar )
1514 {
1515  for( size_t i=0UL; i<size(); ++i )
1516  vector_[idx(i)] *= scalar;
1517  return *this;
1518 }
1520 //*************************************************************************************************
1521 
1522 
1523 
1524 
1525 //=================================================================================================
1526 //
1527 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1528 //
1529 //=================================================================================================
1530 
1531 //*************************************************************************************************
1542 template< typename VT // Type of the dense vector
1543  , bool TF // Transpose flag
1544  , typename... CEAs > // Compile time element arguments
1545 template< typename Other > // Data type of the foreign expression
1546 inline bool Elements<VT,TF,true,CEAs...>::canAlias( const Other* alias ) const noexcept
1547 {
1548  return vector_.isAliased( alias );
1549 }
1551 //*************************************************************************************************
1552 
1553 
1554 //*************************************************************************************************
1565 template< typename VT // Type of the dense vector
1566  , bool TF // Transpose flag
1567  , typename... CEAs > // Compile time element arguments
1568 template< typename Other > // Data type of the foreign expression
1569 inline bool Elements<VT,TF,true,CEAs...>::isAliased( const Other* alias ) const noexcept
1570 {
1571  return vector_.isAliased( alias );
1572 }
1574 //*************************************************************************************************
1575 
1576 
1577 //*************************************************************************************************
1587 template< typename VT // Type of the dense vector
1588  , bool TF // Transpose flag
1589  , typename... CEAs > // Compile time element arguments
1590 inline bool Elements<VT,TF,true,CEAs...>::isAligned() const noexcept
1591 {
1592  return false;
1593 }
1595 //*************************************************************************************************
1596 
1597 
1598 //*************************************************************************************************
1609 template< typename VT // Type of the dense vector
1610  , bool TF // Transpose flag
1611  , typename... CEAs > // Compile time element arguments
1612 inline bool Elements<VT,TF,true,CEAs...>::canSMPAssign() const noexcept
1613 {
1614  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1615 }
1617 //*************************************************************************************************
1618 
1619 
1620 //*************************************************************************************************
1632 template< typename VT // Type of the dense vector
1633  , bool TF // Transpose flag
1634  , typename... CEAs > // Compile time element arguments
1635 template< typename VT2 > // Type of the right-hand side dense vector
1636 inline void Elements<VT,TF,true,CEAs...>::assign( const DenseVector<VT2,TF>& rhs )
1637 {
1638  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1639 
1640  const size_t ipos( size() & size_t(-2) );
1641  for( size_t i=0UL; i<ipos; i+=2UL ) {
1642  vector_[idx(i )] = (~rhs)[i ];
1643  vector_[idx(i+1UL)] = (~rhs)[i+1UL];
1644  }
1645  if( ipos < size() ) {
1646  vector_[idx(ipos)] = (~rhs)[ipos];
1647  }
1648 }
1650 //*************************************************************************************************
1651 
1652 
1653 //*************************************************************************************************
1665 template< typename VT // Type of the dense vector
1666  , bool TF // Transpose flag
1667  , typename... CEAs > // Compile time element arguments
1668 template< typename VT2 > // Type of the right-hand side sparse vector
1669 inline void Elements<VT,TF,true,CEAs...>::assign( const SparseVector<VT2,TF>& rhs )
1670 {
1671  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1672 
1673  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1674  vector_[idx(element->index())] = element->value();
1675 }
1677 //*************************************************************************************************
1678 
1679 
1680 //*************************************************************************************************
1692 template< typename VT // Type of the dense vector
1693  , bool TF // Transpose flag
1694  , typename... CEAs > // Compile time element arguments
1695 template< typename VT2 > // Type of the right-hand side dense vector
1696 inline void Elements<VT,TF,true,CEAs...>::addAssign( const DenseVector<VT2,TF>& rhs )
1697 {
1698  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1699 
1700  const size_t ipos( size() & size_t(-2) );
1701  for( size_t i=0UL; i<ipos; i+=2UL ) {
1702  vector_[idx(i )] += (~rhs)[i ];
1703  vector_[idx(i+1UL)] += (~rhs)[i+1UL];
1704  }
1705  if( ipos < size() ) {
1706  vector_[idx(ipos)] += (~rhs)[ipos];
1707  }
1708 }
1710 //*************************************************************************************************
1711 
1712 
1713 //*************************************************************************************************
1725 template< typename VT // Type of the dense vector
1726  , bool TF // Transpose flag
1727  , typename... CEAs > // Compile time element arguments
1728 template< typename VT2 > // Type of the right-hand side sparse vector
1729 inline void Elements<VT,TF,true,CEAs...>::addAssign( const SparseVector<VT2,TF>& rhs )
1730 {
1731  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1732 
1733  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1734  vector_[idx(element->index())] += element->value();
1735 }
1737 //*************************************************************************************************
1738 
1739 
1740 //*************************************************************************************************
1752 template< typename VT // Type of the dense vector
1753  , bool TF // Transpose flag
1754  , typename... CEAs > // Compile time element arguments
1755 template< typename VT2 > // Type of the right-hand side dense vector
1756 inline void Elements<VT,TF,true,CEAs...>::subAssign( const DenseVector<VT2,TF>& rhs )
1757 {
1758  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1759 
1760  const size_t ipos( size() & size_t(-2) );
1761  for( size_t i=0UL; i<ipos; i+=2UL ) {
1762  vector_[idx(i )] -= (~rhs)[i ];
1763  vector_[idx(i+1UL)] -= (~rhs)[i+1UL];
1764  }
1765  if( ipos < size() ) {
1766  vector_[idx(ipos)] -= (~rhs)[ipos];
1767  }
1768 }
1770 //*************************************************************************************************
1771 
1772 
1773 //*************************************************************************************************
1785 template< typename VT // Type of the dense vector
1786  , bool TF // Transpose flag
1787  , typename... CEAs > // Compile time element arguments
1788 template< typename VT2 > // Type of the right-hand side sparse vector
1789 inline void Elements<VT,TF,true,CEAs...>::subAssign( const SparseVector<VT2,TF>& rhs )
1790 {
1791  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1792 
1793  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1794  vector_[idx(element->index())] -= element->value();
1795 }
1797 //*************************************************************************************************
1798 
1799 
1800 //*************************************************************************************************
1812 template< typename VT // Type of the dense vector
1813  , bool TF // Transpose flag
1814  , typename... CEAs > // Compile time element arguments
1815 template< typename VT2 > // Type of the right-hand side dense vector
1816 inline void Elements<VT,TF,true,CEAs...>::multAssign( const DenseVector<VT2,TF>& rhs )
1817 {
1818  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1819 
1820  const size_t ipos( size() & size_t(-2) );
1821  for( size_t i=0UL; i<ipos; i+=2UL ) {
1822  vector_[idx(i )] *= (~rhs)[i ];
1823  vector_[idx(i+1UL)] *= (~rhs)[i+1UL];
1824  }
1825  if( ipos < size() ) {
1826  vector_[idx(ipos)] *= (~rhs)[ipos];
1827  }
1828 }
1830 //*************************************************************************************************
1831 
1832 
1833 //*************************************************************************************************
1845 template< typename VT // Type of the dense vector
1846  , bool TF // Transpose flag
1847  , typename... CEAs > // Compile time element arguments
1848 template< typename VT2 > // Type of the right-hand side sparse vector
1849 inline void Elements<VT,TF,true,CEAs...>::multAssign( const SparseVector<VT2,TF>& rhs )
1850 {
1851  using blaze::reset;
1852 
1853  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1854 
1855  size_t i( 0UL );
1856 
1857  for( ConstIterator_t<VT2> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
1858  const size_t index( element->index() );
1859  for( ; i<index; ++i )
1860  reset( vector_[idx(i)] );
1861  vector_[idx(i)] *= element->value();
1862  ++i;
1863  }
1864 
1865  for( ; i<size(); ++i ) {
1866  reset( vector_[idx(i)] );
1867  }
1868 }
1870 //*************************************************************************************************
1871 
1872 
1873 //*************************************************************************************************
1885 template< typename VT // Type of the dense vector
1886  , bool TF // Transpose flag
1887  , typename... CEAs > // Compile time element arguments
1888 template< typename VT2 > // Type of the right-hand side dense vector
1889 inline void Elements<VT,TF,true,CEAs...>::divAssign( const DenseVector<VT2,TF>& rhs )
1890 {
1891  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1892 
1893  const size_t ipos( size() & size_t(-2) );
1894  for( size_t i=0UL; i<ipos; i+=2UL ) {
1895  vector_[idx(i )] /= (~rhs)[i ];
1896  vector_[idx(i+1UL)] /= (~rhs)[i+1UL];
1897  }
1898  if( ipos < size() ) {
1899  vector_[idx(ipos)] /= (~rhs)[ipos];
1900  }
1901 }
1903 //*************************************************************************************************
1904 
1905 
1906 
1907 
1908 
1909 
1910 
1911 
1912 //=================================================================================================
1913 //
1914 // CLASS TEMPLATE SPECIALIZATION FOR DVECDVECCROSSEXPR
1915 //
1916 //=================================================================================================
1917 
1918 //*************************************************************************************************
1926 template< typename VT1 // Type of the left-hand side dense vector
1927  , typename VT2 // Type of the right-hand side dense vector
1928  , bool TF // Transpose flag
1929  , typename... CEAs > // Compile time element arguments
1930 class Elements< DVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
1931  : public View< DenseVector< Elements< DVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
1932  , private ElementsData<CEAs...>
1933 {
1934  private:
1935  //**Type definitions****************************************************************************
1936  using CPE = DVecDVecCrossExpr<VT1,VT2,TF>;
1937  using RT = ResultType_t<CPE>;
1938  using DataType = ElementsData<CEAs...>;
1939  //**********************************************************************************************
1940 
1941  //**Compile time flags**************************************************************************
1942  using DataType::N;
1943  //**********************************************************************************************
1944 
1945  public:
1946  //**Type definitions****************************************************************************
1948  using This = Elements<CPE,TF,true,CEAs...>;
1949 
1950  using BaseType = DenseVector<This,TF>;
1951  using ViewedType = CPE;
1952  using ResultType = ElementsTrait_t<RT,N>;
1953  using TransposeType = TransposeType_t<ResultType>;
1954  using ElementType = ElementType_t<CPE>;
1955  using ReturnType = ReturnType_t<CPE>;
1956  using CompositeType = const ResultType;
1957  //**********************************************************************************************
1958 
1959  //**Compilation flags***************************************************************************
1961  static constexpr bool simdEnabled = false;
1962 
1964  static constexpr bool smpAssignable = false;
1965  //**********************************************************************************************
1966 
1967  //**Constructor*********************************************************************************
1974  template< typename... REAs > // Optional element arguments
1975  explicit inline Elements( const CPE& vector, REAs... args )
1976  : DataType( args... ) // Base class initialization
1977  , vector_ ( vector ) // The dense vector/dense vector cross product expression
1978  {
1979  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
1980  for( size_t i=0UL; i<size(); ++i ) {
1981  if( vector_.size() <= idx(i) ) {
1982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
1983  }
1984  }
1985  }
1986  }
1987  //**********************************************************************************************
1988 
1989  //**Subscript operator**************************************************************************
1995  inline ReturnType operator[]( size_t index ) const {
1996  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
1997  return vector_[idx(index)];
1998  }
1999  //**********************************************************************************************
2000 
2001  //**At function*********************************************************************************
2008  inline ReturnType at( size_t index ) const {
2009  if( index >= size() ) {
2010  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2011  }
2012  return (*this)[index];
2013  }
2014  //**********************************************************************************************
2015 
2016  //**********************************************************************************************
2017  using DataType::idces;
2018  using DataType::idx;
2019  using DataType::size;
2020  //**********************************************************************************************
2021 
2022  //**Operand access******************************************************************************
2027  inline CPE operand() const noexcept {
2028  return vector_;
2029  }
2030  //**********************************************************************************************
2031 
2032  //**********************************************************************************************
2038  template< typename T >
2039  inline bool canAlias( const T* alias ) const noexcept {
2040  return vector_.canAlias( alias );
2041  }
2042  //**********************************************************************************************
2043 
2044  //**********************************************************************************************
2050  template< typename T >
2051  inline bool isAliased( const T* alias ) const noexcept {
2052  return vector_.isAliased( alias );
2053  }
2054  //**********************************************************************************************
2055 
2056  private:
2057  //**Member variables****************************************************************************
2058  CPE vector_;
2059  //**********************************************************************************************
2060 };
2062 //*************************************************************************************************
2063 
2064 
2065 
2066 
2067 
2068 
2069 
2070 
2071 //=================================================================================================
2072 //
2073 // CLASS TEMPLATE SPECIALIZATION FOR DVECSVECCROSSEXPR
2074 //
2075 //=================================================================================================
2076 
2077 //*************************************************************************************************
2085 template< typename VT1 // Type of the left-hand side dense vector
2086  , typename VT2 // Type of the right-hand side sparse vector
2087  , bool TF // Transpose flag
2088  , typename... CEAs > // Compile time element arguments
2089 class Elements< DVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
2090  : public View< DenseVector< Elements< DVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
2091  , private ElementsData<CEAs...>
2092 {
2093  private:
2094  //**Type definitions****************************************************************************
2095  using CPE = DVecSVecCrossExpr<VT1,VT2,TF>;
2096  using RT = ResultType_t<CPE>;
2097  using DataType = ElementsData<CEAs...>;
2098  //**********************************************************************************************
2099 
2100  //**Compile time flags**************************************************************************
2101  using DataType::N;
2102  //**********************************************************************************************
2103 
2104  public:
2105  //**Type definitions****************************************************************************
2107  using This = Elements<CPE,TF,true,CEAs...>;
2108 
2109  using BaseType = DenseVector<This,TF>;
2110  using ViewedType = CPE;
2111  using ResultType = ElementsTrait_t<RT,N>;
2112  using TransposeType = TransposeType_t<ResultType>;
2113  using ElementType = ElementType_t<CPE>;
2114  using ReturnType = ReturnType_t<CPE>;
2115  using CompositeType = const ResultType;
2116  //**********************************************************************************************
2117 
2118  //**Compilation flags***************************************************************************
2120  static constexpr bool simdEnabled = false;
2121 
2123  static constexpr bool smpAssignable = false;
2124  //**********************************************************************************************
2125 
2126  //**Constructor*********************************************************************************
2133  template< typename... REAs > // Optional element arguments
2134  explicit inline Elements( const CPE& vector, REAs... args )
2135  : DataType( args... ) // Base class initialization
2136  , vector_ ( vector ) // The dense vector/sparse vector cross product expression
2137  {
2138  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
2139  for( size_t i=0UL; i<size(); ++i ) {
2140  if( vector_.size() <= idx(i) ) {
2141  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
2142  }
2143  }
2144  }
2145  }
2146  //**********************************************************************************************
2147 
2148  //**Subscript operator**************************************************************************
2154  inline ReturnType operator[]( size_t index ) const {
2155  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2156  return vector_[idx(index)];
2157  }
2158  //**********************************************************************************************
2159 
2160  //**At function*********************************************************************************
2167  inline ReturnType at( size_t index ) const {
2168  if( index >= size() ) {
2169  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2170  }
2171  return (*this)[index];
2172  }
2173  //**********************************************************************************************
2174 
2175  //**********************************************************************************************
2176  using DataType::idces;
2177  using DataType::idx;
2178  using DataType::size;
2179  //**********************************************************************************************
2180 
2181  //**Operand access******************************************************************************
2186  inline CPE operand() const noexcept {
2187  return vector_;
2188  }
2189  //**********************************************************************************************
2190 
2191  //**********************************************************************************************
2197  template< typename T >
2198  inline bool canAlias( const T* alias ) const noexcept {
2199  return vector_.canAlias( alias );
2200  }
2201  //**********************************************************************************************
2202 
2203  //**********************************************************************************************
2209  template< typename T >
2210  inline bool isAliased( const T* alias ) const noexcept {
2211  return vector_.isAliased( alias );
2212  }
2213  //**********************************************************************************************
2214 
2215  private:
2216  //**Member variables****************************************************************************
2217  CPE vector_;
2218  //**********************************************************************************************
2219 };
2221 //*************************************************************************************************
2222 
2223 
2224 
2225 
2226 
2227 
2228 
2229 
2230 //=================================================================================================
2231 //
2232 // CLASS TEMPLATE SPECIALIZATION FOR SVECDVECCROSSEXPR
2233 //
2234 //=================================================================================================
2235 
2236 //*************************************************************************************************
2244 template< typename VT1 // Type of the left-hand side sparse vector
2245  , typename VT2 // Type of the right-hand side dense vector
2246  , bool TF // Transpose flag
2247  , typename... CEAs > // Compile time element arguments
2248 class Elements< SVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
2249  : public View< DenseVector< Elements< SVecDVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
2250  , private ElementsData<CEAs...>
2251 {
2252  private:
2253  //**Type definitions****************************************************************************
2254  using CPE = SVecDVecCrossExpr<VT1,VT2,TF>;
2255  using RT = ResultType_t<CPE>;
2256  using DataType = ElementsData<CEAs...>;
2257  //**********************************************************************************************
2258 
2259  //**Compile time flags**************************************************************************
2260  using DataType::N;
2261  //**********************************************************************************************
2262 
2263  public:
2264  //**Type definitions****************************************************************************
2266  using This = Elements<CPE,TF,true,CEAs...>;
2267 
2268  using BaseType = DenseVector<This,TF>;
2269  using ViewedType = CPE;
2270  using ResultType = ElementsTrait_t<RT,N>;
2271  using TransposeType = TransposeType_t<ResultType>;
2272  using ElementType = ElementType_t<CPE>;
2273  using ReturnType = ReturnType_t<CPE>;
2274  using CompositeType = const ResultType;
2275  //**********************************************************************************************
2276 
2277  //**Compilation flags***************************************************************************
2279  static constexpr bool simdEnabled = false;
2280 
2282  static constexpr bool smpAssignable = false;
2283  //**********************************************************************************************
2284 
2285  //**Constructor*********************************************************************************
2292  template< typename... REAs > // Optional element arguments
2293  explicit inline Elements( const CPE& vector, REAs... args )
2294  : DataType( args... ) // Base class initialization
2295  , vector_ ( vector ) // The sparse vector/dense vector cross product expression
2296  {
2297  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
2298  for( size_t i=0UL; i<size(); ++i ) {
2299  if( vector_.size() <= idx(i) ) {
2300  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
2301  }
2302  }
2303  }
2304  }
2305  //**********************************************************************************************
2306 
2307  //**Subscript operator**************************************************************************
2313  inline ReturnType operator[]( size_t index ) const {
2314  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2315  return vector_[idx(index)];
2316  }
2317  //**********************************************************************************************
2318 
2319  //**At function*********************************************************************************
2326  inline ReturnType at( size_t index ) const {
2327  if( index >= size() ) {
2328  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2329  }
2330  return (*this)[index];
2331  }
2332  //**********************************************************************************************
2333 
2334  //**********************************************************************************************
2335  using DataType::idces;
2336  using DataType::idx;
2337  using DataType::size;
2338  //**********************************************************************************************
2339 
2340  //**Operand access******************************************************************************
2345  inline CPE operand() const noexcept {
2346  return vector_;
2347  }
2348  //**********************************************************************************************
2349 
2350  //**********************************************************************************************
2356  template< typename T >
2357  inline bool canAlias( const T* alias ) const noexcept {
2358  return vector_.canAlias( alias );
2359  }
2360  //**********************************************************************************************
2361 
2362  //**********************************************************************************************
2368  template< typename T >
2369  inline bool isAliased( const T* alias ) const noexcept {
2370  return vector_.isAliased( alias );
2371  }
2372  //**********************************************************************************************
2373 
2374  private:
2375  //**Member variables****************************************************************************
2376  CPE vector_;
2377  //**********************************************************************************************
2378 };
2380 //*************************************************************************************************
2381 
2382 
2383 
2384 
2385 
2386 
2387 
2388 
2389 //=================================================================================================
2390 //
2391 // CLASS TEMPLATE SPECIALIZATION FOR SVECSVECCROSSEXPR
2392 //
2393 //=================================================================================================
2394 
2395 //*************************************************************************************************
2403 template< typename VT1 // Type of the left-hand side sparse vector
2404  , typename VT2 // Type of the right-hand side sparse vector
2405  , bool TF // Transpose flag
2406  , typename... CEAs > // Compile time element arguments
2407 class Elements< SVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >
2408  : public View< DenseVector< Elements< SVecSVecCrossExpr<VT1,VT2,TF>, TF, true, CEAs... >, TF > >
2409  , private ElementsData<CEAs...>
2410 {
2411  private:
2412  //**Type definitions****************************************************************************
2413  using CPE = SVecSVecCrossExpr<VT1,VT2,TF>;
2414  using RT = ResultType_t<CPE>;
2415  using DataType = ElementsData<CEAs...>;
2416  //**********************************************************************************************
2417 
2418  //**Compile time flags**************************************************************************
2419  using DataType::N;
2420  //**********************************************************************************************
2421 
2422  public:
2423  //**Type definitions****************************************************************************
2425  using This = Elements<CPE,TF,true,CEAs...>;
2426 
2427  using BaseType = DenseVector<This,TF>;
2428  using ViewedType = CPE;
2429  using ResultType = ElementsTrait_t<RT,N>;
2430  using TransposeType = TransposeType_t<ResultType>;
2431  using ElementType = ElementType_t<CPE>;
2432  using ReturnType = ReturnType_t<CPE>;
2433  using CompositeType = const ResultType;
2434  //**********************************************************************************************
2435 
2436  //**Compilation flags***************************************************************************
2438  static constexpr bool simdEnabled = false;
2439 
2441  static constexpr bool smpAssignable = false;
2442  //**********************************************************************************************
2443 
2444  //**Constructor*********************************************************************************
2451  template< typename... REAs > // Optional element arguments
2452  explicit inline Elements( const CPE& vector, REAs... args )
2453  : DataType( args... ) // Base class initialization
2454  , vector_ ( vector ) // The sparse vector/sparse vector cross product expression
2455  {
2456  if( !Contains_v< TypeList<REAs...>, Unchecked > ) {
2457  for( size_t i=0UL; i<size(); ++i ) {
2458  if( vector_.size() <= idx(i) ) {
2459  BLAZE_THROW_INVALID_ARGUMENT( "Invalid element access index" );
2460  }
2461  }
2462  }
2463  }
2464  //**********************************************************************************************
2465 
2466  //**Subscript operator**************************************************************************
2472  inline ReturnType operator[]( size_t index ) const {
2473  BLAZE_INTERNAL_ASSERT( index < size(), "Invalid vector access index" );
2474  return vector_[idx(index)];
2475  }
2476  //**********************************************************************************************
2477 
2478  //**At function*********************************************************************************
2485  inline ReturnType at( size_t index ) const {
2486  if( index >= size() ) {
2487  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
2488  }
2489  return (*this)[index];
2490  }
2491  //**********************************************************************************************
2492 
2493  //**********************************************************************************************
2494  using DataType::idces;
2495  using DataType::idx;
2496  using DataType::size;
2497  //**********************************************************************************************
2498 
2499  //**Operand access******************************************************************************
2504  inline CPE operand() const noexcept {
2505  return vector_;
2506  }
2507  //**********************************************************************************************
2508 
2509  //**********************************************************************************************
2515  template< typename T >
2516  inline bool canAlias( const T* alias ) const noexcept {
2517  return vector_.canAlias( alias );
2518  }
2519  //**********************************************************************************************
2520 
2521  //**********************************************************************************************
2527  template< typename T >
2528  inline bool isAliased( const T* alias ) const noexcept {
2529  return vector_.isAliased( alias );
2530  }
2531  //**********************************************************************************************
2532 
2533  private:
2534  //**Member variables****************************************************************************
2535  CPE vector_;
2536  //**********************************************************************************************
2537 };
2539 //*************************************************************************************************
2540 
2541 } // namespace blaze
2542 
2543 #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.
#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
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:354
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:169
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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
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
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
Header file for the DenseVector base class.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
Constraint on the data type.
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.
Header file for the decltype(auto) workaround.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
#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:252
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
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.
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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:139
#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:135
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
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:8908
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.
Header file for all forward declarations for expression class templates.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the IsSparseVector type trait.
Header file for the IsConst type trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
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 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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#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
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
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
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:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
Header file for the implementation of the ElementsData class template.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
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, 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 clear shim.
Header file for the IsExpression type trait class.