Blaze  3.6
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>
71 #include <blaze/system/Inline.h>
73 #include <blaze/util/Assert.h>
77 #include <blaze/util/EnableIf.h>
79 #include <blaze/util/mpl/If.h>
80 #include <blaze/util/Types.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // CLASS DVECSCALARMULTEXPR
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
99 template< typename VT // Type of the left-hand side dense vector
100  , typename ST // Type of the right-hand side scalar value
101  , bool TF > // Transpose flag
103  : public VecScalarMultExpr< DenseVector< DVecScalarMultExpr<VT,ST,TF>, TF > >
104  , private Computation
105 {
106  private:
107  //**Type definitions****************************************************************************
112  //**********************************************************************************************
113 
114  //**Return type evaluation**********************************************************************
116 
121  static constexpr bool returnExpr = !IsTemporary_v<RN>;
122 
124  using ExprReturnType = decltype( std::declval<RN>() * std::declval<ST>() );
125  //**********************************************************************************************
126 
127  //**Serial evaluation strategy******************************************************************
129 
135  static constexpr bool useAssign = ( IsComputation_v<VT> && RequiresEvaluation_v<VT> );
136 
138  template< typename VT2 >
140  static constexpr bool UseAssign_v = useAssign;
142  //**********************************************************************************************
143 
144  //**Parallel evaluation strategy****************************************************************
146 
152  template< typename VT2 >
153  static constexpr bool UseSMPAssign_v =
154  ( ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign );
156  //**********************************************************************************************
157 
158  public:
159  //**Type definitions****************************************************************************
165 
168 
171 
173  using LeftOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
174 
176  using RightOperand = ST;
177  //**********************************************************************************************
178 
179  //**ConstIterator class definition**************************************************************
183  {
184  public:
185  //**Type definitions*************************************************************************
186  using IteratorCategory = std::random_access_iterator_tag;
191 
192  // STL iterator requirements
198 
201  //*******************************************************************************************
202 
203  //**Constructor******************************************************************************
209  explicit inline BLAZE_DEVICE_CALLABLE ConstIterator( IteratorType iterator, RightOperand scalar )
210  : iterator_( iterator ) // Iterator to the current element
211  , scalar_ ( scalar ) // Scalar of the multiplication expression
212  {}
213  //*******************************************************************************************
214 
215  //**Addition assignment operator*************************************************************
222  iterator_ += inc;
223  return *this;
224  }
225  //*******************************************************************************************
226 
227  //**Subtraction assignment operator**********************************************************
234  iterator_ -= dec;
235  return *this;
236  }
237  //*******************************************************************************************
238 
239  //**Prefix increment operator****************************************************************
245  ++iterator_;
246  return *this;
247  }
248  //*******************************************************************************************
249 
250  //**Postfix increment operator***************************************************************
256  return ConstIterator( iterator_++, scalar_ );
257  }
258  //*******************************************************************************************
259 
260  //**Prefix decrement operator****************************************************************
266  --iterator_;
267  return *this;
268  }
269  //*******************************************************************************************
270 
271  //**Postfix decrement operator***************************************************************
277  return ConstIterator( iterator_--, scalar_ );
278  }
279  //*******************************************************************************************
280 
281  //**Element access operator******************************************************************
287  return *iterator_ * scalar_;
288  }
289  //*******************************************************************************************
290 
291  //**Load function****************************************************************************
296  inline auto load() const noexcept {
297  return iterator_.load() * set( scalar_ );
298  }
299  //*******************************************************************************************
300 
301  //**Equality operator************************************************************************
307  inline BLAZE_DEVICE_CALLABLE bool operator==( const ConstIterator& rhs ) const {
308  return iterator_ == rhs.iterator_;
309  }
310  //*******************************************************************************************
311 
312  //**Inequality operator**********************************************************************
318  inline BLAZE_DEVICE_CALLABLE bool operator!=( const ConstIterator& rhs ) const {
319  return iterator_ != rhs.iterator_;
320  }
321  //*******************************************************************************************
322 
323  //**Less-than operator***********************************************************************
329  inline BLAZE_DEVICE_CALLABLE bool operator<( const ConstIterator& rhs ) const {
330  return iterator_ < rhs.iterator_;
331  }
332  //*******************************************************************************************
333 
334  //**Greater-than operator********************************************************************
340  inline BLAZE_DEVICE_CALLABLE bool operator>( const ConstIterator& rhs ) const {
341  return iterator_ > rhs.iterator_;
342  }
343  //*******************************************************************************************
344 
345  //**Less-or-equal-than operator**************************************************************
351  inline BLAZE_DEVICE_CALLABLE bool operator<=( const ConstIterator& rhs ) const {
352  return iterator_ <= rhs.iterator_;
353  }
354  //*******************************************************************************************
355 
356  //**Greater-or-equal-than operator***********************************************************
362  inline BLAZE_DEVICE_CALLABLE bool operator>=( const ConstIterator& rhs ) const {
363  return iterator_ >= rhs.iterator_;
364  }
365  //*******************************************************************************************
366 
367  //**Subtraction operator*********************************************************************
374  return iterator_ - rhs.iterator_;
375  }
376  //*******************************************************************************************
377 
378  //**Addition operator************************************************************************
385  friend inline BLAZE_DEVICE_CALLABLE const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
386  return ConstIterator( it.iterator_ + inc, it.scalar_ );
387  }
388  //*******************************************************************************************
389 
390  //**Addition operator************************************************************************
397  friend inline BLAZE_DEVICE_CALLABLE const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
398  return ConstIterator( it.iterator_ + inc, it.scalar_ );
399  }
400  //*******************************************************************************************
401 
402  //**Subtraction operator*********************************************************************
409  friend inline BLAZE_DEVICE_CALLABLE const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
410  return ConstIterator( it.iterator_ - dec, it.scalar_ );
411  }
412  //*******************************************************************************************
413 
414  private:
415  //**Member variables*************************************************************************
418  //*******************************************************************************************
419  };
420  //**********************************************************************************************
421 
422  //**Compilation flags***************************************************************************
424  static constexpr bool simdEnabled =
425  ( VT::simdEnabled && IsNumeric_v<ET> &&
426  ( HasSIMDMult_v<ET,ST> || HasSIMDMult_v<UnderlyingElement_t<ET>,ST> ) );
427 
429  static constexpr bool smpAssignable = VT::smpAssignable;
430  //**********************************************************************************************
431 
432  //**SIMD properties*****************************************************************************
434  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
435  //**********************************************************************************************
436 
437  //**Constructor*********************************************************************************
443  explicit inline DVecScalarMultExpr( const VT& vector, ST scalar ) noexcept
444  : vector_( vector ) // Left-hand side dense vector of the multiplication expression
445  , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
446  {}
447  //**********************************************************************************************
448 
449  //**Subscript operator**************************************************************************
455  inline ReturnType operator[]( size_t index ) const {
456  BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
457  return vector_[index] * scalar_;
458  }
459  //**********************************************************************************************
460 
461  //**At function*********************************************************************************
468  inline ReturnType at( size_t index ) const {
469  if( index >= vector_.size() ) {
470  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
471  }
472  return (*this)[index];
473  }
474  //**********************************************************************************************
475 
476  //**Load function*******************************************************************************
482  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
483  BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
484  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
485  return vector_.load( index ) * set( scalar_ );
486  }
487  //**********************************************************************************************
488 
489  //**Begin function******************************************************************************
494  inline ConstIterator begin() const {
495  return ConstIterator( vector_.begin(), scalar_ );
496  }
497  //**********************************************************************************************
498 
499  //**End function********************************************************************************
504  inline ConstIterator end() const {
505  return ConstIterator( vector_.end(), scalar_ );
506  }
507  //**********************************************************************************************
508 
509  //**Size function*******************************************************************************
514  inline size_t size() const noexcept {
515  return vector_.size();
516  }
517  //**********************************************************************************************
518 
519  //**Left operand access*************************************************************************
524  inline LeftOperand leftOperand() const noexcept {
525  return vector_;
526  }
527  //**********************************************************************************************
528 
529  //**Right operand access************************************************************************
534  inline RightOperand rightOperand() const noexcept {
535  return scalar_;
536  }
537  //**********************************************************************************************
538 
539  //**********************************************************************************************
545  template< typename T >
546  inline bool canAlias( const T* alias ) const noexcept {
547  return IsExpression_v<VT> && vector_.canAlias( alias );
548  }
549  //**********************************************************************************************
550 
551  //**********************************************************************************************
557  template< typename T >
558  inline bool isAliased( const T* alias ) const noexcept {
559  return vector_.isAliased( alias );
560  }
561  //**********************************************************************************************
562 
563  //**********************************************************************************************
568  inline bool isAligned() const noexcept {
569  return vector_.isAligned();
570  }
571  //**********************************************************************************************
572 
573  //**********************************************************************************************
578  inline bool canSMPAssign() const noexcept {
579  return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
580  }
581  //**********************************************************************************************
582 
583  private:
584  //**Member variables****************************************************************************
587  //**********************************************************************************************
588 
589  //**Assignment to dense vectors*****************************************************************
603  template< typename VT2 > // Type of the target dense vector
604  friend inline auto assign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
606  {
608 
609  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
610 
611  assign( ~lhs, rhs.vector_ );
612  assign( ~lhs, (~lhs) * rhs.scalar_ );
613  }
615  //**********************************************************************************************
616 
617  //**Assignment to sparse vectors****************************************************************
631  template< typename VT2 > // Type of the target sparse vector
632  friend inline auto assign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
634  {
636 
637  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
638 
639  assign( ~lhs, rhs.vector_ );
640  (~lhs) *= rhs.scalar_;
641  }
643  //**********************************************************************************************
644 
645  //**Addition assignment to dense vectors********************************************************
659  template< typename VT2 > // Type of the target dense vector
660  friend inline auto addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
661  -> EnableIf_t< UseAssign_v<VT2> >
662  {
664 
668 
669  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
670 
671  const ResultType tmp( serial( rhs ) );
672  addAssign( ~lhs, tmp );
673  }
675  //**********************************************************************************************
676 
677  //**Addition assignment to sparse vectors*******************************************************
678  // No special implementation for the addition assignment to sparse vectors.
679  //**********************************************************************************************
680 
681  //**Subtraction assignment to dense vectors*****************************************************
695  template< typename VT2 > // Type of the target dense vector
696  friend inline auto subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
697  -> EnableIf_t< UseAssign_v<VT2> >
698  {
700 
704 
705  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
706 
707  const ResultType tmp( serial( rhs ) );
708  subAssign( ~lhs, tmp );
709  }
711  //**********************************************************************************************
712 
713  //**Subtraction assignment to sparse vectors****************************************************
714  // No special implementation for the subtraction assignment to sparse vectors.
715  //**********************************************************************************************
716 
717  //**Multiplication assignment to dense vectors**************************************************
731  template< typename VT2 > // Type of the target dense vector
732  friend inline auto multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
733  -> EnableIf_t< UseAssign_v<VT2> >
734  {
736 
740 
741  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
742 
743  const ResultType tmp( serial( rhs ) );
744  multAssign( ~lhs, tmp );
745  }
747  //**********************************************************************************************
748 
749  //**Multiplication assignment to sparse vectors*************************************************
750  // No special implementation for the multiplication assignment to sparse vectors.
751  //**********************************************************************************************
752 
753  //**Division assignment to dense vectors********************************************************
767  template< typename VT2 > // Type of the target dense vector
768  friend inline auto divAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
769  -> EnableIf_t< UseAssign_v<VT2> >
770  {
772 
776 
777  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
778 
779  const ResultType tmp( serial( rhs ) );
780  divAssign( ~lhs, tmp );
781  }
783  //**********************************************************************************************
784 
785  //**Division assignment to sparse vectors*******************************************************
786  // No special implementation for the division assignment to sparse vectors.
787  //**********************************************************************************************
788 
789  //**SMP assignment to dense vectors*************************************************************
803  template< typename VT2 > // Type of the target dense vector
804  friend inline auto smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
805  -> EnableIf_t< UseSMPAssign_v<VT2> >
806  {
808 
809  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
810 
811  smpAssign( ~lhs, rhs.vector_ );
812  smpAssign( ~lhs, (~lhs) * rhs.scalar_ );
813  }
815  //**********************************************************************************************
816 
817  //**SMP assignment to sparse vectors************************************************************
831  template< typename VT2 > // Type of the target sparse vector
832  friend inline auto smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
833  -> EnableIf_t< UseSMPAssign_v<VT2> >
834  {
836 
837  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
838 
839  smpAssign( ~lhs, rhs.vector_ );
840  (~lhs) *= rhs.scalar_;
841  }
843  //**********************************************************************************************
844 
845  //**SMP addition assignment to dense vectors****************************************************
859  template< typename VT2 > // Type of the target dense vector
860  friend inline auto smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
861  -> EnableIf_t< UseSMPAssign_v<VT2> >
862  {
864 
868 
869  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
870 
871  const ResultType tmp( rhs );
872  smpAddAssign( ~lhs, tmp );
873  }
875  //**********************************************************************************************
876 
877  //**SMP addition assignment to sparse vectors***************************************************
878  // No special implementation for the SMP addition assignment to sparse vectors.
879  //**********************************************************************************************
880 
881  //**SMP subtraction assignment to dense vectors*************************************************
895  template< typename VT2 > // Type of the target dense vector
896  friend inline auto smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
897  -> EnableIf_t< UseSMPAssign_v<VT2> >
898  {
900 
904 
905  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
906 
907  const ResultType tmp( rhs );
908  smpSubAssign( ~lhs, tmp );
909  }
911  //**********************************************************************************************
912 
913  //**SMP subtraction assignment to sparse vectors************************************************
914  // No special implementation for the SMP subtraction assignment to sparse vectors.
915  //**********************************************************************************************
916 
917  //**SMP multiplication assignment to dense vectors**********************************************
931  template< typename VT2 > // Type of the target dense vector
932  friend inline auto smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
933  -> EnableIf_t< UseSMPAssign_v<VT2> >
934  {
936 
940 
941  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
942 
943  const ResultType tmp( rhs );
944  smpMultAssign( ~lhs, tmp );
945  }
947  //**********************************************************************************************
948 
949  //**SMP multiplication assignment to sparse vectors*********************************************
950  // No special implementation for the SMP multiplication assignment to sparse vectors.
951  //**********************************************************************************************
952 
953  //**SMP division assignment to dense vectors****************************************************
967  template< typename VT2 > // Type of the target dense vector
968  friend inline auto smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecScalarMultExpr& rhs )
969  -> EnableIf_t< UseSMPAssign_v<VT2> >
970  {
972 
976 
977  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
978 
979  const ResultType tmp( rhs );
980  smpDivAssign( ~lhs, tmp );
981  }
983  //**********************************************************************************************
984 
985  //**SMP division assignment to sparse vectors***************************************************
986  // No special implementation for the SMP division assignment to sparse vectors.
987  //**********************************************************************************************
988 
989  //**Compile time checks*************************************************************************
996  //**********************************************************************************************
997 };
998 //*************************************************************************************************
999 
1000 
1001 
1002 
1003 //=================================================================================================
1004 //
1005 // GLOBAL UNARY ARITHMETIC OPERATORS
1006 //
1007 //=================================================================================================
1008 
1009 //*************************************************************************************************
1026 template< typename VT // Type of the dense vector
1027  , bool TF > // Transpose flag
1028 inline decltype(auto) operator-( const DenseVector<VT,TF>& dv )
1029 {
1031 
1032  using ScalarType = UnderlyingBuiltin_t<VT>;
1033  using ReturnType = const DVecScalarMultExpr<VT,ScalarType,TF>;
1034  return ReturnType( ~dv, ScalarType(-1) );
1035 }
1036 //*************************************************************************************************
1037 
1038 
1039 
1040 
1041 //=================================================================================================
1042 //
1043 // GLOBAL BINARY ARITHMETIC OPERATORS
1044 //
1045 //=================================================================================================
1046 
1047 //*************************************************************************************************
1069 template< typename VT // Type of the left-hand side dense vector
1070  , typename ST // Type of the right-hand side scalar
1071  , bool TF // Transpose flag
1072  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1073 inline decltype(auto) operator*( const DenseVector<VT,TF>& vec, ST scalar )
1074 {
1076 
1077  using ScalarType = MultTrait_t< UnderlyingBuiltin_t<VT>, ST >;
1078  using ReturnType = const DVecScalarMultExpr<VT,ScalarType,TF>;
1079  return ReturnType( ~vec, scalar );
1080 }
1081 //*************************************************************************************************
1082 
1083 
1084 //*************************************************************************************************
1106 template< typename ST // Type of the left-hand side scalar
1107  , typename VT // Type of the right-hand side dense vector
1108  , bool TF // Transpose flag
1109  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1110 inline decltype(auto) operator*( ST scalar, const DenseVector<VT,TF>& vec )
1111 {
1113 
1114  using ScalarType = MultTrait_t< ST, UnderlyingBuiltin_t<VT> >;
1115  using ReturnType = const DVecScalarMultExpr<VT,ScalarType,TF>;
1116  return ReturnType( ~vec, scalar );
1117 }
1118 //*************************************************************************************************
1119 
1120 
1121 
1122 
1123 //=================================================================================================
1124 //
1125 // GLOBAL FUNCTIONS
1126 //
1127 //=================================================================================================
1128 
1129 //*************************************************************************************************
1147 template< typename VT // Type of the dense vector
1148  , bool TF > // Transpose flag
1149 inline decltype(auto) normalize( const DenseVector<VT,TF>& vec )
1150 {
1151  using ElementType = ElementType_t<VT>;
1152 
1154 
1155  const ElementType len ( length( ~vec ) );
1156  const ElementType ilen( ( len != ElementType(0) )?( ElementType(1) / len ):( 0 ) );
1157 
1158  using ReturnType = const DVecScalarMultExpr<VT,ElementType,TF>;
1159  return ReturnType( ~vec, ilen );
1160 }
1161 //*************************************************************************************************
1162 
1163 
1164 
1165 
1166 //=================================================================================================
1167 //
1168 // GLOBAL RESTRUCTURING UNARY ARITHMETIC OPERATORS
1169 //
1170 //=================================================================================================
1171 
1172 //*************************************************************************************************
1184 template< typename VT // Type of the dense vector
1185  , typename ST // Type of the scalar
1186  , bool TF > // Transpose flag
1187 inline decltype(auto) operator-( const DVecScalarMultExpr<VT,ST,TF>& dv )
1188 {
1190 
1191  using ReturnType = const DVecScalarMultExpr<VT,ST,TF>;
1192  return ReturnType( dv.leftOperand(), -dv.rightOperand() );
1193 }
1195 //*************************************************************************************************
1196 
1197 
1198 
1199 
1200 //=================================================================================================
1201 //
1202 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1203 //
1204 //=================================================================================================
1205 
1206 //*************************************************************************************************
1219 template< typename VT // Type of the dense vector of the left-hand side expression
1220  , typename ST1 // Type of the scalar of the left-hand side expression
1221  , bool TF // Transpose flag of the dense vector
1222  , typename ST2 // Type of the right-hand side scalar
1223  , EnableIf_t< IsNumeric_v<ST2> >* = nullptr >
1224 inline decltype(auto) operator*( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1225 {
1227 
1228  return vec.leftOperand() * ( vec.rightOperand() * scalar );
1229 }
1231 //*************************************************************************************************
1232 
1233 
1234 //*************************************************************************************************
1247 template< typename ST1 // Type of the left-hand side scalar
1248  , typename VT // Type of the dense vector of the right-hand side expression
1249  , typename ST2 // Type of the scalar of the right-hand side expression
1250  , bool TF // Transpose flag of the dense vector
1251  , EnableIf_t< IsNumeric_v<ST1> >* = nullptr >
1252 inline decltype(auto) operator*( ST1 scalar, const DVecScalarMultExpr<VT,ST2,TF>& vec )
1253 {
1255 
1256  return vec.leftOperand() * ( scalar * vec.rightOperand() );
1257 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1275 template< typename VT // Type of the dense vector of the left-hand side expression
1276  , typename ST1 // Type of the scalar of the left-hand side expression
1277  , bool TF // Transpose flag of the dense vector
1278  , typename ST2 // Type of the right-hand side scalar
1279  , EnableIf_t< ( IsNumeric_v<ST2> && ( IsInvertible_v<ST1> || IsInvertible_v<ST2> ) ) >* = nullptr >
1280 inline decltype(auto) operator/( const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1281 {
1283 
1284  return vec.leftOperand() * ( vec.rightOperand() / scalar );
1285 }
1287 //*************************************************************************************************
1288 
1289 
1290 //*************************************************************************************************
1304 template< typename VT1 // Type of the dense vector of the left-hand side expression
1305  , typename ST // Type of the scalar of the left-hand side expression
1306  , bool TF // Transpose flag of the dense vectors
1307  , typename VT2 > // Type of the right-hand side dense vector
1308 inline decltype(auto)
1309  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1310 {
1312 
1313  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1314 }
1316 //*************************************************************************************************
1317 
1318 
1319 //*************************************************************************************************
1333 template< typename VT1 // Type of the left-hand side dense vector
1334  , bool TF // Transpose flag of the dense vectors
1335  , typename VT2 // Type of the dense vector of the right-hand side expression
1336  , typename ST > // Type of the scalar of the right-hand side expression
1337 inline decltype(auto)
1338  operator*( const DenseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1339 {
1341 
1342  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1343 }
1345 //*************************************************************************************************
1346 
1347 
1348 //*************************************************************************************************
1362 template< typename VT1 // Type of the dense vector of the left-hand side expression
1363  , typename ST1 // Type of the scalar of the left-hand side expression
1364  , bool TF // Transpose flag of the dense vectors
1365  , typename VT2 // Type of the dense vector of the right-hand side expression
1366  , typename ST2 > // Type of the scalar of the right-hand side expression
1367 inline decltype(auto)
1368  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1369 {
1371 
1372  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1373 }
1375 //*************************************************************************************************
1376 
1377 
1378 //*************************************************************************************************
1392 template< typename VT1 // Type of the dense vector of the left-hand side expression
1393  , typename ST // Type of the scalar of the left-hand side expression
1394  , typename VT2 > // Type of the right-hand side dense vector
1395 inline decltype(auto)
1396  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const DenseVector<VT2,true>& rhs )
1397 {
1399 
1400  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1401 }
1403 //*************************************************************************************************
1404 
1405 
1406 //*************************************************************************************************
1420 template< typename VT1 // Type of the left-hand side dense vector
1421  , typename VT2 // Type of the dense vector of the right-hand side expression
1422  , typename ST > // Type of the scalar of the right-hand side expression
1423 inline decltype(auto)
1424  operator*( const DenseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1425 {
1427 
1428  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1429 }
1431 //*************************************************************************************************
1432 
1433 
1434 //*************************************************************************************************
1448 template< typename VT1 // Type of the dense vector of the left-hand side expression
1449  , typename ST1 // Type of the scalar of the left-hand side expression
1450  , typename VT2 // Type of the dense vector of the right-hand side expression
1451  , typename ST2 > // Type of the scalar of the right-hand side expression
1452 inline decltype(auto)
1453  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1454 {
1456 
1457  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1458 }
1460 //*************************************************************************************************
1461 
1462 
1463 //*************************************************************************************************
1477 template< typename VT1 // Type of the dense vector of the left-hand side expression
1478  , typename ST // Type of the scalar of the left-hand side expression
1479  , bool TF // Transpose flag of the vectors
1480  , typename VT2 > // Type of the right-hand side sparse vector
1481 inline decltype(auto)
1482  operator*( const DVecScalarMultExpr<VT1,ST,TF>& lhs, const SparseVector<VT2,TF>& rhs )
1483 {
1485 
1486  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1487 }
1489 //*************************************************************************************************
1490 
1491 
1492 //*************************************************************************************************
1506 template< typename VT1 // Type of the left-hand side sparse vector
1507  , bool TF // Transpose flag of the vectors
1508  , typename VT2 // Type of the dense vector of the right-hand side expression
1509  , typename ST > // Type of the scalar of the right-hand side expression
1510 inline decltype(auto)
1511  operator*( const SparseVector<VT1,TF>& lhs, const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1512 {
1514 
1515  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1516 }
1518 //*************************************************************************************************
1519 
1520 
1521 //*************************************************************************************************
1536 template< typename VT1 // Type of the dense vector of the left-hand side expression
1537  , typename ST1 // Type of the scalar of the left-hand side expression
1538  , bool TF // Transpose flag of the vectors
1539  , typename VT2 // Type of the sparse vector of the right-hand side expression
1540  , typename ST2 > // Type of the scalar o the right-hand side expression
1541 inline decltype(auto)
1542  operator*( const DVecScalarMultExpr<VT1,ST1,TF>& lhs, const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1543 {
1545 
1546  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1547 }
1549 //*************************************************************************************************
1550 
1551 
1552 //*************************************************************************************************
1567 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1568  , typename ST1 // Type of the scalar of the left-hand side expression
1569  , bool TF // Transpose flag of the vectors
1570  , typename VT2 // Type of the dense vector of the right-hand side expression
1571  , typename ST2 > // Type of the scalar o the right-hand side expression
1572 inline decltype(auto)
1573  operator*( const SVecScalarMultExpr<VT1,ST1,TF>& lhs, const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1574 {
1576 
1577  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1578 }
1580 //*************************************************************************************************
1581 
1582 
1583 //*************************************************************************************************
1597 template< typename VT1 // Type of the dense vector of the left-hand side expression
1598  , typename ST // Type of the scalar of the left-hand side expression
1599  , typename VT2 > // Type of the right-hand side sparse vector
1600 inline decltype(auto)
1601  operator*( const DVecScalarMultExpr<VT1,ST,false>& lhs, const SparseVector<VT2,true>& rhs )
1602 {
1604 
1605  return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1606 }
1608 //*************************************************************************************************
1609 
1610 
1611 //*************************************************************************************************
1625 template< typename VT1 // Type of the left-hand side sparse vector
1626  , typename VT2 // Type of the dense vector of the right-hand side expression
1627  , typename ST > // Type of the scalar of the right-hand side expression
1628 inline decltype(auto)
1629  operator*( const SparseVector<VT1,false>& lhs, const DVecScalarMultExpr<VT2,ST,true>& rhs )
1630 {
1632 
1633  return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1634 }
1636 //*************************************************************************************************
1637 
1638 
1639 //*************************************************************************************************
1654 template< typename VT1 // Type of the dense vector of the left-hand side expression
1655  , typename ST1 // Type of the scalar of the left-hand side expression
1656  , typename VT2 // Type of the sparse vector of the right-hand side expression
1657  , typename ST2 > // Type of the scalar o the right-hand side expression
1658 inline decltype(auto)
1659  operator*( const DVecScalarMultExpr<VT1,ST1,false>& lhs, const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1660 {
1662 
1663  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1664 }
1666 //*************************************************************************************************
1667 
1668 
1669 //*************************************************************************************************
1684 template< typename VT1 // Type of the sparse vector of the left-hand side expression
1685  , typename ST1 // Type of the scalar of the left-hand side expression
1686  , typename VT2 // Type of the dense vector of the right-hand side expression
1687  , typename ST2 > // Type of the scalar o the right-hand side expression
1688 inline decltype(auto)
1689  operator*( const SVecScalarMultExpr<VT1,ST1,false>& lhs, const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1690 {
1692 
1693  return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1694 }
1696 //*************************************************************************************************
1697 
1698 
1699 //*************************************************************************************************
1713 template< typename MT // Type of the left-hand side dense matrix
1714  , bool SO // Storage order of the left-hand side dense matrix
1715  , typename VT // Type of the dense vector of the right-hand side expression
1716  , typename ST > // Type of the scalar of the right-hand side expression
1717 inline decltype(auto)
1718  operator*( const DenseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1719 {
1721 
1722  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1723 }
1725 //*************************************************************************************************
1726 
1727 
1728 //*************************************************************************************************
1742 template< typename VT // Type of the dense vector of the left-hand side expression
1743  , typename ST // Type of the scalar of the left-hand side expression
1744  , typename MT // Type of the right-hand side dense matrix
1745  , bool SO > // Storage order of the right-hand side dense matrix
1746 inline decltype(auto)
1747  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const DenseMatrix<MT,SO>& mat )
1748 {
1750 
1751  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1752 }
1754 //*************************************************************************************************
1755 
1756 
1757 //*************************************************************************************************
1771 template< typename MT // Type of the left-hand side sparse matrix
1772  , bool SO // Storage order of the left-hand side sparse matrix
1773  , typename VT // Type of the dense vector of the right-hand side expression
1774  , typename ST > // Type of the scalar of the right-hand side expression
1775 inline decltype(auto)
1776  operator*( const SparseMatrix<MT,SO>& mat, const DVecScalarMultExpr<VT,ST,false>& vec )
1777 {
1779 
1780  return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1781 }
1783 //*************************************************************************************************
1784 
1785 
1786 //*************************************************************************************************
1800 template< typename VT // Type of the dense vector of the left-hand side expression
1801  , typename ST // Type of the scalar of the left-hand side expression
1802  , typename MT // Type of the right-hand side sparse matrix
1803  , bool SO > // Storage order of the right-hand side sparse matrix
1804 inline decltype(auto)
1805  operator*( const DVecScalarMultExpr<VT,ST,true>& vec, const SparseMatrix<MT,SO>& mat )
1806 {
1808 
1809  return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1810 }
1812 //*************************************************************************************************
1813 
1814 
1815 
1816 
1817 //=================================================================================================
1818 //
1819 // ISALIGNED SPECIALIZATIONS
1820 //
1821 //=================================================================================================
1822 
1823 //*************************************************************************************************
1825 template< typename VT, typename ST, bool TF >
1826 struct IsAligned< DVecScalarMultExpr<VT,ST,TF> >
1827  : public IsAligned<VT>
1828 {};
1830 //*************************************************************************************************
1831 
1832 
1833 
1834 
1835 //=================================================================================================
1836 //
1837 // ISPADDED SPECIALIZATIONS
1838 //
1839 //=================================================================================================
1840 
1841 //*************************************************************************************************
1843 template< typename VT, typename ST, bool TF >
1844 struct IsPadded< DVecScalarMultExpr<VT,ST,TF> >
1845  : public IsPadded<VT>
1846 {};
1848 //*************************************************************************************************
1849 
1850 } // namespace blaze
1851 
1852 #endif
BLAZE_DEVICE_CALLABLE bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:362
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:568
Pointer difference type of the Blaze library.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:524
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:135
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:164
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:163
Header file for basic type definitions.
Header file for the SparseVector base class.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
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:482
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:534
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:167
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.
BLAZE_DEVICE_CALLABLE ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:209
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:194
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:265
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecScalarMultExpr.h:429
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:514
Header file for the DenseVector base class.
BLAZE_DEVICE_CALLABLE bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:340
If_t< useAssign, const ResultType, const DVecScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:170
ConstIterator_t< VT > IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:200
Header file for the Computation base class.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:296
Header file for the UnderlyingElement type trait.
Header file for the RequiresEvaluation type trait.
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:255
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:504
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:434
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:186
BLAZE_DEVICE_CALLABLE DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:373
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:187
Header file for the SparseMatrix base class.
BLAZE_DEVICE_CALLABLE ReturnType operator *() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:286
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:468
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:188
Header file for the UnderlyingBuiltin type trait.
#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:182
Header file for the DenseMatrix base class.
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:244
decltype(auto) normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1149
BLAZE_DEVICE_CALLABLE bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:318
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:494
Header file for all SIMD functionality.
ResultType_t< VT > RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:108
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.
friend BLAZE_DEVICE_CALLABLE const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:385
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:173
Constraint on the data type.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:585
Header file for the EnableIf class template.
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:558
decltype(std::declval< RN >() *std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:124
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:196
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarMultExpr.h:189
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
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarMultExpr.h:276
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:586
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarMultExpr.h:455
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:111
Header file for the HasSIMDMult type trait.
decltype(auto) length(const DenseVector< VT, TF > &dv)
Calculation of the length (magnitude) of the dense vector .
Definition: DVecNormExpr.h:596
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:578
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
friend BLAZE_DEVICE_CALLABLE const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:409
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:193
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:416
BLAZE_DEVICE_CALLABLE bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:329
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_t alias declar...
Definition: UnderlyingBuiltin.h:116
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
friend BLAZE_DEVICE_CALLABLE const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:397
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
Header file for all forward declarations for expression class templates.
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
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:162
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:110
BLAZE_DEVICE_CALLABLE bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:307
Header file for the IsInvertible type trait.
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
#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:546
BLAZE_DEVICE_CALLABLE bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:351
Macro for CUDA compatibility.
Header file for the IsComputation type trait class.
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:102
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:443
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:190
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarMultExpr.h:233
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DVecScalarMultExpr.h:121
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
ReturnType_t< VT > RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:109
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:221
System settings for the inline keywords.
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:417
#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,...
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:195
Header file for the function trace functionality.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:176
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecScalarMultExpr.h:424