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>
65 #include <blaze/util/Assert.h>
70 #include <blaze/util/EnableIf.h>
71 #include <blaze/util/InvalidType.h>
73 #include <blaze/util/SelectType.h>
74 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DVECSCALARDIVEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename VT // Type of the left-hand side dense vector
96  , typename ST // Type of the right-hand side scalar value
97  , bool TF > // Transpose flag
98 class DVecScalarDivExpr : public DenseVector< DVecScalarDivExpr<VT,ST,TF>, TF >
99  , private VecScalarDivExpr
100  , private Computation
101 {
102  private:
103  //**Type definitions****************************************************************************
104  typedef typename VT::ResultType RT;
105  typedef typename VT::ReturnType RN;
106  typedef typename VT::ElementType ET;
107  typedef typename VT::CompositeType CT;
108  //**********************************************************************************************
109 
110  //**Return type evaluation**********************************************************************
112 
117  enum { returnExpr = !IsTemporary<RN>::value };
118 
121  //**********************************************************************************************
122 
123  //**Evaluation strategy*************************************************************************
125 
131  enum { useAssign = RequiresEvaluation<VT>::value };
132 
134  template< typename VT2 >
136  struct UseAssign {
137  enum { value = useAssign };
138  };
140  //**********************************************************************************************
141 
142  public:
143  //**Type definitions****************************************************************************
149 
152 
155 
157  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
158 
160  typedef ST RightOperand;
161  //**********************************************************************************************
162 
163  //**ConstIterator class definition**************************************************************
167  {
168  public:
169  //**Type definitions*************************************************************************
170  typedef std::random_access_iterator_tag IteratorCategory;
175 
176  // STL iterator requirements
182 
184  typedef typename VT::ConstIterator IteratorType;
185  //*******************************************************************************************
186 
187  //**Constructor******************************************************************************
193  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
194  : iterator_( iterator ) // Iterator to the current element
195  , scalar_ ( scalar ) // Scalar of the multiplication expression
196  {}
197  //*******************************************************************************************
198 
199  //**Addition assignment operator*************************************************************
205  inline ConstIterator& operator+=( size_t inc ) {
206  iterator_ += inc;
207  return *this;
208  }
209  //*******************************************************************************************
210 
211  //**Subtraction assignment operator**********************************************************
217  inline ConstIterator& operator-=( size_t dec ) {
218  iterator_ -= dec;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Prefix increment operator****************************************************************
229  ++iterator_;
230  return *this;
231  }
232  //*******************************************************************************************
233 
234  //**Postfix increment operator***************************************************************
239  inline const ConstIterator operator++( int ) {
240  return ConstIterator( iterator_++ );
241  }
242  //*******************************************************************************************
243 
244  //**Prefix decrement operator****************************************************************
250  --iterator_;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Postfix decrement operator***************************************************************
260  inline const ConstIterator operator--( int ) {
261  return ConstIterator( iterator_-- );
262  }
263  //*******************************************************************************************
264 
265  //**Element access operator******************************************************************
270  inline ReturnType operator*() const {
271  return *iterator_ / scalar_;
272  }
273  //*******************************************************************************************
274 
275  //**Load function****************************************************************************
280  inline IntrinsicType load() const {
281  return iterator_.load() / set( scalar_ );
282  }
283  //*******************************************************************************************
284 
285  //**Equality operator************************************************************************
291  inline bool operator==( const ConstIterator& rhs ) const {
292  return iterator_ == rhs.iterator_;
293  }
294  //*******************************************************************************************
295 
296  //**Inequality operator**********************************************************************
302  inline bool operator!=( const ConstIterator& rhs ) const {
303  return iterator_ != rhs.iterator_;
304  }
305  //*******************************************************************************************
306 
307  //**Less-than operator***********************************************************************
313  inline bool operator<( const ConstIterator& rhs ) const {
314  return iterator_ < rhs.iterator_;
315  }
316  //*******************************************************************************************
317 
318  //**Greater-than operator********************************************************************
324  inline bool operator>( const ConstIterator& rhs ) const {
325  return iterator_ > rhs.iterator_;
326  }
327  //*******************************************************************************************
328 
329  //**Less-or-equal-than operator**************************************************************
335  inline bool operator<=( const ConstIterator& rhs ) const {
336  return iterator_ <= rhs.iterator_;
337  }
338  //*******************************************************************************************
339 
340  //**Greater-or-equal-than operator***********************************************************
346  inline bool operator>=( const ConstIterator& rhs ) const {
347  return iterator_ >= rhs.iterator_;
348  }
349  //*******************************************************************************************
350 
351  //**Subtraction operator*********************************************************************
357  inline DifferenceType operator-( const ConstIterator& rhs ) const {
358  return iterator_ - rhs.iterator_;
359  }
360  //*******************************************************************************************
361 
362  //**Addition operator************************************************************************
369  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
370  return ConstIterator( it.iterator_ + inc );
371  }
372  //*******************************************************************************************
373 
374  //**Addition operator************************************************************************
381  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
382  return ConstIterator( it.iterator_ + inc );
383  }
384  //*******************************************************************************************
385 
386  //**Subtraction operator*********************************************************************
393  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
394  return ConstIterator( it.iterator_ - dec );
395  }
396  //*******************************************************************************************
397 
398  private:
399  //**Member variables*************************************************************************
402  //*******************************************************************************************
403  };
404  //**********************************************************************************************
405 
406  //**Compilation flags***************************************************************************
408  enum { vectorizable = VT::vectorizable &&
411 
413  enum { smpAssignable = 0 };
414  //**********************************************************************************************
415 
416  //**Constructor*********************************************************************************
422  explicit inline DVecScalarDivExpr( const VT& vector, ST scalar )
423  : vector_( vector ) // Left-hand side dense vector of the division expression
424  , scalar_( scalar ) // Right-hand side scalar of the division expression
425  {}
426  //**********************************************************************************************
427 
428  //**Subscript operator**************************************************************************
434  inline ReturnType operator[]( size_t index ) const {
435  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
436  return vector_[index] / scalar_;
437  }
438  //**********************************************************************************************
439 
440  //**Load function*******************************************************************************
446  inline IntrinsicType load( size_t index ) const {
447  typedef IntrinsicTrait<ElementType> IT;
448  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
449  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
450  const IntrinsicType xmm1( vector_.load( index ) );
451  const IntrinsicType xmm2( set( scalar_ ) );
452  return xmm1 / xmm2;
453  }
454  //**********************************************************************************************
455 
456  //**Begin function******************************************************************************
461  inline ConstIterator begin() const {
462  return ConstIterator( vector_.begin(), scalar_ );
463  }
464  //**********************************************************************************************
465 
466  //**End function********************************************************************************
471  inline ConstIterator end() const {
472  return ConstIterator( vector_.end(), scalar_ );
473  }
474  //**********************************************************************************************
475 
476  //**Size function*******************************************************************************
481  inline size_t size() const {
482  return vector_.size();
483  }
484  //**********************************************************************************************
485 
486  //**Left operand access*************************************************************************
491  inline LeftOperand leftOperand() const {
492  return vector_;
493  }
494  //**********************************************************************************************
495 
496  //**Right operand access************************************************************************
501  inline RightOperand rightOperand() const {
502  return scalar_;
503  }
504  //**********************************************************************************************
505 
506  //**********************************************************************************************
512  template< typename T >
513  inline bool canAlias( const T* alias ) const {
514  return IsComputation<VT>::value && vector_.canAlias( alias );
515  }
516  //**********************************************************************************************
517 
518  //**********************************************************************************************
524  template< typename T >
525  inline bool isAliased( const T* alias ) const {
526  return vector_.isAliased( alias );
527  }
528  //**********************************************************************************************
529 
530  private:
531  //**Member variables****************************************************************************
534  //**********************************************************************************************
535 
536  //**Assignment to dense vectors*****************************************************************
550  template< typename VT2 > // Type of the target dense vector
551  friend inline typename EnableIf< UseAssign<VT2> >::Type
552  assign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
553  {
555 
556  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
557 
558  assign( ~lhs, rhs.vector_ );
559  (~lhs) /= rhs.scalar_;
560  }
562  //**********************************************************************************************
563 
564  //**Assignment to sparse vectors****************************************************************
578  template< typename VT2 > // Type of the target sparse vector
579  friend inline typename EnableIf< UseAssign<VT2> >::Type
580  assign( SparseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
581  {
583 
584  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
585 
586  assign( ~lhs, rhs.vector_ );
587  (~lhs) /= rhs.scalar_;
588  }
590  //**********************************************************************************************
591 
592  //**Addition assignment to dense vectors********************************************************
606  template< typename VT2 > // Type of the target dense vector
607  friend inline typename EnableIf< UseAssign<VT2> >::Type
608  addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
609  {
611 
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
617 
618  const ResultType tmp( rhs );
619  addAssign( ~lhs, tmp );
620  }
622  //**********************************************************************************************
623 
624  //**Addition assignment to sparse vectors*******************************************************
625  // No special implementation for the addition assignment to sparse vectors.
626  //**********************************************************************************************
627 
628  //**Subtraction assignment to dense vectors*****************************************************
642  template< typename VT2 > // Type of the target dense vector
643  friend inline typename EnableIf< UseAssign<VT2> >::Type
644  subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
645  {
647 
651 
652  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
653 
654  const ResultType tmp( rhs );
655  subAssign( ~lhs, tmp );
656  }
658  //**********************************************************************************************
659 
660  //**Subtraction assignment to sparse vectors****************************************************
661  // No special implementation for the subtraction assignment to sparse vectors.
662  //**********************************************************************************************
663 
664  //**Multiplication assignment to dense vectors**************************************************
678  template< typename VT2 > // Type of the target dense vector
679  friend inline typename EnableIf< UseAssign<VT2> >::Type
680  multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
681  {
683 
687 
688  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
689 
690  const ResultType tmp( rhs );
691  multAssign( ~lhs, tmp );
692  }
694  //**********************************************************************************************
695 
696  //**Multiplication assignment to sparse vectors*************************************************
697  // No special implementation for the multiplication assignment to sparse vectors.
698  //**********************************************************************************************
699 
700  //**Compile time checks*************************************************************************
709  //**********************************************************************************************
710 };
711 //*************************************************************************************************
712 
713 
714 
715 
716 //=================================================================================================
717 //
718 // GLOBAL BINARY ARITHMETIC OPERATORS
719 //
720 //=================================================================================================
721 
722 //*************************************************************************************************
746 template< typename T1 // Type of the left-hand side dense vector
747  , typename T2 // Type of the right-hand side scalar
748  , bool TF > // Transpose flag
749 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
750  operator/( const DenseVector<T1,TF>& vec, T2 scalar )
751 {
753 
754  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
755 
756  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
757  typedef typename ReturnType::RightOperand ScalarType;
758 
760  return ReturnType( ~vec, ScalarType(1)/ScalarType(scalar) );
761  }
762  else {
763  return ReturnType( ~vec, scalar );
764  }
765 }
766 //*************************************************************************************************
767 
768 
769 
770 
771 //=================================================================================================
772 //
773 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
774 //
775 //=================================================================================================
776 
777 //*************************************************************************************************
790 template< typename VT // Type of the dense vector of the left-hand side expression
791  , typename ST1 // Type of the scalar of the left-hand side expression
792  , bool TF // Transpose flag of the dense vector
793  , typename ST2 > // Type of the right-hand side scalar
794 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
795  , typename MultExprTrait< DVecScalarDivExpr<VT,ST1,TF>, ST2 >::Type >::Type
796  operator*( const DVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
797 {
799 
800  return vec.leftOperand() * ( scalar / vec.rightOperand() );
801 }
803 //*************************************************************************************************
804 
805 
806 //*************************************************************************************************
819 template< typename ST1 // Type of the left-hand side scalar
820  , typename VT // Type of the dense vector of the right-hand side expression
821  , typename ST2 // Type of the scalar of the right-hand side expression
822  , bool TF > // Transpose flag of the dense vector
823 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
824  , typename MultExprTrait< ST1, DVecScalarDivExpr<VT,ST2,TF> >::Type >::Type
825  operator*( ST1 scalar, const DVecScalarDivExpr<VT,ST2,TF>& vec )
826 {
828 
829  return vec.leftOperand() * ( scalar / vec.rightOperand() );
830 }
832 //*************************************************************************************************
833 
834 
835 //*************************************************************************************************
848 template< typename VT // Type of the dense vector of the left-hand side expression
849  , typename ST1 // Type of the scalar of the left-hand side expression
850  , bool TF // Transpose flag of the dense vector
851  , typename ST2 > // Type of the right-hand side scalar
852 inline const typename EnableIf< IsNumeric<ST2>
853  , typename DivExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
854  operator/( const DVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
855 {
857 
858  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
859 
860  typedef typename MultTrait<ST1,ST2>::Type MultType;
861  typedef typename DivExprTrait<VT,MultType>::Type ReturnType;
862  typedef typename ReturnType::RightOperand ScalarType;
863 
864  if( IsMultExpr<ReturnType>::value ) {
865  return ReturnType( vec.leftOperand(), ScalarType(1)/( vec.rightOperand() * scalar ) );
866  }
867  else {
868  return ReturnType( vec.leftOperand(), vec.rightOperand() * scalar );
869  }
870 }
872 //*************************************************************************************************
873 
874 
875 
876 
877 //=================================================================================================
878 //
879 // DVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
880 //
881 //=================================================================================================
882 
883 //*************************************************************************************************
885 template< typename VT, typename ST1, typename ST2 >
886 struct DVecScalarMultExprTrait< DVecScalarDivExpr<VT,ST1,false>, ST2 >
887 {
888  private:
889  //**********************************************************************************************
890  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
891  //**********************************************************************************************
892 
893  //**********************************************************************************************
894  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
895  typedef DVecScalarMultExpr< DVecScalarDivExpr<VT,ST1,false>, ST2, false > T2;
896  //**********************************************************************************************
897 
898  public:
899  //**********************************************************************************************
900  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
901  IsNumeric<ST1>::value && IsNumeric<ST2>::value
902  , typename SelectType<condition,T1,T2>::Type
903  , INVALID_TYPE >::Type Type;
904  //**********************************************************************************************
905 };
907 //*************************************************************************************************
908 
909 
910 
911 
912 //=================================================================================================
913 //
914 // TDVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
915 //
916 //=================================================================================================
917 
918 //*************************************************************************************************
920 template< typename VT, typename ST1, typename ST2 >
921 struct TDVecScalarMultExprTrait< DVecScalarDivExpr<VT,ST1,true>, ST2 >
922 {
923  private:
924  //**********************************************************************************************
925  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
926  //**********************************************************************************************
927 
928  //**********************************************************************************************
929  typedef typename DVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
930  typedef DVecScalarMultExpr< DVecScalarDivExpr<VT,ST1,true>, ST2, true > T2;
931  //**********************************************************************************************
932 
933  public:
934  //**********************************************************************************************
935  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
936  IsNumeric<ST1>::value && IsNumeric<ST2>::value
937  , typename SelectType<condition,T1,T2>::Type
938  , INVALID_TYPE >::Type Type;
939  //**********************************************************************************************
940 };
942 //*************************************************************************************************
943 
944 
945 
946 
947 //=================================================================================================
948 //
949 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
950 //
951 //=================================================================================================
952 
953 //*************************************************************************************************
955 template< typename VT, typename ST, bool TF >
956 struct SubvectorExprTrait< DVecScalarDivExpr<VT,ST,TF> >
957 {
958  public:
959  //**********************************************************************************************
960  typedef typename DivExprTrait< typename SubvectorExprTrait<const VT>::Type, ST >::Type Type;
961  //**********************************************************************************************
962 };
964 //*************************************************************************************************
965 
966 } // namespace blaze
967 
968 #endif
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DVecScalarDivExpr.h:533
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:146
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:3703
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:745
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarDivExpr.h:105
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:471
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarDivExpr.h:173
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarDivExpr.h:513
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarDivExpr.h:401
LeftOperand vector_
Left-hand side dense vector of the division expression.
Definition: DVecScalarDivExpr.h:532
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
Header file for the IsSame and IsStrictlySame type traits.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
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:248
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarDivExpr.h:174
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarDivExpr.h:193
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:145
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DVecScalarDivExpr.h:501
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:291
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarDivExpr.h:228
Constraint on the data type.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarDivExpr.h:170
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:381
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:335
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarDivExpr.h:181
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarDivExpr.h:239
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:250
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:184
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:2379
Iterator over the elements of the dense vector.
Definition: DVecScalarDivExpr.h:166
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarDivExpr.h:147
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarDivExpr.h:171
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:160
Constraint on the data type.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarDivExpr.h:481
#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:434
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarDivExpr.h:107
Constraint on the data type.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarDivExpr.h:205
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarDivExpr.h:525
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
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarDivExpr.h:400
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:178
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:2374
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarDivExpr.h:491
PointerType pointer
Pointer return type.
Definition: DVecScalarDivExpr.h:179
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:461
DVecScalarDivExpr< VT, ST, TF > This
Type of this DVecScalarDivExpr instance.
Definition: DVecScalarDivExpr.h:144
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:346
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:249
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarDivExpr.h:177
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:106
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:393
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarDivExpr.h:446
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarDivExpr.h:148
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:98
#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:217
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarDivExpr.h:151
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:369
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarDivExpr.h:270
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
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:2370
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarDivExpr.h:280
ElementType * PointerType
Pointer return type.
Definition: DVecScalarDivExpr.h:172
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:302
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarDivExpr.h:260
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarDivExpr.h:120
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarDivExpr.h:357
Header file for the IsColumnVector type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:324
DVecScalarDivExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarDivExpr class.
Definition: DVecScalarDivExpr.h:422
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarDivExpr.h:157
#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
#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:313
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:154
Header file for the IsExpression type trait class.
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarDivExpr.h:104
ReferenceType reference
Reference return type.
Definition: DVecScalarDivExpr.h:180
Header file for the FunctionTrace class.