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>
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 SVECSCALARDIVEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename VT // Type of the left-hand side sparse vector
96  , typename ST // Type of the right-hand side scalar value
97  , bool TF > // Transpose flag
98 class SVecScalarDivExpr : public SparseVector< SVecScalarDivExpr<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::CompositeType CT;
107  //**********************************************************************************************
108 
109  //**Return type evaluation**********************************************************************
111 
116  enum { returnExpr = !IsTemporary<RN>::value };
117 
120  //**********************************************************************************************
121 
122  //**Evaluation strategy*************************************************************************
124 
130  enum { useAssign = RequiresEvaluation<VT>::value };
131 
133  template< typename VT2 >
135  struct UseAssign {
136  enum { value = useAssign };
137  };
139  //**********************************************************************************************
140 
141  public:
142  //**Type definitions****************************************************************************
147 
150 
153 
155  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
156 
158  typedef ST RightOperand;
159  //**********************************************************************************************
160 
161  //**ConstIterator class definition**************************************************************
165  {
166  public:
167  //**Type definitions*************************************************************************
170 
173 
174  typedef std::forward_iterator_tag IteratorCategory;
175  typedef Element ValueType;
179 
180  // STL iterator requirements
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
191  inline ConstIterator( IteratorType vector, RightOperand scalar )
192  : vector_( vector ) // Iterator over the elements of the left-hand side sparse vector expression
193  , scalar_( scalar ) // Right hand side scalar of the multiplication expression
194  {}
195  //*******************************************************************************************
196 
197  //**Prefix increment operator****************************************************************
203  ++vector_;
204  return *this;
205  }
206  //*******************************************************************************************
207 
208  //**Element access operator******************************************************************
213  inline const Element operator*() const {
214  return Element( vector_->value() / scalar_, vector_->index() );
215  }
216  //*******************************************************************************************
217 
218  //**Element access operator******************************************************************
223  inline const ConstIterator* operator->() const {
224  return this;
225  }
226  //*******************************************************************************************
227 
228  //**Value function***************************************************************************
233  inline ReturnType value() const {
234  return vector_->value() / scalar_;
235  }
236  //*******************************************************************************************
237 
238  //**Index function***************************************************************************
243  inline size_t index() const {
244  return vector_->index();
245  }
246  //*******************************************************************************************
247 
248  //**Equality operator************************************************************************
254  inline bool operator==( const ConstIterator& rhs ) const {
255  return vector_ == rhs.vector_;
256  }
257  //*******************************************************************************************
258 
259  //**Inequality operator**********************************************************************
265  inline bool operator!=( const ConstIterator& rhs ) const {
266  return vector_ != rhs.vector_;
267  }
268  //*******************************************************************************************
269 
270  //**Subtraction operator*********************************************************************
276  inline DifferenceType operator-( const ConstIterator& rhs ) const {
277  return vector_ - rhs.vector_;
278  }
279  //*******************************************************************************************
280 
281  private:
282  //**Member variables*************************************************************************
285  //*******************************************************************************************
286  };
287  //**********************************************************************************************
288 
289  //**Constructor*********************************************************************************
295  explicit inline SVecScalarDivExpr( const VT& vector, ST scalar )
296  : vector_( vector ) // Left-hand side sparse vector of the division expression
297  , scalar_( scalar ) // Right-hand side scalar of the division expression
298  {}
299  //**********************************************************************************************
300 
301  //**Subscript operator**************************************************************************
307  inline ReturnType operator[]( size_t index ) const {
308  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
309  return vector_[index] / scalar_;
310  }
311  //**********************************************************************************************
312 
313  //**Begin function******************************************************************************
318  inline ConstIterator begin() const {
319  return ConstIterator( vector_.begin(), scalar_ );
320  }
321  //**********************************************************************************************
322 
323  //**End function********************************************************************************
328  inline ConstIterator end() const {
329  return ConstIterator( vector_.end(), scalar_ );
330  }
331  //**********************************************************************************************
332 
333  //**Size function*******************************************************************************
338  inline size_t size() const {
339  return vector_.size();
340  }
341  //**********************************************************************************************
342 
343  //**NonZeros function***************************************************************************
348  inline size_t nonZeros() const {
349  return vector_.nonZeros();
350  }
351  //**********************************************************************************************
352 
353  //**Left operand access*************************************************************************
358  inline LeftOperand leftOperand() const {
359  return vector_;
360  }
361  //**********************************************************************************************
362 
363  //**Right operand access************************************************************************
368  inline RightOperand rightOperand() const {
369  return scalar_;
370  }
371  //**********************************************************************************************
372 
373  //**********************************************************************************************
379  template< typename T >
380  inline bool canAlias( const T* alias ) const {
381  return vector_.canAlias( alias );
382  }
383  //**********************************************************************************************
384 
385  //**********************************************************************************************
391  template< typename T >
392  inline bool isAliased( const T* alias ) const {
393  return vector_.isAliased( alias );
394  }
395  //**********************************************************************************************
396 
397  private:
398  //**Member variables****************************************************************************
401  //**********************************************************************************************
402 
403  //**Assignment to dense vectors*****************************************************************
417  template< typename VT2 > // Type of the target dense vector
418  friend inline typename EnableIf< UseAssign<VT2> >::Type
419  assign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
420  {
422 
423  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
424 
425  assign( ~lhs, rhs.vector_ );
426  (~lhs) /= rhs.scalar_;
427  }
429  //**********************************************************************************************
430 
431  //**Assignment to sparse vectors****************************************************************
445  template< typename VT2 > // Type of the target sparse vector
446  friend inline typename EnableIf< UseAssign<VT2> >::Type
447  assign( SparseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
448  {
450 
451  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
452 
453  assign( ~lhs, rhs.vector_ );
454  (~lhs) /= rhs.scalar_;
455  }
457  //**********************************************************************************************
458 
459  //**Addition assignment to dense vectors********************************************************
473  template< typename VT2 > // Type of the target dense vector
474  friend inline typename EnableIf< UseAssign<VT2> >::Type
475  addAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
476  {
478 
482 
483  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
484 
485  const ResultType tmp( rhs );
486  addAssign( ~lhs, tmp );
487  }
489  //**********************************************************************************************
490 
491  //**Addition assignment to sparse vectors*******************************************************
492  // No special implementation for the addition assignment to sparse vectors.
493  //**********************************************************************************************
494 
495  //**Subtraction assignment to dense vectors*****************************************************
509  template< typename VT2 > // Type of the target dense vector
510  friend inline typename EnableIf< UseAssign<VT2> >::Type
511  subAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
512  {
514 
518 
519  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
520 
521  const ResultType tmp( rhs );
522  subAssign( ~lhs, tmp );
523  }
525  //**********************************************************************************************
526 
527  //**Subtraction assignment to sparse vectors****************************************************
528  // No special implementation for the subtraction assignment to sparse vectors.
529  //**********************************************************************************************
530 
531  //**Multiplication assignment to dense vectors**************************************************
545  template< typename VT2 > // Type of the target dense vector
546  friend inline typename EnableIf< UseAssign<VT2> >::Type
547  multAssign( DenseVector<VT2,TF>& lhs, const SVecScalarDivExpr& rhs )
548  {
550 
554 
555  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
556 
557  const ResultType tmp( rhs );
558  multAssign( ~lhs, tmp );
559  }
561  //**********************************************************************************************
562 
563  //**Multiplication assignment to sparse vectors*************************************************
564  // No special implementation for the multiplication assignment to sparse vectors.
565  //**********************************************************************************************
566 
567  //**Compile time checks*************************************************************************
576  //**********************************************************************************************
577 };
578 //*************************************************************************************************
579 
580 
581 
582 
583 //=================================================================================================
584 //
585 // GLOBAL BINARY ARITHMETIC OPERATORS
586 //
587 //=================================================================================================
588 
589 //*************************************************************************************************
612 template< typename T1 // Type of the left-hand side sparse vector
613  , typename T2 // Type of the right-hand side scalar
614  , bool TF > // Transpose flag
615 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
616  operator/( const SparseVector<T1,TF>& vec, T2 scalar )
617 {
619 
620  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
621 
622  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
623  typedef typename ReturnType::RightOperand ScalarType;
624 
626  return ReturnType( ~vec, ScalarType(1)/ScalarType(scalar) );
627  }
628  else {
629  return ReturnType( ~vec, scalar );
630  }
631 }
632 //*************************************************************************************************
633 
634 
635 
636 
637 //=================================================================================================
638 //
639 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
640 //
641 //=================================================================================================
642 
643 //*************************************************************************************************
656 template< typename VT // Type of the sparse vector of the left-hand side expression
657  , typename ST1 // Type of the scalar of the left-hand side expression
658  , bool TF // Transpose flag of the sparse vector
659  , typename ST2 > // Type of the right-hand side scalar
660 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
661  , typename MultExprTrait< SVecScalarDivExpr<VT,ST1,TF>, ST2 >::Type >::Type
662  operator*( const SVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
663 {
665 
666  return vec.leftOperand() * ( scalar / vec.rightOperand() );
667 }
669 //*************************************************************************************************
670 
671 
672 //*************************************************************************************************
685 template< typename ST1 // Type of the left-hand side scalar
686  , typename VT // Type of the sparse vector of the right-hand side expression
687  , typename ST2 // Type of the scalar of the right-hand side expression
688  , bool TF > // Transpose flag of the sparse vector
689 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
690  , typename MultExprTrait< ST1, SVecScalarDivExpr<VT,ST2,TF> >::Type >::Type
691  operator*( ST1 scalar, const SVecScalarDivExpr<VT,ST2,TF>& vec )
692 {
694 
695  return vec.leftOperand() * ( scalar / vec.rightOperand() );
696 }
698 //*************************************************************************************************
699 
700 
701 //*************************************************************************************************
714 template< typename VT // Type of the sparse vector of the left-hand side expression
715  , typename ST1 // Type of the scalar of the left-hand side expression
716  , bool TF // Transpose flag of the sparse vector
717  , typename ST2 > // Type of the right-hand side scalar
718 inline const typename EnableIf< IsNumeric<ST2>
719  , typename DivExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
720  operator/( const SVecScalarDivExpr<VT,ST1,TF>& vec, ST2 scalar )
721 {
723 
724  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
725 
726  typedef typename MultTrait<ST1,ST2>::Type MultType;
727  typedef typename DivExprTrait<VT,MultType>::Type ReturnType;
728  typedef typename ReturnType::RightOperand ScalarType;
729 
730  if( IsMultExpr<ReturnType>::value ) {
731  return ReturnType( vec.leftOperand(), ScalarType(1)/( vec.rightOperand() * scalar ) );
732  }
733  else {
734  return ReturnType( vec.leftOperand(), vec.rightOperand() * scalar );
735  }
736 }
738 //*************************************************************************************************
739 
740 
741 
742 
743 //=================================================================================================
744 //
745 // SVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
746 //
747 //=================================================================================================
748 
749 //*************************************************************************************************
751 template< typename VT, typename ST1, typename ST2 >
752 struct SVecScalarMultExprTrait< SVecScalarDivExpr<VT,ST1,false>, ST2 >
753 {
754  private:
755  //**********************************************************************************************
756  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
757  //**********************************************************************************************
758 
759  //**********************************************************************************************
760  typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
761  typedef SVecScalarMultExpr< SVecScalarDivExpr<VT,ST1,false>, ST2, false > T2;
762  //**********************************************************************************************
763 
764  public:
765  //**********************************************************************************************
766  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
767  IsNumeric<ST1>::value && IsNumeric<ST2>::value
768  , typename SelectType<condition,T1,T2>::Type
769  , INVALID_TYPE >::Type Type;
770  //**********************************************************************************************
771 };
773 //*************************************************************************************************
774 
775 
776 
777 
778 //=================================================================================================
779 //
780 // TSVECSCALARMULTEXPRTRAIT SPECIALIZATIONS
781 //
782 //=================================================================================================
783 
784 //*************************************************************************************************
786 template< typename VT, typename ST1, typename ST2 >
787 struct TSVecScalarMultExprTrait< SVecScalarDivExpr<VT,ST1,true>, ST2 >
788 {
789  private:
790  //**********************************************************************************************
791  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
792  //**********************************************************************************************
793 
794  //**********************************************************************************************
795  typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
796  typedef SVecScalarMultExpr< SVecScalarDivExpr<VT,ST1,true>, ST2, true > T2;
797  //**********************************************************************************************
798 
799  public:
800  //**********************************************************************************************
801  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
802  IsNumeric<ST1>::value && IsNumeric<ST2>::value
803  , typename SelectType<condition,T1,T2>::Type
804  , INVALID_TYPE >::Type Type;
805  //**********************************************************************************************
806 };
808 //*************************************************************************************************
809 
810 
811 
812 
813 //=================================================================================================
814 //
815 // SUBVECTOREXPRTRAIT SPECIALIZATIONS
816 //
817 //=================================================================================================
818 
819 //*************************************************************************************************
821 template< typename VT, typename ST, bool TF >
822 struct SubvectorExprTrait< SVecScalarDivExpr<VT,ST,TF> >
823 {
824  public:
825  //**********************************************************************************************
826  typedef typename DivExprTrait< typename SubvectorExprTrait<const VT>::Type, ST >::Type Type;
827  //**********************************************************************************************
828 };
830 //*************************************************************************************************
831 
832 } // namespace blaze
833 
834 #endif
SVecScalarDivExpr< VT, ST, TF > This
Type of this SVecScalarDivExpr instance.
Definition: SVecScalarDivExpr.h:143
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: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
PointerType pointer
Pointer return type.
Definition: SVecScalarDivExpr.h:183
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:283
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecScalarDivExpr.h:348
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:104
IteratorCategory iterator_category
The iterator category.
Definition: SVecScalarDivExpr.h:181
DivTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SVecScalarDivExpr.h:144
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecScalarDivExpr.h:149
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecScalarDivExpr.h:119
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
size_t index() const
Access to the current index of the sparse element.
Definition: SVecScalarDivExpr.h:243
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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecScalarDivExpr.h:276
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:265
ValueType & ReferenceType
Reference return type.
Definition: SVecScalarDivExpr.h:177
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.
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:213
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:250
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecScalarDivExpr.h:233
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:105
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:368
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
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:169
Element ValueType
Type of the underlying pointers.
Definition: SVecScalarDivExpr.h:175
Iterator over the elements of the sparse vector/scalar multiplication expression. ...
Definition: SVecScalarDivExpr.h:164
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
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: SVecScalarDivExpr.h:400
RightOperand scalar_
Right hand side scalar of the multiplication expression.
Definition: SVecScalarDivExpr.h:284
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecScalarDivExpr.h:392
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:172
#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:191
#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:295
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecScalarDivExpr.h:178
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
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 BaseElementType type trait.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SVecScalarDivExpr.h:158
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecScalarDivExpr.h:307
Header file for the IsNumeric type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SVecScalarDivExpr.h:182
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
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:209
LeftOperand vector_
Left-hand side sparse vector of the division expression.
Definition: SVecScalarDivExpr.h:399
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecScalarDivExpr.h:254
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecScalarDivExpr.h:318
SelectType< useAssign, const ResultType, const SVecScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecScalarDivExpr.h:152
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecScalarDivExpr.h:106
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:239
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecScalarDivExpr.h:155
ReferenceType reference
Reference return type.
Definition: SVecScalarDivExpr.h:184
Expression object for divisions of a sparse vector by a scalar.The SVecScalarDivExpr class represents...
Definition: Forward.h:111
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecScalarDivExpr.h:202
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecScalarDivExpr.h:174
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecScalarDivExpr.h:358
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:380
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecScalarDivExpr.h:146
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:223
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: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
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecScalarDivExpr.h:328
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
DifferenceType difference_type
Difference between two iterators.
Definition: SVecScalarDivExpr.h:185
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:176
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecScalarDivExpr.h:338
Header file for the IsExpression type trait class.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecScalarDivExpr.h:145
Header file for the FunctionTrace class.