DVecDVecDivExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
54 #include <blaze/math/SIMD.h>
65 #include <blaze/system/Inline.h>
67 #include <blaze/util/Assert.h>
69 #include <blaze/util/EnableIf.h>
72 #include <blaze/util/mpl/And.h>
73 #include <blaze/util/mpl/If.h>
74 #include <blaze/util/mpl/Max.h>
75 #include <blaze/util/Types.h>
77 
78 
79 namespace blaze {
80 
81 //=================================================================================================
82 //
83 // CLASS DVECDVECDIVEXPR
84 //
85 //=================================================================================================
86 
87 //*************************************************************************************************
94 template< typename VT1 // Type of the left-hand side dense vector
95  , typename VT2 // Type of the right-hand side dense vector
96  , bool TF > // Transpose flag
97 class DVecDVecDivExpr : public DenseVector< DVecDVecDivExpr<VT1,VT2,TF>, TF >
98  , private VecVecDivExpr
99  , private Computation
100 {
101  private:
102  //**Type definitions****************************************************************************
111  //**********************************************************************************************
112 
113  //**Return type evaluation**********************************************************************
115 
120  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
121 
124  //**********************************************************************************************
125 
126  //**Serial evaluation strategy******************************************************************
128 
134  enum : bool { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
135 
137  template< typename VT >
139  struct UseAssign {
140  enum : bool { value = useAssign };
141  };
143  //**********************************************************************************************
144 
145  //**Parallel evaluation strategy****************************************************************
147 
153  template< typename VT >
154  struct UseSMPAssign {
155  enum : bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
156  };
158  //**********************************************************************************************
159 
160  public:
161  //**Type definitions****************************************************************************
166 
169 
172 
174  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
175 
177  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
178  //**********************************************************************************************
179 
180  //**ConstIterator class definition**************************************************************
184  {
185  public:
186  //**Type definitions*************************************************************************
187  typedef std::random_access_iterator_tag IteratorCategory;
188  typedef ElementType ValueType;
189  typedef ElementType* PointerType;
190  typedef ElementType& ReferenceType;
192 
193  // STL iterator requirements
194  typedef IteratorCategory iterator_category;
195  typedef ValueType value_type;
196  typedef PointerType pointer;
197  typedef ReferenceType reference;
198  typedef DifferenceType difference_type;
199 
202 
205  //*******************************************************************************************
206 
207  //**Constructor******************************************************************************
213  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
214  : left_ ( left ) // Iterator to the current left-hand side element
215  , right_( right ) // Iterator to the current right-hand side element
216  {}
217  //*******************************************************************************************
218 
219  //**Addition assignment operator*************************************************************
225  inline ConstIterator& operator+=( size_t inc ) {
226  left_ += inc;
227  right_ += inc;
228  return *this;
229  }
230  //*******************************************************************************************
231 
232  //**Subtraction assignment operator**********************************************************
238  inline ConstIterator& operator-=( size_t dec ) {
239  left_ -= dec;
240  right_ -= dec;
241  return *this;
242  }
243  //*******************************************************************************************
244 
245  //**Prefix increment operator****************************************************************
251  ++left_;
252  ++right_;
253  return *this;
254  }
255  //*******************************************************************************************
256 
257  //**Postfix increment operator***************************************************************
262  inline const ConstIterator operator++( int ) {
263  return ConstIterator( left_++, right_++ );
264  }
265  //*******************************************************************************************
266 
267  //**Prefix decrement operator****************************************************************
273  --left_;
274  --right_;
275  return *this;
276  }
277  //*******************************************************************************************
278 
279  //**Postfix decrement operator***************************************************************
284  inline const ConstIterator operator--( int ) {
285  return ConstIterator( left_--, right_-- );
286  }
287  //*******************************************************************************************
288 
289  //**Element access operator******************************************************************
294  inline ReturnType operator*() const {
295  return (*left_) / (*right_);
296  }
297  //*******************************************************************************************
298 
299  //**Load function****************************************************************************
304  inline auto load() const noexcept {
305  return left_.load() / right_.load();
306  }
307  //*******************************************************************************************
308 
309  //**Equality operator************************************************************************
315  inline bool operator==( const ConstIterator& rhs ) const {
316  return left_ == rhs.left_;
317  }
318  //*******************************************************************************************
319 
320  //**Inequality operator**********************************************************************
326  inline bool operator!=( const ConstIterator& rhs ) const {
327  return left_ != rhs.left_;
328  }
329  //*******************************************************************************************
330 
331  //**Less-than operator***********************************************************************
337  inline bool operator<( const ConstIterator& rhs ) const {
338  return left_ < rhs.left_;
339  }
340  //*******************************************************************************************
341 
342  //**Greater-than operator********************************************************************
348  inline bool operator>( const ConstIterator& rhs ) const {
349  return left_ > rhs.left_;
350  }
351  //*******************************************************************************************
352 
353  //**Less-or-equal-than operator**************************************************************
359  inline bool operator<=( const ConstIterator& rhs ) const {
360  return left_ <= rhs.left_;
361  }
362  //*******************************************************************************************
363 
364  //**Greater-or-equal-than operator***********************************************************
370  inline bool operator>=( const ConstIterator& rhs ) const {
371  return left_ >= rhs.left_;
372  }
373  //*******************************************************************************************
374 
375  //**Subtraction operator*********************************************************************
381  inline DifferenceType operator-( const ConstIterator& rhs ) const {
382  return left_ - rhs.left_;
383  }
384  //*******************************************************************************************
385 
386  //**Addition operator************************************************************************
393  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
394  return ConstIterator( it.left_ + inc, it.right_ + inc );
395  }
396  //*******************************************************************************************
397 
398  //**Addition operator************************************************************************
405  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
406  return ConstIterator( it.left_ + inc, it.right_ + inc );
407  }
408  //*******************************************************************************************
409 
410  //**Subtraction operator*********************************************************************
417  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
418  return ConstIterator( it.left_ - dec, it.right_ - dec );
419  }
420  //*******************************************************************************************
421 
422  private:
423  //**Member variables*************************************************************************
424  LeftIteratorType left_;
425  RightIteratorType right_;
426  //*******************************************************************************************
427  };
428  //**********************************************************************************************
429 
430  //**Compilation flags***************************************************************************
432  enum : bool { simdEnabled = VT1::simdEnabled && VT2::simdEnabled &&
434 
436  enum : bool { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
437  //**********************************************************************************************
438 
439  //**SIMD properties*****************************************************************************
441  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
442  //**********************************************************************************************
443 
444  //**Constructor*********************************************************************************
450  explicit inline DVecDVecDivExpr( const VT1& lhs, const VT2& rhs ) noexcept
451  : lhs_( lhs ) // Left-hand side dense vector of the division expression
452  , rhs_( rhs ) // Right-hand side dense vector of the division expression
453  {
454  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
455  }
456  //**********************************************************************************************
457 
458  //**Subscript operator**************************************************************************
464  inline ReturnType operator[]( size_t index ) const {
465  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
466  return lhs_[index] / rhs_[index];
467  }
468  //**********************************************************************************************
469 
470  //**At function*********************************************************************************
477  inline ReturnType at( size_t index ) const {
478  if( index >= lhs_.size() ) {
479  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
480  }
481  return (*this)[index];
482  }
483  //**********************************************************************************************
484 
485  //**Load function*******************************************************************************
491  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
492  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
493  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
494  return lhs_.load( index ) / rhs_.load( index );
495  }
496  //**********************************************************************************************
497 
498  //**Begin function******************************************************************************
503  inline ConstIterator begin() const {
504  return ConstIterator( lhs_.begin(), rhs_.begin() );
505  }
506  //**********************************************************************************************
507 
508  //**End function********************************************************************************
513  inline ConstIterator end() const {
514  return ConstIterator( lhs_.end(), rhs_.end() );
515  }
516  //**********************************************************************************************
517 
518  //**Size function*******************************************************************************
523  inline size_t size() const noexcept {
524  return lhs_.size();
525  }
526  //**********************************************************************************************
527 
528  //**Left operand access*************************************************************************
533  inline LeftOperand leftOperand() const noexcept {
534  return lhs_;
535  }
536  //**********************************************************************************************
537 
538  //**Right operand access************************************************************************
543  inline RightOperand rightOperand() const noexcept {
544  return rhs_;
545  }
546  //**********************************************************************************************
547 
548  //**********************************************************************************************
554  template< typename T >
555  inline bool canAlias( const T* alias ) const noexcept {
556  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
557  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
558  }
559  //**********************************************************************************************
560 
561  //**********************************************************************************************
567  template< typename T >
568  inline bool isAliased( const T* alias ) const noexcept {
569  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
570  }
571  //**********************************************************************************************
572 
573  //**********************************************************************************************
578  inline bool isAligned() const noexcept {
579  return lhs_.isAligned() && rhs_.isAligned();
580  }
581  //**********************************************************************************************
582 
583  //**********************************************************************************************
588  inline bool canSMPAssign() const noexcept {
589  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
590  ( size() > SMP_DVECDVECDIV_THRESHOLD );
591  }
592  //**********************************************************************************************
593 
594  private:
595  //**Member variables****************************************************************************
596  LeftOperand lhs_;
597  RightOperand rhs_;
598  //**********************************************************************************************
599 
600  //**Assignment to dense vectors*****************************************************************
614  template< typename VT > // Type of the target dense vector
615  friend inline EnableIf_< UseAssign<VT> >
616  assign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
617  {
619 
620  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
621 
622  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
623  divAssign( ~lhs, rhs.rhs_ );
624  }
626  assign ( ~lhs, rhs.lhs_ );
627  divAssign( ~lhs, rhs.rhs_ );
628  }
629  else {
630  const ResultType tmp( serial( rhs ) );
631  assign( ~lhs, tmp );
632  }
633  }
635  //**********************************************************************************************
636 
637  //**Assignment to sparse vectors****************************************************************
651  template< typename VT > // Type of the target sparse vector
652  friend inline EnableIf_< UseAssign<VT> >
653  assign( SparseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
654  {
656 
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
662 
663  const ResultType tmp( serial( rhs ) );
664  assign( ~lhs, tmp );
665  }
667  //**********************************************************************************************
668 
669  //**Addition assignment to dense vectors********************************************************
683  template< typename VT > // Type of the target dense vector
684  friend inline EnableIf_< UseAssign<VT> >
685  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
686  {
688 
692 
693  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
694 
695  const ResultType tmp( serial( rhs ) );
696  addAssign( ~lhs, tmp );
697  }
699  //**********************************************************************************************
700 
701  //**Addition assignment to sparse vectors*******************************************************
702  // No special implementation for the addition assignment to sparse vectors.
703  //**********************************************************************************************
704 
705  //**Subtraction assignment to dense vectors*****************************************************
719  template< typename VT > // Type of the target dense vector
720  friend inline EnableIf_< UseAssign<VT> >
721  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
722  {
724 
728 
729  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
730 
731  const ResultType tmp( serial( rhs ) );
732  subAssign( ~lhs, tmp );
733  }
735  //**********************************************************************************************
736 
737  //**Subtraction assignment to sparse vectors****************************************************
738  // No special implementation for the subtraction assignment to sparse vectors.
739  //**********************************************************************************************
740 
741  //**Multiplication assignment to dense vectors**************************************************
755  template< typename VT > // Type of the target dense vector
756  friend inline EnableIf_< UseAssign<VT> >
757  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
758  {
760 
764 
765  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
766 
767  const ResultType tmp( serial( rhs ) );
768  multAssign( ~lhs, tmp );
769  }
771  //**********************************************************************************************
772 
773  //**Multiplication assignment to sparse vectors*************************************************
774  // No special implementation for the multiplication assignment to sparse vectors.
775  //**********************************************************************************************
776 
777  //**Division assignment to dense vectors********************************************************
791  template< typename VT > // Type of the target dense vector
792  friend inline EnableIf_< UseAssign<VT> >
793  divAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
794  {
796 
800 
801  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
802 
803  const ResultType tmp( serial( rhs ) );
804  divAssign( ~lhs, tmp );
805  }
807  //**********************************************************************************************
808 
809  //**Division assignment to sparse vectors*******************************************************
810  // No special implementation for the division assignment to sparse vectors.
811  //**********************************************************************************************
812 
813  //**SMP assignment to dense vectors*************************************************************
827  template< typename VT > // Type of the target dense vector
828  friend inline EnableIf_< UseSMPAssign<VT> >
829  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
830  {
832 
833  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
834 
835  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
836  smpDivAssign( ~lhs, rhs.rhs_ );
837  }
839  smpAssign ( ~lhs, rhs.lhs_ );
840  smpDivAssign( ~lhs, rhs.rhs_ );
841  }
842  else {
843  const ResultType tmp( rhs );
844  smpAssign( ~lhs, tmp );
845  }
846  }
848  //**********************************************************************************************
849 
850  //**SMP assignment to sparse vectors************************************************************
864  template< typename VT > // Type of the target sparse vector
865  friend inline EnableIf_< UseSMPAssign<VT> >
866  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
867  {
869 
873 
874  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
875 
876  const ResultType tmp( rhs );
877  smpAssign( ~lhs, tmp );
878  }
880  //**********************************************************************************************
881 
882  //**SMP addition assignment to dense vectors****************************************************
896  template< typename VT > // Type of the target dense vector
897  friend inline EnableIf_< UseSMPAssign<VT> >
899  {
901 
905 
906  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
907 
908  const ResultType tmp( rhs );
909  smpAddAssign( ~lhs, tmp );
910  }
912  //**********************************************************************************************
913 
914  //**SMP addition assignment to sparse vectors***************************************************
915  // No special implementation for the SMP addition assignment to sparse vectors.
916  //**********************************************************************************************
917 
918  //**SMP subtraction assignment to dense vectors*************************************************
932  template< typename VT > // Type of the target dense vector
933  friend inline EnableIf_< UseSMPAssign<VT> >
935  {
937 
941 
942  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
943 
944  const ResultType tmp( rhs );
945  smpSubAssign( ~lhs, tmp );
946  }
948  //**********************************************************************************************
949 
950  //**SMP subtraction assignment to sparse vectors************************************************
951  // No special implementation for the SMP subtraction assignment to sparse vectors.
952  //**********************************************************************************************
953 
954  //**SMP multiplication assignment to dense vectors**********************************************
968  template< typename VT > // Type of the target dense vector
969  friend inline EnableIf_< UseSMPAssign<VT> >
971  {
973 
977 
978  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
979 
980  const ResultType tmp( rhs );
981  smpMultAssign( ~lhs, tmp );
982  }
984  //**********************************************************************************************
985 
986  //**SMP multiplication assignment to sparse vectors*********************************************
987  // No special implementation for the SMP multiplication assignment to sparse vectors.
988  //**********************************************************************************************
989 
990  //**SMP division assignment to dense vectors****************************************************
1004  template< typename VT > // Type of the target dense vector
1005  friend inline EnableIf_< UseSMPAssign<VT> >
1006  smpDivAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
1007  {
1009 
1013 
1014  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1015 
1016  const ResultType tmp( rhs );
1017  smpDivAssign( ~lhs, tmp );
1018  }
1020  //**********************************************************************************************
1021 
1022  //**SMP division assignment to sparse vectors***************************************************
1023  // No special implementation for the SMP division assignment to sparse vectors.
1024  //**********************************************************************************************
1025 
1026  //**Compile time checks*************************************************************************
1034  //**********************************************************************************************
1035 };
1036 //*************************************************************************************************
1037 
1038 
1039 
1040 
1041 //=================================================================================================
1042 //
1043 // GLOBAL BINARY ARITHMETIC OPERATORS
1044 //
1045 //=================================================================================================
1046 
1047 //*************************************************************************************************
1072 template< typename T1 // Type of the left-hand side dense vector
1073  , typename T2 // Type of the right-hand side dense vector
1074  , bool TF > // Transpose flag
1075 inline const DVecDVecDivExpr<T1,T2,TF>
1077 {
1079 
1080  if( (~lhs).size() != (~rhs).size() ) {
1081  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1082  }
1083 
1084  return DVecDVecDivExpr<T1,T2,TF>( ~lhs, ~rhs );
1085 }
1086 //*************************************************************************************************
1087 
1088 
1089 
1090 
1091 //=================================================================================================
1092 //
1093 // SIZE SPECIALIZATIONS
1094 //
1095 //=================================================================================================
1096 
1097 //*************************************************************************************************
1099 template< typename VT1, typename VT2, bool TF >
1100 struct Size< DVecDVecDivExpr<VT1,VT2,TF> >
1101  : public Max< Size<VT1>, Size<VT2> >
1102 {};
1104 //*************************************************************************************************
1105 
1106 
1107 
1108 
1109 //=================================================================================================
1110 //
1111 // ISALIGNED SPECIALIZATIONS
1112 //
1113 //=================================================================================================
1114 
1115 //*************************************************************************************************
1117 template< typename VT1, typename VT2, bool TF >
1118 struct IsAligned< DVecDVecDivExpr<VT1,VT2,TF> >
1119  : public BoolConstant< And< IsAligned<VT1>, IsAligned<VT2> >::value >
1120 {};
1122 //*************************************************************************************************
1123 
1124 
1125 
1126 
1127 //=================================================================================================
1128 //
1129 // EXPRESSION TRAIT SPECIALIZATIONS
1130 //
1131 //=================================================================================================
1132 
1133 //*************************************************************************************************
1135 template< typename VT1, typename VT2, bool TF, bool AF >
1136 struct SubvectorExprTrait< DVecDVecDivExpr<VT1,VT2,TF>, AF >
1137 {
1138  public:
1139  //**********************************************************************************************
1142  //**********************************************************************************************
1143 };
1145 //*************************************************************************************************
1146 
1147 } // namespace blaze
1148 
1149 #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
Pointer difference type of the Blaze library.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:348
Header file for auxiliary alias declarations.
Header file for the Max class template.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
DVecDVecDivExpr< VT1, VT2, TF > This
Type of this DVecDVecDivExpr instance.
Definition: DVecDVecDivExpr.h:162
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Evaluation of the expression type type of a subvector operation.Via this type trait it is possible to...
Definition: SubvectorExprTrait.h:79
Header file for the VecVecDivExpr base class.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecDivExpr.h:381
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:721
Header file for basic type definitions.
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the serial shim.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the IsSame and IsStrictlySame type traits.
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:337
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:503
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
Iterator over the elements of the dense vector.
Definition: DVecDVecDivExpr.h:183
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:177
Header file for the And class template.
Header file for the DenseVector base class.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:315
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:138
RightOperand rhs_
Right-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:597
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecDivExpr.h:425
Constraint on the data type.
Header file for the RequiresEvaluation type trait.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecDivExpr.h:191
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:370
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecDivExpr.h:464
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:108
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecDivExpr.h:194
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecDVecDivExpr.h:523
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the DivExprTrait class template.
Expression object for dense vector-dense vector divisions.The DVecDVecDivExpr class represents the co...
Definition: DVecDVecDivExpr.h:97
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:359
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:104
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
IfTrue_< useAssign, const ResultType, const DVecDVecDivExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecDVecDivExpr.h:171
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ConstIterator_< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:201
const EnableIf_< IsNumeric< T2 >, DivExprTrait_< T1, T2 > > operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:966
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecDivExpr.h:272
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecDivExpr.h:262
Header file for the IsTemporary type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecDivExpr.h:284
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:110
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecDivExpr.h:424
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
DivTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecDVecDivExpr.h:163
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:195
#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
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:533
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:65
typename SubvectorExprTrait< VT, AF >::Type SubvectorExprTrait_
Auxiliary alias declaration for the SubvectorExprTrait type trait.The SubvectorExprTrait_ alias decla...
Definition: SubvectorExprTrait.h:133
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:393
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:144
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the IsAligned type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecDivExpr.h:238
Constraint on the data type.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecDivExpr.h:578
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecDivExpr.h:568
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:326
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
DivExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecDivExpr.h:123
ElementType * PointerType
Pointer return type.
Definition: DVecDVecDivExpr.h:189
Constraint on the data type.
ConstIterator_< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:204
Header file for the exception macros of the math module.
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:188
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:174
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecDivExpr.h:198
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:304
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:245
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:417
Header file for run time assertion macros.
Compile time value evaluation.The Max class template selects the larger of the two given template arg...
Definition: Max.h:72
Header file for the division trait.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecDivExpr.h:405
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecDivExpr.h:225
ReferenceType reference
Reference return type.
Definition: DVecDVecDivExpr.h:197
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:103
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecDivExpr.h:250
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecDivExpr.h:477
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:491
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecDivExpr.h:187
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:107
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecDivExpr.h:588
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:109
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecDivExpr.h:164
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:513
LeftOperand lhs_
Left-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:596
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:106
Header file for the HasSIMDDiv type trait.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECDIVEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecDivExpr.h:109
Header file for the IsComputation type trait class.
typename DivExprTrait< T1, T2 >::Type DivExprTrait_
Auxiliary alias declaration for the DivExprTrait class template.The DivExprTrait_ alias declaration p...
Definition: DivExprTrait.h:196
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecDivExpr.h:190
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:75
PointerType pointer
Pointer return type.
Definition: DVecDVecDivExpr.h:196
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:120
Header file for the IntegralConstant class template.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecDivExpr.h:213
Header file for the SubvectorExprTrait class template.
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:543
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
DVecDVecDivExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecDivExpr class.
Definition: DVecDVecDivExpr.h:450
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecDVecDivExpr.h:168
System settings for the inline keywords.
Header file for the Size 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
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:71
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecDivExpr.h:555
Header file for the IsExpression type trait class.
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:105
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecDVecDivExpr.h:165
Header file for the function trace functionality.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecDivExpr.h:294