DVecSVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
55 #include <blaze/math/shims/Reset.h>
64 #include <blaze/util/Assert.h>
65 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/mpl/If.h>
68 #include <blaze/util/mpl/Maximum.h>
69 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS DVECSVECMULTEXPR
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 template< typename VT1 // Type of the left-hand side dense vector
89  , typename VT2 // Type of the right-hand side sparse vector
90  , bool TF > // Transpose flag
92  : public VecVecMultExpr< SparseVector< DVecSVecMultExpr<VT1,VT2,TF>, TF > >
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
115 
118  //**********************************************************************************************
119 
120  //**Evaluation strategy*************************************************************************
122 
128  enum : bool { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value ) };
129 
131  template< typename VT >
133  struct UseAssign {
134  enum : bool { value = useAssign };
135  };
137  //**********************************************************************************************
138 
139  public:
140  //**Type definitions****************************************************************************
145 
148 
151 
153  using LeftOperand = If_< IsExpression<VT1>, const VT1, const VT1& >;
154 
156  using RightOperand = If_< IsExpression<VT2>, const VT2, const VT2& >;
157  //**********************************************************************************************
158 
159  //**Compilation flags***************************************************************************
161  enum : bool { smpAssignable = false };
162  //**********************************************************************************************
163 
164  //**ConstIterator class definition**************************************************************
168  {
169  public:
170  //**Type definitions*************************************************************************
173 
176 
177  using IteratorCategory = std::forward_iterator_tag;
178  using ValueType = Element;
182 
183  // STL iterator requirements
189  //*******************************************************************************************
190 
191  //**Constructor******************************************************************************
198  : vec_( vec ) // Left-hand side dense vector expression
199  , it_ ( it ) // Iterator over the elements of the right-hand side sparse vector expression
200  {}
201  //*******************************************************************************************
202 
203  //**Prefix increment operator****************************************************************
209  ++it_;
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Element access operator******************************************************************
219  inline const Element operator*() const {
220  return Element( vec_[it_->index()] * it_->value(), it_->index() );
221  }
222  //*******************************************************************************************
223 
224  //**Element access operator******************************************************************
229  inline const ConstIterator* operator->() const {
230  return this;
231  }
232  //*******************************************************************************************
233 
234  //**Value function***************************************************************************
239  inline ReturnType value() const {
240  return vec_[it_->index()] * it_->value();
241  }
242  //*******************************************************************************************
243 
244  //**Index function***************************************************************************
249  inline size_t index() const {
250  return it_->index();
251  }
252  //*******************************************************************************************
253 
254  //**Equality operator************************************************************************
260  inline bool operator==( const ConstIterator& rhs ) const {
261  return it_ == rhs.it_;
262  }
263  //*******************************************************************************************
264 
265  //**Inequality operator**********************************************************************
271  inline bool operator!=( const ConstIterator& rhs ) const {
272  return it_ != rhs.it_;
273  }
274  //*******************************************************************************************
275 
276  //**Subtraction operator*********************************************************************
282  inline DifferenceType operator-( const ConstIterator& rhs ) const {
283  return it_ - rhs.it_;
284  }
285  //*******************************************************************************************
286 
287  private:
288  //**Member variables*************************************************************************
291  //*******************************************************************************************
292  };
293  //**********************************************************************************************
294 
295  //**Constructor*********************************************************************************
301  explicit inline DVecSVecMultExpr( const VT1& lhs, const VT2& rhs ) noexcept
302  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
303  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
304  {
305  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
306  }
307  //**********************************************************************************************
308 
309  //**Subscript operator**************************************************************************
315  inline ReturnType operator[]( size_t index ) const {
316  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
317  return lhs_[index] * rhs_[index];
318  }
319  //**********************************************************************************************
320 
321  //**At function*********************************************************************************
328  inline ReturnType at( size_t index ) const {
329  if( index >= lhs_.size() ) {
330  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
331  }
332  return (*this)[index];
333  }
334  //**********************************************************************************************
335 
336  //**Begin function******************************************************************************
341  inline ConstIterator begin() const {
342  return ConstIterator( lhs_, rhs_.begin() );
343  }
344  //**********************************************************************************************
345 
346  //**End function********************************************************************************
351  inline ConstIterator end() const {
352  return ConstIterator( lhs_, rhs_.end() );
353  }
354  //**********************************************************************************************
355 
356  //**Size function*******************************************************************************
361  inline size_t size() const noexcept {
362  return lhs_.size();
363  }
364  //**********************************************************************************************
365 
366  //**NonZeros function***************************************************************************
371  inline size_t nonZeros() const {
372  return rhs_.nonZeros();
373  }
374  //**********************************************************************************************
375 
376  //**Find function*******************************************************************************
382  inline ConstIterator find( size_t index ) const {
384  return ConstIterator( lhs_, rhs_.find( index ) );
385  }
386  //**********************************************************************************************
387 
388  //**LowerBound function*************************************************************************
394  inline ConstIterator lowerBound( size_t index ) const {
396  return ConstIterator( lhs_, rhs_.lowerBound( index ) );
397  }
398  //**********************************************************************************************
399 
400  //**UpperBound function*************************************************************************
406  inline ConstIterator upperBound( size_t index ) const {
408  return ConstIterator( lhs_, rhs_.upperBound( index ) );
409  }
410  //**********************************************************************************************
411 
412  //**Left operand access*************************************************************************
417  inline LeftOperand leftOperand() const noexcept {
418  return lhs_;
419  }
420  //**********************************************************************************************
421 
422  //**Right operand access************************************************************************
427  inline RightOperand rightOperand() const noexcept {
428  return rhs_;
429  }
430  //**********************************************************************************************
431 
432  //**********************************************************************************************
438  template< typename T >
439  inline bool canAlias( const T* alias ) const noexcept {
440  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
441  }
442  //**********************************************************************************************
443 
444  //**********************************************************************************************
450  template< typename T >
451  inline bool isAliased( const T* alias ) const noexcept {
452  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
453  }
454  //**********************************************************************************************
455 
456  private:
457  //**Member variables****************************************************************************
460  //**********************************************************************************************
461 
462  //**Assignment to dense vectors*****************************************************************
476  template< typename VT > // Type of the target dense vector
477  friend inline EnableIf_< UseAssign<VT> >
478  assign( DenseVector<VT,TF>& lhs, const DVecSVecMultExpr& rhs )
479  {
481 
482  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
483 
485 
486  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
487  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
488 
489  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
490  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
491  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
492 
493  for( ConstIterator element=y.begin(); element!=y.end(); ++element )
494  (~lhs)[element->index()] = x[element->index()] * element->value();
495  }
497  //**********************************************************************************************
498 
499  //**Assignment to sparse vectors****************************************************************
513  template< typename VT > // Type of the target sparse vector
514  friend inline EnableIf_< UseAssign<VT> >
515  assign( SparseVector<VT,TF>& lhs, const DVecSVecMultExpr& rhs )
516  {
518 
519  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
520 
522 
523  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
524  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
525 
526  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
527  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
528  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
529 
530  // Final memory allocation (based on the evaluated operands)
531  (~lhs).reserve( y.nonZeros() );
532 
533  // Performing the vector multiplication
534  for( ConstIterator element=y.begin(); element!=y.end(); ++element )
535  (~lhs).append( element->index(), x[element->index()] * element->value() );
536  }
538  //**********************************************************************************************
539 
540  //**Addition assignment to dense vectors********************************************************
554  template< typename VT > // Type of the target dense vector
555  friend inline EnableIf_< UseAssign<VT> >
556  addAssign( DenseVector<VT,TF>& lhs, const DVecSVecMultExpr& rhs )
557  {
559 
560  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
561 
563 
564  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
565  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
566 
567  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
568  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
569  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
570 
571  for( ConstIterator element=y.begin(); element!=y.end(); ++element )
572  (~lhs)[element->index()] += x[element->index()] * element->value();
573  }
575  //**********************************************************************************************
576 
577  //**Addition assignment to sparse vectors*******************************************************
578  // No special implementation for the addition assignment to sparse vectors.
579  //**********************************************************************************************
580 
581  //**Subtraction assignment to dense vectors*****************************************************
595  template< typename VT > // Type of the target dense vector
596  friend inline EnableIf_< UseAssign<VT> >
597  subAssign( DenseVector<VT,TF>& lhs, const DVecSVecMultExpr& rhs )
598  {
600 
601  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
602 
604 
605  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
606  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
607 
608  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
609  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
610  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
611 
612  for( ConstIterator element=y.begin(); element!=y.end(); ++element )
613  (~lhs)[element->index()] -= x[element->index()] * element->value();
614  }
616  //**********************************************************************************************
617 
618  //**Subtraction assignment to sparse vectors****************************************************
619  // No special implementation for the subtraction assignment to sparse vectors.
620  //**********************************************************************************************
621 
622  //**Multiplication assignment to dense vectors**************************************************
636  template< typename VT > // Type of the target dense vector
637  friend inline EnableIf_< UseAssign<VT> >
638  multAssign( DenseVector<VT,TF>& lhs, const DVecSVecMultExpr& rhs )
639  {
641 
642  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
643 
645 
646  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
647  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
648 
649  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
650  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
651  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
652 
653  const ConstIterator end( y.end() );
654  ConstIterator begin( y.begin() );
655  size_t i( 0UL );
656 
657  for( ; begin!=end; ++begin ) {
658  const size_t index( begin->index() );
659  for( ; i<index; ++i )
660  reset( (~lhs)[i] );
661  (~lhs)[index] *= x[index] * begin->value();
662  ++i;
663  }
664 
665  for( ; i<(~lhs).size(); ++i )
666  reset( (~lhs)[i] );
667  }
669  //**********************************************************************************************
670 
671  //**Multiplication assignment to sparse vectors*************************************************
672  // No special implementation for the multiplication assignment to sparse vectors.
673  //**********************************************************************************************
674 
675  //**Compile time checks*************************************************************************
683  //**********************************************************************************************
684 };
685 //*************************************************************************************************
686 
687 
688 
689 
690 //=================================================================================================
691 //
692 // GLOBAL BINARY ARITHMETIC OPERATORS
693 //
694 //=================================================================================================
695 
696 //*************************************************************************************************
723 template< typename VT1 // Type of the left-hand side dense vector
724  , typename VT2 // Type of the right-hand side sparse vector
725  , bool TF > // Transpose flag
726 inline decltype(auto)
727  operator*( const DenseVector<VT1,TF>& lhs, const SparseVector<VT2,TF>& rhs )
728 {
730 
731  if( (~lhs).size() != (~rhs).size() ) {
732  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
733  }
734 
736  return ReturnType( ~lhs, ~rhs );
737 }
738 //*************************************************************************************************
739 
740 
741 
742 
743 //=================================================================================================
744 //
745 // SIZE SPECIALIZATIONS
746 //
747 //=================================================================================================
748 
749 //*************************************************************************************************
751 template< typename VT1, typename VT2, bool TF >
752 struct Size< DVecSVecMultExpr<VT1,VT2,TF>, 0UL >
753  : public Maximum< Size<VT1,0UL>, Size<VT2,0UL> >
754 {};
756 //*************************************************************************************************
757 
758 } // namespace blaze
759 
760 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Pointer difference type of the Blaze library.
LeftOperand vec_
Left-hand side dense vector expression.
Definition: DVecSVecMultExpr.h:289
Header file for auxiliary alias declarations.
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: DVecSVecMultExpr.h:219
ConstIterator(LeftOperand vec, IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecSVecMultExpr.h:197
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecSVecMultExpr.h:439
Header file for basic type definitions.
Header file for the SparseVector base class.
Header file for the serial shim.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecSVecMultExpr.h:451
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: DVecSVecMultExpr.h:229
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecSVecMultExpr.h:143
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: DVecSVecMultExpr.h:341
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: DVecSVecMultExpr.h:394
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Expression object for dense vector-sparse vector multiplications.The DVecSVecMultExpr class represent...
Definition: DVecSVecMultExpr.h:91
Header file for the Computation base class.
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecSVecMultExpr.h:144
Header file for the RequiresEvaluation type trait.
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecSVecMultExpr.h:100
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecSVecMultExpr.h:361
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: DVecSVecMultExpr.h:459
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecSVecMultExpr.h:417
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: DVecSVecMultExpr.h:282
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Header file for the Maximum class template.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:112
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:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecSVecMultExpr.h:142
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: DVecSVecMultExpr.h:382
Header file for the ValueIndexPair class.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecSVecMultExpr.h:208
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecMultExpr.h:102
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecSVecMultExpr.h:147
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecSVecMultExpr.h:117
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecMultExpr.h:156
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecSVecMultExpr.h:98
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecMultExpr.h:153
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
#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:61
TransposeType_< VT2 > TT2
Transpose type of the right-hand side sparse vector expression.
Definition: DVecSVecMultExpr.h:104
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: DVecSVecMultExpr.h:351
ConstIterator_< RemoveReference_< RightOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: DVecSVecMultExpr.h:175
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: DVecSVecMultExpr.h:427
Constraint on the data type.
Constraint on the data type.
Header file for the exception macros of the math module.
Header file for the VecVecMultExpr base class.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecSVecMultExpr.h:271
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
DVecSVecMultExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecSVecMultExpr class.
Definition: DVecSVecMultExpr.h:301
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecSVecMultExpr.h:260
IteratorCategory iterator_category
The iterator category.
Definition: DVecSVecMultExpr.h:184
Iterator over the elements of the dense vector-sparse vector multiplication expression.
Definition: DVecSVecMultExpr.h:167
Header file for run time assertion macros.
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecSVecMultExpr.h:99
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecSVecMultExpr.h:328
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: DVecSVecMultExpr.h:406
Header file for the reset shim.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecSVecMultExpr.h:315
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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:81
Header file for the RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
ReturnType value() const
Access to the current value of the sparse element.
Definition: DVecSVecMultExpr.h:239
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: DVecSVecMultExpr.h:177
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecMultExpr.h:108
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecSVecMultExpr.h:458
IfTrue_< useAssign, const ResultType, const DVecSVecMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecSVecMultExpr.h:150
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: DVecSVecMultExpr.h:371
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecSVecMultExpr.h:97
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
IteratorType it_
Iterator over the elements of the right-hand side sparse vector expression.
Definition: DVecSVecMultExpr.h:290
TransposeType_< VT1 > TT1
Transpose type of the left-hand side dense vector expression.
Definition: DVecSVecMultExpr.h:103
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:63
Base class for all vector/vector multiplication expression templates.The VecVecMultExpr class serves ...
Definition: VecVecMultExpr.h:66
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecMultExpr.h:101
#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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
size_t index() const
Access to the current index of the sparse element.
Definition: DVecSVecMultExpr.h:249