All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecSVecAddExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSVECADDEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSVECADDEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/EnableIf.h>
69 #include <blaze/util/mpl/Max.h>
70 #include <blaze/util/SelectType.h>
71 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS DVECSVECADDEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename VT1 // Type of the left-hand side dense vector
90  , typename VT2 // Type of the right-hand side sparse vector
91  , bool TF > // Transpose flag
92 class DVecSVecAddExpr : public DenseVector< DVecSVecAddExpr<VT1,VT2,TF>, TF >
93  , private VecVecAddExpr
94  , private Computation
95 {
96  private:
97  //**Type definitions****************************************************************************
98  typedef typename VT1::ResultType RT1;
99  typedef typename VT2::ResultType RT2;
100  typedef typename VT1::ReturnType RN1;
101  typedef typename VT2::ReturnType RN2;
102  typedef typename VT1::CompositeType CT1;
103  typedef typename VT2::CompositeType CT2;
104  typedef typename VT1::TransposeType TT1;
105  typedef typename VT2::TransposeType TT2;
106  //**********************************************************************************************
107 
108  //**Return type evaluation**********************************************************************
110 
115  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
116 
119  //**********************************************************************************************
120 
121  //**Parallel evaluation strategy****************************************************************
123 
128  template< typename VT >
129  struct UseSMPAssign {
130  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) };
131  };
133  //**********************************************************************************************
134 
135  public:
136  //**Type definitions****************************************************************************
141 
144 
146  typedef const ResultType CompositeType;
147 
149  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
150 
152  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
153  //**********************************************************************************************
154 
155  //**Compilation flags***************************************************************************
157  enum { vectorizable = 0 };
158 
160  enum { smpAssignable = 0 };
161  //**********************************************************************************************
162 
163  //**Constructor*********************************************************************************
169  explicit inline DVecSVecAddExpr( const VT1& lhs, const VT2& rhs )
170  : lhs_( lhs ) // Left-hand side dense vector of the addition expression
171  , rhs_( rhs ) // Right-hand side sparse vector of the addition expression
172  {
173  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
174  }
175  //**********************************************************************************************
176 
177  //**Subscript operator**************************************************************************
183  inline ReturnType operator[]( size_t index ) const {
184  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
185  return lhs_[index] + rhs_[index];
186  }
187  //**********************************************************************************************
188 
189  //**Size function*******************************************************************************
194  inline size_t size() const {
195  return lhs_.size();
196  }
197  //**********************************************************************************************
198 
199  //**Left operand access*************************************************************************
204  inline LeftOperand leftOperand() const {
205  return lhs_;
206  }
207  //**********************************************************************************************
208 
209  //**Right operand access************************************************************************
214  inline RightOperand rightOperand() const {
215  return rhs_;
216  }
217  //**********************************************************************************************
218 
219  //**********************************************************************************************
225  template< typename T >
226  inline bool canAlias( const T* alias ) const {
227  return ( IsExpression<VT1>::value && lhs_.canAlias( alias ) ) ||
228  ( rhs_.canAlias( alias ) );
229  }
230  //**********************************************************************************************
231 
232  //**********************************************************************************************
238  template< typename T >
239  inline bool isAliased( const T* alias ) const {
240  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
241  }
242  //**********************************************************************************************
243 
244  private:
245  //**Member variables****************************************************************************
248  //**********************************************************************************************
249 
250  //**Assignment to dense vectors*****************************************************************
262  template< typename VT > // Type of the target dense vector
263  friend inline void assign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
264  {
266 
267  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
268 
269  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
270  addAssign( ~lhs, rhs.rhs_ );
271  }
272  else {
273  assign ( ~lhs, rhs.lhs_ );
274  addAssign( ~lhs, rhs.rhs_ );
275  }
276  }
278  //**********************************************************************************************
279 
280  //**Assignment to sparse vectors****************************************************************
292  template< typename VT > // Type of the target sparse vector
293  friend inline void assign( SparseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
294  {
296 
300 
301  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
302 
303  const ResultType tmp( serial( rhs ) );
304  assign( ~lhs, tmp );
305  }
307  //**********************************************************************************************
308 
309  //**Addition assignment to dense vectors********************************************************
321  template< typename VT > // Type of the target dense vector
322  friend inline void addAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
323  {
325 
326  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
327 
328  addAssign( ~lhs, rhs.lhs_ );
329  addAssign( ~lhs, rhs.rhs_ );
330  }
332  //**********************************************************************************************
333 
334  //**Addition assignment to sparse vectors*******************************************************
335  // No special implementation for the addition assignment to sparse vectors.
336  //**********************************************************************************************
337 
338  //**Subtraction assignment to dense vectors*****************************************************
350  template< typename VT > // Type of the target dense vector
351  friend inline void subAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
352  {
354 
355  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
356 
357  subAssign( ~lhs, rhs.lhs_ );
358  subAssign( ~lhs, rhs.rhs_ );
359  }
361  //**********************************************************************************************
362 
363  //**Subtraction assignment to sparse vectors****************************************************
364  // No special implementation for the subtraction assignment to sparse vectors.
365  //**********************************************************************************************
366 
367  //**Multiplication assignment to dense vectors**************************************************
379  template< typename VT > // Type of the target dense vector
380  friend inline void multAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
381  {
383 
387 
388  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
389 
390  const ResultType tmp( serial( rhs ) );
391  multAssign( ~lhs, tmp );
392  }
394  //**********************************************************************************************
395 
396  //**Multiplication assignment to sparse vectors*************************************************
397  // No special implementation for the multiplication assignment to sparse vectors.
398  //**********************************************************************************************
399 
400  //**SMP assignment to dense vectors*************************************************************
414  template< typename VT > // Type of the target dense vector
415  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
416  smpAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
417  {
419 
420  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
421 
422  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
423  smpAddAssign( ~lhs, rhs.rhs_ );
424  }
425  else {
426  smpAssign ( ~lhs, rhs.lhs_ );
427  smpAddAssign( ~lhs, rhs.rhs_ );
428  }
429  }
431  //**********************************************************************************************
432 
433  //**SMP assignment to sparse vectors************************************************************
447  template< typename VT > // Type of the target sparse vector
448  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
449  smpAssign( SparseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
450  {
452 
456 
457  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
458 
459  const ResultType tmp( rhs );
460  smpAssign( ~lhs, tmp );
461  }
463  //**********************************************************************************************
464 
465  //**SMP addition assignment to dense vectors****************************************************
479  template< typename VT > // Type of the target dense vector
480  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
481  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
482  {
484 
485  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
486 
487  smpAddAssign( ~lhs, rhs.lhs_ );
488  smpAddAssign( ~lhs, rhs.rhs_ );
489  }
491  //**********************************************************************************************
492 
493  //**SMP addition assignment to sparse vectors***************************************************
494  // No special implementation for the SMP addition assignment to sparse vectors.
495  //**********************************************************************************************
496 
497  //**SMP subtraction assignment to dense vectors*************************************************
511  template< typename VT > // Type of the target dense vector
512  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
513  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
514  {
516 
517  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
518 
519  smpSubAssign( ~lhs, rhs.lhs_ );
520  smpSubAssign( ~lhs, rhs.rhs_ );
521  }
523  //**********************************************************************************************
524 
525  //**SMP subtraction assignment to sparse vectors************************************************
526  // No special implementation for the SMP subtraction assignment to sparse vectors.
527  //**********************************************************************************************
528 
529  //**SMP multiplication assignment to dense vectors**********************************************
544  template< typename VT > // Type of the target dense vector
545  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
546  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
547  {
549 
553 
554  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
555 
556  const ResultType tmp( rhs );
557  smpMultAssign( ~lhs, tmp );
558  }
560  //**********************************************************************************************
561 
562  //**SMP multiplication assignment to sparse vectors*********************************************
563  // No special implementation for the SMP multiplication assignment to sparse vectors.
564  //**********************************************************************************************
565 
566  //**Compile time checks*************************************************************************
574  //**********************************************************************************************
575 };
576 //*************************************************************************************************
577 
578 
579 
580 
581 //=================================================================================================
582 //
583 // GLOBAL BINARY ARITHMETIC OPERATORS
584 //
585 //=================================================================================================
586 
587 //*************************************************************************************************
613 template< typename T1 // Type of the left-hand side dense vector
614  , typename T2 // Type of the right-hand side sparse vector
615  , bool TF > // Transpose flag
616 inline const DVecSVecAddExpr<T1,T2,TF>
618 {
620 
621  if( (~lhs).size() != (~rhs).size() )
622  throw std::invalid_argument( "Vector sizes do not match" );
623 
624  return DVecSVecAddExpr<T1,T2,TF>( ~lhs, ~rhs );
625 }
626 //*************************************************************************************************
627 
628 
629 //*************************************************************************************************
655 template< typename T1 // Type of the left-hand side sparse vector
656  , typename T2 // Type of the right-hand side dense vector
657  , bool TF > // Transpose flag
658 inline const DVecSVecAddExpr<T2,T1,TF>
660 {
662 
663  if( (~lhs).size() != (~rhs).size() )
664  throw std::invalid_argument( "Vector sizes do not match" );
665 
666  return DVecSVecAddExpr<T2,T1,TF>( ~rhs, ~lhs );
667 }
668 //*************************************************************************************************
669 
670 
671 
672 
673 //=================================================================================================
674 //
675 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
676 //
677 //=================================================================================================
678 
679 //*************************************************************************************************
692 template< typename T1 // Type of the dense vector of the left-hand side expression
693  , typename T2 // Type of the sparse vector of the left-hand side expression
694  , bool TF // Transpose flag of the left-hand side expression
695  , typename T3 > // Type of the right-hand side dense vector
696 inline const typename AddExprTrait< DVecSVecAddExpr<T1,T2,TF>, T3 >::Type
697  operator+( const DVecSVecAddExpr<T1,T2,TF>& lhs, const DenseVector<T3,TF>& rhs )
698 {
700 
701  return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
702 }
704 //*************************************************************************************************
705 
706 
707 //*************************************************************************************************
720 template< typename T1 // Type of the dense vector of the left-hand side expression
721  , typename T2 // Type of the sparse vector of the left-hand side expression
722  , bool TF // Transpose flag of the left-hand side expression
723  , typename T3 > // Type of the right-hand side dense vector
724 inline const typename SubExprTrait< DVecSVecAddExpr<T1,T2,TF>, T3 >::Type
725  operator-( const DVecSVecAddExpr<T1,T2,TF>& lhs, const DenseVector<T3,TF>& rhs )
726 {
728 
729  return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
730 }
732 //*************************************************************************************************
733 
734 
735 
736 
737 //=================================================================================================
738 //
739 // SIZE SPECIALIZATIONS
740 //
741 //=================================================================================================
742 
743 //*************************************************************************************************
745 template< typename VT1, typename VT2, bool TF >
746 struct Size< DVecSVecAddExpr<VT1,VT2,TF> >
747  : public Max< Size<VT1>, Size<VT2> >::Type
748 {};
750 //*************************************************************************************************
751 
752 
753 
754 
755 //=================================================================================================
756 //
757 // EXPRESSION TRAIT SPECIALIZATIONS
758 //
759 //=================================================================================================
760 
761 //*************************************************************************************************
763 template< typename VT1, typename VT2, typename VT3 >
764 struct DVecDVecAddExprTrait< DVecSVecAddExpr<VT1,VT2,false>, VT3 >
765 {
766  public:
767  //**********************************************************************************************
769  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
770  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
771  IsDenseVector<VT3>::value && IsColumnVector<VT3>::value
772  , typename DVecSVecAddExprTrait< typename DVecDVecAddExprTrait<VT1,VT3>::Type, VT2 >::Type
773  , INVALID_TYPE >::Type Type;
775  //**********************************************************************************************
776 };
778 //*************************************************************************************************
779 
780 
781 //*************************************************************************************************
783 template< typename VT1, typename VT2, typename VT3 >
784 struct TDVecTDVecAddExprTrait< DVecSVecAddExpr<VT1,VT2,true>, VT3 >
785 {
786  public:
787  //**********************************************************************************************
789  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
790  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
791  IsDenseVector<VT3>::value && IsRowVector<VT3>::value
792  , typename TDVecTSVecAddExprTrait< typename TDVecTDVecAddExprTrait<VT1,VT3>::Type, VT2 >::Type
793  , INVALID_TYPE >::Type Type;
795  //**********************************************************************************************
796 };
798 //*************************************************************************************************
799 
800 
801 //*************************************************************************************************
803 template< typename VT1, typename VT2, typename VT3 >
804 struct DVecDVecSubExprTrait< DVecSVecAddExpr<VT1,VT2,false>, VT3 >
805 {
806  public:
807  //**********************************************************************************************
809  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
810  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
811  IsDenseVector<VT3>::value && IsColumnVector<VT3>::value
812  , typename DVecSVecAddExprTrait< typename DVecDVecSubExprTrait<VT1,VT3>::Type, VT2 >::Type
813  , INVALID_TYPE >::Type Type;
815  //**********************************************************************************************
816 };
818 //*************************************************************************************************
819 
820 
821 //*************************************************************************************************
823 template< typename VT1, typename VT2, typename VT3 >
824 struct TDVecTDVecSubExprTrait< DVecSVecAddExpr<VT1,VT2,true>, VT3 >
825 {
826  public:
827  //**********************************************************************************************
829  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
830  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
831  IsDenseVector<VT3>::value && IsRowVector<VT3>::value
832  , typename TDVecTSVecAddExprTrait< typename TDVecTDVecSubExprTrait<VT1,VT3>::Type, VT2 >::Type
833  , INVALID_TYPE >::Type Type;
835  //**********************************************************************************************
836 };
838 //*************************************************************************************************
839 
840 
841 //*************************************************************************************************
843 template< typename VT1, typename VT2, bool TF, bool AF >
844 struct SubvectorExprTrait< DVecSVecAddExpr<VT1,VT2,TF>, AF >
845 {
846  public:
847  //**********************************************************************************************
848  typedef typename AddExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
849  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
850  //**********************************************************************************************
851 };
853 //*************************************************************************************************
854 
855 } // namespace blaze
856 
857 #endif
VT2::ResultType RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:99
Header file for the Max class template.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecSVecAddExpr.h:239
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
RightOperand rhs_
Right-hand side sparse vector of the addition expression.
Definition: DVecSVecAddExpr.h:247
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
Evaluation of the return type of an addition expression.Via this type trait it is possible to evaluat...
Definition: AddExprTrait.h:104
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
VT2::ReturnType RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:101
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecSVecAddExpr.h:139
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:98
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:102
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:946
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
Header file for the DenseVector base class.
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:695
Header file for the Computation base class.
Expression object for dense vector-sparse vector additions.The DVecSVecAddExpr class represents the c...
Definition: DVecSVecAddExpr.h:92
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: DVecSVecAddExpr.h:214
Constraint on the data type.
VT1::TransposeType TT1
Transpose type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:104
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecSVecAddExpr.h:204
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
VT2::TransposeType TT2
Transpose type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:105
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the VecVecAddExpr base class.
DVecSVecAddExpr< VT1, VT2, TF > This
Type of this DVecSVecAddExpr instance.
Definition: DVecSVecAddExpr.h:137
#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:165
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: DVecSVecAddExpr.h:140
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecSVecAddExpr.h:146
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
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.
LeftOperand lhs_
Left-hand side dense vector of the addition expression.
Definition: DVecSVecAddExpr.h:246
#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:2475
Constraint on the data type.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecSVecAddExpr.h:226
VT2::CompositeType CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:103
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Base class for all vector/vector addition expression templates.The VecVecAddExpr class serves as a ta...
Definition: VecVecAddExpr.h:65
Header file for the EnableIf class template.
Header file for the serial shim.
Constraint on the data type.
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
AddExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecSVecAddExpr.h:118
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:142
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Header file for the addition trait.
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
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:149
DVecSVecAddExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecSVecAddExpr class.
Definition: DVecSVecAddExpr.h:169
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecSVecAddExpr.h:143
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecSVecAddExpr.h:194
Header file for the IsDenseVector type trait.
#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:79
AddTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecSVecAddExpr.h:138
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
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
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecSVecAddExpr.h:183
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:152
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:100
Header file for the IsColumnVector 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
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:87
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