Blaze  3.6
DVecDVecMapExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECMAPEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECMAPEXPR_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>
62 #include <blaze/math/functors/Or.h>
67 #include <blaze/math/SIMD.h>
77 #include <blaze/system/Inline.h>
78 #include <blaze/util/Assert.h>
79 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/mpl/If.h>
83 #include <blaze/util/Types.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS DVECDVECMAPEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
101 template< typename VT1 // Type of the left-hand side dense vector
102  , typename VT2 // Type of the right-hand side dense vector
103  , typename OP // Type of the custom operation
104  , bool TF > // Transpose flag
106  : public VecVecMapExpr< DenseVector< DVecDVecMapExpr<VT1,VT2,OP,TF>, TF > >
107  , private Computation
108 {
109  private:
110  //**Type definitions****************************************************************************
119  //**********************************************************************************************
120 
121  //**Serial evaluation strategy******************************************************************
123 
129  static constexpr bool useAssign = ( RequiresEvaluation_v<VT1> || RequiresEvaluation_v<VT2> );
130 
132  template< typename VT >
134  static constexpr bool UseAssign_v = useAssign;
136  //**********************************************************************************************
137 
138  //**Parallel evaluation strategy****************************************************************
140 
146  template< typename VT >
147  static constexpr bool UseSMPAssign_v =
148  ( ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign );
150  //**********************************************************************************************
151 
152  public:
153  //**Type definitions****************************************************************************
159 
161  using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
162 
165 
167  using LeftOperand = If_t< IsExpression_v<VT1>, const VT1, const VT1& >;
168 
170  using RightOperand = If_t< IsExpression_v<VT2>, const VT2, const VT2& >;
171 
173  using Operation = OP;
174 
177 
180  //**********************************************************************************************
181 
182  //**ConstIterator class definition**************************************************************
186  {
187  public:
188  //**Type definitions*************************************************************************
189  using IteratorCategory = std::random_access_iterator_tag;
194 
195  // STL iterator requirements
201 
204 
207  //*******************************************************************************************
208 
209  //**Constructor******************************************************************************
216  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right, OP op )
217  : left_ ( left ) // Iterator to the current left-hand side element
218  , right_( right ) // Iterator to the current right-hand side element
219  , op_ ( op ) // The custom unary operation
220  {}
221  //*******************************************************************************************
222 
223  //**Addition assignment operator*************************************************************
230  left_ += inc;
231  right_ += inc;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Subtraction assignment operator**********************************************************
243  left_ -= dec;
244  right_ -= dec;
245  return *this;
246  }
247  //*******************************************************************************************
248 
249  //**Prefix increment operator****************************************************************
255  ++left_;
256  ++right_;
257  return *this;
258  }
259  //*******************************************************************************************
260 
261  //**Postfix increment operator***************************************************************
267  return ConstIterator( left_++, right_++, op_ );
268  }
269  //*******************************************************************************************
270 
271  //**Prefix decrement operator****************************************************************
277  --left_;
278  --right_;
279  return *this;
280  }
281  //*******************************************************************************************
282 
283  //**Postfix decrement operator***************************************************************
289  return ConstIterator( left_--, right_--, op_ );
290  }
291  //*******************************************************************************************
292 
293  //**Element access operator******************************************************************
298  inline ReturnType operator*() const {
299  return op_( *left_, *right_ );
300  }
301  //*******************************************************************************************
302 
303  //**Load function****************************************************************************
308  inline auto load() const noexcept {
309  return op_.load( left_.load(), right_.load() );
310  }
311  //*******************************************************************************************
312 
313  //**Equality operator************************************************************************
319  inline bool operator==( const ConstIterator& rhs ) const {
320  return left_ == rhs.left_;
321  }
322  //*******************************************************************************************
323 
324  //**Inequality operator**********************************************************************
330  inline bool operator!=( const ConstIterator& rhs ) const {
331  return left_ != rhs.left_;
332  }
333  //*******************************************************************************************
334 
335  //**Less-than operator***********************************************************************
341  inline bool operator<( const ConstIterator& rhs ) const {
342  return left_ < rhs.left_;
343  }
344  //*******************************************************************************************
345 
346  //**Greater-than operator********************************************************************
352  inline bool operator>( const ConstIterator& rhs ) const {
353  return left_ > rhs.left_;
354  }
355  //*******************************************************************************************
356 
357  //**Less-or-equal-than operator**************************************************************
363  inline bool operator<=( const ConstIterator& rhs ) const {
364  return left_ <= rhs.left_;
365  }
366  //*******************************************************************************************
367 
368  //**Greater-or-equal-than operator***********************************************************
374  inline bool operator>=( const ConstIterator& rhs ) const {
375  return left_ >= rhs.left_;
376  }
377  //*******************************************************************************************
378 
379  //**Subtraction operator*********************************************************************
385  inline DifferenceType operator-( const ConstIterator& rhs ) const {
386  return left_ - rhs.left_;
387  }
388  //*******************************************************************************************
389 
390  //**Addition operator************************************************************************
397  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
398  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
399  }
400  //*******************************************************************************************
401 
402  //**Addition operator************************************************************************
409  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
410  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
411  }
412  //*******************************************************************************************
413 
414  //**Subtraction operator*********************************************************************
421  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
422  return ConstIterator( it.left_ - dec, it.right_ - dec, it.op_ );
423  }
424  //*******************************************************************************************
425 
426  private:
427  //**Member variables*************************************************************************
430  OP op_;
431  //*******************************************************************************************
432  };
433  //**********************************************************************************************
434 
435  //**Compilation flags***************************************************************************
437  static constexpr bool simdEnabled =
438  ( VT1::simdEnabled && VT2::simdEnabled &&
439  If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET1,ET2>, HasLoad<OP> >::value );
440 
442  static constexpr bool smpAssignable = ( VT1::smpAssignable && VT2::smpAssignable );
443  //**********************************************************************************************
444 
445  //**SIMD properties*****************************************************************************
447  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
448  //**********************************************************************************************
449 
450  //**Constructor*********************************************************************************
457  explicit inline DVecDVecMapExpr( const VT1& lhs, const VT2& rhs, OP op ) noexcept
458  : lhs_( lhs ) // Left-hand side dense vector of the map expression
459  , rhs_( rhs ) // Right-hand side dense vector of the map expression
460  , op_ ( op ) // The custom unary operation
461  {}
462  //**********************************************************************************************
463 
464  //**Subscript operator**************************************************************************
470  inline ReturnType operator[]( size_t index ) const {
471  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
472  return op_( lhs_[index], rhs_[index] );
473  }
474  //**********************************************************************************************
475 
476  //**At function*********************************************************************************
483  inline ReturnType at( size_t index ) const {
484  if( index >= lhs_.size() ) {
485  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
486  }
487  return (*this)[index];
488  }
489  //**********************************************************************************************
490 
491  //**Load function*******************************************************************************
497  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
498  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
499  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
500  return op_.load( lhs_.load( index ), rhs_.load( index ) );
501  }
502  //**********************************************************************************************
503 
504  //**Begin function******************************************************************************
509  inline ConstIterator begin() const {
510  return ConstIterator( lhs_.begin(), rhs_.begin(), op_ );
511  }
512  //**********************************************************************************************
513 
514  //**End function********************************************************************************
519  inline ConstIterator end() const {
520  return ConstIterator( lhs_.end(), rhs_.end(), op_ );
521  }
522  //**********************************************************************************************
523 
524  //**Size function*******************************************************************************
529  inline size_t size() const noexcept {
530  return lhs_.size();
531  }
532  //**********************************************************************************************
533 
534  //**Left operand access*************************************************************************
539  inline LeftOperand leftOperand() const noexcept {
540  return lhs_;
541  }
542  //**********************************************************************************************
543 
544  //**Right operand access************************************************************************
549  inline RightOperand rightOperand() const noexcept {
550  return rhs_;
551  }
552  //**********************************************************************************************
553 
554  //**Operation access****************************************************************************
559  inline Operation operation() const {
560  return op_;
561  }
562  //**********************************************************************************************
563 
564  //**********************************************************************************************
570  template< typename T >
571  inline bool canAlias( const T* alias ) const noexcept {
572  return ( IsExpression_v<VT1> && lhs_.canAlias( alias ) ) ||
573  ( IsExpression_v<VT2> && rhs_.canAlias( alias ) );
574  }
575  //**********************************************************************************************
576 
577  //**********************************************************************************************
583  template< typename T >
584  inline bool isAliased( const T* alias ) const noexcept {
585  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
586  }
587  //**********************************************************************************************
588 
589  //**********************************************************************************************
594  inline bool isAligned() const noexcept {
595  return lhs_.isAligned() && rhs_.isAligned();
596  }
597  //**********************************************************************************************
598 
599  //**********************************************************************************************
604  inline bool canSMPAssign() const noexcept {
605  return lhs_.canSMPAssign() && rhs_.canSMPAssign();
606  }
607  //**********************************************************************************************
608 
609  private:
610  //**Member variables****************************************************************************
614  //**********************************************************************************************
615 
616  //**Assignment to dense vectors*****************************************************************
630  template< typename VT > // Type of the target dense vector
631  friend inline auto assign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
633  {
635 
636  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
637 
638  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
639  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
640 
641  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
642  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
643 
644  assign( ~lhs, map( x, y, rhs.op_ ) );
645  }
647  //**********************************************************************************************
648 
649  //**Assignment to sparse vectors****************************************************************
663  template< typename VT > // Type of the target sparse vector
664  friend inline auto assign( SparseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
666  {
668 
672 
673  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
674 
675  const ResultType tmp( serial( rhs ) );
676  assign( ~lhs, tmp );
677  }
679  //**********************************************************************************************
680 
681  //**Addition assignment to dense vectors********************************************************
695  template< typename VT > // Type of the target dense vector
696  friend inline auto addAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
697  -> EnableIf_t< UseAssign_v<VT> >
698  {
700 
701  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
702 
703  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
704  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
705 
706  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
707  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
708 
709  addAssign( ~lhs, map( x, y, rhs.op_ ) );
710  }
712  //**********************************************************************************************
713 
714  //**Addition assignment to sparse vectors*******************************************************
715  // No special implementation for the addition assignment to sparse vectors.
716  //**********************************************************************************************
717 
718  //**Subtraction assignment to dense vectors*****************************************************
732  template< typename VT > // Type of the target dense vector
733  friend inline auto subAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
734  -> EnableIf_t< UseAssign_v<VT> >
735  {
737 
738  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
739 
740  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
741  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
742 
743  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
744  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
745 
746  subAssign( ~lhs, map( x, y, rhs.op_ ) );
747  }
749  //**********************************************************************************************
750 
751  //**Subtraction assignment to sparse vectors****************************************************
752  // No special implementation for the subtraction assignment to sparse vectors.
753  //**********************************************************************************************
754 
755  //**Multiplication assignment to dense vectors**************************************************
769  template< typename VT > // Type of the target dense vector
770  friend inline auto multAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
771  -> EnableIf_t< UseAssign_v<VT> >
772  {
774 
775  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
776 
777  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
778  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
779 
780  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
781  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
782 
783  multAssign( ~lhs, map( x, y, rhs.op_ ) );
784  }
786  //**********************************************************************************************
787 
788  //**Multiplication assignment to sparse vectors*************************************************
789  // No special implementation for the multiplication assignment to sparse vectors.
790  //**********************************************************************************************
791 
792  //**Division assignment to dense vectors********************************************************
806  template< typename VT > // Type of the target dense vector
807  friend inline auto divAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
808  -> EnableIf_t< UseAssign_v<VT> >
809  {
811 
812  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
813 
814  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
815  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
816 
817  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
818  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
819 
820  divAssign( ~lhs, map( x, y, rhs.op_ ) );
821  }
823  //**********************************************************************************************
824 
825  //**Division assignment to sparse vectors*******************************************************
826  // No special implementation for the division assignment to sparse vectors.
827  //**********************************************************************************************
828 
829  //**SMP assignment to dense vectors*************************************************************
843  template< typename VT > // Type of the target dense vector
844  friend inline auto smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
845  -> EnableIf_t< UseSMPAssign_v<VT> >
846  {
848 
849  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
850 
851  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
852  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
853 
854  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
855  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
856 
857  smpAssign( ~lhs, map( x, y, rhs.op_ ) );
858  }
860  //**********************************************************************************************
861 
862  //**SMP assignment to sparse vectors************************************************************
876  template< typename VT > // Type of the target sparse vector
877  friend inline auto smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
878  -> EnableIf_t< UseSMPAssign_v<VT> >
879  {
881 
885 
886  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
887 
888  const ResultType tmp( rhs );
889  smpAssign( ~lhs, tmp );
890  }
892  //**********************************************************************************************
893 
894  //**SMP addition assignment to dense vectors****************************************************
909  template< typename VT > // Type of the target dense vector
910  friend inline auto smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
911  -> EnableIf_t< UseSMPAssign_v<VT> >
912  {
914 
915  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
916 
917  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
918  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
919 
920  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
921  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
922 
923  smpAddAssign( ~lhs, map( x, y, rhs.op_ ) );
924  }
926  //**********************************************************************************************
927 
928  //**SMP addition assignment to sparse vectors***************************************************
929  // No special implementation for the SMP addition assignment to sparse vectors.
930  //**********************************************************************************************
931 
932  //**SMP subtraction assignment to dense vectors*************************************************
947  template< typename VT > // Type of the target dense vector
948  friend inline auto smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
949  -> EnableIf_t< UseSMPAssign_v<VT> >
950  {
952 
953  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
954 
955  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
956  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
957 
958  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
959  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
960 
961  smpSubAssign( ~lhs, map( x, y, rhs.op_ ) );
962  }
964  //**********************************************************************************************
965 
966  //**SMP subtraction assignment to sparse vectors************************************************
967  // No special implementation for the SMP subtraction assignment to sparse vectors.
968  //**********************************************************************************************
969 
970  //**SMP multiplication assignment to dense vectors**********************************************
985  template< typename VT > // Type of the target dense vector
986  friend inline auto smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
987  -> EnableIf_t< UseSMPAssign_v<VT> >
988  {
990 
991  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
992 
993  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
994  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
995 
996  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
997  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
998 
999  smpMultAssign( ~lhs, map( x, y, rhs.op_ ) );
1000  }
1002  //**********************************************************************************************
1003 
1004  //**SMP multiplication assignment to sparse vectors*********************************************
1005  // No special implementation for the SMP multiplication assignment to sparse vectors.
1006  //**********************************************************************************************
1007 
1008  //**SMP division assignment to dense vectors****************************************************
1023  template< typename VT > // Type of the target dense vector
1024  friend inline auto smpDivAssign( DenseVector<VT,TF>& lhs, const DVecDVecMapExpr& rhs )
1025  -> EnableIf_t< UseSMPAssign_v<VT> >
1026  {
1028 
1029  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1030 
1031  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1032  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1033 
1034  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1035  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1036 
1037  smpDivAssign( ~lhs, map( x, y, rhs.op_ ) );
1038  }
1040  //**********************************************************************************************
1041 
1042  //**SMP division assignment to sparse vectors***************************************************
1043  // No special implementation for the SMP division assignment to sparse vectors.
1044  //**********************************************************************************************
1045 
1046  //**Compile time checks*************************************************************************
1053  //**********************************************************************************************
1054 };
1055 //*************************************************************************************************
1056 
1057 
1058 
1059 
1060 //=================================================================================================
1061 //
1062 // GLOBAL FUNCTIONS
1063 //
1064 //=================================================================================================
1065 
1066 //*************************************************************************************************
1090 template< typename VT1 // Type of the left-hand side dense vector
1091  , typename VT2 // Type of the right-hand side dense vector
1092  , bool TF // Transpose flag
1093  , typename OP > // Type of the custom operation
1094 inline decltype(auto)
1095  map( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs, OP op )
1096 {
1098 
1099  if( (~lhs).size() != (~rhs).size() ) {
1100  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1101  }
1102 
1103  using ReturnType = const DVecDVecMapExpr<VT1,VT2,OP,TF>;
1104  return ReturnType( ~lhs, ~rhs, op );
1105 }
1106 //*************************************************************************************************
1107 
1108 
1109 //*************************************************************************************************
1131 template< typename VT1 // Type of the left-hand side dense vector
1132  , typename VT2 // Type of the right-hand side dense vector
1133  , bool TF > // Transpose flag
1134 inline decltype(auto)
1135  min( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1136 {
1138 
1139  return map( ~lhs, ~rhs, Min() );
1140 }
1141 //*************************************************************************************************
1142 
1143 
1144 //*************************************************************************************************
1166 template< typename VT1 // Type of the left-hand side dense vector
1167  , typename VT2 // Type of the right-hand side dense vector
1168  , bool TF > // Transpose flag
1169 inline decltype(auto)
1170  max( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1171 {
1173 
1174  return map( ~lhs, ~rhs, Max() );
1175 }
1176 //*************************************************************************************************
1177 
1178 
1179 //*************************************************************************************************
1201 template< typename VT1 // Type of the left-hand side dense vector
1202  , typename VT2 // Type of the right-hand side dense vector
1203  , bool TF > // Transpose flag
1204 inline decltype(auto)
1205  hypot( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1206 {
1208 
1209  return map( ~lhs, ~rhs, Hypot() );
1210 }
1211 //*************************************************************************************************
1212 
1213 
1214 //*************************************************************************************************
1236 template< typename VT1 // Type of the left-hand side dense vector
1237  , typename VT2 // Type of the right-hand side dense vector
1238  , bool TF > // Transpose flag
1239 inline decltype(auto)
1240  pow( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1241 {
1243 
1244  return map( ~lhs, ~rhs, Pow() );
1245 }
1246 //*************************************************************************************************
1247 
1248 
1249 //*************************************************************************************************
1271 template< typename VT1 // Type of the left-hand side dense vector
1272  , typename VT2 // Type of the right-hand side dense vector
1273  , bool TF > // Transpose flag
1274 inline decltype(auto)
1275  atan2( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1276 {
1278 
1279  return map( ~lhs, ~rhs, Atan2() );
1280 }
1281 //*************************************************************************************************
1282 
1283 
1284 
1285 
1286 //=================================================================================================
1287 //
1288 // GLOBAL BINARY ARITHMETIC OPERATORS
1289 //
1290 //=================================================================================================
1291 
1292 //*************************************************************************************************
1312 template< typename VT1 // Type of the left-hand side dense vector
1313  , typename VT2 // Type of the right-hand side dense vector
1314  , bool TF > // Transpose flag
1315 inline decltype(auto)
1316  operator<<( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1317 {
1319 
1320  return map( ~lhs, ~rhs, ShiftLV() );
1321 }
1322 //*************************************************************************************************
1323 
1324 
1325 //*************************************************************************************************
1345 template< typename VT1 // Type of the left-hand side dense vector
1346  , typename VT2 // Type of the right-hand side dense vector
1347  , bool TF > // Transpose flag
1348 inline decltype(auto)
1349  operator>>( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1350 {
1352 
1353  return map( ~lhs, ~rhs, ShiftRV() );
1354 }
1355 //*************************************************************************************************
1356 
1357 
1358 //*************************************************************************************************
1378 template< typename VT1 // Type of the left-hand side dense vector
1379  , typename VT2 // Type of the right-hand side dense vector
1380  , bool TF > // Transpose flag
1381 inline decltype(auto)
1382  operator&( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1383 {
1385 
1386  return map( ~lhs, ~rhs, Bitand() );
1387 }
1388 //*************************************************************************************************
1389 
1390 
1391 //*************************************************************************************************
1411 template< typename VT1 // Type of the left-hand side dense vector
1412  , typename VT2 // Type of the right-hand side dense vector
1413  , bool TF > // Transpose flag
1414 inline decltype(auto)
1415  operator|( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1416 {
1418 
1419  return map( ~lhs, ~rhs, Bitor() );
1420 }
1421 //*************************************************************************************************
1422 
1423 
1424 //*************************************************************************************************
1444 template< typename VT1 // Type of the left-hand side dense vector
1445  , typename VT2 // Type of the right-hand side dense vector
1446  , bool TF > // Transpose flag
1447 inline decltype(auto)
1448  operator^( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1449 {
1451 
1452  return map( ~lhs, ~rhs, Bitxor() );
1453 }
1454 //*************************************************************************************************
1455 
1456 
1457 
1458 
1459 //=================================================================================================
1460 //
1461 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
1462 //
1463 //=================================================================================================
1464 
1465 //*************************************************************************************************
1479 template< typename VT1 // Type of the left-hand side dense vector
1480  , typename VT2 // Type of the middle dense vector
1481  , typename VT3 // Type of the right-hand side dense vector
1482  , bool TF > // Transpose flag
1483 inline decltype(auto)
1484  operator<<( const DVecDVecMapExpr<VT1,VT2,ShiftLV,TF>& lhs, const DenseVector<VT3,TF>& rhs )
1485 {
1487 
1488  return map( lhs.leftOperand(), lhs.rightOperand() + (~rhs), lhs.operation() );
1489 }
1491 //*************************************************************************************************
1492 
1493 
1494 //*************************************************************************************************
1508 template< typename VT1 // Type of the left-hand side dense vector
1509  , typename VT2 // Type of the middle dense vector
1510  , typename VT3 // Type of the right-hand side dense vector
1511  , bool TF > // Transpose flag
1512 inline decltype(auto)
1513  operator>>( const DVecDVecMapExpr<VT1,VT2,ShiftRV,TF>& lhs, const DenseVector<VT3,TF>& rhs )
1514 {
1516 
1517  return map( lhs.leftOperand(), lhs.rightOperand() + (~rhs), lhs.operation() );
1518 }
1520 //*************************************************************************************************
1521 
1522 
1523 
1524 
1525 //=================================================================================================
1526 //
1527 // GLOBAL BINARY LOGICAL OPERATORS
1528 //
1529 //=================================================================================================
1530 
1531 //*************************************************************************************************
1551 template< typename VT1 // Type of the left-hand side dense vector
1552  , typename VT2 // Type of the right-hand side dense vector
1553  , bool TF > // Transpose flag
1554 inline decltype(auto)
1555  operator&&( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1556 {
1558 
1559  return map( ~lhs, ~rhs, And{} );
1560 }
1561 //*************************************************************************************************
1562 
1563 
1564 //*************************************************************************************************
1584 template< typename VT1 // Type of the left-hand side dense vector
1585  , typename VT2 // Type of the right-hand side dense vector
1586  , bool TF > // Transpose flag
1587 inline decltype(auto)
1588  operator||( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
1589 {
1591 
1592  return map( ~lhs, ~rhs, Or{} );
1593 }
1594 //*************************************************************************************************
1595 
1596 
1597 
1598 
1599 //=================================================================================================
1600 //
1601 // ISALIGNED SPECIALIZATIONS
1602 //
1603 //=================================================================================================
1604 
1605 //*************************************************************************************************
1607 template< typename VT1, typename VT2, typename OP, bool TF >
1608 struct IsAligned< DVecDVecMapExpr<VT1,VT2,OP,TF> >
1609  : public BoolConstant< IsAligned_v<VT1> && IsAligned_v<VT2> >
1610 {};
1612 //*************************************************************************************************
1613 
1614 
1615 
1616 
1617 //=================================================================================================
1618 //
1619 // ISPADDED SPECIALIZATIONS
1620 //
1621 //=================================================================================================
1622 
1623 //*************************************************************************************************
1625 template< typename VT1, typename VT2, typename OP, bool TF >
1626 struct IsPadded< DVecDVecMapExpr<VT1,VT2,OP,TF> >
1627  : public BoolConstant< IsPadded_v<VT1> && IsPadded_v<VT2> && IsPaddingEnabled_v<OP> >
1628 {};
1630 //*************************************************************************************************
1631 
1632 } // namespace blaze
1633 
1634 #endif
Header file for the Pow functor.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for the IsPaddingEnabled type trait.
Pointer difference type of the Blaze library.
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecMapExpr.h:196
ReferenceType reference
Reference return type.
Definition: DVecDVecMapExpr.h:199
Header file for auxiliary alias declarations.
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMapExpr.h:288
Header file for the ShiftRV functor.
decltype(std::declval< OP >()(std::declval< RN1 >(), std::declval< RN2 >())) ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMapExpr.h:161
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecMapExpr.h:242
Header file for the HasLoad type trait.
Header file for basic type definitions.
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the map expression.
Definition: DVecDVecMapExpr.h:129
decltype(auto) hypot(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise hypotenous for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1235
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMapExpr.h:157
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
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecDVecMapExpr.h:437
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 Hypot functor.
Header file for the serial shim.
Generic wrapper for the atan2() function.
Definition: Atan2.h:78
Generic wrapper for the bitwise OR ('|') operator.
Definition: Bitor.h:80
Header file for the Bitor functor.
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.The MapTrait_t alias declaration provides...
Definition: MapTrait.h:160
Header file for the And functor.
RightOperand rhs_
Right-hand side dense vector of the map expression.
Definition: DVecDVecMapExpr.h:612
decltype(auto) pow(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise exponential value for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1271
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMapExpr.h:571
Generic wrapper for the elementwise right-shift operation.
Definition: ShiftRV.h:75
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecMapExpr.h:193
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMapExpr.h:330
Header file for the DenseVector base class.
LeftOperand lhs_
Left-hand side dense vector of the map expression.
Definition: DVecDVecMapExpr.h:611
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMapExpr.h:191
CompositeType_t< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:118
ElementType_t< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:114
Header file for the Computation base class.
Header file for the ShiftLV functor.
Header file for the RequiresEvaluation type trait.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecMapExpr.h:421
ReturnType_t< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:115
Header file for the VecVecMapExpr base class.
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
Generic wrapper for the elementwise left-shift operation.
Definition: ShiftLV.h:75
Header file for the Bitxor functor.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecMapExpr.h:594
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
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecMapExpr.h:192
If_t< IsExpression_v< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:170
Operation operation() const
Returns a copy of the custom operation.
Definition: DVecDVecMapExpr.h:559
If_t< RequiresEvaluation_v< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecDVecMapExpr.h:176
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecMapExpr.h:190
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
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DVecDVecMapExpr.h:158
Header file for the If class template.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMapExpr.h:470
ConstIterator_t< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:203
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMapExpr.h:352
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1162
#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
If_t< RequiresEvaluation_v< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: DVecDVecMapExpr.h:179
MapTrait_t< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DVecDVecMapExpr.h:156
Iterator over the elements of the dense vector map expression.
Definition: DVecDVecMapExpr.h:185
Header file for all SIMD functionality.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMapExpr.h:519
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the IsAligned type trait.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DVecDVecMapExpr.h:447
Constraint on the data type.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMapExpr.h:319
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMapExpr.h:429
OP op_
The custom unary operation.
Definition: DVecDVecMapExpr.h:430
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMapExpr.h:428
Constraint on the data type.
DVecDVecMapExpr(const VT1 &lhs, const VT2 &rhs, OP op) noexcept
Constructor for the DVecMapExpr class.
Definition: DVecDVecMapExpr.h:457
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMapExpr.h:385
Header file for the exception macros of the math module.
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1198
decltype(auto) atan2(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the multi-valued inverse tangent of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1307
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMapExpr.h:341
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMapExpr.h:254
Constraint on the data type.
ReturnType operator *() const
Direct access to the element at the current iterator position.
Definition: DVecDVecMapExpr.h:298
ConstIterator_t< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:206
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMapExpr.h:604
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
ReturnType_t< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:116
ConstIterator(LeftIteratorType left, RightIteratorType right, OP op)
Constructor for the ConstIterator class.
Definition: DVecDVecMapExpr.h:216
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMapExpr.h:363
Generic wrapper for the bitwise XOR ('^') operator.
Definition: Bitxor.h:66
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecMapExpr.h:266
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMapExpr.h:374
Header file for the IsSIMDEnabled type trait.
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecMapExpr.h:539
Header file for run time assertion macros.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
PointerType pointer
Pointer return type.
Definition: DVecDVecMapExpr.h:198
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecMapExpr.h:483
Generic wrapper for the pow() function.
Definition: Pow.h:63
Generic wrapper for the max() function.
Definition: Max.h:80
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecMapExpr.h:189
Header file for the Or functor.
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
Generic wrapper for the bitwise AND ('&') operator.
Definition: Bitand.h:80
OP Operation
Data type of the custom unary operation.
Definition: DVecDVecMapExpr.h:173
Header file for the Atan2 functor.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
If_t< IsExpression_v< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:167
#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.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
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
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecMapExpr.h:497
CompositeType_t< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:117
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecMapExpr.h:584
#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
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Header file for the Bitand functor.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecMapExpr.h:509
ElementType_t< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:113
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecDVecMapExpr.h:442
Generic wrapper for the min() function.
Definition: Min.h:80
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
Header file for the Min functor.
#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
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMapExpr.h:197
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMapExpr.h:276
Macro for CUDA compatibility.
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMapExpr.h:397
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecMapExpr.h:308
Operation op_
The custom unary operation.
Definition: DVecDVecMapExpr.h:613
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
If_t< useAssign, const ResultType, const DVecDVecMapExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecDVecMapExpr.h:164
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Generic wrapper for the logical OR operator.
Definition: Or.h:58
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMapExpr.h:229
Generic wrapper for the hypot() function.
Definition: Hypot.h:78
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMapExpr.h:409
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
Header file for the IntegralConstant class template.
ResultType_t< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:112
Base class for all binary vector map expression templates.The VecVecMapExpr class serves as a tag for...
Definition: VecVecMapExpr.h:66
Header file for the map trait.
Generic wrapper for the logical AND operator.
Definition: And.h:58
Header file for the Max functor.
Expression object for the dense vector-dense vector map() function.The DVecDVecMapExpr class represen...
Definition: DVecDVecMapExpr.h:105
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecMapExpr.h:549
System settings for the inline keywords.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
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
ResultType_t< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMapExpr.h:111
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecDVecMapExpr.h:529
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1121