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  //**Evaluation strategy*************************************************************************
128 
134  enum { useAssign = RequiresEvaluation<VT>::value };
135 
137  template< typename VT2 >
139  struct UseAssign {
140  enum { value = useAssign };
141  };
143  //**********************************************************************************************
144 
145  public:
146  //**Type definitions****************************************************************************
152 
155 
158 
160  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
161 
163  typedef ST RightOperand;
164  //**********************************************************************************************
165 
166  //**ConstIterator class definition**************************************************************
170  {
171  public:
172  //**Type definitions*************************************************************************
173  typedef std::random_access_iterator_tag IteratorCategory;
178 
179  // STL iterator requirements
185 
187  typedef typename VT::ConstIterator IteratorType;
188  //*******************************************************************************************
189 
190  //**Constructor******************************************************************************
196  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
197  : iterator_( iterator ) // Iterator to the current element
198  , scalar_ ( scalar ) // Scalar of the multiplication expression
199  {}
200  //*******************************************************************************************
201 
202  //**Addition assignment operator*************************************************************
208  inline ConstIterator& operator+=( size_t inc ) {
209  iterator_ += inc;
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Subtraction assignment operator**********************************************************
220  inline ConstIterator& operator-=( size_t dec ) {
221  iterator_ -= dec;
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
232  ++iterator_;
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Postfix increment operator***************************************************************
242  inline const ConstIterator operator++( int ) {
243  return ConstIterator( iterator_++ );
244  }
245  //*******************************************************************************************
246 
247  //**Prefix decrement operator****************************************************************
253  --iterator_;
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix decrement operator***************************************************************
263  inline const ConstIterator operator--( int ) {
264  return ConstIterator( iterator_-- );
265  }
266  //*******************************************************************************************
267 
268  //**Element access operator******************************************************************
273  inline ReturnType operator*() const {
274  return *iterator_ / scalar_;
275  }
276  //*******************************************************************************************
277 
278  //**Load function****************************************************************************
283  inline IntrinsicType load() const {
284  return iterator_.load() / set( scalar_ );
285  }
286  //*******************************************************************************************
287 
288  //**Equality operator************************************************************************
294  inline bool operator==( const ConstIterator& rhs ) const {
295  return iterator_ == rhs.iterator_;
296  }
297  //*******************************************************************************************
298 
299  //**Inequality operator**********************************************************************
305  inline bool operator!=( const ConstIterator& rhs ) const {
306  return iterator_ != rhs.iterator_;
307  }
308  //*******************************************************************************************
309 
310  //**Less-than operator***********************************************************************
316  inline bool operator<( const ConstIterator& rhs ) const {
317  return iterator_ < rhs.iterator_;
318  }
319  //*******************************************************************************************
320 
321  //**Greater-than operator********************************************************************
327  inline bool operator>( const ConstIterator& rhs ) const {
328  return iterator_ > rhs.iterator_;
329  }
330  //*******************************************************************************************
331 
332  //**Less-or-equal-than operator**************************************************************
338  inline bool operator<=( const ConstIterator& rhs ) const {
339  return iterator_ <= rhs.iterator_;
340  }
341  //*******************************************************************************************
342 
343  //**Greater-or-equal-than operator***********************************************************
349  inline bool operator>=( const ConstIterator& rhs ) const {
350  return iterator_ >= rhs.iterator_;
351  }
352  //*******************************************************************************************
353 
354  //**Subtraction operator*********************************************************************
360  inline DifferenceType operator-( const ConstIterator& rhs ) const {
361  return iterator_ - rhs.iterator_;
362  }
363  //*******************************************************************************************
364 
365  //**Addition operator************************************************************************
372  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
373  return ConstIterator( it.iterator_ + inc );
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
385  return ConstIterator( it.iterator_ + inc );
386  }
387  //*******************************************************************************************
388 
389  //**Subtraction operator*********************************************************************
396  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
397  return ConstIterator( it.iterator_ - dec );
398  }
399  //*******************************************************************************************
400 
401  private:
402  //**Member variables*************************************************************************
405  //*******************************************************************************************
406  };
407  //**********************************************************************************************
408 
409  //**Compilation flags***************************************************************************
411  enum { vectorizable = VT::vectorizable &&
414 
416  enum { smpAssignable = VT::smpAssignable };
417  //**********************************************************************************************
418 
419  //**Constructor*********************************************************************************
425  explicit inline DVecScalarDivExpr( const VT& vector, ST scalar )
426  : vector_( vector ) // Left-hand side dense vector of the division expression
427  , scalar_( scalar ) // Right-hand side scalar of the division expression
428  {}
429  //**********************************************************************************************
430 
431  //**Subscript operator**************************************************************************
437  inline ReturnType operator[]( size_t index ) const {
438  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
439  return vector_[index] / scalar_;
440  }
441  //**********************************************************************************************
442 
443  //**Load function*******************************************************************************
449  inline IntrinsicType load( size_t index ) const {
450  typedef IntrinsicTrait<ElementType> IT;
451  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
452  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
453  const IntrinsicType xmm1( vector_.load( index ) );
454  const IntrinsicType xmm2( set( scalar_ ) );
455  return xmm1 / xmm2;
456  }
457  //**********************************************************************************************
458 
459  //**Begin function******************************************************************************
464  inline ConstIterator begin() const {
465  return ConstIterator( vector_.begin(), scalar_ );
466  }
467  //**********************************************************************************************
468 
469  //**End function********************************************************************************
474  inline ConstIterator end() const {
475  return ConstIterator( vector_.end(), scalar_ );
476  }
477  //**********************************************************************************************
478 
479  //**Size function*******************************************************************************
484  inline size_t size() const {
485  return vector_.size();
486  }
487  //**********************************************************************************************
488 
489  //**Left operand access*************************************************************************
494  inline LeftOperand leftOperand() const {
495  return vector_;
496  }
497  //**********************************************************************************************
498 
499  //**Right operand access************************************************************************
504  inline RightOperand rightOperand() const {
505  return scalar_;
506  }
507  //**********************************************************************************************
508 
509  //**********************************************************************************************
515  template< typename T >
516  inline bool canAlias( const T* alias ) const {
517  return IsComputation<VT>::value && vector_.canAlias( alias );
518  }
519  //**********************************************************************************************
520 
521  //**********************************************************************************************
527  template< typename T >
528  inline bool isAliased( const T* alias ) const {
529  return vector_.isAliased( alias );
530  }
531  //**********************************************************************************************
532 
533  //**********************************************************************************************
538  inline bool isAligned() const {
539  return vector_.isAligned();
540  }
541  //**********************************************************************************************
542 
543  //**********************************************************************************************
548  inline bool canSMPAssign() const {
549  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
550  }
551  //**********************************************************************************************
552 
553  private:
554  //**Member variables****************************************************************************
557  //**********************************************************************************************
558 
559  //**Assignment to dense vectors*****************************************************************
573  template< typename VT2 > // Type of the target dense vector
574  friend inline typename EnableIf< UseAssign<VT2> >::Type
575  assign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
576  {
578 
579  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
580 
581  assign( ~lhs, rhs.vector_ );
582  (~lhs) /= rhs.scalar_;
583  }
585  //**********************************************************************************************
586 
587  //**Assignment to sparse vectors****************************************************************
601  template< typename VT2 > // Type of the target sparse vector
602  friend inline typename EnableIf< UseAssign<VT2> >::Type
603  assign( SparseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
604  {
606 
607  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
608 
609  assign( ~lhs, rhs.vector_ );
610  (~lhs) /= rhs.scalar_;
611  }
613  //**********************************************************************************************
614 
615  //**Addition assignment to dense vectors********************************************************
629  template< typename VT2 > // Type of the target dense vector
630  friend inline typename EnableIf< UseAssign<VT2> >::Type
631  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
632  {
634 
638 
639  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
640 
641  const ResultType tmp( rhs );
642  smpAddAssign( ~lhs, tmp );
643  }
645  //**********************************************************************************************
646 
647  //**Addition assignment to sparse vectors*******************************************************
648  // No special implementation for the addition assignment to sparse vectors.
649  //**********************************************************************************************
650 
651  //**Subtraction assignment to dense vectors*****************************************************
665  template< typename VT2 > // Type of the target dense vector
666  friend inline typename EnableIf< UseAssign<VT2> >::Type
667  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
668  {
670 
674 
675  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
676 
677  const ResultType tmp( rhs );
678  smpSubAssign( ~lhs, tmp );
679  }
681  //**********************************************************************************************
682 
683  //**Subtraction assignment to sparse vectors****************************************************
684  // No special implementation for the subtraction assignment to sparse vectors.
685  //**********************************************************************************************
686 
687  //**Multiplication assignment to dense vectors**************************************************
701  template< typename VT2 > // Type of the target dense vector
702  friend inline typename EnableIf< UseAssign<VT2> >::Type
703  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
704  {
706 
710 
711  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
712 
713  const ResultType tmp( rhs );
714  smpMultAssign( ~lhs, tmp );
715  }
717  //**********************************************************************************************
718 
719  //**Multiplication assignment to sparse vectors*************************************************
720  // No special implementation for the multiplication assignment to sparse vectors.
721  //**********************************************************************************************
722 
723  //**Compile time checks*************************************************************************
732  //**********************************************************************************************
733 };
734 //*************************************************************************************************
735 
736 
737 
738 
739 //=================================================================================================
740 //
741 // GLOBAL BINARY ARITHMETIC OPERATORS
742 //
743 //=================================================================================================
744 
745 //*************************************************************************************************
769 template< typename T1 // Type of the left-hand side dense vector
770  , typename T2 // Type of the right-hand side scalar
771  , bool TF > // Transpose flag
772 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
773  operator/( const DenseVector<T1,TF>& vec, T2 scalar )
774 {
776 
777  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
778 
779  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
780  typedef typename ReturnType::RightOperand ScalarType;
781 
783  return ReturnType( ~vec, ScalarType(1)/ScalarType(scalar) );
784  }
785  else {
786  return ReturnType( ~vec, scalar );
787  }
788 }
789 //*************************************************************************************************
790 
791 
792 
793 
794 //=================================================================================================
795 //
796 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
797 //
798 //=================================================================================================
799 
800 //*************************************************************************************************
813 template< typename VT // Type of the dense vector of the left-hand side expression
814  , typename ST1 // Type of the scalar of the left-hand side expression
815  , bool TF // Transpose flag of the dense vector
816  , typename ST2 > // Type of the right-hand side scalar
817 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
818  , typename MultExprTrait< DVecScalarDivExpr<VT,ST1,TF>, ST2 >::Type >::Type
819  operator*( const DVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
820 {
822 
823  return vec.leftOperand() * ( scalar / vec.rightOperand() );
824 }
826 //*************************************************************************************************
827 
828 
829 //*************************************************************************************************
842 template< typename ST1 // Type of the left-hand side scalar
843  , typename VT // Type of the dense vector of the right-hand side expression
844  , typename ST2 // Type of the scalar of the right-hand side expression
845  , bool TF > // Transpose flag of the dense vector
846 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
847  , typename MultExprTrait< ST1, DVecScalarDivExpr<VT,ST2,TF> >::Type >::Type
848  operator*( ST1 scalar, const DVecScalarDivExpr<VT,ST2,TF>& vec )
849 {
851 
852  return vec.leftOperand() * ( scalar / vec.rightOperand() );
853 }
855 //*************************************************************************************************
856 
857 
858 //*************************************************************************************************
871 template< typename VT // Type of the dense vector of the left-hand side expression
872  , typename ST1 // Type of the scalar of the left-hand side expression
873  , bool TF // Transpose flag of the dense vector
874  , typename ST2 > // Type of the right-hand side scalar
875 inline const typename EnableIf< IsNumeric<ST2>
876  , typename DivExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
877  operator/( const DVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
878 {
880 
881  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
882 
883  typedef typename MultTrait<ST1,ST2>::Type MultType;
884  typedef typename DivExprTrait<VT,MultType>::Type ReturnType;
885  typedef typename ReturnType::RightOperand ScalarType;
886 
887  if( IsMultExpr<ReturnType>::value ) {
888  return ReturnType( vec.leftOperand(), ScalarType(1)/( vec.rightOperand() * scalar ) );
889  }
890  else {
891  return ReturnType( vec.leftOperand(), vec.rightOperand() * scalar );
892  }
893 }
895 //*************************************************************************************************
896 
897 
898 
899 
900 //=================================================================================================
901 //
902 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
903 //
904 //=================================================================================================
905 
906 //*************************************************************************************************
908 template< typename VT, typename ST1, typename ST2 >
909 struct DVecScalarMultExprTrait< DVecScalarDivExpr<VT,ST1,false>, ST2 >
910 {
911  private:
912  //**********************************************************************************************
913  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
914  //**********************************************************************************************
915 
916  //**********************************************************************************************
917  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
918  typedef DVecScalarMultExpr< DVecScalarDivExpr<VT,ST1,false>, ST2, false > T2;
919  //**********************************************************************************************
920 
921  public:
922  //**********************************************************************************************
923  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
924  IsNumeric<ST1>::value && IsNumeric<ST2>::value
925  , typename SelectType<condition,T1,T2>::Type
926  , INVALID_TYPE >::Type Type;
927  //**********************************************************************************************
928 };
930 //*************************************************************************************************
931 
932 
933 
934 
935 //=================================================================================================
936 //
937 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
938 //
939 //=================================================================================================
940 
941 //*************************************************************************************************
943 template< typename VT, typename ST1, typename ST2 >
944 struct TDVecScalarMultExprTrait< DVecScalarDivExpr<VT,ST1,true>, ST2 >
945 {
946  private:
947  //**********************************************************************************************
948  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
949  //**********************************************************************************************
950 
951  //**********************************************************************************************
952  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
953  typedef DVecScalarMultExpr< DVecScalarDivExpr<VT,ST1,true>, ST2, true > T2;
954  //**********************************************************************************************
955 
956  public:
957  //**********************************************************************************************
958  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
959  IsNumeric<ST1>::value && IsNumeric<ST2>::value
960  , typename SelectType<condition,T1,T2>::Type
961  , INVALID_TYPE >::Type Type;
962  //**********************************************************************************************
963 };
965 //*************************************************************************************************
966 
967 
968 
969 
970 //=================================================================================================
971 //
972 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
973 //
974 //=================================================================================================
975 
976 //*************************************************************************************************
978 template< typename VT, typename ST, bool TF, bool AF >
979 struct SubvectorExprTrait< DVecScalarDivExpr<VT,ST,TF>, AF >
980 {
981  public:
982  //**********************************************************************************************
983  typedef typename DivExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
984  //**********************************************************************************************
985 };
987 //*************************************************************************************************
988 
989 } // namespace blaze
990 
991 #endif
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DVecScalarDivExpr.h:556
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.
#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:149
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:4075
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:772
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:474
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarDivExpr.h:176
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarDivExpr.h:516
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarDivExpr.h:404
LeftOperand vector_
Left-hand side dense vector of the division expression.
Definition: DVecScalarDivExpr.h:555
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
void smpMultAssign(DenseVector< 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:178
Header file for the IsSame and IsStrictlySame type traits.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
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:249
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarDivExpr.h:177
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarDivExpr.h:196
Header file for the DenseVector base class.
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:148
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DVecScalarDivExpr.h:504
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:294
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarDivExpr.h:231
Constraint on the data type.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarDivExpr.h:173
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:87
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarDivExpr.h:384
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:338
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarDivExpr.h:184
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarDivExpr.h:242
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< 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:121
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:251
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarDivExpr.h:538
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:187
Header file for the dense vector SMP implementation.
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:2388
Iterator over the elements of the dense vector.
Definition: DVecScalarDivExpr.h:169
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarDivExpr.h:150
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarDivExpr.h:174
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:179
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:163
Constraint on the data type.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarDivExpr.h:484
#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:437
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:208
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarDivExpr.h:528
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:269
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarDivExpr.h:548
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarDivExpr.h:403
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:181
Header file for the EnableIf class template.
Header file for the BaseElementType type trait.
Header file for the IsNumeric type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarDivExpr.h:494
PointerType pointer
Pointer return type.
Definition: DVecScalarDivExpr.h:182
Header file for run time assertion macros.
Utility type for generic codes.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarDivExpr.h:464
DVecScalarDivExpr< VT, ST, TF > This
Type of this DVecScalarDivExpr instance.
Definition: DVecScalarDivExpr.h:147
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:349
Header file for the division trait.
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:209
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:252
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarDivExpr.h:180
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:239
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:396
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarDivExpr.h:449
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarDivExpr.h:151
Base template for the DivTrait class.
Definition: DivTrait.h:141
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:220
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarDivExpr.h:154
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:372
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarDivExpr.h:273
Header file for the IsComputation type trait class.
const size_t SMP_DVECSCALARMULT_THRESHOLD
SMP dense vector/scalar multiplication/division threshold.This threshold represents the system-specif...
Definition: Thresholds.h:126
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#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:2379
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarDivExpr.h:283
ElementType * PointerType
Pointer return type.
Definition: DVecScalarDivExpr.h:175
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:305
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarDivExpr.h:263
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:360
Header file for the IsColumnVector type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:327
DVecScalarDivExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarDivExpr class.
Definition: DVecScalarDivExpr.h:425
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarDivExpr.h:160
#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:316
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:209
SelectType< useAssign, const ResultType, const DVecScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarDivExpr.h:157
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:183
Header file for the FunctionTrace class.