SVecDVecSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECDVECSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECDVECSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
66 #include <blaze/util/Assert.h>
68 #include <blaze/util/EnableIf.h>
69 #include <blaze/util/InvalidType.h>
71 #include <blaze/util/mpl/And.h>
72 #include <blaze/util/mpl/If.h>
73 #include <blaze/util/mpl/Max.h>
74 #include <blaze/util/Types.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS SVECDVECSUBEXPR
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
92 template< typename VT1 // Type of the left-hand side sparse vector
93  , typename VT2 // Type of the right-hand side dense vector
94  , bool TF > // Transpose flag
95 class SVecDVecSubExpr : public DenseVector< SVecDVecSubExpr<VT1,VT2,TF>, TF >
96  , private VecVecSubExpr
97  , private Computation
98 {
99  private:
100  //**Type definitions****************************************************************************
109  //**********************************************************************************************
110 
111  //**Return type evaluation**********************************************************************
113 
118  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
119 
122  //**********************************************************************************************
123 
124  //**Parallel evaluation strategy****************************************************************
126 
131  template< typename VT >
132  struct UseSMPAssign {
133  enum : bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) };
134  };
136  //**********************************************************************************************
137 
138  public:
139  //**Type definitions****************************************************************************
144 
147 
149  typedef const ResultType CompositeType;
150 
152  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
153 
155  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
156  //**********************************************************************************************
157 
158  //**Compilation flags***************************************************************************
160  enum : bool { simdEnabled = false };
161 
163  enum : bool { smpAssignable = false };
164  //**********************************************************************************************
165 
166  //**Constructor*********************************************************************************
172  explicit inline SVecDVecSubExpr( const VT1& lhs, const VT2& rhs ) noexcept
173  : lhs_( lhs ) // Left-hand side sparse vector of the subtraction expression
174  , rhs_( rhs ) // Right-hand side dense vector of the subtraction expression
175  {
176  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
177  }
178  //**********************************************************************************************
179 
180  //**Subscript operator**************************************************************************
186  inline ReturnType operator[]( size_t index ) const {
187  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
188  return lhs_[index] - rhs_[index];
189  }
190  //**********************************************************************************************
191 
192  //**At function*********************************************************************************
199  inline ReturnType at( size_t index ) const {
200  if( index >= lhs_.size() ) {
201  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
202  }
203  return (*this)[index];
204  }
205  //**********************************************************************************************
206 
207  //**Size function*******************************************************************************
212  inline size_t size() const noexcept {
213  return lhs_.size();
214  }
215  //**********************************************************************************************
216 
217  //**Left operand access*************************************************************************
222  inline LeftOperand leftOperand() const noexcept {
223  return lhs_;
224  }
225  //**********************************************************************************************
226 
227  //**Right operand access************************************************************************
232  inline RightOperand rightOperand() const noexcept {
233  return rhs_;
234  }
235  //**********************************************************************************************
236 
237  //**********************************************************************************************
243  template< typename T >
244  inline bool canAlias( const T* alias ) const noexcept {
245  return ( lhs_.canAlias( alias ) ) ||
246  ( IsExpression<VT2>::value && rhs_.canAlias( alias ) );
247  }
248  //**********************************************************************************************
249 
250  //**********************************************************************************************
256  template< typename T >
257  inline bool isAliased( const T* alias ) const noexcept {
258  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
259  }
260  //**********************************************************************************************
261 
262  private:
263  //**Member variables****************************************************************************
264  LeftOperand lhs_;
265  RightOperand rhs_;
266  //**********************************************************************************************
267 
268  //**Assignment to dense vectors*****************************************************************
280  template< typename VT > // Type of the target dense vector
281  friend inline void assign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
282  {
284 
285  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
286 
287  assign ( ~lhs, -rhs.rhs_ );
288  addAssign( ~lhs, rhs.lhs_ );
289  }
291  //**********************************************************************************************
292 
293  //**Assignment to sparse vectors****************************************************************
305  template< typename VT > // Type of the target sparse vector
306  friend inline void assign( SparseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
307  {
309 
313 
314  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
315 
316  const ResultType tmp( serial( rhs ) );
317  assign( ~lhs, tmp );
318  }
320  //**********************************************************************************************
321 
322  //**Addition assignment to dense vectors********************************************************
334  template< typename VT > // Type of the target dense vector
335  friend inline void addAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
336  {
338 
339  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
340 
341  subAssign( ~lhs, rhs.rhs_ );
342  addAssign( ~lhs, rhs.lhs_ );
343  }
345  //**********************************************************************************************
346 
347  //**Addition assignment to sparse vectors*******************************************************
348  // No special implementation for the addition assignment to sparse vectors.
349  //**********************************************************************************************
350 
351  //**Subtraction assignment to dense vectors*****************************************************
363  template< typename VT > // Type of the target dense vector
364  friend inline void subAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
365  {
367 
368  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
369 
370  addAssign( ~lhs, rhs.rhs_ );
371  subAssign( ~lhs, rhs.lhs_ );
372  }
374  //**********************************************************************************************
375 
376  //**Subtraction assignment to sparse vectors****************************************************
377  // No special implementation for the subtraction assignment to sparse vectors.
378  //**********************************************************************************************
379 
380  //**Multiplication assignment to dense vectors**************************************************
392  template< typename VT > // Type of the target dense vector
393  friend inline void multAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
394  {
396 
399  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
400 
401  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
402 
403  const ResultType tmp( serial( rhs ) );
404  multAssign( ~lhs, tmp );
405  }
407  //**********************************************************************************************
408 
409  //**Multiplication assignment to sparse vectors*************************************************
410  // No special implementation for the multiplication assignment to sparse vectors.
411  //**********************************************************************************************
412 
413  //**Division assignment to dense vectors********************************************************
425  template< typename VT > // Type of the target dense vector
426  friend inline void divAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
427  {
429 
432  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
433 
434  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
435 
436  const ResultType tmp( serial( rhs ) );
437  divAssign( ~lhs, tmp );
438  }
440  //**********************************************************************************************
441 
442  //**Division assignment to sparse vectors*******************************************************
443  // No special implementation for the division assignment to sparse vectors.
444  //**********************************************************************************************
445 
446  //**SMP assignment to dense vectors*************************************************************
460  template< typename VT > // Type of the target dense vector
461  friend inline EnableIf_< UseSMPAssign<VT> >
462  smpAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
463  {
465 
466  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
467 
468  smpAssign ( ~lhs, -rhs.rhs_ );
469  smpAddAssign( ~lhs, rhs.lhs_ );
470  }
472  //**********************************************************************************************
473 
474  //**SMP assignment to sparse vectors************************************************************
488  template< typename VT > // Type of the target sparse vector
489  friend inline EnableIf_< UseSMPAssign<VT> >
490  smpAssign( SparseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
491  {
493 
496  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
497 
498  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
499 
500  const ResultType tmp( rhs );
501  smpAssign( ~lhs, tmp );
502  }
504  //**********************************************************************************************
505 
506  //**SMP addition assignment to dense vectors****************************************************
520  template< typename VT > // Type of the target dense vector
521  friend inline EnableIf_< UseSMPAssign<VT> >
522  smpAddAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
523  {
525 
526  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
527 
528  smpSubAssign( ~lhs, rhs.rhs_ );
529  smpAddAssign( ~lhs, rhs.lhs_ );
530  }
532  //**********************************************************************************************
533 
534  //**SMP addition assignment to sparse vectors***************************************************
535  // No special implementation for the SMP addition assignment to sparse vectors.
536  //**********************************************************************************************
537 
538  //**SMP subtraction assignment to dense vectors*************************************************
552  template< typename VT > // Type of the target dense vector
553  friend inline EnableIf_< UseSMPAssign<VT> >
554  smpSubAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
555  {
557 
558  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
559 
560  smpAddAssign( ~lhs, rhs.rhs_ );
561  smpSubAssign( ~lhs, rhs.lhs_ );
562  }
564  //**********************************************************************************************
565 
566  //**SMP subtraction assignment to sparse vectors************************************************
567  // No special implementation for the SMP subtraction assignment to sparse vectors.
568  //**********************************************************************************************
569 
570  //**SMP multiplication assignment to dense vectors**********************************************
585  template< typename VT > // Type of the target dense vector
586  friend inline EnableIf_< UseSMPAssign<VT> >
587  smpMultAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
588  {
590 
593  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
594 
595  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
596 
597  const ResultType tmp( rhs );
598  smpMultAssign( ~lhs, tmp );
599  }
601  //**********************************************************************************************
602 
603  //**SMP multiplication assignment to sparse vectors*********************************************
604  // No special implementation for the SMP multiplication assignment to sparse vectors.
605  //**********************************************************************************************
606 
607  //**SMP division assignment to dense vectors****************************************************
621  template< typename VT > // Type of the target dense vector
622  friend inline EnableIf_< UseSMPAssign<VT> >
623  smpDivAssign( DenseVector<VT,TF>& lhs, const SVecDVecSubExpr& rhs )
624  {
626 
629  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
630 
631  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
632 
633  const ResultType tmp( rhs );
634  smpDivAssign( ~lhs, tmp );
635  }
637  //**********************************************************************************************
638 
639  //**SMP division assignment to sparse vectors***************************************************
640  // No special implementation for the SMP division assignment to sparse vectors.
641  //**********************************************************************************************
642 
643  //**Compile time checks*************************************************************************
651  //**********************************************************************************************
652 };
653 //*************************************************************************************************
654 
655 
656 
657 
658 //=================================================================================================
659 //
660 // GLOBAL BINARY ARITHMETIC OPERATORS
661 //
662 //=================================================================================================
663 
664 //*************************************************************************************************
690 template< typename T1 // Type of the left-hand side sparse vector
691  , typename T2 // Type of the right-hand side dense vector
692  , bool TF > // Transpose flag
693 inline const SVecDVecSubExpr<T1,T2,TF>
695 {
697 
698  if( (~lhs).size() != (~rhs).size() ) {
699  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
700  }
701 
702  return SVecDVecSubExpr<T1,T2,TF>( ~lhs, ~rhs );
703 }
704 //*************************************************************************************************
705 
706 
707 
708 
709 //=================================================================================================
710 //
711 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
712 //
713 //=================================================================================================
714 
715 //*************************************************************************************************
728 template< typename T1 // Type of the sparse vector of the left-hand side expression
729  , typename T2 // Type of the dense vector of the left-hand side expression
730  , bool TF // Transpose flag of the left-hand side expression
731  , typename T3 > // Type of right-hand side dense vector
732 inline const AddExprTrait_< SVecDVecSubExpr<T1,T2,TF>, T3 >
733  operator+( const SVecDVecSubExpr<T1,T2,TF>& lhs, const DenseVector<T3,TF>& rhs )
734 {
736 
737  return ( (~rhs) - lhs.rightOperand() ) + lhs.leftOperand();
738 }
740 //*************************************************************************************************
741 
742 
743 //*************************************************************************************************
756 template< typename T1 // Type of the sparse vector of the left-hand side expression
757  , typename T2 // Type of the dense vector of the left-hand side expression
758  , bool TF // Transpose flag of the left-hand side expression
759  , typename T3 > // Type of right-hand side dense vector
760 inline const SubExprTrait_< SVecDVecSubExpr<T1,T2,TF>, T3 >
761  operator-( const SVecDVecSubExpr<T1,T2,TF>& lhs, const DenseVector<T3,TF>& rhs )
762 {
764 
765  return lhs.leftOperand() - ( lhs.rightOperand() + (~rhs) );
766 }
768 //*************************************************************************************************
769 
770 
771 
772 
773 //=================================================================================================
774 //
775 // SIZE SPECIALIZATIONS
776 //
777 //=================================================================================================
778 
779 //*************************************************************************************************
781 template< typename VT1, typename VT2, bool TF >
782 struct Size< SVecDVecSubExpr<VT1,VT2,TF> >
783  : public Max< Size<VT1>, Size<VT2> >
784 {};
786 //*************************************************************************************************
787 
788 
789 
790 
791 //=================================================================================================
792 //
793 // EXPRESSION TRAIT SPECIALIZATIONS
794 //
795 //=================================================================================================
796 
797 //*************************************************************************************************
799 template< typename VT1, typename VT2, typename VT3 >
800 struct DVecDVecAddExprTrait< SVecDVecSubExpr<VT1,VT2,false>, VT3 >
801 {
802  public:
803  //**********************************************************************************************
805  using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
806  , IsDenseVector<VT2>, IsColumnVector<VT2>
807  , IsDenseVector<VT3>, IsColumnVector<VT3> >
808  , DVecSVecAddExprTrait_< DVecDVecSubExprTrait_<VT3,VT2>, VT1 >
809  , INVALID_TYPE >;
811  //**********************************************************************************************
812 };
814 //*************************************************************************************************
815 
816 
817 //*************************************************************************************************
819 template< typename VT1, typename VT2, typename VT3 >
820 struct TDVecTDVecAddExprTrait< SVecDVecSubExpr<VT1,VT2,true>, VT3 >
821 {
822  public:
823  //**********************************************************************************************
825  using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
826  , IsDenseVector<VT2>, IsRowVector<VT2>
827  , IsDenseVector<VT3>, IsRowVector<VT3> >
828  , TDVecTSVecAddExprTrait_< TDVecTDVecSubExprTrait_<VT3,VT2>, VT1 >
829  , INVALID_TYPE >;
831  //**********************************************************************************************
832 };
834 //*************************************************************************************************
835 
836 
837 //*************************************************************************************************
839 template< typename VT1, typename VT2, typename VT3 >
840 struct DVecDVecSubExprTrait< SVecDVecSubExpr<VT1,VT2,false>, VT3 >
841 {
842  public:
843  //**********************************************************************************************
845  using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
846  , IsDenseVector<VT2>, IsColumnVector<VT2>
847  , IsDenseVector<VT3>, IsColumnVector<VT3> >
848  , SVecDVecSubExprTrait_< VT1, DVecDVecAddExprTrait_<VT2,VT3> >
849  , INVALID_TYPE >;
851  //**********************************************************************************************
852 };
854 //*************************************************************************************************
855 
856 
857 //*************************************************************************************************
859 template< typename VT1, typename VT2, typename VT3 >
860 struct TDVecTDVecSubExprTrait< SVecDVecSubExpr<VT1,VT2,true>, VT3 >
861 {
862  public:
863  //**********************************************************************************************
865  using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
866  , IsDenseVector<VT2>, IsRowVector<VT2>
867  , IsDenseVector<VT3>, IsRowVector<VT3> >
868  , TSVecTDVecSubExprTrait_< VT1, TDVecTDVecAddExprTrait_<VT2,VT3> >
869  , INVALID_TYPE >;
871  //**********************************************************************************************
872 };
874 //*************************************************************************************************
875 
876 
877 //*************************************************************************************************
879 template< typename VT1, typename VT2, bool TF, bool AF >
880 struct SubvectorExprTrait< SVecDVecSubExpr<VT1,VT2,TF>, AF >
881 {
882  public:
883  //**********************************************************************************************
884  using Type = SubExprTrait_< SubvectorExprTrait_<const VT1,AF>
885  , SubvectorExprTrait_<const VT2,AF> >;
886  //**********************************************************************************************
887 };
889 //*************************************************************************************************
890 
891 } // namespace blaze
892 
893 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: SVecDVecSubExpr.h:106
Header file for auxiliary alias declarations.
Header file for the Max class template.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecDVecSubExpr.h:149
LeftOperand lhs_
Left-hand side sparse vector of the subtraction expression.
Definition: SVecDVecSubExpr.h:264
Expression object for sparse vector-dense vector subtractions.The SVecDVecSubExpr class represents th...
Definition: Forward.h:114
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecDVecSubExpr.h:142
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
TransposeType_< VT1 > TT1
Transpose type of the left-hand side sparse vector expression.
Definition: SVecDVecSubExpr.h:107
Header file for the subtraction trait.
Header file for basic type definitions.
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecDVecSubExpr.h:152
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the serial shim.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecDVecSubExpr.h:146
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
Header file for the IsRowVector type trait.
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
Header file for the And class template.
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:723
Header file for the Computation base class.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecDVecSubExpr.h:199
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
SubTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SVecDVecSubExpr.h:141
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: SVecDVecSubExpr.h:155
typename SubExprTrait< T1, T2 >::Type SubExprTrait_
Auxiliary alias declaration for the SubExprTrait class template.The SubExprTrait_ alias declaration p...
Definition: SubExprTrait.h:220
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: SVecDVecSubExpr.h:104
RightOperand rhs_
Right-hand side dense vector of the subtraction expression.
Definition: SVecDVecSubExpr.h:265
Header file for the IsTemporary type trait class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
EnableIf_< IsDenseMatrix< MT1 > > 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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecDVecSubExpr.h:257
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
SVecDVecSubExpr< VT1, VT2, TF > This
Type of this SVecDVecSubExpr instance.
Definition: SVecDVecSubExpr.h:140
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecDVecSubExpr.h:143
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: SVecDVecSubExpr.h:102
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
Constraint on the data type.
SubExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecDVecSubExpr.h:121
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
SVecDVecSubExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the SVecDVecSubExpr class.
Definition: SVecDVecSubExpr.h:172
Constraint on the data type.
Header file for the exception macros of the math module.
ReturnType_< VT1 > RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecDVecSubExpr.h:103
Header file for the VecVecSubExpr base class.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
TransposeType_< VT2 > TT2
Transpose type of the right-hand side dense vector expression.
Definition: SVecDVecSubExpr.h:108
Header file for the IsSparseVector type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecDVecSubExpr.h:222
Header file for run time assertion macros.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecDVecSubExpr.h:244
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecDVecSubExpr.h:186
CompositeType_< VT1 > CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecDVecSubExpr.h:105
Header file for the IsDenseVector type trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecDVecSubExpr.h:212
#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:109
Header file for the IsComputation type trait class.
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:245
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
ResultType_< VT1 > RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecDVecSubExpr.h:101
Header file for the IsColumnVector type trait.
Header file for the SubExprTrait class template.
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#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:71
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: SVecDVecSubExpr.h:232