SVecSVecAddExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECADDEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECADDEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
47 #include <blaze/math/Exception.h>
52 #include <blaze/math/Functions.h>
63 #include <blaze/util/Assert.h>
65 #include <blaze/util/DisableIf.h>
66 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/mpl/If.h>
69 #include <blaze/util/mpl/Max.h>
70 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS SVECSVECADDEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename VT1 // Type of the left-hand side sparse vector
90  , typename VT2 // Type of the right-hand side sparse vector
91  , bool TF > // Transpose flag
92 class SVecSVecAddExpr : public SparseVector< SVecSVecAddExpr<VT1,VT2,TF>, TF >
93  , private VecVecAddExpr
94  , private Computation
95 {
96  private:
97  //**Type definitions****************************************************************************
104  //**********************************************************************************************
105 
106  //**Return type evaluation**********************************************************************
108 
113  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
114 
117  //**********************************************************************************************
118 
119  //**Parallel evaluation strategy****************************************************************
121 
126  template< typename VT >
127  struct UseSMPAssign {
128  enum : bool { value = VT::smpAssignable };
129  };
131  //**********************************************************************************************
132 
133  public:
134  //**Type definitions****************************************************************************
139 
142 
144  typedef const ResultType CompositeType;
145 
147  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
148 
150  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
151  //**********************************************************************************************
152 
153  //**Compilation flags***************************************************************************
155  enum : bool { smpAssignable = false };
156  //**********************************************************************************************
157 
158  //**Constructor*********************************************************************************
161  explicit inline SVecSVecAddExpr( const VT1& lhs, const VT2& rhs ) noexcept
162  : lhs_( lhs ) // Left-hand side sparse vector of the addition expression
163  , rhs_( rhs ) // Right-hand side sparse vector of the addition expression
164  {
165  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
166  }
167  //**********************************************************************************************
168 
169  //**Subscript operator**************************************************************************
175  inline ReturnType operator[]( size_t index ) const {
176  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
177  return lhs_[index] + rhs_[index];
178  }
179  //**********************************************************************************************
180 
181  //**At function*********************************************************************************
188  inline ReturnType at( size_t index ) const {
189  if( index >= lhs_.size() ) {
190  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
191  }
192  return (*this)[index];
193  }
194  //**********************************************************************************************
195 
196  //**Size function*******************************************************************************
201  inline size_t size() const noexcept {
202  return lhs_.size();
203  }
204  //**********************************************************************************************
205 
206  //**NonZeros function***************************************************************************
211  inline size_t nonZeros() const {
212  return min( lhs_.size(), lhs_.nonZeros() + rhs_.nonZeros() );
213  }
214  //**********************************************************************************************
215 
216  //**Left operand access*************************************************************************
221  inline LeftOperand leftOperand() const noexcept {
222  return lhs_;
223  }
224  //**********************************************************************************************
225 
226  //**Right operand access************************************************************************
231  inline RightOperand rightOperand() const noexcept {
232  return rhs_;
233  }
234  //**********************************************************************************************
235 
236  //**********************************************************************************************
242  template< typename T >
243  inline bool canAlias( const T* alias ) const noexcept {
244  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
245  }
246  //**********************************************************************************************
247 
248  //**********************************************************************************************
254  template< typename T >
255  inline bool isAliased( const T* alias ) const noexcept {
256  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
257  }
258  //**********************************************************************************************
259 
260  private:
261  //**Member variables****************************************************************************
262  LeftOperand lhs_;
263  RightOperand rhs_;
264  //**********************************************************************************************
265 
266  //**Default assignment to dense vectors*********************************************************
279  template< typename VT > // Type of the target dense vector
281  assign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
282  {
284 
285  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
286 
287  typedef ConstIterator_< RemoveReference_<CT1> > LeftIterator;
288  typedef ConstIterator_< RemoveReference_<CT2> > RightIterator;
289 
290  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
291  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
292 
293  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
294  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
295  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
296 
297  const LeftIterator lend( x.end() );
298  const RightIterator rend( y.end() );
299 
300  for( LeftIterator l=x.begin(); l!=lend; ++l ) {
301  (~lhs)[l->index()] = l->value();
302  }
303 
304  for( RightIterator r=y.begin(); r!=rend; ++r ) {
305  if( isDefault( (~lhs)[r->index()] ) )
306  (~lhs)[r->index()] = r->value();
307  else
308  (~lhs)[r->index()] += r->value();
309  }
310  }
312  //**********************************************************************************************
313 
314  //**Optimized assignment to dense vectors*******************************************************
327  template< typename VT > // Type of the target dense vector
329  assign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
330  {
332 
333  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
334 
335  typedef ConstIterator_< RemoveReference_<CT1> > LeftIterator;
336  typedef ConstIterator_< RemoveReference_<CT2> > RightIterator;
337 
338  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
339  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
340 
341  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
342  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
343  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
344 
345  const LeftIterator lend( x.end() );
346  const RightIterator rend( y.end() );
347 
348  for( LeftIterator l=x.begin(); l!=lend; ++l ) {
349  (~lhs)[l->index()] = l->value();
350  }
351 
352  for( RightIterator r=y.begin(); r!=rend; ++r ) {
353  (~lhs)[r->index()] += r->value();
354  }
355  }
357  //**********************************************************************************************
358 
359  //**Assignment to sparse vectors****************************************************************
371  template< typename VT > // Type of the target sparse vector
372  friend inline void assign( SparseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
373  {
375 
376  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
377 
378  typedef ConstIterator_< RemoveReference_<CT1> > LeftIterator;
379  typedef ConstIterator_< RemoveReference_<CT2> > RightIterator;
380 
381  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
382  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
383 
384  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
385  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
386  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
387 
388  const LeftIterator lend( x.end() );
389  const RightIterator rend( y.end() );
390 
391  LeftIterator l( x.begin() );
392  RightIterator r( y.begin() );
393 
394  while( l != lend && r != rend )
395  {
396  if( l->index() < r->index() ) {
397  (~lhs).append( l->index(), l->value() );
398  ++l;
399  }
400  else if( l->index() > r->index() ) {
401  (~lhs).append( r->index(), r->value() );
402  ++r;
403  }
404  else {
405  (~lhs).append( l->index(), l->value() + r->value() );
406  ++l;
407  ++r;
408  }
409  }
410 
411  while( l != lend ) {
412  (~lhs).append( l->index(), l->value() );
413  ++l;
414  }
415 
416  while( r != rend ) {
417  (~lhs).append( r->index(), r->value() );
418  ++r;
419  }
420  }
422  //**********************************************************************************************
423 
424  //**Addition assignment to dense vectors********************************************************
436  template< typename VT > // Type of the target dense vector
437  friend inline void addAssign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
438  {
440 
441  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
442 
443  addAssign( ~lhs, rhs.lhs_ );
444  addAssign( ~lhs, rhs.rhs_ );
445  }
447  //**********************************************************************************************
448 
449  //**Addition assignment to sparse vectors*******************************************************
450  // No special implementation for the addition assignment to sparse vectors.
451  //**********************************************************************************************
452 
453  //**Subtraction assignment to dense vectors*****************************************************
465  template< typename VT > // Type of the target dense vector
466  friend inline void subAssign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
467  {
469 
470  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
471 
472  subAssign( ~lhs, rhs.lhs_ );
473  subAssign( ~lhs, rhs.rhs_ );
474  }
476  //**********************************************************************************************
477 
478  //**Subtraction assignment to sparse vectors****************************************************
479  // No special implementation for the subtraction assignment to sparse vectors.
480  //**********************************************************************************************
481 
482  //**Multiplication assignment to dense vectors**************************************************
494  template< typename VT > // Type of the target dense vector
495  friend inline void multAssign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
496  {
498 
501  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
502 
503  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
504 
505  const ResultType tmp( serial( rhs ) );
506  multAssign( ~lhs, tmp );
507  }
509  //**********************************************************************************************
510 
511  //**Multiplication assignment to sparse vectors*************************************************
512  // No special implementation for the multiplication assignment to sparse vectors.
513  //**********************************************************************************************
514 
515  //**SMP assignment to dense vectors*************************************************************
516  // No special implementation for the SMP assignment to dense vectors.
517  //**********************************************************************************************
518 
519  //**SMP assignment to sparse vectors************************************************************
520  // No special implementation for the SMP assignment to sparse vectors.
521  //**********************************************************************************************
522 
523  //**SMP addition assignment to dense vectors****************************************************
537  template< typename VT > // Type of the target dense vector
538  friend inline EnableIf_< UseSMPAssign<VT> >
539  smpAddAssign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
540  {
542 
543  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
544 
545  smpAddAssign( ~lhs, rhs.lhs_ );
546  smpAddAssign( ~lhs, rhs.rhs_ );
547  }
549  //**********************************************************************************************
550 
551  //**SMP addition assignment to sparse vectors***************************************************
552  // No special implementation for the SMP addition assignment to sparse vectors.
553  //**********************************************************************************************
554 
555  //**SMP subtraction assignment to dense vectors*************************************************
569  template< typename VT > // Type of the target dense vector
570  friend inline EnableIf_< UseSMPAssign<VT> >
571  smpSubAssign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
572  {
574 
575  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
576 
577  smpSubAssign( ~lhs, rhs.lhs_ );
578  smpSubAssign( ~lhs, rhs.rhs_ );
579  }
581  //**********************************************************************************************
582 
583  //**SMP subtraction assignment to sparse vectors************************************************
584  // No special implementation for the SMP subtraction assignment to sparse vectors.
585  //**********************************************************************************************
586 
587  //**SMP multiplication assignment to dense vectors**********************************************
602  template< typename VT > // Type of the target dense vector
603  friend inline EnableIf_< UseSMPAssign<VT> >
604  smpMultAssign( DenseVector<VT,TF>& lhs, const SVecSVecAddExpr& rhs )
605  {
607 
610  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
611 
612  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
613 
614  const ResultType tmp( rhs );
615  smpMultAssign( ~lhs, tmp );
616  }
618  //**********************************************************************************************
619 
620  //**SMP multiplication assignment to sparse vectors*********************************************
621  // No special implementation for the SMP multiplication assignment to sparse vectors.
622  //**********************************************************************************************
623 
624  //**Compile time checks*************************************************************************
632  //**********************************************************************************************
633 };
634 //*************************************************************************************************
635 
636 
637 
638 
639 //=================================================================================================
640 //
641 // GLOBAL BINARY ARITHMETIC OPERATORS
642 //
643 //=================================================================================================
644 
645 //*************************************************************************************************
669 template< typename T1 // Type of the left-hand side sparse vector
670  , typename T2 // Type of the right-hand side sparse vector
671  , bool TF > // Transpose flag
672 inline const SVecSVecAddExpr<T1,T2,TF>
674 {
676 
677  if( (~lhs).size() != (~rhs).size() ) {
678  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
679  }
680 
681  return SVecSVecAddExpr<T1,T2,TF>( ~lhs, ~rhs );
682 }
683 //*************************************************************************************************
684 
685 
686 
687 
688 //=================================================================================================
689 //
690 // SIZE SPECIALIZATIONS
691 //
692 //=================================================================================================
693 
694 //*************************************************************************************************
696 template< typename VT1, typename VT2, bool TF >
697 struct Size< SVecSVecAddExpr<VT1,VT2,TF> >
698  : public Max< Size<VT1>, Size<VT2> >
699 {};
701 //*************************************************************************************************
702 
703 
704 
705 
706 //=================================================================================================
707 //
708 // EXPRESSION TRAIT SPECIALIZATIONS
709 //
710 //=================================================================================================
711 
712 //*************************************************************************************************
714 template< typename VT1, typename VT2, bool TF, bool AF >
715 struct SubvectorExprTrait< SVecSVecAddExpr<VT1,VT2,TF>, AF >
716 {
717  public:
718  //**********************************************************************************************
719  using Type = AddExprTrait_< SubvectorExprTrait_<const VT1,AF>
720  , SubvectorExprTrait_<const VT2,AF> >;
721  //**********************************************************************************************
722 };
724 //*************************************************************************************************
725 
726 } // namespace blaze
727 
728 #endif
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecSVecAddExpr.h:211
#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
Header file for auxiliary alias declarations.
Header file for the Max class template.
Header file for mathematical functions.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for basic type definitions.
Header file for the SparseVector base class.
LeftOperand lhs_
Left-hand side sparse vector of the addition expression.
Definition: SVecSVecAddExpr.h:262
EnableIf_< IsDenseMatrix< MT1 > > 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 serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecSVecAddExpr.h:141
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecSVecAddExpr.h:175
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
EnableIf_< IsDenseVector< VT1 > > 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:193
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
Header file for the AddExprTrait class template.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the Computation base class.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > 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
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
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
AddExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecSVecAddExpr.h:116
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:103
Expression object for sparse vector-sparse vector additions.The SVecSVecAddExpr class represents the ...
Definition: Forward.h:120
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:150
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecSVecAddExpr.h:188
Header file for the DisableIf class template.
Header file for the IsTemporary type trait class.
typename AddExprTrait< T1, T2 >::Type AddExprTrait_
Auxiliary alias declaration for the AddExprTrait class template.The AddExprTrait_ alias declaration p...
Definition: AddExprTrait.h:219
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the VecVecAddExpr base class.
#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
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECADDEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecAddExpr.h:109
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecSVecAddExpr.h:137
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
CompositeType_< VT1 > CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:102
ReturnType_< VT1 > RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:100
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:147
#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
ResultType_< VT1 > RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:98
AddTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SVecSVecAddExpr.h:136
Constraint on the data type.
#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:60
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecSVecAddExpr.h:138
Header file for the EnableIf class template.
Constraint on the data type.
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:99
Header file for run time assertion macros.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: SVecSVecAddExpr.h:231
Header file for the addition trait.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecSVecAddExpr.h:201
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:160
SVecSVecAddExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the SVecSVecAddExpr class.
Definition: SVecSVecAddExpr.h:161
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecSVecAddExpr.h:243
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecSVecAddExpr.h:101
Header file for the isDefault shim.
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:223
RightOperand rhs_
Right-hand side sparse vector of the addition expression.
Definition: SVecSVecAddExpr.h:263
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
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:110
#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
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecSVecAddExpr.h:221
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsResizable type trait.
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
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecSVecAddExpr.h:144
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:245
#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 FunctionTrace class.
SVecSVecAddExpr< VT1, VT2, TF > This
Type of this SVecSVecAddExpr instance.
Definition: SVecSVecAddExpr.h:135
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecSVecAddExpr.h:255