SVecSVecSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
51 #include <blaze/math/Functions.h>
62 #include <blaze/util/Assert.h>
64 #include <blaze/util/DisableIf.h>
65 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/mpl/Max.h>
68 #include <blaze/util/SelectType.h>
69 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS SVECSVECSUBEXPR
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 template< typename VT1 // Type of the left-hand side sparse vector
89  , typename VT2 // Type of the right-hand side sparse vector
90  , bool TF > // Transpose flag
91 class SVecSVecSubExpr : public SparseVector< SVecSVecSubExpr<VT1,VT2,TF>, TF >
92  , private VecVecSubExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename VT1::ResultType RT1;
98  typedef typename VT2::ResultType RT2;
99  typedef typename VT1::ReturnType RN1;
100  typedef typename VT2::ReturnType RN2;
101  typedef typename VT1::CompositeType CT1;
102  typedef typename VT2::CompositeType CT2;
103  typedef typename VT1::TransposeType TT1;
104  typedef typename VT2::TransposeType TT2;
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
115 
118  //**********************************************************************************************
119 
120  //**Parallel evaluation strategy****************************************************************
122 
127  template< typename VT >
128  struct UseSMPAssign {
129  enum { value = VT::smpAssignable };
130  };
132  //**********************************************************************************************
133 
134  public:
135  //**Type definitions****************************************************************************
140 
143 
145  typedef const ResultType CompositeType;
146 
148  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
149 
151  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
152  //**********************************************************************************************
153 
154  //**Compilation flags***************************************************************************
156  enum { smpAssignable = 0 };
157  //**********************************************************************************************
158 
159  //**Constructor*********************************************************************************
162  explicit inline SVecSVecSubExpr( const VT1& lhs, const VT2& rhs )
163  : lhs_( lhs ) // Left-hand side sparse vector of the subtraction expression
164  , rhs_( rhs ) // Right-hand side sparse vector of the subtraction expression
165  {
166  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
167  }
168  //**********************************************************************************************
169 
170  //**Subscript operator**************************************************************************
176  inline ReturnType operator[]( size_t index ) const {
177  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
178  return lhs_[index] - rhs_[index];
179  }
180  //**********************************************************************************************
181 
182  //**Size function*******************************************************************************
187  inline size_t size() const {
188  return lhs_.size();
189  }
190  //**********************************************************************************************
191 
192  //**NonZeros function***************************************************************************
197  inline size_t nonZeros() const {
198  return min( lhs_.size(), lhs_.nonZeros() + rhs_.nonZeros() );
199  }
200  //**********************************************************************************************
201 
202  //**Left operand access*************************************************************************
207  inline LeftOperand leftOperand() const {
208  return lhs_;
209  }
210  //**********************************************************************************************
211 
212  //**Right operand access************************************************************************
217  inline RightOperand rightOperand() const {
218  return rhs_;
219  }
220  //**********************************************************************************************
221 
222  //**********************************************************************************************
228  template< typename T >
229  inline bool canAlias( const T* alias ) const {
230  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
231  }
232  //**********************************************************************************************
233 
234  //**********************************************************************************************
240  template< typename T >
241  inline bool isAliased( const T* alias ) const {
242  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
243  }
244  //**********************************************************************************************
245 
246  private:
247  //**Member variables****************************************************************************
248  LeftOperand lhs_;
249  RightOperand rhs_;
250  //**********************************************************************************************
251 
252  //**Default assignment to dense vectors*********************************************************
265  template< typename VT > // Type of the target dense vector
266  friend inline typename EnableIf< IsResizable<typename VT::ElementType> >::Type
267  assign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
268  {
270 
271  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
272 
273  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
274  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
275 
276  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
277  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
278 
279  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
280  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
281  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
282 
283  const LeftIterator lend( x.end() );
284  const RightIterator rend( y.end() );
285 
286  for( LeftIterator l=x.begin(); l!=lend; ++l ) {
287  (~lhs)[l->index()] = l->value();
288  }
289 
290  for( RightIterator r=y.begin(); r!=rend; ++r ) {
291  if( isDefault( (~lhs)[r->index()] ) )
292  (~lhs)[r->index()] = -r->value();
293  else
294  (~lhs)[r->index()] -= r->value();
295  }
296  }
298  //**********************************************************************************************
299 
300  //**Optimized assignment to dense vectors*******************************************************
313  template< typename VT > // Type of the target dense vector
314  friend inline typename DisableIf< IsResizable<typename VT::ElementType> >::Type
315  assign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
316  {
318 
319  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
320 
321  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
322  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
323 
324  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
325  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
326 
327  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
328  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
329  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
330 
331  const LeftIterator lend( x.end() );
332  const RightIterator rend( y.end() );
333 
334  for( LeftIterator l=x.begin(); l!=lend; ++l ) {
335  (~lhs)[l->index()] = l->value();
336  }
337 
338  for( RightIterator r=y.begin(); r!=rend; ++r ) {
339  (~lhs)[r->index()] -= r->value();
340  }
341  }
343  //**********************************************************************************************
344 
345  //**Assignment to sparse vectors****************************************************************
357  template< typename VT > // Type of the target sparse vector
358  friend inline void assign( SparseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
359  {
361 
362  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
363 
364  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
365  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
366 
367  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
368  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
369 
370  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
371  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
372  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
373 
374  const LeftIterator lend( x.end() );
375  const RightIterator rend( y.end() );
376 
377  LeftIterator l( x.begin() );
378  RightIterator r( y.begin() );
379 
380  while( l != lend && r != rend )
381  {
382  if( l->index() < r->index() ) {
383  (~lhs).append( l->index(), l->value() );
384  ++l;
385  }
386  else if( l->index() > r->index() ) {
387  (~lhs).append( r->index(), -r->value() );
388  ++r;
389  }
390  else {
391  (~lhs).append( l->index(), l->value() - r->value() );
392  ++l;
393  ++r;
394  }
395  }
396 
397  while( l != lend ) {
398  (~lhs).append( l->index(), l->value() );
399  ++l;
400  }
401 
402  while( r != rend ) {
403  (~lhs).append( r->index(), -r->value() );
404  ++r;
405  }
406  }
408  //**********************************************************************************************
409 
410  //**Addition assignment to dense vectors********************************************************
422  template< typename VT > // Type of the target dense vector
423  friend inline void addAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
424  {
426 
427  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
428 
429  addAssign( ~lhs, rhs.lhs_ );
430  subAssign( ~lhs, rhs.rhs_ );
431  }
433  //**********************************************************************************************
434 
435  //**Addition assignment to sparse vectors*******************************************************
436  // No special implementation for the addition assignment to sparse vectors.
437  //**********************************************************************************************
438 
439  //**Subtraction assignment to dense vectors*****************************************************
451  template< typename VT > // Type of the target dense vector
452  friend inline void subAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
453  {
455 
456  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
457 
458  subAssign( ~lhs, rhs.lhs_ );
459  addAssign( ~lhs, rhs.rhs_ );
460  }
462  //**********************************************************************************************
463 
464  //**Subtraction assignment to sparse vectors****************************************************
465  // No special implementation for the subtraction assignment to sparse vectors.
466  //**********************************************************************************************
467 
468  //**Multiplication assignment to dense vectors**************************************************
480  template< typename VT > // Type of the target dense vector
481  friend inline void multAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
482  {
484 
488 
489  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
490 
491  const ResultType tmp( serial( rhs ) );
492  multAssign( ~lhs, tmp );
493  }
495  //**********************************************************************************************
496 
497  //**Multiplication assignment to sparse vectors*************************************************
498  // No special implementation for the multiplication assignment to sparse vectors.
499  //**********************************************************************************************
500 
501  //**SMP assignment to dense vectors*************************************************************
502  // No special implementation for the SMP assignment to dense vectors.
503  //**********************************************************************************************
504 
505  //**SMP assignment to sparse vectors************************************************************
506  // No special implementation for the SMP assignment to sparse vectors.
507  //**********************************************************************************************
508 
509  //**SMP addition assignment to dense vectors****************************************************
523  template< typename VT > // Type of the target dense vector
524  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
525  smpAddAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
526  {
528 
529  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
530 
531  smpAddAssign( ~lhs, rhs.lhs_ );
532  smpSubAssign( ~lhs, rhs.rhs_ );
533  }
535  //**********************************************************************************************
536 
537  //**SMP addition assignment to sparse vectors***************************************************
538  // No special implementation for the SMP addition assignment to sparse vectors.
539  //**********************************************************************************************
540 
541  //**SMP subtraction assignment to dense vectors*************************************************
556  template< typename VT > // Type of the target dense vector
557  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
558  smpSubAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
559  {
561 
562  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
563 
564  smpSubAssign( ~lhs, rhs.lhs_ );
565  smpAddAssign( ~lhs, rhs.rhs_ );
566  }
568  //**********************************************************************************************
569 
570  //**SMP subtraction assignment to sparse vectors************************************************
571  // No special implementation for the SMP subtraction assignment to sparse vectors.
572  //**********************************************************************************************
573 
574  //**SMP multiplication assignment to dense vectors**********************************************
589  template< typename VT > // Type of the target dense vector
590  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
591  smpMultAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
592  {
594 
598 
599  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
600 
601  const ResultType tmp( rhs );
602  smpMultAssign( ~lhs, tmp );
603  }
605  //**********************************************************************************************
606 
607  //**SMP multiplication assignment to sparse vectors*********************************************
608  // No special implementation for the SMP multiplication assignment to sparse vectors.
609  //**********************************************************************************************
610 
611  //**Compile time checks*************************************************************************
619  //**********************************************************************************************
620 };
621 //*************************************************************************************************
622 
623 
624 
625 
626 //=================================================================================================
627 //
628 // GLOBAL BINARY ARITHMETIC OPERATORS
629 //
630 //=================================================================================================
631 
632 //*************************************************************************************************
656 template< typename T1 // Type of the left-hand side sparse vector
657  , typename T2 // Type of the right-hand side sparse vector
658  , bool TF > // Transpose flag
659 inline const SVecSVecSubExpr<T1,T2,TF>
661 {
663 
664  if( (~lhs).size() != (~rhs).size() )
665  throw std::invalid_argument( "Vector sizes do not match" );
666 
667  return SVecSVecSubExpr<T1,T2,TF>( ~lhs, ~rhs );
668 }
669 //*************************************************************************************************
670 
671 
672 
673 
674 //=================================================================================================
675 //
676 // SIZE SPECIALIZATIONS
677 //
678 //=================================================================================================
679 
680 //*************************************************************************************************
682 template< typename VT1, typename VT2, bool TF >
683 struct Size< SVecSVecSubExpr<VT1,VT2,TF> >
684  : public Max< Size<VT1>, Size<VT2> >::Type
685 {};
687 //*************************************************************************************************
688 
689 
690 
691 
692 //=================================================================================================
693 //
694 // EXPRESSION TRAIT SPECIALIZATIONS
695 //
696 //=================================================================================================
697 
698 //*************************************************************************************************
700 template< typename VT1, typename VT2, bool TF, bool AF >
701 struct SubvectorExprTrait< SVecSVecSubExpr<VT1,VT2,TF>, AF >
702 {
703  public:
704  //**********************************************************************************************
705  typedef typename SubExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
706  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
707  //**********************************************************************************************
708 };
710 //*************************************************************************************************
711 
712 } // namespace blaze
713 
714 #endif
Header file for the Max class template.
Header file for mathematical functions.
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:151
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:148
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecSVecSubExpr.h:187
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecSVecSubExpr.h:229
LeftOperand lhs_
Left-hand side sparse vector of the subtraction expression.
Definition: SVecSVecSubExpr.h:248
VT1::ResultType RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:97
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecSVecSubExpr.h:145
VT2::ResultType RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:98
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
Header file for the Computation base class.
VT1::CompositeType CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:101
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: SVecSVecSubExpr.h:217
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Constraint on the data type.
SubExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecSVecSubExpr.h:117
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:263
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 DisableIf class template.
Header file for the IsTemporary type trait class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Expression object for sparse vector-sparse vector subtractions.The SVecSVecSubExpr class represents t...
Definition: Forward.h:120
SubTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SVecSVecSubExpr.h:137
VT2::TransposeType TT2
Transpose type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:104
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1602
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecSVecSubExpr.h:176
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecSVecSubExpr.h:139
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#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.
#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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Evaluation of the return type of a subtraction expression.Via this type trait it is possible to evalu...
Definition: SubExprTrait.h:104
Header file for the VecVecSubExpr base class.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecSVecSubExpr.h:241
Header file for the EnableIf class template.
Header file for the serial shim.
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecSVecSubExpr.h:138
Header file for run time assertion macros.
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
VT1::TransposeType TT1
Transpose type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:103
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the isDefault shim.
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecSVecSubExpr.h:207
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecSVecSubExpr.h:197
Constraint on the data type.
VT1::ReturnType RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:99
SVecSVecSubExpr< VT1, VT2, TF > This
Type of this SVecSVecSubExpr instance.
Definition: SVecSVecSubExpr.h:136
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECSUBEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecSubExpr.h:165
Header file for the IsComputation type trait class.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
RightOperand rhs_
Right-hand side sparse vector of the subtraction expression.
Definition: SVecSVecSubExpr.h:249
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
Header file for the SubvectorExprTrait class template.
Base template for the SubTrait class.
Definition: SubTrait.h:150
VT2::ReturnType RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:100
Header file for the IsResizable type trait.
Header file for the SubExprTrait class template.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecSVecSubExpr.h:142
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849
SVecSVecSubExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the SVecSVecSubExpr class.
Definition: SVecSVecSubExpr.h:162
VT2::CompositeType CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:102