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>
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 SVECSCALARDIVEXPR
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
98 template< typename VT // Type of the left-hand side sparse vector
99  , typename ST // Type of the right-hand side scalar value
100  , bool TF > // Transpose flag
101 class SVecScalarDivExpr : public SparseVector< SVecScalarDivExpr<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::CompositeType CT;
110  //**********************************************************************************************
111 
112  //**Return type evaluation**********************************************************************
114 
119  enum { returnExpr = !IsTemporary<RN>::value };
120 
123  //**********************************************************************************************
124 
125  //**Serial evaluation strategy******************************************************************
127 
133  enum { useAssign = RequiresEvaluation<VT>::value };
134 
136  template< typename VT2 >
138  struct UseAssign {
139  enum { value = useAssign };
140  };
142  //**********************************************************************************************
143 
144  //**Parallel evaluation strategy****************************************************************
146 
152  template< typename VT2 >
153  struct UseSMPAssign {
154  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
155  };
157  //**********************************************************************************************
158 
159  public:
160  //**Type definitions****************************************************************************
165 
168 
171 
173  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
174 
176  typedef ST RightOperand;
177  //**********************************************************************************************
178 
179  //**Compilation flags***************************************************************************
181  enum { smpAssignable = 0 };
182  //**********************************************************************************************
183 
184  //**ConstIterator class definition**************************************************************
188  {
189  public:
190  //**Type definitions*************************************************************************
193 
196 
197  typedef std::forward_iterator_tag IteratorCategory;
198  typedef Element ValueType;
202 
203  // STL iterator requirements
209  //*******************************************************************************************
210 
211  //**Constructor******************************************************************************
214  inline ConstIterator( IteratorType vector, RightOperand scalar )
215  : vector_( vector ) // Iterator over the elements of the left-hand side sparse vector expression
216  , scalar_( scalar ) // Right hand side scalar of the multiplication expression
217  {}
218  //*******************************************************************************************
219 
220  //**Prefix increment operator****************************************************************
226  ++vector_;
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Element access operator******************************************************************
236  inline const Element operator*() const {
237  return Element( vector_->value() / scalar_, vector_->index() );
238  }
239  //*******************************************************************************************
240 
241  //**Element access operator******************************************************************
246  inline const ConstIterator* operator->() const {
247  return this;
248  }
249  //*******************************************************************************************
250 
251  //**Value function***************************************************************************
256  inline ReturnType value() const {
257  return vector_->value() / scalar_;
258  }
259  //*******************************************************************************************
260 
261  //**Index function***************************************************************************
266  inline size_t index() const {
267  return vector_->index();
268  }
269  //*******************************************************************************************
270 
271  //**Equality operator************************************************************************
277  inline bool operator==( const ConstIterator& rhs ) const {
278  return vector_ == rhs.vector_;
279  }
280  //*******************************************************************************************
281 
282  //**Inequality operator**********************************************************************
288  inline bool operator!=( const ConstIterator& rhs ) const {
289  return vector_ != rhs.vector_;
290  }
291  //*******************************************************************************************
292 
293  //**Subtraction operator*********************************************************************
299  inline DifferenceType operator-( const ConstIterator& rhs ) const {
300  return vector_ - rhs.vector_;
301  }
302  //*******************************************************************************************
303 
304  private:
305  //**Member variables*************************************************************************
308  //*******************************************************************************************
309  };
310  //**********************************************************************************************
311 
312  //**Constructor*********************************************************************************
318  explicit inline SVecScalarDivExpr( const VT& vector, ST scalar )
319  : vector_( vector ) // Left-hand side sparse vector of the division expression
320  , scalar_( scalar ) // Right-hand side scalar of the division expression
321  {}
322  //**********************************************************************************************
323 
324  //**Subscript operator**************************************************************************
330  inline ReturnType operator[]( size_t index ) const {
331  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
332  return vector_[index] / scalar_;
333  }
334  //**********************************************************************************************
335 
336  //**Begin function******************************************************************************
341  inline ConstIterator begin() const {
342  return ConstIterator( vector_.begin(), scalar_ );
343  }
344  //**********************************************************************************************
345 
346  //**End function********************************************************************************
351  inline ConstIterator end() const {
352  return ConstIterator( vector_.end(), scalar_ );
353  }
354  //**********************************************************************************************
355 
356  //**Size function*******************************************************************************
361  inline size_t size() const {
362  return vector_.size();
363  }
364  //**********************************************************************************************
365 
366  //**NonZeros function***************************************************************************
371  inline size_t nonZeros() const {
372  return vector_.nonZeros();
373  }
374  //**********************************************************************************************
375 
376  //**Find function*******************************************************************************
382  inline ConstIterator find( size_t index ) const {
384  return ConstIterator( vector_.find( index ) );
385  }
386  //**********************************************************************************************
387 
388  //**LowerBound function*************************************************************************
394  inline ConstIterator lowerBound( size_t index ) const {
396  return ConstIterator( vector_.lowerBound( index ) );
397  }
398  //**********************************************************************************************
399 
400  //**UpperBound function*************************************************************************
406  inline ConstIterator upperBound( size_t index ) const {
408  return ConstIterator( vector_.upperBound( index ) );
409  }
410  //**********************************************************************************************
411 
412  //**Left operand access*************************************************************************
417  inline LeftOperand leftOperand() const {
418  return vector_;
419  }
420  //**********************************************************************************************
421 
422  //**Right operand access************************************************************************
427  inline RightOperand rightOperand() const {
428  return scalar_;
429  }
430  //**********************************************************************************************
431 
432  //**********************************************************************************************
438  template< typename T >
439  inline bool canAlias( const T* alias ) const {
440  return vector_.canAlias( alias );
441  }
442  //**********************************************************************************************
443 
444  //**********************************************************************************************
450  template< typename T >
451  inline bool isAliased( const T* alias ) const {
452  return vector_.isAliased( alias );
453  }
454  //**********************************************************************************************
455 
456  private:
457  //**Member variables****************************************************************************
460  //**********************************************************************************************
461 
462  //**Assignment to dense vectors*****************************************************************
476  template< typename VT2 > // Type of the target dense vector
477  friend inline typename EnableIf< UseAssign<VT2> >::Type
478  assign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
479  {
481 
482  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
483 
484  assign( ~lhs, rhs.vector_ );
485  (~lhs) /= rhs.scalar_;
486  }
488  //**********************************************************************************************
489 
490  //**Assignment to sparse vectors****************************************************************
504  template< typename VT2 > // Type of the target sparse vector
505  friend inline typename EnableIf< UseAssign<VT2> >::Type
506  assign( SparseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
507  {
509 
510  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
511 
512  assign( ~lhs, rhs.vector_ );
513  (~lhs) /= rhs.scalar_;
514  }
516  //**********************************************************************************************
517 
518  //**Addition assignment to dense vectors********************************************************
532  template< typename VT2 > // Type of the target dense vector
533  friend inline typename EnableIf< UseAssign<VT2> >::Type
534  addAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
535  {
537 
541 
542  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
543 
544  const ResultType tmp( serial( rhs ) );
545  addAssign( ~lhs, tmp );
546  }
548  //**********************************************************************************************
549 
550  //**Addition assignment to sparse vectors*******************************************************
551  // No special implementation for the addition assignment to sparse vectors.
552  //**********************************************************************************************
553 
554  //**Subtraction assignment to dense vectors*****************************************************
568  template< typename VT2 > // Type of the target dense vector
569  friend inline typename EnableIf< UseAssign<VT2> >::Type
570  subAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
571  {
573 
577 
578  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
579 
580  const ResultType tmp( serial( rhs ) );
581  subAssign( ~lhs, tmp );
582  }
584  //**********************************************************************************************
585 
586  //**Subtraction assignment to sparse vectors****************************************************
587  // No special implementation for the subtraction assignment to sparse vectors.
588  //**********************************************************************************************
589 
590  //**Multiplication assignment to dense vectors**************************************************
604  template< typename VT2 > // Type of the target dense vector
605  friend inline typename EnableIf< UseAssign<VT2> >::Type
606  multAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
607  {
609 
613 
614  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
615 
616  const ResultType tmp( serial( rhs ) );
617  multAssign( ~lhs, tmp );
618  }
620  //**********************************************************************************************
621 
622  //**Multiplication assignment to sparse vectors*************************************************
623  // No special implementation for the multiplication assignment to sparse vectors.
624  //**********************************************************************************************
625 
626  //**SMP assignment to dense vectors*************************************************************
627  // No special implementation for the SMP assignment to dense vectors.
628  //**********************************************************************************************
629 
630  //**SMP assignment to sparse vectors************************************************************
631  // No special implementation for the SMP assignment to sparse vectors.
632  //**********************************************************************************************
633 
634  //**SMP addition assignment to dense vectors****************************************************
648  template< typename VT2 > // Type of the target dense vector
649  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
650  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
651  {
653 
657 
658  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
659 
660  const ResultType tmp( rhs );
661  smpAddAssign( ~lhs, tmp );
662  }
664  //**********************************************************************************************
665 
666  //**SMP addition assignment to sparse vectors***************************************************
667  // No special implementation for the SMP addition assignment to sparse vectors.
668  //**********************************************************************************************
669 
670  //**SMP subtraction assignment to dense vectors*************************************************
684  template< typename VT2 > // Type of the target dense vector
685  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
686  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
687  {
689 
693 
694  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
695 
696  const ResultType tmp( rhs );
697  smpSubAssign( ~lhs, tmp );
698  }
700  //**********************************************************************************************
701 
702  //**SMP subtraction assignment to sparse vectors************************************************
703  // No special implementation for the SMP subtraction assignment to sparse vectors.
704  //**********************************************************************************************
705 
706  //**SMP multiplication assignment to dense vectors**********************************************
720  template< typename VT2 > // Type of the target dense vector
721  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
722  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
723  {
725 
729 
730  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
731 
732  const ResultType tmp( rhs );
733  smpMultAssign( ~lhs, tmp );
734  }
736  //**********************************************************************************************
737 
738  //**SMP multiplication assignment to sparse vectors*********************************************
739  // No special implementation for the SMP multiplication assignment to sparse vectors.
740  //**********************************************************************************************
741 
742  //**Compile time checks*************************************************************************
751  //**********************************************************************************************
752 };
753 //*************************************************************************************************
754 
755 
756 
757 
758 //=================================================================================================
759 //
760 // GLOBAL BINARY ARITHMETIC OPERATORS
761 //
762 //=================================================================================================
763 
764 //*************************************************************************************************
787 template< typename T1 // Type of the left-hand side sparse vector
788  , typename T2 // Type of the right-hand side scalar
789  , bool TF > // Transpose flag
790 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
791  operator/( const SparseVector<T1,TF>& vec, T2 scalar )
792 {
794 
795  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
796 
797  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
798  typedef typename ReturnType::RightOperand ScalarType;
799 
801  return ReturnType( ~vec, ScalarType(1)/ScalarType(scalar) );
802  }
803  else {
804  return ReturnType( ~vec, scalar );
805  }
806 }
807 //*************************************************************************************************
808 
809 
810 
811 
812 //=================================================================================================
813 //
814 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
815 //
816 //=================================================================================================
817 
818 //*************************************************************************************************
831 template< typename VT // Type of the sparse vector of the left-hand side expression
832  , typename ST1 // Type of the scalar of the left-hand side expression
833  , bool TF // Transpose flag of the sparse vector
834  , typename ST2 > // Type of the right-hand side scalar
835 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
836  , typename MultExprTrait< SVecScalarDivExpr<VT,ST1,TF>, ST2 >::Type >::Type
837  operator*( const SVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
838 {
840 
841  return vec.leftOperand() * ( scalar / vec.rightOperand() );
842 }
844 //*************************************************************************************************
845 
846 
847 //*************************************************************************************************
860 template< typename ST1 // Type of the left-hand side scalar
861  , typename VT // Type of the sparse vector of the right-hand side expression
862  , typename ST2 // Type of the scalar of the right-hand side expression
863  , bool TF > // Transpose flag of the sparse vector
864 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
865  , typename MultExprTrait< ST1, SVecScalarDivExpr<VT,ST2,TF> >::Type >::Type
866  operator*( ST1 scalar, const SVecScalarDivExpr<VT,ST2,TF>& vec )
867 {
869 
870  return vec.leftOperand() * ( scalar / vec.rightOperand() );
871 }
873 //*************************************************************************************************
874 
875 
876 //*************************************************************************************************
889 template< typename VT // Type of the sparse vector of the left-hand side expression
890  , typename ST1 // Type of the scalar of the left-hand side expression
891  , bool TF // Transpose flag of the sparse vector
892  , typename ST2 > // Type of the right-hand side scalar
893 inline const typename EnableIf< IsNumeric<ST2>
894  , typename DivExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
895  operator/( const SVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
896 {
898 
899  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
900 
901  typedef typename MultTrait<ST1,ST2>::Type MultType;
902  typedef typename DivExprTrait<VT,MultType>::Type ReturnType;
903  typedef typename ReturnType::RightOperand ScalarType;
904 
905  if( IsMultExpr<ReturnType>::value ) {
906  return ReturnType( vec.leftOperand(), ScalarType(1)/( vec.rightOperand() * scalar ) );
907  }
908  else {
909  return ReturnType( vec.leftOperand(), vec.rightOperand() * scalar );
910  }
911 }
913 //*************************************************************************************************
914 
915 
916 
917 
918 //=================================================================================================
919 //
920 // SIZE SPECIALIZATIONS
921 //
922 //=================================================================================================
923 
924 //*************************************************************************************************
926 template< typename VT, typename ST, bool TF >
927 struct Size< SVecScalarDivExpr<VT,ST,TF> >
928  : public Size<VT>
929 {};
931 //*************************************************************************************************
932 
933 
934 
935 
936 //=================================================================================================
937 //
938 // SVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
939 //
940 //=================================================================================================
941 
942 //*************************************************************************************************
944 template< typename VT, typename ST1, typename ST2 >
945 struct SVecScalarMultExprTrait< SVecScalarDivExpr<VT,ST1,false>, ST2 >
946 {
947  private:
948  //**********************************************************************************************
949  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
950  //**********************************************************************************************
951 
952  //**********************************************************************************************
953  typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
954  typedef SVecScalarMultExpr< SVecScalarDivExpr<VT,ST1,false>, ST2, false > T2;
955  //**********************************************************************************************
956 
957  public:
958  //**********************************************************************************************
959  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
960  IsNumeric<ST1>::value && IsNumeric<ST2>::value
961  , typename SelectType<condition,T1,T2>::Type
962  , INVALID_TYPE >::Type Type;
963  //**********************************************************************************************
964 };
966 //*************************************************************************************************
967 
968 
969 
970 
971 //=================================================================================================
972 //
973 // TSVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
974 //
975 //=================================================================================================
976 
977 //*************************************************************************************************
979 template< typename VT, typename ST1, typename ST2 >
980 struct TSVecScalarMultExprTrait< SVecScalarDivExpr<VT,ST1,true>, ST2 >
981 {
982  private:
983  //**********************************************************************************************
984  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
985  //**********************************************************************************************
986 
987  //**********************************************************************************************
988  typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
989  typedef SVecScalarMultExpr< SVecScalarDivExpr<VT,ST1,true>, ST2, true > T2;
990  //**********************************************************************************************
991 
992  public:
993  //**********************************************************************************************
994  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
995  IsNumeric<ST1>::value && IsNumeric<ST2>::value
996  , typename SelectType<condition,T1,T2>::Type
997  , INVALID_TYPE >::Type Type;
998  //**********************************************************************************************
999 };
1001 //*************************************************************************************************
1002 
1003 
1004 
1005 
1006 //=================================================================================================
1007 //
1008 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
1009 //
1010 //=================================================================================================
1011 
1012 //*************************************************************************************************
1014 template< typename VT, typename ST, bool TF, bool AF >
1015 struct SubvectorExprTrait< SVecScalarDivExpr<VT,ST,TF>, AF >
1016 {
1017  public:
1018  //**********************************************************************************************
1019  typedef typename DivExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
1020  //**********************************************************************************************
1021 };
1023 //*************************************************************************************************
1024 
1025 } // namespace blaze
1026 
1027 #endif
SVecScalarDivExpr< VT, ST, TF > This
Type of this SVecScalarDivExpr instance.
Definition: SVecScalarDivExpr.h:161
Pointer difference type of the Blaze library.
Data type constraint.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:936
PointerType pointer
Pointer return type.
Definition: SVecScalarDivExpr.h:206
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:306
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecScalarDivExpr.h:371
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:107
IteratorCategory iterator_category
The iterator category.
Definition: SVecScalarDivExpr.h:204
DivTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SVecScalarDivExpr.h:162
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecScalarDivExpr.h:167
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecScalarDivExpr.h:122
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
size_t index() const
Access to the current index of the sparse element.
Definition: SVecScalarDivExpr.h:266
Header file for the IsRowVector type trait.
Header file for the VecScalarDivExpr base class.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecScalarDivExpr.h:299
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecScalarDivExpr.h:288
ValueType & ReferenceType
Reference return type.
Definition: SVecScalarDivExpr.h:200
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:88
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 Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarDivExpr.h:236
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecScalarDivExpr.h:256
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:108
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:427
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecScalarDivExpr.h:382
Header file for the IsFloatingPoint type trait.
Header file for the IsMultExpr type trait class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:192
Element ValueType
Type of the underlying pointers.
Definition: SVecScalarDivExpr.h:198
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecScalarDivExpr.h:406
Iterator over the elements of the sparse vector/scalar multiplication expression. ...
Definition: SVecScalarDivExpr.h:187
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: SVecScalarDivExpr.h:459
RightOperand scalar_
Right hand side scalar of the multiplication expression.
Definition: SVecScalarDivExpr.h:307
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecScalarDivExpr.h:451
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:195
#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:214
#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:318
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecScalarDivExpr.h:201
Constraint on the data type.
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:176
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecScalarDivExpr.h:330
Header file for the IsNumeric type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SVecScalarDivExpr.h:205
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
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.
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the division trait.
LeftOperand vector_
Left-hand side sparse vector of the division expression.
Definition: SVecScalarDivExpr.h:458
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecScalarDivExpr.h:277
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecScalarDivExpr.h:341
SelectType< useAssign, const ResultType, const SVecScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecScalarDivExpr.h:170
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:109
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
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecScalarDivExpr.h:173
ReferenceType reference
Reference return type.
Definition: SVecScalarDivExpr.h:207
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
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:225
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecScalarDivExpr.h:197
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecScalarDivExpr.h:417
Header file for the RemoveReference type trait.
Base template for the DivTrait class.
Definition: DivTrait.h:142
#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:439
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecScalarDivExpr.h:164
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarDivExpr.h:246
Header file for the IsComputation type trait class.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecScalarDivExpr.h:351
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
DifferenceType difference_type
Difference between two iterators.
Definition: SVecScalarDivExpr.h:208
Header file for the IsColumnVector type trait.
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecScalarDivExpr.h:394
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
#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:199
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecScalarDivExpr.h:361
Header file for the IsExpression type trait class.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecScalarDivExpr.h:163
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849