All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SVecScalarDivExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSCALARDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSCALARDIVEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
66 #include <blaze/util/Assert.h>
71 #include <blaze/util/EnableIf.h>
72 #include <blaze/util/InvalidType.h>
74 #include <blaze/util/SelectType.h>
75 #include <blaze/util/Types.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // CLASS SVECSCALARDIVEXPR
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
96 template< typename VT // Type of the left-hand side sparse vector
97  , typename ST // Type of the right-hand side scalar value
98  , bool TF > // Transpose flag
99 class SVecScalarDivExpr : public SparseVector< SVecScalarDivExpr<VT,ST,TF>, TF >
100  , private VecScalarDivExpr
101  , private Computation
102 {
103  private:
104  //**Type definitions****************************************************************************
105  typedef typename VT::ResultType RT;
106  typedef typename VT::ReturnType RN;
107  typedef typename VT::CompositeType CT;
108  //**********************************************************************************************
109 
110  //**Return type evaluation**********************************************************************
112 
117  enum { returnExpr = !IsTemporary<RN>::value };
118 
121  //**********************************************************************************************
122 
123  //**Serial 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  //**Parallel evaluation strategy****************************************************************
144 
150  template< typename VT2 >
151  struct UseSMPAssign {
152  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
153  };
155  //**********************************************************************************************
156 
157  public:
158  //**Type definitions****************************************************************************
163 
166 
169 
171  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
172 
174  typedef ST RightOperand;
175  //**********************************************************************************************
176 
177  //**Compilation flags***************************************************************************
179  enum { smpAssignable = 0 };
180  //**********************************************************************************************
181 
182  //**ConstIterator class definition**************************************************************
186  {
187  public:
188  //**Type definitions*************************************************************************
191 
194 
195  typedef std::forward_iterator_tag IteratorCategory;
196  typedef Element ValueType;
200 
201  // STL iterator requirements
207  //*******************************************************************************************
208 
209  //**Constructor******************************************************************************
212  inline ConstIterator( IteratorType vector, RightOperand scalar )
213  : vector_( vector ) // Iterator over the elements of the left-hand side sparse vector expression
214  , scalar_( scalar ) // Right hand side scalar of the multiplication expression
215  {}
216  //*******************************************************************************************
217 
218  //**Prefix increment operator****************************************************************
224  ++vector_;
225  return *this;
226  }
227  //*******************************************************************************************
228 
229  //**Element access operator******************************************************************
234  inline const Element operator*() const {
235  return Element( vector_->value() / scalar_, vector_->index() );
236  }
237  //*******************************************************************************************
238 
239  //**Element access operator******************************************************************
244  inline const ConstIterator* operator->() const {
245  return this;
246  }
247  //*******************************************************************************************
248 
249  //**Value function***************************************************************************
254  inline ReturnType value() const {
255  return vector_->value() / scalar_;
256  }
257  //*******************************************************************************************
258 
259  //**Index function***************************************************************************
264  inline size_t index() const {
265  return vector_->index();
266  }
267  //*******************************************************************************************
268 
269  //**Equality operator************************************************************************
275  inline bool operator==( const ConstIterator& rhs ) const {
276  return vector_ == rhs.vector_;
277  }
278  //*******************************************************************************************
279 
280  //**Inequality operator**********************************************************************
286  inline bool operator!=( const ConstIterator& rhs ) const {
287  return vector_ != rhs.vector_;
288  }
289  //*******************************************************************************************
290 
291  //**Subtraction operator*********************************************************************
297  inline DifferenceType operator-( const ConstIterator& rhs ) const {
298  return vector_ - rhs.vector_;
299  }
300  //*******************************************************************************************
301 
302  private:
303  //**Member variables*************************************************************************
306  //*******************************************************************************************
307  };
308  //**********************************************************************************************
309 
310  //**Constructor*********************************************************************************
316  explicit inline SVecScalarDivExpr( const VT& vector, ST scalar )
317  : vector_( vector ) // Left-hand side sparse vector of the division expression
318  , scalar_( scalar ) // Right-hand side scalar of the division expression
319  {}
320  //**********************************************************************************************
321 
322  //**Subscript operator**************************************************************************
328  inline ReturnType operator[]( size_t index ) const {
329  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
330  return vector_[index] / scalar_;
331  }
332  //**********************************************************************************************
333 
334  //**Begin function******************************************************************************
339  inline ConstIterator begin() const {
340  return ConstIterator( vector_.begin(), scalar_ );
341  }
342  //**********************************************************************************************
343 
344  //**End function********************************************************************************
349  inline ConstIterator end() const {
350  return ConstIterator( vector_.end(), scalar_ );
351  }
352  //**********************************************************************************************
353 
354  //**Size function*******************************************************************************
359  inline size_t size() const {
360  return vector_.size();
361  }
362  //**********************************************************************************************
363 
364  //**NonZeros function***************************************************************************
369  inline size_t nonZeros() const {
370  return vector_.nonZeros();
371  }
372  //**********************************************************************************************
373 
374  //**Left operand access*************************************************************************
379  inline LeftOperand leftOperand() const {
380  return vector_;
381  }
382  //**********************************************************************************************
383 
384  //**Right operand access************************************************************************
389  inline RightOperand rightOperand() const {
390  return scalar_;
391  }
392  //**********************************************************************************************
393 
394  //**********************************************************************************************
400  template< typename T >
401  inline bool canAlias( const T* alias ) const {
402  return vector_.canAlias( alias );
403  }
404  //**********************************************************************************************
405 
406  //**********************************************************************************************
412  template< typename T >
413  inline bool isAliased( const T* alias ) const {
414  return vector_.isAliased( alias );
415  }
416  //**********************************************************************************************
417 
418  private:
419  //**Member variables****************************************************************************
422  //**********************************************************************************************
423 
424  //**Assignment to dense vectors*****************************************************************
438  template< typename VT2 > // Type of the target dense vector
439  friend inline typename EnableIf< UseAssign<VT2> >::Type
440  assign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
441  {
443 
444  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
445 
446  assign( ~lhs, rhs.vector_ );
447  (~lhs) /= rhs.scalar_;
448  }
450  //**********************************************************************************************
451 
452  //**Assignment to sparse vectors****************************************************************
466  template< typename VT2 > // Type of the target sparse vector
467  friend inline typename EnableIf< UseAssign<VT2> >::Type
468  assign( SparseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
469  {
471 
472  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
473 
474  assign( ~lhs, rhs.vector_ );
475  (~lhs) /= rhs.scalar_;
476  }
478  //**********************************************************************************************
479 
480  //**Addition assignment to dense vectors********************************************************
494  template< typename VT2 > // Type of the target dense vector
495  friend inline typename EnableIf< UseAssign<VT2> >::Type
496  addAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
497  {
499 
503 
504  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
505 
506  const ResultType tmp( serial( rhs ) );
507  addAssign( ~lhs, tmp );
508  }
510  //**********************************************************************************************
511 
512  //**Addition assignment to sparse vectors*******************************************************
513  // No special implementation for the addition assignment to sparse vectors.
514  //**********************************************************************************************
515 
516  //**Subtraction assignment to dense vectors*****************************************************
530  template< typename VT2 > // Type of the target dense vector
531  friend inline typename EnableIf< UseAssign<VT2> >::Type
532  subAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
533  {
535 
539 
540  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
541 
542  const ResultType tmp( serial( rhs ) );
543  subAssign( ~lhs, tmp );
544  }
546  //**********************************************************************************************
547 
548  //**Subtraction assignment to sparse vectors****************************************************
549  // No special implementation for the subtraction assignment to sparse vectors.
550  //**********************************************************************************************
551 
552  //**Multiplication assignment to dense vectors**************************************************
566  template< typename VT2 > // Type of the target dense vector
567  friend inline typename EnableIf< UseAssign<VT2> >::Type
568  multAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
569  {
571 
575 
576  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
577 
578  const ResultType tmp( serial( rhs ) );
579  multAssign( ~lhs, tmp );
580  }
582  //**********************************************************************************************
583 
584  //**Multiplication assignment to sparse vectors*************************************************
585  // No special implementation for the multiplication assignment to sparse vectors.
586  //**********************************************************************************************
587 
588  //**SMP assignment to dense vectors*************************************************************
589  // No special implementation for the SMP assignment to dense vectors.
590  //**********************************************************************************************
591 
592  //**SMP assignment to sparse vectors************************************************************
593  // No special implementation for the SMP assignment to sparse vectors.
594  //**********************************************************************************************
595 
596  //**SMP addition assignment to dense vectors****************************************************
610  template< typename VT2 > // Type of the target dense vector
611  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
612  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
613  {
615 
619 
620  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
621 
622  const ResultType tmp( rhs );
623  smpAddAssign( ~lhs, tmp );
624  }
626  //**********************************************************************************************
627 
628  //**SMP addition assignment to sparse vectors***************************************************
629  // No special implementation for the SMP addition assignment to sparse vectors.
630  //**********************************************************************************************
631 
632  //**SMP subtraction assignment to dense vectors*************************************************
646  template< typename VT2 > // Type of the target dense vector
647  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
648  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
649  {
651 
655 
656  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
657 
658  const ResultType tmp( rhs );
659  smpSubAssign( ~lhs, tmp );
660  }
662  //**********************************************************************************************
663 
664  //**SMP subtraction assignment to sparse vectors************************************************
665  // No special implementation for the SMP subtraction assignment to sparse vectors.
666  //**********************************************************************************************
667 
668  //**SMP multiplication assignment to dense vectors**********************************************
682  template< typename VT2 > // Type of the target dense vector
683  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
684  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
685  {
687 
691 
692  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
693 
694  const ResultType tmp( rhs );
695  smpMultAssign( ~lhs, tmp );
696  }
698  //**********************************************************************************************
699 
700  //**SMP multiplication assignment to sparse vectors*********************************************
701  // No special implementation for the SMP multiplication assignment to sparse vectors.
702  //**********************************************************************************************
703 
704  //**Compile time checks*************************************************************************
713  //**********************************************************************************************
714 };
715 //*************************************************************************************************
716 
717 
718 
719 
720 //=================================================================================================
721 //
722 // GLOBAL BINARY ARITHMETIC OPERATORS
723 //
724 //=================================================================================================
725 
726 //*************************************************************************************************
749 template< typename T1 // Type of the left-hand side sparse vector
750  , typename T2 // Type of the right-hand side scalar
751  , bool TF > // Transpose flag
752 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
753  operator/( const SparseVector<T1,TF>& vec, T2 scalar )
754 {
756 
757  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
758 
759  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
760  typedef typename ReturnType::RightOperand ScalarType;
761 
763  return ReturnType( ~vec, ScalarType(1)/ScalarType(scalar) );
764  }
765  else {
766  return ReturnType( ~vec, scalar );
767  }
768 }
769 //*************************************************************************************************
770 
771 
772 
773 
774 //=================================================================================================
775 //
776 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
777 //
778 //=================================================================================================
779 
780 //*************************************************************************************************
793 template< typename VT // Type of the sparse vector of the left-hand side expression
794  , typename ST1 // Type of the scalar of the left-hand side expression
795  , bool TF // Transpose flag of the sparse vector
796  , typename ST2 > // Type of the right-hand side scalar
797 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
798  , typename MultExprTrait< SVecScalarDivExpr<VT,ST1,TF>, ST2 >::Type >::Type
799  operator*( const SVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
800 {
802 
803  return vec.leftOperand() * ( scalar / vec.rightOperand() );
804 }
806 //*************************************************************************************************
807 
808 
809 //*************************************************************************************************
822 template< typename ST1 // Type of the left-hand side scalar
823  , typename VT // Type of the sparse vector of the right-hand side expression
824  , typename ST2 // Type of the scalar of the right-hand side expression
825  , bool TF > // Transpose flag of the sparse vector
826 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
827  , typename MultExprTrait< ST1, SVecScalarDivExpr<VT,ST2,TF> >::Type >::Type
828  operator*( ST1 scalar, const SVecScalarDivExpr<VT,ST2,TF>& vec )
829 {
831 
832  return vec.leftOperand() * ( scalar / vec.rightOperand() );
833 }
835 //*************************************************************************************************
836 
837 
838 //*************************************************************************************************
851 template< typename VT // Type of the sparse vector of the left-hand side expression
852  , typename ST1 // Type of the scalar of the left-hand side expression
853  , bool TF // Transpose flag of the sparse vector
854  , typename ST2 > // Type of the right-hand side scalar
855 inline const typename EnableIf< IsNumeric<ST2>
856  , typename DivExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
857  operator/( const SVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
858 {
860 
861  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
862 
863  typedef typename MultTrait<ST1,ST2>::Type MultType;
864  typedef typename DivExprTrait<VT,MultType>::Type ReturnType;
865  typedef typename ReturnType::RightOperand ScalarType;
866 
867  if( IsMultExpr<ReturnType>::value ) {
868  return ReturnType( vec.leftOperand(), ScalarType(1)/( vec.rightOperand() * scalar ) );
869  }
870  else {
871  return ReturnType( vec.leftOperand(), vec.rightOperand() * scalar );
872  }
873 }
875 //*************************************************************************************************
876 
877 
878 
879 
880 //=================================================================================================
881 //
882 // SVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
883 //
884 //=================================================================================================
885 
886 //*************************************************************************************************
888 template< typename VT, typename ST1, typename ST2 >
889 struct SVecScalarMultExprTrait< SVecScalarDivExpr<VT,ST1,false>, ST2 >
890 {
891  private:
892  //**********************************************************************************************
893  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
894  //**********************************************************************************************
895 
896  //**********************************************************************************************
897  typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
898  typedef SVecScalarMultExpr< SVecScalarDivExpr<VT,ST1,false>, ST2, false > T2;
899  //**********************************************************************************************
900 
901  public:
902  //**********************************************************************************************
903  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
904  IsNumeric<ST1>::value && IsNumeric<ST2>::value
905  , typename SelectType<condition,T1,T2>::Type
906  , INVALID_TYPE >::Type Type;
907  //**********************************************************************************************
908 };
910 //*************************************************************************************************
911 
912 
913 
914 
915 //=================================================================================================
916 //
917 // TSVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
918 //
919 //=================================================================================================
920 
921 //*************************************************************************************************
923 template< typename VT, typename ST1, typename ST2 >
924 struct TSVecScalarMultExprTrait< SVecScalarDivExpr<VT,ST1,true>, ST2 >
925 {
926  private:
927  //**********************************************************************************************
928  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
929  //**********************************************************************************************
930 
931  //**********************************************************************************************
932  typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
933  typedef SVecScalarMultExpr< SVecScalarDivExpr<VT,ST1,true>, ST2, true > T2;
934  //**********************************************************************************************
935 
936  public:
937  //**********************************************************************************************
938  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
939  IsNumeric<ST1>::value && IsNumeric<ST2>::value
940  , typename SelectType<condition,T1,T2>::Type
941  , INVALID_TYPE >::Type Type;
942  //**********************************************************************************************
943 };
945 //*************************************************************************************************
946 
947 
948 
949 
950 //=================================================================================================
951 //
952 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
953 //
954 //=================================================================================================
955 
956 //*************************************************************************************************
958 template< typename VT, typename ST, bool TF, bool AF >
959 struct SubvectorExprTrait< SVecScalarDivExpr<VT,ST,TF>, AF >
960 {
961  public:
962  //**********************************************************************************************
963  typedef typename DivExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
964  //**********************************************************************************************
965 };
967 //*************************************************************************************************
968 
969 } // namespace blaze
970 
971 #endif
SVecScalarDivExpr< VT, ST, TF > This
Type of this SVecScalarDivExpr instance.
Definition: SVecScalarDivExpr.h:159
Pointer difference type of the Blaze library.
Data type constraint.
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
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:4329
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:930
PointerType pointer
Pointer return type.
Definition: SVecScalarDivExpr.h:204
Header file for the SparseVector base class.
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
IteratorType vector_
Iterator over the elements of the left-hand side sparse vector expression.
Definition: SVecScalarDivExpr.h:304
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecScalarDivExpr.h:369
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:152
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:105
IteratorCategory iterator_category
The iterator category.
Definition: SVecScalarDivExpr.h:202
DivTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SVecScalarDivExpr.h:160
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecScalarDivExpr.h:165
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:179
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecScalarDivExpr.h:120
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
size_t index() const
Access to the current index of the sparse element.
Definition: SVecScalarDivExpr.h:264
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:251
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecScalarDivExpr.h:297
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecScalarDivExpr.h:286
ValueType & ReferenceType
Reference return type.
Definition: SVecScalarDivExpr.h:198
Constraint on the data type.
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
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:122
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarDivExpr.h:234
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:253
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecScalarDivExpr.h:254
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:106
Header file for the ValueIndexPair class.
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.
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SVecScalarDivExpr.h:389
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:2412
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:190
Element ValueType
Type of the underlying pointers.
Definition: SVecScalarDivExpr.h:196
Iterator over the elements of the sparse vector/scalar multiplication expression. ...
Definition: SVecScalarDivExpr.h:185
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:271
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: SVecScalarDivExpr.h:421
RightOperand scalar_
Right hand side scalar of the multiplication expression.
Definition: SVecScalarDivExpr.h:305
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecScalarDivExpr.h:413
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:193
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:79
Constraint on the data type.
ConstIterator(IteratorType vector, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SVecScalarDivExpr.h:212
#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
SVecScalarDivExpr(const VT &vector, ST scalar)
Constructor for the SVecScalarDivExpr class.
Definition: SVecScalarDivExpr.h:316
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecScalarDivExpr.h:199
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:361
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the serial shim.
Header file for the BaseElementType type trait.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SVecScalarDivExpr.h:174
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecScalarDivExpr.h:328
Header file for the IsNumeric type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SVecScalarDivExpr.h:203
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for run time assertion macros.
Utility type for generic codes.
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:301
LeftOperand vector_
Left-hand side sparse vector of the division expression.
Definition: SVecScalarDivExpr.h:420
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecScalarDivExpr.h:275
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecScalarDivExpr.h:339
SelectType< useAssign, const ResultType, const SVecScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecScalarDivExpr.h:168
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:107
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
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:331
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecScalarDivExpr.h:171
ReferenceType reference
Reference return type.
Definition: SVecScalarDivExpr.h:205
Expression object for divisions of a sparse vector by a scalar.The SVecScalarDivExpr class represents...
Definition: Forward.h:114
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecScalarDivExpr.h:223
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecScalarDivExpr.h:195
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecScalarDivExpr.h:379
Header file for the RemoveReference type trait.
Base template for the DivTrait class.
Definition: DivTrait.h:141
#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
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecScalarDivExpr.h:401
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecScalarDivExpr.h:162
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarDivExpr.h:244
Header file for the IsComputation type trait class.
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:2403
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecScalarDivExpr.h:349
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
DifferenceType difference_type
Difference between two iterators.
Definition: SVecScalarDivExpr.h:206
Header file for the IsColumnVector 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
#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
ValueType * PointerType
Pointer return type.
Definition: SVecScalarDivExpr.h:197
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecScalarDivExpr.h:359
Header file for the IsExpression type trait class.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecScalarDivExpr.h:161
Header file for the FunctionTrace class.