DVecScalarMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
45 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
58 #include <blaze/math/SIMD.h>
70 #include <blaze/system/Inline.h>
72 #include <blaze/util/Assert.h>
76 #include <blaze/util/EnableIf.h>
78 #include <blaze/util/mpl/If.h>
79 #include <blaze/util/Types.h>
81 
82 
83 namespace blaze {
84 
85 //=================================================================================================
86 //
87 // CLASS DVECSCALARMULTEXPR
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
98 template< typename VT // Type of the left-hand side dense vector
99  , typename ST // Type of the right-hand side scalar value
100  , bool TF > // Transpose flag
102  : public VecScalarMultExpr< DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF > >
103  , private Computation
104 {
105  private:
106  //**Type definitions****************************************************************************
111  //**********************************************************************************************
112 
113  //**Return type evaluation**********************************************************************
115 
120  static constexpr bool returnExpr = !IsTemporary_v<RN>;
121 
123  using ExprReturnType = decltype( std::declval<RN>() * std::declval<ST>() );
124  //**********************************************************************************************
125 
126  //**Serial evaluation strategy******************************************************************
128 
134  static constexpr bool useAssign = ( IsComputation_v<VT> && RequiresEvaluation_v<VT> );
135 
137  template< typename VT2 >
139  static constexpr bool UseAssign_v = useAssign;
141  //**********************************************************************************************
142 
143  //**Parallel evaluation strategy****************************************************************
145 
151  template< typename VT2 >
152  static constexpr bool UseSMPAssign_v =
155  //**********************************************************************************************
156 
157  public:
158  //**Type definitions****************************************************************************
164 
167 
170 
172  using LeftOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
173 
175  using RightOperand = ST;
176  //**********************************************************************************************
177 
178  //**ConstIterator class definition**************************************************************
182  {
183  public:
184  //**Type definitions*************************************************************************
185  using IteratorCategory = std::random_access_iterator_tag;
190 
191  // STL iterator requirements
197 
200  //*******************************************************************************************
201 
202  //**Constructor******************************************************************************
208  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
209  : iterator_( iterator ) // Iterator to the current element
210  , scalar_ ( scalar ) // Scalar of the multiplication expression
211  {}
212  //*******************************************************************************************
213 
214  //**Addition assignment operator*************************************************************
220  inline ConstIterator& operator+=( size_t inc ) {
221  iterator_ += inc;
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Subtraction assignment operator**********************************************************
232  inline ConstIterator& operator-=( size_t dec ) {
233  iterator_ -= dec;
234  return *this;
235  }
236  //*******************************************************************************************
237 
238  //**Prefix increment operator****************************************************************
244  ++iterator_;
245  return *this;
246  }
247  //*******************************************************************************************
248 
249  //**Postfix increment operator***************************************************************
254  inline const ConstIterator operator++( int ) {
255  return ConstIterator( iterator_++ );
256  }
257  //*******************************************************************************************
258 
259  //**Prefix decrement operator****************************************************************
265  --iterator_;
266  return *this;
267  }
268  //*******************************************************************************************
269 
270  //**Postfix decrement operator***************************************************************
275  inline const ConstIterator operator--( int ) {
276  return ConstIterator( iterator_-- );
277  }
278  //*******************************************************************************************
279 
280  //**Element access operator******************************************************************
285  inline ReturnType operator*() const {
286  return *iterator_ * scalar_;
287  }
288  //*******************************************************************************************
289 
290  //**Load function****************************************************************************
295  inline auto load() const noexcept {
296  return iterator_.load() * set( scalar_ );
297  }
298  //*******************************************************************************************
299 
300  //**Equality operator************************************************************************
306  inline bool operator==( const ConstIterator& rhs ) const {
307  return iterator_ == rhs.iterator_;
308  }
309  //*******************************************************************************************
310 
311  //**Inequality operator**********************************************************************
317  inline bool operator!=( const ConstIterator& rhs ) const {
318  return iterator_ != rhs.iterator_;
319  }
320  //*******************************************************************************************
321 
322  //**Less-than operator***********************************************************************
328  inline bool operator<( const ConstIterator& rhs ) const {
329  return iterator_ < rhs.iterator_;
330  }
331  //*******************************************************************************************
332 
333  //**Greater-than operator********************************************************************
339  inline bool operator>( const ConstIterator& rhs ) const {
340  return iterator_ > rhs.iterator_;
341  }
342  //*******************************************************************************************
343 
344  //**Less-or-equal-than operator**************************************************************
350  inline bool operator<=( const ConstIterator& rhs ) const {
351  return iterator_ <= rhs.iterator_;
352  }
353  //*******************************************************************************************
354 
355  //**Greater-or-equal-than operator***********************************************************
361  inline bool operator>=( const ConstIterator& rhs ) const {
362  return iterator_ >= rhs.iterator_;
363  }
364  //*******************************************************************************************
365 
366  //**Subtraction operator*********************************************************************
372  inline DifferenceType operator-( const ConstIterator& rhs ) const {
373  return iterator_ - rhs.iterator_;
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
385  return ConstIterator( it.iterator_ + inc );
386  }
387  //*******************************************************************************************
388 
389  //**Addition operator************************************************************************
396  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
397  return ConstIterator( it.iterator_ + inc );
398  }
399  //*******************************************************************************************
400 
401  //**Subtraction operator*********************************************************************
408  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
409  return ConstIterator( it.iterator_ - dec );
410  }
411  //*******************************************************************************************
412 
413  private:
414  //**Member variables*************************************************************************
417  //*******************************************************************************************
418  };
419  //**********************************************************************************************
420 
421  //**Compilation flags***************************************************************************
423  static constexpr bool simdEnabled =
424  ( VT::simdEnabled && IsNumeric_v<ET> &&
425  ( HasSIMDMult_v<ET,ST> || HasSIMDMult_v<UnderlyingElement_t<ET>,ST> ) );
426 
428  static constexpr bool smpAssignable = VT::smpAssignable;
429  //**********************************************************************************************
430 
431  //**SIMD properties*****************************************************************************
433  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
434  //**********************************************************************************************
435 
436  //**Constructor*********************************************************************************
442  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar ) noexcept
443  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
444  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
445  {}
446  //**********************************************************************************************
447 
448  //**Subscript operator**************************************************************************
454  inline ReturnType operator[]( size_t index ) const {
455  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
456  return vector_[index] * scalar_;
457  }
458  //**********************************************************************************************
459 
460  //**At function*********************************************************************************
467  inline ReturnType at( size_t index ) const {
468  if( index >= vector_.size() ) {
469  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
470  }
471  return (*this)[index];
472  }
473  //**********************************************************************************************
474 
475  //**Load function*******************************************************************************
481  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
482  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
483  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
484  return vector_.load( index ) * set( scalar_ );
485  }
486  //**********************************************************************************************
487 
488  //**Begin function******************************************************************************
493  inline ConstIterator begin() const {
494  return ConstIterator( vector_.begin(), scalar_ );
495  }
496  //**********************************************************************************************
497 
498  //**End function********************************************************************************
503  inline ConstIterator end() const {
504  return ConstIterator( vector_.end(), scalar_ );
505  }
506  //**********************************************************************************************
507 
508  //**Size function*******************************************************************************
513  inline size_t size() const noexcept {
514  return vector_.size();
515  }
516  //**********************************************************************************************
517 
518  //**Left operand access*************************************************************************
523  inline LeftOperand leftOperand() const noexcept {
524  return vector_;
525  }
526  //**********************************************************************************************
527 
528  //**Right operand access************************************************************************
533  inline RightOperand rightOperand() const noexcept {
534  return scalar_;
535  }
536  //**********************************************************************************************
537 
538  //**********************************************************************************************
544  template< typename T >
545  inline bool canAlias( const T* alias ) const noexcept {
546  return IsExpression_v<VT> && vector_.canAlias( alias );
547  }
548  //**********************************************************************************************
549 
550  //**********************************************************************************************
556  template< typename T >
557  inline bool isAliased( const T* alias ) const noexcept {
558  return vector_.isAliased( alias );
559  }
560  //**********************************************************************************************
561 
562  //**********************************************************************************************
567  inline bool isAligned() const noexcept {
568  return vector_.isAligned();
569  }
570  //**********************************************************************************************
571 
572  //**********************************************************************************************
577  inline bool canSMPAssign() const noexcept {
578  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
579  }
580  //**********************************************************************************************
581 
582  private:
583  //**Member variables****************************************************************************
586  //**********************************************************************************************
587 
588  //**Assignment to dense vectors*****************************************************************
602  template< typename VT2 > // Type of the target dense vector
603  friend inline auto assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
605  {
607 
608  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
609 
610  assign( ~lhs, rhs.vector_ );
611  assign( ~lhs, (~lhs) * rhs.scalar_ );
612  }
614  //**********************************************************************************************
615 
616  //**Assignment to sparse vectors****************************************************************
630  template< typename VT2 > // Type of the target sparse vector
631  friend inline auto assign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
633  {
635 
636  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
637 
638  assign( ~lhs, rhs.vector_ );
639  (~lhs) *= rhs.scalar_;
640  }
642  //**********************************************************************************************
643 
644  //**Addition assignment to dense vectors********************************************************
658  template< typename VT2 > // Type of the target dense vector
659  friend inline auto addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
660  -> EnableIf_t< UseAssign_v<VT2> >
661  {
663 
667 
668  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
669 
670  const ResultType tmp( serial( rhs ) );
671  addAssign( ~lhs, tmp );
672  }
674  //**********************************************************************************************
675 
676  //**Addition assignment to sparse vectors*******************************************************
677  // No special implementation for the addition assignment to sparse vectors.
678  //**********************************************************************************************
679 
680  //**Subtraction assignment to dense vectors*****************************************************
694  template< typename VT2 > // Type of the target dense vector
695  friend inline auto subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
696  -> EnableIf_t< UseAssign_v<VT2> >
697  {
699 
703 
704  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
705 
706  const ResultType tmp( serial( rhs ) );
707  subAssign( ~lhs, tmp );
708  }
710  //**********************************************************************************************
711 
712  //**Subtraction assignment to sparse vectors****************************************************
713  // No special implementation for the subtraction assignment to sparse vectors.
714  //**********************************************************************************************
715 
716  //**Multiplication assignment to dense vectors**************************************************
730  template< typename VT2 > // Type of the target dense vector
731  friend inline auto multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
732  -> EnableIf_t< UseAssign_v<VT2> >
733  {
735 
739 
740  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
741 
742  const ResultType tmp( serial( rhs ) );
743  multAssign( ~lhs, tmp );
744  }
746  //**********************************************************************************************
747 
748  //**Multiplication assignment to sparse vectors*************************************************
749  // No special implementation for the multiplication assignment to sparse vectors.
750  //**********************************************************************************************
751 
752  //**Division assignment to dense vectors********************************************************
766  template< typename VT2 > // Type of the target dense vector
767  friend inline auto divAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
768  -> EnableIf_t< UseAssign_v<VT2> >
769  {
771 
775 
776  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
777 
778  const ResultType tmp( serial( rhs ) );
779  divAssign( ~lhs, tmp );
780  }
782  //**********************************************************************************************
783 
784  //**Division assignment to sparse vectors*******************************************************
785  // No special implementation for the division assignment to sparse vectors.
786  //**********************************************************************************************
787 
788  //**SMP assignment to dense vectors*************************************************************
802  template< typename VT2 > // Type of the target dense vector
803  friend inline auto smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
804  -> EnableIf_t< UseSMPAssign_v<VT2> >
805  {
807 
808  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
809 
810  smpAssign( ~lhs, rhs.vector_ );
811  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
812  }
814  //**********************************************************************************************
815 
816  //**SMP assignment to sparse vectors************************************************************
830  template< typename VT2 > // Type of the target sparse vector
831  friend inline auto smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
832  -> EnableIf_t< UseSMPAssign_v<VT2> >
833  {
835 
836  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
837 
838  smpAssign( ~lhs, rhs.vector_ );
839  (~lhs) *= rhs.scalar_;
840  }
842  //**********************************************************************************************
843 
844  //**SMP addition assignment to dense vectors****************************************************
858  template< typename VT2 > // Type of the target dense vector
859  friend inline auto smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
860  -> EnableIf_t< UseSMPAssign_v<VT2> >
861  {
863 
867 
868  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
869 
870  const ResultType tmp( rhs );
871  smpAddAssign( ~lhs, tmp );
872  }
874  //**********************************************************************************************
875 
876  //**SMP addition assignment to sparse vectors***************************************************
877  // No special implementation for the SMP addition assignment to sparse vectors.
878  //**********************************************************************************************
879 
880  //**SMP subtraction assignment to dense vectors*************************************************
894  template< typename VT2 > // Type of the target dense vector
895  friend inline auto smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
896  -> EnableIf_t< UseSMPAssign_v<VT2> >
897  {
899 
903 
904  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
905 
906  const ResultType tmp( rhs );
907  smpSubAssign( ~lhs, tmp );
908  }
910  //**********************************************************************************************
911 
912  //**SMP subtraction assignment to sparse vectors************************************************
913  // No special implementation for the SMP subtraction assignment to sparse vectors.
914  //**********************************************************************************************
915 
916  //**SMP multiplication assignment to dense vectors**********************************************
930  template< typename VT2 > // Type of the target dense vector
931  friend inline auto smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
932  -> EnableIf_t< UseSMPAssign_v<VT2> >
933  {
935 
939 
940  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
941 
942  const ResultType tmp( rhs );
943  smpMultAssign( ~lhs, tmp );
944  }
946  //**********************************************************************************************
947 
948  //**SMP multiplication assignment to sparse vectors*********************************************
949  // No special implementation for the SMP multiplication assignment to sparse vectors.
950  //**********************************************************************************************
951 
952  //**SMP division assignment to dense vectors****************************************************
966  template< typename VT2 > // Type of the target dense vector
967  friend inline auto smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
968  -> EnableIf_t< UseSMPAssign_v<VT2> >
969  {
971 
975 
976  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
977 
978  const ResultType tmp( rhs );
979  smpDivAssign( ~lhs, tmp );
980  }
982  //**********************************************************************************************
983 
984  //**SMP division assignment to sparse vectors***************************************************
985  // No special implementation for the SMP division assignment to sparse vectors.
986  //**********************************************************************************************
987 
988  //**Compile time checks*************************************************************************
995  //**********************************************************************************************
996 };
997 //*************************************************************************************************
998 
999 
1000 
1001 
1002 //=================================================================================================
1003 //
1004 // GLOBAL UNARY ARITHMETIC OPERATORS
1005 //
1006 //=================================================================================================
1007 
1008 //*************************************************************************************************
1025 template< typename VT // Type of the dense vector
1026  , bool TF > // Transpose flag
1027 inline decltype(auto) operator-( const DenseVector<VT,TF>& dv )
1028 {
1030 
1031  using ScalarType = UnderlyingBuiltin_t<VT>;
1033  return ReturnType( ~dv, ScalarType(-1) );
1034 }
1035 //*************************************************************************************************
1036 
1037 
1038 
1039 
1040 //=================================================================================================
1041 //
1042 // GLOBAL BINARY ARITHMETIC OPERATORS
1043 //
1044 //=================================================================================================
1045 
1046 //*************************************************************************************************
1068 template< typename VT // Type of the left-hand side dense vector
1069  , typename ST // Type of the right-hand side scalar
1070  , bool TF // Transpose flag
1071  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1072 inline decltype(auto) operator*( const DenseVector<VT,TF>& vec, ST scalar )
1073 {
1075 
1076  using ScalarType = MultTrait_t< UnderlyingBuiltin_t<VT>, ST >;
1078  return ReturnType( ~vec, scalar );
1079 }
1080 //*************************************************************************************************
1081 
1082 
1083 //*************************************************************************************************
1105 template< typename ST // Type of the left-hand side scalar
1106  , typename VT // Type of the right-hand side dense vector
1107  , bool TF // Transpose flag
1108  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1109 inline decltype(auto) operator*( ST scalar, const DenseVector<VT,TF>& vec )
1110 {
1112 
1113  using ScalarType = MultTrait_t< ST, UnderlyingBuiltin_t<VT> >;
1115  return ReturnType( ~vec, scalar );
1116 }
1117 //*************************************************************************************************
1118 
1119 
1120 
1121 
1122 //=================================================================================================
1123 //
1124 // GLOBAL FUNCTIONS
1125 //
1126 //=================================================================================================
1127 
1128 //*************************************************************************************************
1146 template< typename VT // Type of the dense vector
1147  , bool TF > // Transpose flag
1148 inline decltype(auto) normalize( const DenseVector<VT,TF>& vec )
1149 {
1151 
1153 
1154  const ElementType len ( length( ~vec ) );
1155  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1156 
1158  return ReturnType( ~vec, ilen );
1159 }
1160 //*************************************************************************************************
1161 
1162 
1163 
1164 
1165 //=================================================================================================
1166 //
1167 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1168 //
1169 //=================================================================================================
1170 
1171 //*************************************************************************************************
1183 template< typename VT // Type of the dense vector
1184  , typename ST // Type of the scalar
1185  , bool TF > // Transpose flag
1186 inline decltype(auto) operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1187 {
1189 
1190  using ReturnType = const DVecScalarMultExpr<VT,ST,TF>;
1191  return ReturnType( dv.leftOperand(), -dv.rightOperand() );
1192 }
1194 //*************************************************************************************************
1195 
1196 
1197 
1198 
1199 //=================================================================================================
1200 //
1201 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1202 //
1203 //=================================================================================================
1204 
1205 //*************************************************************************************************
1218 template< typename VT // Type of the dense vector of the left-hand side expression
1219  , typename ST1 // Type of the scalar of the left-hand side expression
1220  , bool TF // Transpose flag of the dense vector
1221  , typename ST2 // Type of the right-hand side scalar
1222  , EnableIf_t< IsNumeric_v<ST2> >* = nullptr >
1223 inline decltype(auto) operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1224 {
1226 
1227  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1228 }
1230 //*************************************************************************************************
1231 
1232 
1233 //*************************************************************************************************
1246 template< typename ST1 // Type of the left-hand side scalar
1247  , typename VT // Type of the dense vector of the right-hand side expression
1248  , typename ST2 // Type of the scalar of the right-hand side expression
1249  , bool TF // Transpose flag of the dense vector
1250  , EnableIf_t< IsNumeric_v<ST1> >* = nullptr >
1251 inline decltype(auto) operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1252 {
1254 
1255  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1256 }
1258 //*************************************************************************************************
1259 
1260 
1261 //*************************************************************************************************
1274 template< typename VT // Type of the dense vector of the left-hand side expression
1275  , typename ST1 // Type of the scalar of the left-hand side expression
1276  , bool TF // Transpose flag of the dense vector
1277  , typename ST2 // Type of the right-hand side scalar
1278  , EnableIf_t< ( IsNumeric_v<ST2> && ( IsInvertible_v<ST1> || IsInvertible_v<ST2> ) ) >* = nullptr >
1279 inline decltype(auto) operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1280 {
1282 
1283  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1284 }
1286 //*************************************************************************************************
1287 
1288 
1289 //*************************************************************************************************
1303 template< typename VT1 // Type of the dense vector of the left-hand side expression
1304  , typename ST // Type of the scalar of the left-hand side expression
1305  , bool TF // Transpose flag of the dense vectors
1306  , typename VT2 > // Type of the right-hand side dense vector
1307 inline decltype(auto)
1308  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1309 {
1311 
1312  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1313 }
1315 //*************************************************************************************************
1316 
1317 
1318 //*************************************************************************************************
1332 template< typename VT1 // Type of the left-hand side dense vector
1333  , bool TF // Transpose flag of the dense vectors
1334  , typename VT2 // Type of the dense vector of the right-hand side expression
1335  , typename ST > // Type of the scalar of the right-hand side expression
1336 inline decltype(auto)
1337  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1338 {
1340 
1341  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1342 }
1344 //*************************************************************************************************
1345 
1346 
1347 //*************************************************************************************************
1361 template< typename VT1 // Type of the dense vector of the left-hand side expression
1362  , typename ST1 // Type of the scalar of the left-hand side expression
1363  , bool TF // Transpose flag of the dense vectors
1364  , typename VT2 // Type of the dense vector of the right-hand side expression
1365  , typename ST2 > // Type of the scalar of the right-hand side expression
1366 inline decltype(auto)
1367  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1368 {
1370 
1371  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1372 }
1374 //*************************************************************************************************
1375 
1376 
1377 //*************************************************************************************************
1391 template< typename VT1 // Type of the dense vector of the left-hand side expression
1392  , typename ST // Type of the scalar of the left-hand side expression
1393  , typename VT2 > // Type of the right-hand side dense vector
1394 inline decltype(auto)
1395  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1396 {
1398 
1399  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1400 }
1402 //*************************************************************************************************
1403 
1404 
1405 //*************************************************************************************************
1419 template< typename VT1 // Type of the left-hand side dense vector
1420  , typename VT2 // Type of the dense vector of the right-hand side expression
1421  , typename ST > // Type of the scalar of the right-hand side expression
1422 inline decltype(auto)
1423  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1424 {
1426 
1427  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1428 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1447 template< typename VT1 // Type of the dense vector of the left-hand side expression
1448  , typename ST1 // Type of the scalar of the left-hand side expression
1449  , typename VT2 // Type of the dense vector of the right-hand side expression
1450  , typename ST2 > // Type of the scalar of the right-hand side expression
1451 inline decltype(auto)
1452  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1453 {
1455 
1456  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1457 }
1459 //*************************************************************************************************
1460 
1461 
1462 //*************************************************************************************************
1476 template< typename VT1 // Type of the dense vector of the left-hand side expression
1477  , typename ST // Type of the scalar of the left-hand side expression
1478  , bool TF // Transpose flag of the vectors
1479  , typename VT2 > // Type of the right-hand side sparse vector
1480 inline decltype(auto)
1481  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1482 {
1484 
1485  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1486 }
1488 //*************************************************************************************************
1489 
1490 
1491 //*************************************************************************************************
1505 template< typename VT1 // Type of the left-hand side sparse vector
1506  , bool TF // Transpose flag of the vectors
1507  , typename VT2 // Type of the dense vector of the right-hand side expression
1508  , typename ST > // Type of the scalar of the right-hand side expression
1509 inline decltype(auto)
1510  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1511 {
1513 
1514  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1515 }
1517 //*************************************************************************************************
1518 
1519 
1520 //*************************************************************************************************
1535 template< typename VT1 // Type of the dense vector of the left-hand side expression
1536  , typename ST1 // Type of the scalar of the left-hand side expression
1537  , bool TF // Transpose flag of the vectors
1538  , typename VT2 // Type of the sparse vector of the right-hand side expression
1539  , typename ST2 > // Type of the scalar o the right-hand side expression
1540 inline decltype(auto)
1541  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1542 {
1544 
1545  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1546 }
1548 //*************************************************************************************************
1549 
1550 
1551 //*************************************************************************************************
1566 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1567  , typename ST1 // Type of the scalar of the left-hand side expression
1568  , bool TF // Transpose flag of the vectors
1569  , typename VT2 // Type of the dense vector of the right-hand side expression
1570  , typename ST2 > // Type of the scalar o the right-hand side expression
1571 inline decltype(auto)
1572  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1573 {
1575 
1576  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1577 }
1579 //*************************************************************************************************
1580 
1581 
1582 //*************************************************************************************************
1596 template< typename VT1 // Type of the dense vector of the left-hand side expression
1597  , typename ST // Type of the scalar of the left-hand side expression
1598  , typename VT2 > // Type of the right-hand side sparse vector
1599 inline decltype(auto)
1600  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1601 {
1603 
1604  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1605 }
1607 //*************************************************************************************************
1608 
1609 
1610 //*************************************************************************************************
1624 template< typename VT1 // Type of the left-hand side sparse vector
1625  , typename VT2 // Type of the dense vector of the right-hand side expression
1626  , typename ST > // Type of the scalar of the right-hand side expression
1627 inline decltype(auto)
1628  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1629 {
1631 
1632  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1633 }
1635 //*************************************************************************************************
1636 
1637 
1638 //*************************************************************************************************
1653 template< typename VT1 // Type of the dense vector of the left-hand side expression
1654  , typename ST1 // Type of the scalar of the left-hand side expression
1655  , typename VT2 // Type of the sparse vector of the right-hand side expression
1656  , typename ST2 > // Type of the scalar o the right-hand side expression
1657 inline decltype(auto)
1658  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1659 {
1661 
1662  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1663 }
1665 //*************************************************************************************************
1666 
1667 
1668 //*************************************************************************************************
1683 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1684  , typename ST1 // Type of the scalar of the left-hand side expression
1685  , typename VT2 // Type of the dense vector of the right-hand side expression
1686  , typename ST2 > // Type of the scalar o the right-hand side expression
1687 inline decltype(auto)
1688  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1689 {
1691 
1692  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1693 }
1695 //*************************************************************************************************
1696 
1697 
1698 //*************************************************************************************************
1712 template< typename MT // Type of the left-hand side dense matrix
1713  , bool SO // Storage order of the left-hand side dense matrix
1714  , typename VT // Type of the dense vector of the right-hand side expression
1715  , typename ST > // Type of the scalar of the right-hand side expression
1716 inline decltype(auto)
1717  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1718 {
1720 
1721  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1722 }
1724 //*************************************************************************************************
1725 
1726 
1727 //*************************************************************************************************
1741 template< typename VT // Type of the dense vector of the left-hand side expression
1742  , typename ST // Type of the scalar of the left-hand side expression
1743  , typename MT // Type of the right-hand side dense matrix
1744  , bool SO > // Storage order of the right-hand side dense matrix
1745 inline decltype(auto)
1746  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1747 {
1749 
1750  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1751 }
1753 //*************************************************************************************************
1754 
1755 
1756 //*************************************************************************************************
1770 template< typename MT // Type of the left-hand side sparse matrix
1771  , bool SO // Storage order of the left-hand side sparse matrix
1772  , typename VT // Type of the dense vector of the right-hand side expression
1773  , typename ST > // Type of the scalar of the right-hand side expression
1774 inline decltype(auto)
1775  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1776 {
1778 
1779  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1780 }
1782 //*************************************************************************************************
1783 
1784 
1785 //*************************************************************************************************
1799 template< typename VT // Type of the dense vector of the left-hand side expression
1800  , typename ST // Type of the scalar of the left-hand side expression
1801  , typename MT // Type of the right-hand side sparse matrix
1802  , bool SO > // Storage order of the right-hand side sparse matrix
1803 inline decltype(auto)
1804  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1805 {
1807 
1808  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1809 }
1811 //*************************************************************************************************
1812 
1813 
1814 
1815 
1816 //=================================================================================================
1817 //
1818 // ISALIGNED SPECIALIZATIONS
1819 //
1820 //=================================================================================================
1821 
1822 //*************************************************************************************************
1824 template< typename VT, typename ST, bool TF >
1825 struct IsAligned< DVecScalarMultExpr<VT,ST,TF> >
1826  : public IsAligned<VT>
1827 {};
1829 //*************************************************************************************************
1830 
1831 
1832 
1833 
1834 //=================================================================================================
1835 //
1836 // ISPADDED SPECIALIZATIONS
1837 //
1838 //=================================================================================================
1839 
1840 //*************************************************************************************************
1842 template< typename VT, typename ST, bool TF >
1843 struct IsPadded< DVecScalarMultExpr<VT,ST,TF> >
1844  : public IsPadded<VT>
1845 {};
1847 //*************************************************************************************************
1848 
1849 } // namespace blaze
1850 
1851 #endif
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:567
Pointer difference type of the Blaze library.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:523
Header file for auxiliary alias declarations.
Data type constraint.
Constraint on the data type.
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the multiplication expression.
Definition: DVecScalarMultExpr.h:134
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:163
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:162
Header file for basic type definitions.
Header file for the SparseVector base class.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:481
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:533
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:166
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:254
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:193
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecScalarMultExpr.h:428
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:513
Header file for the DenseVector base class.
If_t< useAssign, const ResultType, const DVecScalarMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:169
ConstIterator_t< VT > IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:199
Header file for the Computation base class.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:295
Header file for the UnderlyingElement type trait.
Header file for the RequiresEvaluation type trait.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:306
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:208
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the VecScalarMultExpr base class.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:503
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DVecScalarMultExpr.h:433
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:185
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:186
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the length (magnitude) of the dense vector .
Definition: DenseVector.h:606
Header file for the SparseMatrix base class.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecScalarMultExpr.h:467
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:187
Header file for the UnderlyingBuiltin type trait.
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#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
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:181
Header file for the DenseMatrix base class.
decltype(auto) normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1148
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:350
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:493
Header file for all SIMD functionality.
ResultType_t< VT > RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:107
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:71
Header file for the IsAligned type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the exception macros of the math module.
If_t< IsExpression_v< VT >, const VT, const VT &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:172
Constraint on the data type.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:584
Header file for all forward declarations for expression class templates.
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_t alias declar...
Definition: UnderlyingBuiltin.h:133
Header file for the EnableIf class template.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:243
Header file for the IsPadded type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:557
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:372
decltype(std::declval< RN >() *std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:123
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:195
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarMultExpr.h:188
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:384
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:328
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:585
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarMultExpr.h:454
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:67
CompositeType_t< VT > CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:110
Header file for the HasSIMDMult type trait.
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:577
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:192
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:415
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:317
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:396
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
MultTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:161
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
ElementType_t< VT > ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:109
Header file for the IsInvertible type trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:408
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:545
Header file for the IsComputation type trait class.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:339
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarMultExpr.h:275
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:101
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:220
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
DVecScalarMultExpr(const VT &vector, ST scalar) noexcept
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:442
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:189
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:138
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarMultExpr.h:232
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DVecScalarMultExpr.h:120
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:285
ReturnType_t< VT > RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:108
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:361
System settings for the inline keywords.
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:416
#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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:191
#define BLAZE_CONSTRAINT_MUST_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is not a floating point data type...
Definition: FloatingPoint.h:61
Header file for the IsExpression type trait class.
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:194
Header file for the function trace functionality.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:264
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:175
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecScalarMultExpr.h:423