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 
64 #include <blaze/util/Assert.h>
66 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/Exception.h>
68 #include <blaze/util/InvalidType.h>
70 #include <blaze/util/mpl/Max.h>
71 #include <blaze/util/SelectType.h>
72 #include <blaze/util/Types.h>
73 
74 
75 namespace blaze {
76 
77 //=================================================================================================
78 //
79 // CLASS DVECSVECADDEXPR
80 //
81 //=================================================================================================
82 
83 //*************************************************************************************************
90 template< typename VT1 // Type of the left-hand side dense vector
91  , typename VT2 // Type of the right-hand side sparse vector
92  , bool TF > // Transpose flag
93 class DVecSVecAddExpr : public DenseVector< DVecSVecAddExpr<VT1,VT2,TF>, TF >
94  , private VecVecAddExpr
95  , private Computation
96 {
97  private:
98  //**Type definitions****************************************************************************
99  typedef typename VT1::ResultType RT1;
100  typedef typename VT2::ResultType RT2;
101  typedef typename VT1::ReturnType RN1;
102  typedef typename VT2::ReturnType RN2;
103  typedef typename VT1::CompositeType CT1;
104  typedef typename VT2::CompositeType CT2;
105  typedef typename VT1::TransposeType TT1;
106  typedef typename VT2::TransposeType TT2;
107  //**********************************************************************************************
108 
109  //**Return type evaluation**********************************************************************
111 
116  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
117 
120  //**********************************************************************************************
121 
122  //**Parallel evaluation strategy****************************************************************
124 
129  template< typename VT >
130  struct UseSMPAssign {
131  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) };
132  };
134  //**********************************************************************************************
135 
136  public:
137  //**Type definitions****************************************************************************
142 
145 
147  typedef const ResultType CompositeType;
148 
150  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
151 
153  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
154  //**********************************************************************************************
155 
156  //**Compilation flags***************************************************************************
158  enum { vectorizable = 0 };
159 
161  enum { smpAssignable = 0 };
162  //**********************************************************************************************
163 
164  //**Constructor*********************************************************************************
170  explicit inline DVecSVecAddExpr( const VT1& lhs, const VT2& rhs )
171  : lhs_( lhs ) // Left-hand side dense vector of the addition expression
172  , rhs_( rhs ) // Right-hand side sparse vector of the addition expression
173  {
174  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
175  }
176  //**********************************************************************************************
177 
178  //**Subscript operator**************************************************************************
184  inline ReturnType operator[]( size_t index ) const {
185  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
186  return lhs_[index] + rhs_[index];
187  }
188  //**********************************************************************************************
189 
190  //**At function*********************************************************************************
197  inline ReturnType at( size_t index ) const {
198  if( index >= lhs_.size() ) {
199  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
200  }
201  return (*this)[index];
202  }
203  //**********************************************************************************************
204 
205  //**Size function*******************************************************************************
210  inline size_t size() const {
211  return lhs_.size();
212  }
213  //**********************************************************************************************
214 
215  //**Left operand access*************************************************************************
220  inline LeftOperand leftOperand() const {
221  return lhs_;
222  }
223  //**********************************************************************************************
224 
225  //**Right operand access************************************************************************
230  inline RightOperand rightOperand() const {
231  return rhs_;
232  }
233  //**********************************************************************************************
234 
235  //**********************************************************************************************
241  template< typename T >
242  inline bool canAlias( const T* alias ) const {
243  return ( IsExpression<VT1>::value && lhs_.canAlias( alias ) ) ||
244  ( rhs_.canAlias( alias ) );
245  }
246  //**********************************************************************************************
247 
248  //**********************************************************************************************
254  template< typename T >
255  inline bool isAliased( const T* alias ) const {
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  //**Assignment to dense vectors*****************************************************************
278  template< typename VT > // Type of the target dense vector
279  friend inline void assign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
280  {
282 
283  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
284 
285  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
286  addAssign( ~lhs, rhs.rhs_ );
287  }
288  else {
289  assign ( ~lhs, rhs.lhs_ );
290  addAssign( ~lhs, rhs.rhs_ );
291  }
292  }
294  //**********************************************************************************************
295 
296  //**Assignment to sparse vectors****************************************************************
308  template< typename VT > // Type of the target sparse vector
309  friend inline void assign( SparseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
310  {
312 
316 
317  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
318 
319  const ResultType tmp( serial( rhs ) );
320  assign( ~lhs, tmp );
321  }
323  //**********************************************************************************************
324 
325  //**Addition assignment to dense vectors********************************************************
337  template< typename VT > // Type of the target dense vector
338  friend inline void addAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
339  {
341 
342  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
343 
344  addAssign( ~lhs, rhs.lhs_ );
345  addAssign( ~lhs, rhs.rhs_ );
346  }
348  //**********************************************************************************************
349 
350  //**Addition assignment to sparse vectors*******************************************************
351  // No special implementation for the addition assignment to sparse vectors.
352  //**********************************************************************************************
353 
354  //**Subtraction assignment to dense vectors*****************************************************
366  template< typename VT > // Type of the target dense vector
367  friend inline void subAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
368  {
370 
371  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
372 
373  subAssign( ~lhs, rhs.lhs_ );
374  subAssign( ~lhs, rhs.rhs_ );
375  }
377  //**********************************************************************************************
378 
379  //**Subtraction assignment to sparse vectors****************************************************
380  // No special implementation for the subtraction assignment to sparse vectors.
381  //**********************************************************************************************
382 
383  //**Multiplication assignment to dense vectors**************************************************
395  template< typename VT > // Type of the target dense vector
396  friend inline void multAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
397  {
399 
403 
404  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
405 
406  const ResultType tmp( serial( rhs ) );
407  multAssign( ~lhs, tmp );
408  }
410  //**********************************************************************************************
411 
412  //**Multiplication assignment to sparse vectors*************************************************
413  // No special implementation for the multiplication assignment to sparse vectors.
414  //**********************************************************************************************
415 
416  //**SMP assignment to dense vectors*************************************************************
430  template< typename VT > // Type of the target dense vector
431  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
432  smpAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
433  {
435 
436  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
437 
438  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
439  smpAddAssign( ~lhs, rhs.rhs_ );
440  }
441  else {
442  smpAssign ( ~lhs, rhs.lhs_ );
443  smpAddAssign( ~lhs, rhs.rhs_ );
444  }
445  }
447  //**********************************************************************************************
448 
449  //**SMP assignment to sparse vectors************************************************************
463  template< typename VT > // Type of the target sparse vector
464  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
465  smpAssign( SparseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
466  {
468 
472 
473  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
474 
475  const ResultType tmp( rhs );
476  smpAssign( ~lhs, tmp );
477  }
479  //**********************************************************************************************
480 
481  //**SMP addition assignment to dense vectors****************************************************
495  template< typename VT > // Type of the target dense vector
496  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
497  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
498  {
500 
501  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
502 
503  smpAddAssign( ~lhs, rhs.lhs_ );
504  smpAddAssign( ~lhs, rhs.rhs_ );
505  }
507  //**********************************************************************************************
508 
509  //**SMP addition assignment to sparse vectors***************************************************
510  // No special implementation for the SMP addition assignment to sparse vectors.
511  //**********************************************************************************************
512 
513  //**SMP subtraction assignment to dense vectors*************************************************
527  template< typename VT > // Type of the target dense vector
528  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
529  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
530  {
532 
533  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
534 
535  smpSubAssign( ~lhs, rhs.lhs_ );
536  smpSubAssign( ~lhs, rhs.rhs_ );
537  }
539  //**********************************************************************************************
540 
541  //**SMP subtraction assignment to sparse vectors************************************************
542  // No special implementation for the SMP subtraction assignment to sparse vectors.
543  //**********************************************************************************************
544 
545  //**SMP multiplication assignment to dense vectors**********************************************
560  template< typename VT > // Type of the target dense vector
561  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
562  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecSVecAddExpr& rhs )
563  {
565 
569 
570  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
571 
572  const ResultType tmp( rhs );
573  smpMultAssign( ~lhs, tmp );
574  }
576  //**********************************************************************************************
577 
578  //**SMP multiplication assignment to sparse vectors*********************************************
579  // No special implementation for the SMP multiplication assignment to sparse vectors.
580  //**********************************************************************************************
581 
582  //**Compile time checks*************************************************************************
590  //**********************************************************************************************
591 };
592 //*************************************************************************************************
593 
594 
595 
596 
597 //=================================================================================================
598 //
599 // GLOBAL BINARY ARITHMETIC OPERATORS
600 //
601 //=================================================================================================
602 
603 //*************************************************************************************************
629 template< typename T1 // Type of the left-hand side dense vector
630  , typename T2 // Type of the right-hand side sparse vector
631  , bool TF > // Transpose flag
632 inline const DVecSVecAddExpr<T1,T2,TF>
634 {
636 
637  if( (~lhs).size() != (~rhs).size() ) {
638  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
639  }
640 
641  return DVecSVecAddExpr<T1,T2,TF>( ~lhs, ~rhs );
642 }
643 //*************************************************************************************************
644 
645 
646 //*************************************************************************************************
672 template< typename T1 // Type of the left-hand side sparse vector
673  , typename T2 // Type of the right-hand side dense vector
674  , bool TF > // Transpose flag
675 inline const DVecSVecAddExpr<T2,T1,TF>
677 {
679 
680  if( (~lhs).size() != (~rhs).size() ) {
681  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
682  }
683 
684  return DVecSVecAddExpr<T2,T1,TF>( ~rhs, ~lhs );
685 }
686 //*************************************************************************************************
687 
688 
689 
690 
691 //=================================================================================================
692 //
693 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
694 //
695 //=================================================================================================
696 
697 //*************************************************************************************************
710 template< typename T1 // Type of the dense vector of the left-hand side expression
711  , typename T2 // Type of the sparse vector of the left-hand side expression
712  , bool TF // Transpose flag of the left-hand side expression
713  , typename T3 > // Type of the right-hand side dense vector
714 inline const typename AddExprTrait< DVecSVecAddExpr<T1,T2,TF>, T3 >::Type
715  operator+( const DVecSVecAddExpr<T1,T2,TF>& lhs, const DenseVector<T3,TF>& rhs )
716 {
718 
719  return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
720 }
722 //*************************************************************************************************
723 
724 
725 //*************************************************************************************************
738 template< typename T1 // Type of the dense vector of the left-hand side expression
739  , typename T2 // Type of the sparse vector of the left-hand side expression
740  , bool TF // Transpose flag of the left-hand side expression
741  , typename T3 > // Type of the right-hand side dense vector
742 inline const typename SubExprTrait< DVecSVecAddExpr<T1,T2,TF>, T3 >::Type
743  operator-( const DVecSVecAddExpr<T1,T2,TF>& lhs, const DenseVector<T3,TF>& rhs )
744 {
746 
747  return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
748 }
750 //*************************************************************************************************
751 
752 
753 
754 
755 //=================================================================================================
756 //
757 // SIZE SPECIALIZATIONS
758 //
759 //=================================================================================================
760 
761 //*************************************************************************************************
763 template< typename VT1, typename VT2, bool TF >
764 struct Size< DVecSVecAddExpr<VT1,VT2,TF> >
765  : public Max< Size<VT1>, Size<VT2> >
766 {};
768 //*************************************************************************************************
769 
770 
771 
772 
773 //=================================================================================================
774 //
775 // EXPRESSION TRAIT SPECIALIZATIONS
776 //
777 //=================================================================================================
778 
779 //*************************************************************************************************
781 template< typename VT1, typename VT2, typename VT3 >
782 struct DVecDVecAddExprTrait< DVecSVecAddExpr<VT1,VT2,false>, VT3 >
783 {
784  public:
785  //**********************************************************************************************
787  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
788  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
789  IsDenseVector<VT3>::value && IsColumnVector<VT3>::value
790  , typename DVecSVecAddExprTrait< typename DVecDVecAddExprTrait<VT1,VT3>::Type, VT2 >::Type
791  , INVALID_TYPE >::Type Type;
793  //**********************************************************************************************
794 };
796 //*************************************************************************************************
797 
798 
799 //*************************************************************************************************
801 template< typename VT1, typename VT2, typename VT3 >
802 struct TDVecTDVecAddExprTrait< DVecSVecAddExpr<VT1,VT2,true>, VT3 >
803 {
804  public:
805  //**********************************************************************************************
807  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
808  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
809  IsDenseVector<VT3>::value && IsRowVector<VT3>::value
810  , typename TDVecTSVecAddExprTrait< typename TDVecTDVecAddExprTrait<VT1,VT3>::Type, VT2 >::Type
811  , INVALID_TYPE >::Type Type;
813  //**********************************************************************************************
814 };
816 //*************************************************************************************************
817 
818 
819 //*************************************************************************************************
821 template< typename VT1, typename VT2, typename VT3 >
822 struct DVecDVecSubExprTrait< DVecSVecAddExpr<VT1,VT2,false>, VT3 >
823 {
824  public:
825  //**********************************************************************************************
827  typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
828  IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
829  IsDenseVector<VT3>::value && IsColumnVector<VT3>::value
830  , typename DVecSVecAddExprTrait< typename DVecDVecSubExprTrait<VT1,VT3>::Type, VT2 >::Type
831  , INVALID_TYPE >::Type Type;
833  //**********************************************************************************************
834 };
836 //*************************************************************************************************
837 
838 
839 //*************************************************************************************************
841 template< typename VT1, typename VT2, typename VT3 >
842 struct TDVecTDVecSubExprTrait< DVecSVecAddExpr<VT1,VT2,true>, VT3 >
843 {
844  public:
845  //**********************************************************************************************
847  typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
848  IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
849  IsDenseVector<VT3>::value && IsRowVector<VT3>::value
850  , typename TDVecTSVecAddExprTrait< typename TDVecTDVecSubExprTrait<VT1,VT3>::Type, VT2 >::Type
851  , INVALID_TYPE >::Type Type;
853  //**********************************************************************************************
854 };
856 //*************************************************************************************************
857 
858 
859 //*************************************************************************************************
861 template< typename VT1, typename VT2, bool TF, bool AF >
862 struct SubvectorExprTrait< DVecSVecAddExpr<VT1,VT2,TF>, AF >
863 {
864  public:
865  //**********************************************************************************************
866  typedef typename AddExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
867  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
868  //**********************************************************************************************
869 };
871 //*************************************************************************************************
872 
873 } // namespace blaze
874 
875 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
VT2::ResultType RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:100
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:255
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:263
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
Header file for basic type definitions.
VT2::ReturnType RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:102
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecSVecAddExpr.h:140
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:99
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:103
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:647
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the DenseVector base class.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecSVecAddExpr.h:197
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:721
Header file for the Computation base class.
Expression object for dense vector-sparse vector additions.The DVecSVecAddExpr class represents the c...
Definition: DVecSVecAddExpr.h:93
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: DVecSVecAddExpr.h:230
Constraint on the data type.
VT1::TransposeType TT1
Transpose type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:105
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecSVecAddExpr.h:220
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
VT2::TransposeType TT2
Transpose type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:106
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.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the VecVecAddExpr base class.
DVecSVecAddExpr< VT1, VT2, TF > This
Type of this DVecSVecAddExpr instance.
Definition: DVecSVecAddExpr.h:138
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:610
#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
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecSVecAddExpr.h:141
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecSVecAddExpr.h:147
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
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
Constraint on the data type.
LeftOperand lhs_
Left-hand side dense vector of the addition expression.
Definition: DVecSVecAddExpr.h:262
#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:2585
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:242
VT2::CompositeType CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecAddExpr.h:104
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:2587
AddExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecSVecAddExpr.h:119
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:138
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
Utility type for generic codes.
Header file for the addition trait.
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:150
DVecSVecAddExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecSVecAddExpr class.
Definition: DVecSVecAddExpr.h:170
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecSVecAddExpr.h:144
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecSVecAddExpr.h:210
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:139
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:184
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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:2583
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:153
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecSVecAddExpr.h:101
Header file for exception macros.
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:81
#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.