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>
49 #include <blaze/math/Exception.h>
55 #include <blaze/math/SIMD.h>
65 #include <blaze/system/Inline.h>
67 #include <blaze/util/Assert.h>
68 #include <blaze/util/EnableIf.h>
71 #include <blaze/util/mpl/And.h>
72 #include <blaze/util/mpl/If.h>
73 #include <blaze/util/mpl/Maximum.h>
74 #include <blaze/util/Types.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS DVECDVECDIVEXPR
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename VT1 // Type of the left-hand side dense vector
94  , typename VT2 // Type of the right-hand side dense vector
95  , bool TF > // Transpose flag
97  : public VecVecDivExpr< DenseVector< DVecDVecDivExpr<VT1,VT2,TF>, TF > >
98  , private Computation
99 {
100  private:
101  //**Type definitions****************************************************************************
110  //**********************************************************************************************
111 
112  //**Return type evaluation**********************************************************************
114 
119  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
120 
123  //**********************************************************************************************
124 
125  //**Serial evaluation strategy******************************************************************
127 
133  enum : bool { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
134 
136  template< typename VT >
138  struct UseAssign {
139  enum : bool { value = useAssign };
140  };
142  //**********************************************************************************************
143 
144  //**Parallel evaluation strategy****************************************************************
146 
152  template< typename VT >
153  struct UseSMPAssign {
154  enum : bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
155  };
157  //**********************************************************************************************
158 
159  public:
160  //**Type definitions****************************************************************************
165 
168 
171 
173  using LeftOperand = If_< IsExpression<VT1>, const VT1, const VT1& >;
174 
176  using RightOperand = If_< IsExpression<VT2>, const VT2, const VT2& >;
177  //**********************************************************************************************
178 
179  //**ConstIterator class definition**************************************************************
183  {
184  public:
185  //**Type definitions*************************************************************************
186  using IteratorCategory = std::random_access_iterator_tag;
191 
192  // STL iterator requirements
198 
201 
204  //*******************************************************************************************
205 
206  //**Constructor******************************************************************************
212  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
213  : left_ ( left ) // Iterator to the current left-hand side element
214  , right_( right ) // Iterator to the current right-hand side element
215  {}
216  //*******************************************************************************************
217 
218  //**Addition assignment operator*************************************************************
224  inline ConstIterator& operator+=( size_t inc ) {
225  left_ += inc;
226  right_ += inc;
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Subtraction assignment operator**********************************************************
237  inline ConstIterator& operator-=( size_t dec ) {
238  left_ -= dec;
239  right_ -= dec;
240  return *this;
241  }
242  //*******************************************************************************************
243 
244  //**Prefix increment operator****************************************************************
250  ++left_;
251  ++right_;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Postfix increment operator***************************************************************
261  inline const ConstIterator operator++( int ) {
262  return ConstIterator( left_++, right_++ );
263  }
264  //*******************************************************************************************
265 
266  //**Prefix decrement operator****************************************************************
272  --left_;
273  --right_;
274  return *this;
275  }
276  //*******************************************************************************************
277 
278  //**Postfix decrement operator***************************************************************
283  inline const ConstIterator operator--( int ) {
284  return ConstIterator( left_--, right_-- );
285  }
286  //*******************************************************************************************
287 
288  //**Element access operator******************************************************************
293  inline ReturnType operator*() const {
294  return (*left_) / (*right_);
295  }
296  //*******************************************************************************************
297 
298  //**Load function****************************************************************************
303  inline auto load() const noexcept {
304  return left_.load() / right_.load();
305  }
306  //*******************************************************************************************
307 
308  //**Equality operator************************************************************************
314  inline bool operator==( const ConstIterator& rhs ) const {
315  return left_ == rhs.left_;
316  }
317  //*******************************************************************************************
318 
319  //**Inequality operator**********************************************************************
325  inline bool operator!=( const ConstIterator& rhs ) const {
326  return left_ != rhs.left_;
327  }
328  //*******************************************************************************************
329 
330  //**Less-than operator***********************************************************************
336  inline bool operator<( const ConstIterator& rhs ) const {
337  return left_ < rhs.left_;
338  }
339  //*******************************************************************************************
340 
341  //**Greater-than operator********************************************************************
347  inline bool operator>( const ConstIterator& rhs ) const {
348  return left_ > rhs.left_;
349  }
350  //*******************************************************************************************
351 
352  //**Less-or-equal-than operator**************************************************************
358  inline bool operator<=( const ConstIterator& rhs ) const {
359  return left_ <= rhs.left_;
360  }
361  //*******************************************************************************************
362 
363  //**Greater-or-equal-than operator***********************************************************
369  inline bool operator>=( const ConstIterator& rhs ) const {
370  return left_ >= rhs.left_;
371  }
372  //*******************************************************************************************
373 
374  //**Subtraction operator*********************************************************************
380  inline DifferenceType operator-( const ConstIterator& rhs ) const {
381  return left_ - rhs.left_;
382  }
383  //*******************************************************************************************
384 
385  //**Addition operator************************************************************************
392  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
393  return ConstIterator( it.left_ + inc, it.right_ + inc );
394  }
395  //*******************************************************************************************
396 
397  //**Addition operator************************************************************************
404  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
405  return ConstIterator( it.left_ + inc, it.right_ + inc );
406  }
407  //*******************************************************************************************
408 
409  //**Subtraction operator*********************************************************************
416  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
417  return ConstIterator( it.left_ - dec, it.right_ - dec );
418  }
419  //*******************************************************************************************
420 
421  private:
422  //**Member variables*************************************************************************
425  //*******************************************************************************************
426  };
427  //**********************************************************************************************
428 
429  //**Compilation flags***************************************************************************
431  enum : bool { simdEnabled = VT1::simdEnabled && VT2::simdEnabled &&
433 
435  enum : bool { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
436  //**********************************************************************************************
437 
438  //**SIMD properties*****************************************************************************
440  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
441  //**********************************************************************************************
442 
443  //**Constructor*********************************************************************************
449  explicit inline DVecDVecDivExpr( const VT1& lhs, const VT2& rhs ) noexcept
450  : lhs_( lhs ) // Left-hand side dense vector of the division expression
451  , rhs_( rhs ) // Right-hand side dense vector of the division expression
452  {
453  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
454  }
455  //**********************************************************************************************
456 
457  //**Subscript operator**************************************************************************
463  inline ReturnType operator[]( size_t index ) const {
464  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
465  return lhs_[index] / rhs_[index];
466  }
467  //**********************************************************************************************
468 
469  //**At function*********************************************************************************
476  inline ReturnType at( size_t index ) const {
477  if( index >= lhs_.size() ) {
478  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
479  }
480  return (*this)[index];
481  }
482  //**********************************************************************************************
483 
484  //**Load function*******************************************************************************
490  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
491  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
492  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
493  return lhs_.load( index ) / rhs_.load( index );
494  }
495  //**********************************************************************************************
496 
497  //**Begin function******************************************************************************
502  inline ConstIterator begin() const {
503  return ConstIterator( lhs_.begin(), rhs_.begin() );
504  }
505  //**********************************************************************************************
506 
507  //**End function********************************************************************************
512  inline ConstIterator end() const {
513  return ConstIterator( lhs_.end(), rhs_.end() );
514  }
515  //**********************************************************************************************
516 
517  //**Size function*******************************************************************************
522  inline size_t size() const noexcept {
523  return lhs_.size();
524  }
525  //**********************************************************************************************
526 
527  //**Left operand access*************************************************************************
532  inline LeftOperand leftOperand() const noexcept {
533  return lhs_;
534  }
535  //**********************************************************************************************
536 
537  //**Right operand access************************************************************************
542  inline RightOperand rightOperand() const noexcept {
543  return rhs_;
544  }
545  //**********************************************************************************************
546 
547  //**********************************************************************************************
553  template< typename T >
554  inline bool canAlias( const T* alias ) const noexcept {
555  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
556  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
557  }
558  //**********************************************************************************************
559 
560  //**********************************************************************************************
566  template< typename T >
567  inline bool isAliased( const T* alias ) const noexcept {
568  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
569  }
570  //**********************************************************************************************
571 
572  //**********************************************************************************************
577  inline bool isAligned() const noexcept {
578  return lhs_.isAligned() && rhs_.isAligned();
579  }
580  //**********************************************************************************************
581 
582  //**********************************************************************************************
587  inline bool canSMPAssign() const noexcept {
588  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
589  ( size() > SMP_DVECDVECDIV_THRESHOLD );
590  }
591  //**********************************************************************************************
592 
593  private:
594  //**Member variables****************************************************************************
597  //**********************************************************************************************
598 
599  //**Assignment to dense vectors*****************************************************************
613  template< typename VT > // Type of the target dense vector
614  friend inline EnableIf_< UseAssign<VT> >
615  assign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
616  {
618 
619  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
620 
621  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
622  divAssign( ~lhs, rhs.rhs_ );
623  }
625  assign ( ~lhs, rhs.lhs_ );
626  divAssign( ~lhs, rhs.rhs_ );
627  }
628  else {
629  const ResultType tmp( serial( rhs ) );
630  assign( ~lhs, tmp );
631  }
632  }
634  //**********************************************************************************************
635 
636  //**Assignment to sparse vectors****************************************************************
650  template< typename VT > // Type of the target sparse vector
651  friend inline EnableIf_< UseAssign<VT> >
652  assign( SparseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
653  {
655 
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
661 
662  const ResultType tmp( serial( rhs ) );
663  assign( ~lhs, tmp );
664  }
666  //**********************************************************************************************
667 
668  //**Addition assignment to dense vectors********************************************************
682  template< typename VT > // Type of the target dense vector
683  friend inline EnableIf_< UseAssign<VT> >
684  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
685  {
687 
691 
692  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
693 
694  const ResultType tmp( serial( rhs ) );
695  addAssign( ~lhs, tmp );
696  }
698  //**********************************************************************************************
699 
700  //**Addition assignment to sparse vectors*******************************************************
701  // No special implementation for the addition assignment to sparse vectors.
702  //**********************************************************************************************
703 
704  //**Subtraction assignment to dense vectors*****************************************************
718  template< typename VT > // Type of the target dense vector
719  friend inline EnableIf_< UseAssign<VT> >
720  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
721  {
723 
727 
728  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
729 
730  const ResultType tmp( serial( rhs ) );
731  subAssign( ~lhs, tmp );
732  }
734  //**********************************************************************************************
735 
736  //**Subtraction assignment to sparse vectors****************************************************
737  // No special implementation for the subtraction assignment to sparse vectors.
738  //**********************************************************************************************
739 
740  //**Multiplication assignment to dense vectors**************************************************
754  template< typename VT > // Type of the target dense vector
755  friend inline EnableIf_< UseAssign<VT> >
756  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
757  {
759 
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
765 
766  const ResultType tmp( serial( rhs ) );
767  multAssign( ~lhs, tmp );
768  }
770  //**********************************************************************************************
771 
772  //**Multiplication assignment to sparse vectors*************************************************
773  // No special implementation for the multiplication assignment to sparse vectors.
774  //**********************************************************************************************
775 
776  //**Division assignment to dense vectors********************************************************
790  template< typename VT > // Type of the target dense vector
791  friend inline EnableIf_< UseAssign<VT> >
792  divAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
793  {
795 
799 
800  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
801 
802  const ResultType tmp( serial( rhs ) );
803  divAssign( ~lhs, tmp );
804  }
806  //**********************************************************************************************
807 
808  //**Division assignment to sparse vectors*******************************************************
809  // No special implementation for the division assignment to sparse vectors.
810  //**********************************************************************************************
811 
812  //**SMP assignment to dense vectors*************************************************************
826  template< typename VT > // Type of the target dense vector
827  friend inline EnableIf_< UseSMPAssign<VT> >
828  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
829  {
831 
832  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
833 
834  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
835  smpDivAssign( ~lhs, rhs.rhs_ );
836  }
838  smpAssign ( ~lhs, rhs.lhs_ );
839  smpDivAssign( ~lhs, rhs.rhs_ );
840  }
841  else {
842  const ResultType tmp( rhs );
843  smpAssign( ~lhs, tmp );
844  }
845  }
847  //**********************************************************************************************
848 
849  //**SMP assignment to sparse vectors************************************************************
863  template< typename VT > // Type of the target sparse vector
864  friend inline EnableIf_< UseSMPAssign<VT> >
865  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
866  {
868 
872 
873  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
874 
875  const ResultType tmp( rhs );
876  smpAssign( ~lhs, tmp );
877  }
879  //**********************************************************************************************
880 
881  //**SMP addition assignment to dense vectors****************************************************
895  template< typename VT > // Type of the target dense vector
896  friend inline EnableIf_< UseSMPAssign<VT> >
898  {
900 
904 
905  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
906 
907  const ResultType tmp( rhs );
908  smpAddAssign( ~lhs, tmp );
909  }
911  //**********************************************************************************************
912 
913  //**SMP addition assignment to sparse vectors***************************************************
914  // No special implementation for the SMP addition assignment to sparse vectors.
915  //**********************************************************************************************
916 
917  //**SMP subtraction assignment to dense vectors*************************************************
931  template< typename VT > // Type of the target dense vector
932  friend inline EnableIf_< UseSMPAssign<VT> >
934  {
936 
940 
941  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
942 
943  const ResultType tmp( rhs );
944  smpSubAssign( ~lhs, tmp );
945  }
947  //**********************************************************************************************
948 
949  //**SMP subtraction assignment to sparse vectors************************************************
950  // No special implementation for the SMP subtraction assignment to sparse vectors.
951  //**********************************************************************************************
952 
953  //**SMP multiplication assignment to dense vectors**********************************************
967  template< typename VT > // Type of the target dense vector
968  friend inline EnableIf_< UseSMPAssign<VT> >
970  {
972 
976 
977  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
978 
979  const ResultType tmp( rhs );
980  smpMultAssign( ~lhs, tmp );
981  }
983  //**********************************************************************************************
984 
985  //**SMP multiplication assignment to sparse vectors*********************************************
986  // No special implementation for the SMP multiplication assignment to sparse vectors.
987  //**********************************************************************************************
988 
989  //**SMP division assignment to dense vectors****************************************************
1003  template< typename VT > // Type of the target dense vector
1004  friend inline EnableIf_< UseSMPAssign<VT> >
1005  smpDivAssign( DenseVector<VT,TF>& lhs, const DVecDVecDivExpr& rhs )
1006  {
1008 
1012 
1013  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1014 
1015  const ResultType tmp( rhs );
1016  smpDivAssign( ~lhs, tmp );
1017  }
1019  //**********************************************************************************************
1020 
1021  //**SMP division assignment to sparse vectors***************************************************
1022  // No special implementation for the SMP division assignment to sparse vectors.
1023  //**********************************************************************************************
1024 
1025  //**Compile time checks*************************************************************************
1033  //**********************************************************************************************
1034 };
1035 //*************************************************************************************************
1036 
1037 
1038 
1039 
1040 //=================================================================================================
1041 //
1042 // GLOBAL BINARY ARITHMETIC OPERATORS
1043 //
1044 //=================================================================================================
1045 
1046 //*************************************************************************************************
1071 template< typename VT1 // Type of the left-hand side dense vector
1072  , typename VT2 // Type of the right-hand side dense vector
1073  , bool TF > // Transpose flag
1074 inline decltype(auto)
1075  operator/( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1076 {
1078 
1079  if( (~lhs).size() != (~rhs).size() ) {
1080  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1081  }
1082 
1084  return ReturnType( ~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 Maximum< 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 } // namespace blaze
1125 
1126 #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:347
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the VecVecDivExpr base class.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecDivExpr.h:380
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:786
Header file for basic type definitions.
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecDivExpr.h:189
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecDivExpr.h:193
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:164
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.
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:107
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:102
IfTrue_< useAssign, const ResultType, const DVecDVecDivExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecDVecDivExpr.h:170
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:336
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:502
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:182
Header file for the And class template.
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
Header file for the DenseVector base class.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:314
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:140
RightOperand rhs_
Right-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:596
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecDivExpr.h:424
Constraint on the data type.
Header file for the RequiresEvaluation type trait.
ReferenceType reference
Reference return type.
Definition: DVecDVecDivExpr.h:196
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
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:133
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:369
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecDVecDivExpr.h:164
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:104
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecDivExpr.h:463
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:176
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecDivExpr.h:186
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:522
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecDivExpr.h:163
Header file for the DivExprTrait class template.
DivExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecDivExpr.h:122
Expression object for dense vector-dense vector divisions.The DVecDVecDivExpr class represents the co...
Definition: DVecDVecDivExpr.h:96
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:358
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:105
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Header file for the Maximum class template.
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 & operator--()
Pre-decrement operator.
Definition: DVecDVecDivExpr.h:271
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecDivExpr.h:261
Header file for the IsTemporary type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecDivExpr.h:283
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:423
ElementType * PointerType
Pointer return type.
Definition: DVecDVecDivExpr.h:188
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:102
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:103
#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:532
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:66
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:392
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.
PointerType pointer
Pointer return type.
Definition: DVecDVecDivExpr.h:195
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:150
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:237
Constraint on the data type.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecDivExpr.h:577
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecDivExpr.h:567
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:325
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:106
Constraint on the data type.
Header file for the exception macros of the math module.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecDVecDivExpr.h:167
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:173
Constraint on the data type.
Header file for all forward declarations for expression class templates.
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:108
Header file for the EnableIf class template.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:303
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:250
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:416
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:194
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:404
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:154
ConstIterator_< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:200
DivTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecDVecDivExpr.h:162
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:224
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:94
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
#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
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecDivExpr.h:249
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:109
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecDivExpr.h:476
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:490
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecDivExpr.h:587
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
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:512
LeftOperand lhs_
Left-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:595
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:108
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:112
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:74
ConstIterator_< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:203
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Header file for the IntegralConstant class template.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecDivExpr.h:212
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:187
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:542
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
DVecDVecDivExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecDivExpr class.
Definition: DVecDVecDivExpr.h:449
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:95
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecDivExpr.h:554
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecDivExpr.h:293