All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecScalarDivExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARDIVEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
50 #include <blaze/math/Intrinsics.h>
68 #include <blaze/util/Assert.h>
73 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/InvalidType.h>
76 #include <blaze/util/SelectType.h>
77 #include <blaze/util/Types.h>
81 
82 
83 namespace blaze {
84 
85 //=================================================================================================
86 //
87 // CLASS DVECSCALARDIVEXPR
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
98 template< typename VT // Type of the left-hand side dense vector
99  , typename ST // Type of the right-hand side scalar value
100  , bool TF > // Transpose flag
101 class DVecScalarDivExpr : public DenseVector< DVecScalarDivExpr<VT,ST,TF>, TF >
102  , private VecScalarDivExpr
103  , private Computation
104 {
105  private:
106  //**Type definitions****************************************************************************
107  typedef typename VT::ResultType RT;
108  typedef typename VT::ReturnType RN;
109  typedef typename VT::ElementType ET;
110  typedef typename VT::CompositeType CT;
111  //**********************************************************************************************
112 
113  //**Return type evaluation**********************************************************************
115 
120  enum { returnExpr = !IsTemporary<RN>::value };
121 
124  //**********************************************************************************************
125 
126  //**Serial evaluation strategy******************************************************************
128 
135 
137  template< typename VT2 >
139  struct UseAssign {
140  enum { value = useAssign };
141  };
143  //**********************************************************************************************
144 
145  //**Parallel evaluation strategy****************************************************************
147 
153  template< typename VT2 >
154  struct UseSMPAssign {
155  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
156  };
158  //**********************************************************************************************
159 
160  public:
161  //**Type definitions****************************************************************************
167 
170 
173 
175  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
176 
178  typedef ST RightOperand;
179  //**********************************************************************************************
180 
181  //**ConstIterator class definition**************************************************************
185  {
186  public:
187  //**Type definitions*************************************************************************
188  typedef std::random_access_iterator_tag IteratorCategory;
193 
194  // STL iterator requirements
200 
202  typedef typename VT::ConstIterator IteratorType;
203  //*******************************************************************************************
204 
205  //**Constructor******************************************************************************
211  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
212  : iterator_( iterator ) // Iterator to the current element
213  , scalar_ ( scalar ) // Scalar of the division expression
214  {}
215  //*******************************************************************************************
216 
217  //**Addition assignment operator*************************************************************
223  inline ConstIterator& operator+=( size_t inc ) {
224  iterator_ += inc;
225  return *this;
226  }
227  //*******************************************************************************************
228 
229  //**Subtraction assignment operator**********************************************************
235  inline ConstIterator& operator-=( size_t dec ) {
236  iterator_ -= dec;
237  return *this;
238  }
239  //*******************************************************************************************
240 
241  //**Prefix increment operator****************************************************************
247  ++iterator_;
248  return *this;
249  }
250  //*******************************************************************************************
251 
252  //**Postfix increment operator***************************************************************
257  inline const ConstIterator operator++( int ) {
258  return ConstIterator( iterator_++ );
259  }
260  //*******************************************************************************************
261 
262  //**Prefix decrement operator****************************************************************
268  --iterator_;
269  return *this;
270  }
271  //*******************************************************************************************
272 
273  //**Postfix decrement operator***************************************************************
278  inline const ConstIterator operator--( int ) {
279  return ConstIterator( iterator_-- );
280  }
281  //*******************************************************************************************
282 
283  //**Element access operator******************************************************************
288  inline ReturnType operator*() const {
289  return *iterator_ / scalar_;
290  }
291  //*******************************************************************************************
292 
293  //**Load function****************************************************************************
298  inline IntrinsicType load() const {
299  return iterator_.load() / set( scalar_ );
300  }
301  //*******************************************************************************************
302 
303  //**Equality operator************************************************************************
309  inline bool operator==( const ConstIterator& rhs ) const {
310  return iterator_ == rhs.iterator_;
311  }
312  //*******************************************************************************************
313 
314  //**Inequality operator**********************************************************************
320  inline bool operator!=( const ConstIterator& rhs ) const {
321  return iterator_ != rhs.iterator_;
322  }
323  //*******************************************************************************************
324 
325  //**Less-than operator***********************************************************************
331  inline bool operator<( const ConstIterator& rhs ) const {
332  return iterator_ < rhs.iterator_;
333  }
334  //*******************************************************************************************
335 
336  //**Greater-than operator********************************************************************
342  inline bool operator>( const ConstIterator& rhs ) const {
343  return iterator_ > rhs.iterator_;
344  }
345  //*******************************************************************************************
346 
347  //**Less-or-equal-than operator**************************************************************
353  inline bool operator<=( const ConstIterator& rhs ) const {
354  return iterator_ <= rhs.iterator_;
355  }
356  //*******************************************************************************************
357 
358  //**Greater-or-equal-than operator***********************************************************
364  inline bool operator>=( const ConstIterator& rhs ) const {
365  return iterator_ >= rhs.iterator_;
366  }
367  //*******************************************************************************************
368 
369  //**Subtraction operator*********************************************************************
375  inline DifferenceType operator-( const ConstIterator& rhs ) const {
376  return iterator_ - rhs.iterator_;
377  }
378  //*******************************************************************************************
379 
380  //**Addition operator************************************************************************
387  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
388  return ConstIterator( it.iterator_ + inc );
389  }
390  //*******************************************************************************************
391 
392  //**Addition operator************************************************************************
399  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
400  return ConstIterator( it.iterator_ + inc );
401  }
402  //*******************************************************************************************
403 
404  //**Subtraction operator*********************************************************************
411  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
412  return ConstIterator( it.iterator_ - dec );
413  }
414  //*******************************************************************************************
415 
416  private:
417  //**Member variables*************************************************************************
420  //*******************************************************************************************
421  };
422  //**********************************************************************************************
423 
424  //**Compilation flags***************************************************************************
426  enum { vectorizable = VT::vectorizable &&
429 
431  enum { smpAssignable = VT::smpAssignable };
432  //**********************************************************************************************
433 
434  //**Constructor*********************************************************************************
440  explicit inline DVecScalarDivExpr( const VT& vector, ST scalar )
441  : vector_( vector ) // Left-hand side dense vector of the division expression
442  , scalar_( scalar ) // Right-hand side scalar of the division expression
443  {}
444  //**********************************************************************************************
445 
446  //**Subscript operator**************************************************************************
452  inline ReturnType operator[]( size_t index ) const {
453  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
454  return vector_[index] / scalar_;
455  }
456  //**********************************************************************************************
457 
458  //**Load function*******************************************************************************
464  inline IntrinsicType load( size_t index ) const {
465  typedef IntrinsicTrait<ElementType> IT;
466  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
467  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
468  const IntrinsicType xmm1( vector_.load( index ) );
469  const IntrinsicType xmm2( set( scalar_ ) );
470  return xmm1 / xmm2;
471  }
472  //**********************************************************************************************
473 
474  //**Begin function******************************************************************************
479  inline ConstIterator begin() const {
480  return ConstIterator( vector_.begin(), scalar_ );
481  }
482  //**********************************************************************************************
483 
484  //**End function********************************************************************************
489  inline ConstIterator end() const {
490  return ConstIterator( vector_.end(), scalar_ );
491  }
492  //**********************************************************************************************
493 
494  //**Size function*******************************************************************************
499  inline size_t size() const {
500  return vector_.size();
501  }
502  //**********************************************************************************************
503 
504  //**Left operand access*************************************************************************
509  inline LeftOperand leftOperand() const {
510  return vector_;
511  }
512  //**********************************************************************************************
513 
514  //**Right operand access************************************************************************
519  inline RightOperand rightOperand() const {
520  return scalar_;
521  }
522  //**********************************************************************************************
523 
524  //**********************************************************************************************
530  template< typename T >
531  inline bool canAlias( const T* alias ) const {
532  return IsComputation<VT>::value && vector_.canAlias( alias );
533  }
534  //**********************************************************************************************
535 
536  //**********************************************************************************************
542  template< typename T >
543  inline bool isAliased( const T* alias ) const {
544  return vector_.isAliased( alias );
545  }
546  //**********************************************************************************************
547 
548  //**********************************************************************************************
553  inline bool isAligned() const {
554  return vector_.isAligned();
555  }
556  //**********************************************************************************************
557 
558  //**********************************************************************************************
563  inline bool canSMPAssign() const {
564  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
565  }
566  //**********************************************************************************************
567 
568  private:
569  //**Member variables****************************************************************************
572  //**********************************************************************************************
573 
574  //**Assignment to dense vectors*****************************************************************
588  template< typename VT2 > // Type of the target dense vector
589  friend inline typename EnableIf< UseAssign<VT2> >::Type
590  assign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
591  {
593 
594  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
595 
596  assign( ~lhs, rhs.vector_ );
597  assign( ~lhs, (~lhs) / rhs.scalar_ );
598  }
600  //**********************************************************************************************
601 
602  //**Assignment to sparse vectors****************************************************************
616  template< typename VT2 > // Type of the target sparse vector
617  friend inline typename EnableIf< UseAssign<VT2> >::Type
618  assign( SparseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
619  {
621 
622  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
623 
624  assign( ~lhs, rhs.vector_ );
625  (~lhs) /= rhs.scalar_;
626  }
628  //**********************************************************************************************
629 
630  //**Addition assignment to dense vectors********************************************************
644  template< typename VT2 > // Type of the target dense vector
645  friend inline typename EnableIf< UseAssign<VT2> >::Type
646  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
647  {
649 
653 
654  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
655 
656  const ResultType tmp( serial( rhs ) );
657  addAssign( ~lhs, tmp );
658  }
660  //**********************************************************************************************
661 
662  //**Addition assignment to sparse vectors*******************************************************
663  // No special implementation for the addition assignment to sparse vectors.
664  //**********************************************************************************************
665 
666  //**Subtraction assignment to dense vectors*****************************************************
680  template< typename VT2 > // Type of the target dense vector
681  friend inline typename EnableIf< UseAssign<VT2> >::Type
682  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
683  {
685 
689 
690  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
691 
692  const ResultType tmp( serial( rhs ) );
693  subAssign( ~lhs, tmp );
694  }
696  //**********************************************************************************************
697 
698  //**Subtraction assignment to sparse vectors****************************************************
699  // No special implementation for the subtraction assignment to sparse vectors.
700  //**********************************************************************************************
701 
702  //**Multiplication assignment to dense vectors**************************************************
716  template< typename VT2 > // Type of the target dense vector
717  friend inline typename EnableIf< UseAssign<VT2> >::Type
718  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
719  {
721 
725 
726  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
727 
728  const ResultType tmp( serial( rhs ) );
729  multAssign( ~lhs, tmp );
730  }
732  //**********************************************************************************************
733 
734  //**Multiplication assignment to sparse vectors*************************************************
735  // No special implementation for the multiplication assignment to sparse vectors.
736  //**********************************************************************************************
737 
738  //**SMP assignment to dense vectors*************************************************************
752  template< typename VT2 > // Type of the target dense vector
753  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
754  smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
755  {
757 
758  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
759 
760  smpAssign( ~lhs, rhs.vector_ );
761  smpAssign( ~lhs, (~lhs) / rhs.scalar_ );
762  }
764  //**********************************************************************************************
765 
766  //**SMP assignment to sparse vectors************************************************************
780  template< typename VT2 > // Type of the target sparse vector
781  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
782  smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
783  {
785 
786  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
787 
788  smpAssign( ~lhs, rhs.vector_ );
789  (~lhs) /= rhs.scalar_;
790  }
792  //**********************************************************************************************
793 
794  //**SMP addition assignment to dense vectors****************************************************
808  template< typename VT2 > // Type of the target dense vector
809  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
810  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
811  {
813 
817 
818  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
819 
820  const ResultType tmp( rhs );
821  smpAddAssign( ~lhs, tmp );
822  }
824  //**********************************************************************************************
825 
826  //**SMP addition assignment to sparse vectors***************************************************
827  // No special implementation for the SMP addition assignment to sparse vectors.
828  //**********************************************************************************************
829 
830  //**SMP subtraction assignment to dense vectors*************************************************
844  template< typename VT2 > // Type of the target dense vector
845  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
846  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
847  {
849 
853 
854  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
855 
856  const ResultType tmp( rhs );
857  smpSubAssign( ~lhs, tmp );
858  }
860  //**********************************************************************************************
861 
862  //**SMP subtraction assignment to sparse vectors************************************************
863  // No special implementation for the SMP subtraction assignment to sparse vectors.
864  //**********************************************************************************************
865 
866  //**SMP multiplication assignment to dense vectors**********************************************
880  template< typename VT2 > // Type of the target dense vector
881  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
882  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
883  {
885 
889 
890  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
891 
892  const ResultType tmp( rhs );
893  smpMultAssign( ~lhs, tmp );
894  }
896  //**********************************************************************************************
897 
898  //**SMP multiplication assignment to sparse vectors*********************************************
899  // No special implementation for the SMP multiplication assignment to sparse vectors.
900  //**********************************************************************************************
901 
902  //**Compile time checks*************************************************************************
911  //**********************************************************************************************
912 };
913 //*************************************************************************************************
914 
915 
916 
917 
918 //=================================================================================================
919 //
920 // GLOBAL BINARY ARITHMETIC OPERATORS
921 //
922 //=================================================================================================
923 
924 //*************************************************************************************************
948 template< typename T1 // Type of the left-hand side dense vector
949  , typename T2 // Type of the right-hand side scalar
950  , bool TF > // Transpose flag
951 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
952  operator/( const DenseVector<T1,TF>& vec, T2 scalar )
953 {
955 
956  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
957 
958  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
959  typedef typename ReturnType::RightOperand ScalarType;
960 
962  return ReturnType( ~vec, ScalarType(1)/ScalarType(scalar) );
963  }
964  else {
965  return ReturnType( ~vec, scalar );
966  }
967 }
968 //*************************************************************************************************
969 
970 
971 
972 
973 //=================================================================================================
974 //
975 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
976 //
977 //=================================================================================================
978 
979 //*************************************************************************************************
992 template< typename VT // Type of the dense vector of the left-hand side expression
993  , typename ST1 // Type of the scalar of the left-hand side expression
994  , bool TF // Transpose flag of the dense vector
995  , typename ST2 > // Type of the right-hand side scalar
996 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
997  , typename MultExprTrait< DVecScalarDivExpr<VT,ST1,TF>, ST2 >::Type >::Type
998  operator*( const DVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
999 {
1001 
1002  return vec.leftOperand() * ( scalar / vec.rightOperand() );
1003 }
1005 //*************************************************************************************************
1006 
1007 
1008 //*************************************************************************************************
1021 template< typename ST1 // Type of the left-hand side scalar
1022  , typename VT // Type of the dense vector of the right-hand side expression
1023  , typename ST2 // Type of the scalar of the right-hand side expression
1024  , bool TF > // Transpose flag of the dense vector
1025 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
1026  , typename MultExprTrait< ST1, DVecScalarDivExpr<VT,ST2,TF> >::Type >::Type
1027  operator*( ST1 scalar, const DVecScalarDivExpr<VT,ST2,TF>& vec )
1028 {
1030 
1031  return vec.leftOperand() * ( scalar / vec.rightOperand() );
1032 }
1034 //*************************************************************************************************
1035 
1036 
1037 //*************************************************************************************************
1050 template< typename VT // Type of the dense vector of the left-hand side expression
1051  , typename ST1 // Type of the scalar of the left-hand side expression
1052  , bool TF // Transpose flag of the dense vector
1053  , typename ST2 > // Type of the right-hand side scalar
1054 inline const typename EnableIf< IsNumeric<ST2>
1055  , typename DivExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
1056  operator/( const DVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
1057 {
1059 
1060  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
1061 
1062  typedef typename MultTrait<ST1,ST2>::Type MultType;
1063  typedef typename DivExprTrait<VT,MultType>::Type ReturnType;
1064  typedef typename ReturnType::RightOperand ScalarType;
1065 
1066  if( IsMultExpr<ReturnType>::value ) {
1067  return ReturnType( vec.leftOperand(), ScalarType(1)/( vec.rightOperand() * scalar ) );
1068  }
1069  else {
1070  return ReturnType( vec.leftOperand(), vec.rightOperand() * scalar );
1071  }
1072 }
1074 //*************************************************************************************************
1075 
1076 
1077 
1078 
1079 //=================================================================================================
1080 //
1081 // SIZE SPECIALIZATIONS
1082 //
1083 //=================================================================================================
1084 
1085 //*************************************************************************************************
1087 template< typename VT, typename ST, bool TF >
1088 struct Size< DVecScalarDivExpr<VT,ST,TF> >
1089  : public Size<VT>
1090 {};
1092 //*************************************************************************************************
1093 
1094 
1095 
1096 
1097 //=================================================================================================
1098 //
1099 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1100 //
1101 //=================================================================================================
1102 
1103 //*************************************************************************************************
1105 template< typename VT, typename ST1, typename ST2 >
1106 struct DVecScalarMultExprTrait< DVecScalarDivExpr<VT,ST1,false>, ST2 >
1107 {
1108  private:
1109  //**********************************************************************************************
1110  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1111  //**********************************************************************************************
1112 
1113  //**********************************************************************************************
1114  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1115  typedef DVecScalarMultExpr< DVecScalarDivExpr<VT,ST1,false>, ST2, false > T2;
1116  //**********************************************************************************************
1117 
1118  public:
1119  //**********************************************************************************************
1120  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1121  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1122  , typename SelectType<condition,T1,T2>::Type
1123  , INVALID_TYPE >::Type Type;
1124  //**********************************************************************************************
1125 };
1127 //*************************************************************************************************
1128 
1129 
1130 
1131 
1132 //=================================================================================================
1133 //
1134 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
1135 //
1136 //=================================================================================================
1137 
1138 //*************************************************************************************************
1140 template< typename VT, typename ST1, typename ST2 >
1141 struct TDVecScalarMultExprTrait< DVecScalarDivExpr<VT,ST1,true>, ST2 >
1142 {
1143  private:
1144  //**********************************************************************************************
1145  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1146  //**********************************************************************************************
1147 
1148  //**********************************************************************************************
1149  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1150  typedef DVecScalarMultExpr< DVecScalarDivExpr<VT,ST1,true>, ST2, true > T2;
1151  //**********************************************************************************************
1152 
1153  public:
1154  //**********************************************************************************************
1155  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1156  IsNumeric<ST1>::value && IsNumeric<ST2>::value
1157  , typename SelectType<condition,T1,T2>::Type
1158  , INVALID_TYPE >::Type Type;
1159  //**********************************************************************************************
1160 };
1162 //*************************************************************************************************
1163 
1164 
1165 
1166 
1167 //=================================================================================================
1168 //
1169 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
1170 //
1171 //=================================================================================================
1172 
1173 //*************************************************************************************************
1175 template< typename VT, typename ST, bool TF, bool AF >
1176 struct SubvectorExprTrait< DVecScalarDivExpr<VT,ST,TF>, AF >
1177 {
1178  public:
1179  //**********************************************************************************************
1180  typedef typename DivExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
1181  //**********************************************************************************************
1182 };
1184 //*************************************************************************************************
1185 
1186 } // namespace blaze
1187 
1188 #endif
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DVecScalarDivExpr.h:571
Pointer difference type of the Blaze library.
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Constraint on the data type.
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarDivExpr.h:164
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:936
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarDivExpr.h:108
Compile time check whether the given type is a multiplication expression template.This type trait class tests whether or not the given type Type is a multiplication expression template (i.e. an expression representing an element-wise vector multiplication, a matrix/vector multiplication, a vector/matrix multiplication, or a matrix multiplication). In order to qualify as a valid multiplication expression template, the given type has to derive (publicly or privately) from the MultExpr base class. In case the given type is a valid multiplication expression template, the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsMultExpr.h:90
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarDivExpr.h:489
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarDivExpr.h:191
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarDivExpr.h:531
RightOperand scalar_
Scalar of the division expression.
Definition: DVecScalarDivExpr.h:419
LeftOperand vector_
Left-hand side dense vector of the division expression.
Definition: DVecScalarDivExpr.h:570
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
Header file for the IsSame and IsStrictlySame type traits.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
Header file for the VecScalarDivExpr base class.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarDivExpr.h:192
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarDivExpr.h:211
Header file for the DenseVector base class.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
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 enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the RequiresEvaluation type trait.
Base class for all vector/scalar division expression templates.The VecScalarDivExpr class serves as a...
Definition: VecScalarDivExpr.h:65
DivTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarDivExpr.h:163
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DVecScalarDivExpr.h:519
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:309
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarDivExpr.h:246
Constraint on the data type.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarDivExpr.h:188
Header file for the DivExprTrait class template.
Evaluation of the resulting expression type of a division.Via this type trait it is possible to evalu...
Definition: DivExprTrait.h:88
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarDivExpr.h:399
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:353
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarDivExpr.h:199
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarDivExpr.h:257
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarDivExpr.h:553
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarDivExpr.h:202
Header file for the IsFloatingPoint type trait.
Header file for the IsMultExpr type trait class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Iterator over the elements of the dense vector.
Definition: DVecScalarDivExpr.h:184
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarDivExpr.h:165
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarDivExpr.h:189
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarDivExpr.h:178
Constraint on the data type.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarDivExpr.h:499
#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:78
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarDivExpr.h:452
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarDivExpr.h:110
Constraint on the data type.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarDivExpr.h:223
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarDivExpr.h:543
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarDivExpr.h:563
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarDivExpr.h:418
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarDivExpr.h:196
Header file for the EnableIf class template.
Header file for the serial shim.
Header file for the BaseElementType type trait.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:211
EnableIf< IsDenseMatrix< MT1 > >::Type 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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarDivExpr.h:509
PointerType pointer
Pointer return type.
Definition: DVecScalarDivExpr.h:197
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Utility type for generic codes.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarDivExpr.h:479
DVecScalarDivExpr< VT, ST, TF > This
Type of this DVecScalarDivExpr instance.
Definition: DVecScalarDivExpr.h:162
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:364
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the division trait.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarDivExpr.h:267
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarDivExpr.h:195
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarDivExpr.h:109
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:411
const size_t SMP_DVECSCALARMULT_THRESHOLD
SMP dense vector/scalar multiplication/division threshold.This threshold specifies when a dense vecto...
Definition: Thresholds.h:299
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarDivExpr.h:464
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarDivExpr.h:166
Base template for the DivTrait class.
Definition: DivTrait.h:142
Header file for the IsDenseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is a floating point data type...
Definition: FloatingPoint.h:118
Header file for all intrinsic functionality.
Expression object for divisions of a dense vector by a scalar.The DVecScalarDivExpr class represents ...
Definition: DVecScalarDivExpr.h:101
#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:79
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarDivExpr.h:235
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarDivExpr.h:169
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:387
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarDivExpr.h:288
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarDivExpr.h:298
ElementType * PointerType
Pointer return type.
Definition: DVecScalarDivExpr.h:190
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:320
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarDivExpr.h:278
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarDivExpr.h:123
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarDivExpr.h:375
Header file for the IsColumnVector type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:342
DVecScalarDivExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarDivExpr class.
Definition: DVecScalarDivExpr.h:440
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarDivExpr.h:175
EnableIf< IsDenseVector< VT1 > >::Type 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:189
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:238
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
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:331
SelectType< useAssign, const ResultType, const DVecScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarDivExpr.h:172
Header file for the IsExpression type trait class.
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarDivExpr.h:107
ReferenceType reference
Reference return type.
Definition: DVecScalarDivExpr.h:198
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849