DVecMapExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECMAPEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECMAPEXPR_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>
54 #include <blaze/math/Functors.h>
56 #include <blaze/math/SIMD.h>
64 #include <blaze/system/Inline.h>
65 #include <blaze/util/Assert.h>
66 #include <blaze/util/EnableIf.h>
69 #include <blaze/util/mpl/And.h>
70 #include <blaze/util/mpl/If.h>
71 #include <blaze/util/mpl/Not.h>
72 #include <blaze/util/Template.h>
73 #include <blaze/util/Types.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS DVECMAPEXPR
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename VT // Type of the dense vector
94  , typename OP // Type of the custom operation
95  , bool TF > // Transpose flag
97  : public VecMapExpr< DenseVector< DVecMapExpr<VT,OP,TF>, TF > >
98  , private Computation
99 {
100  private:
101  //**Type definitions****************************************************************************
102  using RT = ResultType_<VT>;
104  using RN = ReturnType_<VT>;
105 
107  BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( HasSIMDEnabled, simdEnabled );
108 
111  //**********************************************************************************************
112 
113  //**Serial evaluation strategy******************************************************************
115 
121  enum : bool { useAssign = RequiresEvaluation<VT>::value };
122 
124  template< typename VT2 >
126  struct UseAssign {
127  enum : bool { value = useAssign };
128  };
130  //**********************************************************************************************
131 
132  //**Parallel evaluation strategy****************************************************************
134 
140  template< typename VT2 >
141  struct UseSMPAssign {
142  enum : bool { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
143  };
145  //**********************************************************************************************
146 
147  //**SIMD support detection**********************************************************************
149  struct UseSIMDEnabledFlag {
151  enum : bool { value = OP::BLAZE_TEMPLATE simdEnabled<ET>() };
152  };
154  //**********************************************************************************************
155 
156  public:
157  //**Type definitions****************************************************************************
162 
164  using ReturnType = decltype( std::declval<OP>()( std::declval<RN>() ) );
165 
168 
170  using Operand = If_< IsExpression<VT>, const VT, const VT& >;
171 
173  using Operation = OP;
174  //**********************************************************************************************
175 
176  //**ConstIterator class definition**************************************************************
180  {
181  public:
182  //**Type definitions*************************************************************************
183  using IteratorCategory = std::random_access_iterator_tag;
188 
189  // STL iterator requirements
195 
198  //*******************************************************************************************
199 
200  //**Constructor******************************************************************************
206  explicit inline ConstIterator( IteratorType it, OP op )
207  : it_( it ) // Iterator to the current vector element
208  , op_( op ) // The custom unary operation
209  {}
210  //*******************************************************************************************
211 
212  //**Addition assignment operator*************************************************************
218  inline ConstIterator& operator+=( size_t inc ) {
219  it_ += inc;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Subtraction assignment operator**********************************************************
230  inline ConstIterator& operator-=( size_t dec ) {
231  it_ -= dec;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Prefix increment operator****************************************************************
242  ++it_;
243  return *this;
244  }
245  //*******************************************************************************************
246 
247  //**Postfix increment operator***************************************************************
252  inline const ConstIterator operator++( int ) {
253  return ConstIterator( it_++, op_ );
254  }
255  //*******************************************************************************************
256 
257  //**Prefix decrement operator****************************************************************
263  --it_;
264  return *this;
265  }
266  //*******************************************************************************************
267 
268  //**Postfix decrement operator***************************************************************
273  inline const ConstIterator operator--( int ) {
274  return ConstIterator( it_--, op_ );
275  }
276  //*******************************************************************************************
277 
278  //**Element access operator******************************************************************
283  inline ReturnType operator*() const {
284  return op_( *it_ );
285  }
286  //*******************************************************************************************
287 
288  //**Load function****************************************************************************
293  inline auto load() const noexcept {
294  return op_.load( it_.load() );
295  }
296  //*******************************************************************************************
297 
298  //**Equality operator************************************************************************
304  inline bool operator==( const ConstIterator& rhs ) const {
305  return it_ == rhs.it_;
306  }
307  //*******************************************************************************************
308 
309  //**Inequality operator**********************************************************************
315  inline bool operator!=( const ConstIterator& rhs ) const {
316  return it_ != rhs.it_;
317  }
318  //*******************************************************************************************
319 
320  //**Less-than operator***********************************************************************
326  inline bool operator<( const ConstIterator& rhs ) const {
327  return it_ < rhs.it_;
328  }
329  //*******************************************************************************************
330 
331  //**Greater-than operator********************************************************************
337  inline bool operator>( const ConstIterator& rhs ) const {
338  return it_ > rhs.it_;
339  }
340  //*******************************************************************************************
341 
342  //**Less-or-equal-than operator**************************************************************
348  inline bool operator<=( const ConstIterator& rhs ) const {
349  return it_ <= rhs.it_;
350  }
351  //*******************************************************************************************
352 
353  //**Greater-or-equal-than operator***********************************************************
359  inline bool operator>=( const ConstIterator& rhs ) const {
360  return it_ >= rhs.it_;
361  }
362  //*******************************************************************************************
363 
364  //**Subtraction operator*********************************************************************
370  inline DifferenceType operator-( const ConstIterator& rhs ) const {
371  return it_ - rhs.it_;
372  }
373  //*******************************************************************************************
374 
375  //**Addition operator************************************************************************
382  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
383  return ConstIterator( it.it_ + inc, it.op_ );
384  }
385  //*******************************************************************************************
386 
387  //**Addition operator************************************************************************
394  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
395  return ConstIterator( it.it_ + inc, it.op_ );
396  }
397  //*******************************************************************************************
398 
399  //**Subtraction operator*********************************************************************
406  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
407  return ConstIterator( it.it_ - dec, it.op_ );
408  }
409  //*******************************************************************************************
410 
411  private:
412  //**Member variables*************************************************************************
414  OP op_;
415  //*******************************************************************************************
416  };
417  //**********************************************************************************************
418 
419  public:
420  //**Compilation flags***************************************************************************
422  enum : bool { simdEnabled = VT::simdEnabled &&
423  If_< HasSIMDEnabled<OP>, UseSIMDEnabledFlag, HasLoad<OP> >::value };
424 
426  enum : bool { smpAssignable = VT::smpAssignable };
427  //**********************************************************************************************
428 
429  //**SIMD properties*****************************************************************************
431  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
432  //**********************************************************************************************
433 
434  //**Constructor*********************************************************************************
440  explicit inline DVecMapExpr( const VT& dv, OP op ) noexcept
441  : dv_( dv ) // Dense vector of the map expression
442  , op_( op ) // The custom unary operation
443  {}
444  //**********************************************************************************************
445 
446  //**Subscript operator**************************************************************************
452  inline ReturnType operator[]( size_t index ) const {
453  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
454  return op_( dv_[index] );
455  }
456  //**********************************************************************************************
457 
458  //**At function*********************************************************************************
465  inline ReturnType at( size_t index ) const {
466  if( index >= dv_.size() ) {
467  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
468  }
469  return (*this)[index];
470  }
471  //**********************************************************************************************
472 
473  //**Load function*******************************************************************************
479  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
480  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
481  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
482  return op_.load( dv_.load( index ) );
483  }
484  //**********************************************************************************************
485 
486  //**Begin function******************************************************************************
491  inline ConstIterator begin() const {
492  return ConstIterator( dv_.begin(), op_ );
493  }
494  //**********************************************************************************************
495 
496  //**End function********************************************************************************
501  inline ConstIterator end() const {
502  return ConstIterator( dv_.end(), op_ );
503  }
504  //**********************************************************************************************
505 
506  //**Size function*******************************************************************************
511  inline size_t size() const noexcept {
512  return dv_.size();
513  }
514  //**********************************************************************************************
515 
516  //**Operand access******************************************************************************
521  inline Operand operand() const noexcept {
522  return dv_;
523  }
524  //**********************************************************************************************
525 
526  //**Operation access****************************************************************************
531  inline Operation operation() const {
532  return op_;
533  }
534  //**********************************************************************************************
535 
536  //**********************************************************************************************
542  template< typename T >
543  inline bool canAlias( const T* alias ) const noexcept {
544  return IsExpression<VT>::value && dv_.canAlias( alias );
545  }
546  //**********************************************************************************************
547 
548  //**********************************************************************************************
554  template< typename T >
555  inline bool isAliased( const T* alias ) const noexcept {
556  return dv_.isAliased( alias );
557  }
558  //**********************************************************************************************
559 
560  //**********************************************************************************************
565  inline bool isAligned() const noexcept {
566  return dv_.isAligned();
567  }
568  //**********************************************************************************************
569 
570  //**********************************************************************************************
575  inline bool canSMPAssign() const noexcept {
576  return dv_.canSMPAssign();
577  }
578  //**********************************************************************************************
579 
580  private:
581  //**Member variables****************************************************************************
584  //**********************************************************************************************
585 
586  //**Assignment to dense vectors*****************************************************************
601  template< typename VT2 > // Type of the target dense vector
602  friend inline EnableIf_< And< UseAssign<VT2>
604  assign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
605  {
607 
608  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
609 
610  assign( ~lhs, rhs.dv_ );
611  assign( ~lhs, map( ~lhs, rhs.op_ ) );
612  }
614  //**********************************************************************************************
615 
616  //**Assignment to dense vectors*****************************************************************
631  template< typename VT2 > // Type of the target dense vector
632  friend inline EnableIf_< And< UseAssign<VT2>
634  assign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
635  {
637 
641 
642  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
643 
644  const RT tmp( serial( rhs.dv_ ) );
645  assign( ~lhs, map( tmp, rhs.op_ ) );
646  }
648  //**********************************************************************************************
649 
650  //**Assignment to sparse vectors****************************************************************
664  template< typename VT2 > // Type of the target sparse vector
665  friend inline EnableIf_< UseAssign<VT2> >
666  assign( SparseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
667  {
669 
673 
674  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
675 
676  const RT tmp( serial( rhs.dv_ ) );
677  assign( ~lhs, map( tmp, rhs.op_ ) );
678  }
680  //**********************************************************************************************
681 
682  //**Addition assignment to dense vectors********************************************************
696  template< typename VT2 > // Type of the target dense vector
697  friend inline EnableIf_< UseAssign<VT2> >
698  addAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
699  {
701 
705 
706  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
707 
708  const RT tmp( serial( rhs.dv_ ) );
709  addAssign( ~lhs, map( tmp, 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 VT2 > // Type of the target dense vector
733  friend inline EnableIf_< UseAssign<VT2> >
734  subAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
735  {
737 
741 
742  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
743 
744  const RT tmp( serial( rhs.dv_ ) );
745  subAssign( ~lhs, map( tmp, rhs.op_ ) );
746  }
748  //**********************************************************************************************
749 
750  //**Subtraction assignment to sparse vectors****************************************************
751  // No special implementation for the subtraction assignment to sparse vectors.
752  //**********************************************************************************************
753 
754  //**Multiplication assignment to dense vectors**************************************************
768  template< typename VT2 > // Type of the target dense vector
769  friend inline EnableIf_< UseAssign<VT2> >
770  multAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
771  {
773 
777 
778  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
779 
780  const RT tmp( serial( rhs.dv_ ) );
781  multAssign( ~lhs, map( tmp, rhs.op_ ) );
782  }
784  //**********************************************************************************************
785 
786  //**Multiplication assignment to sparse vectors*************************************************
787  // No special implementation for the multiplication assignment to sparse vectors.
788  //**********************************************************************************************
789 
790  //**Division assignment to dense vectors********************************************************
804  template< typename VT2 > // Type of the target dense vector
805  friend inline EnableIf_< UseAssign<VT2> >
806  divAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
807  {
809 
813 
814  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
815 
816  const RT tmp( serial( rhs.dv_ ) );
817  divAssign( ~lhs, map( tmp, rhs.op_ ) );
818  }
820  //**********************************************************************************************
821 
822  //**Division assignment to sparse vectors*******************************************************
823  // No special implementation for the division assignment to sparse vectors.
824  //**********************************************************************************************
825 
826  //**SMP assignment to dense vectors*************************************************************
841  template< typename VT2 > // Type of the target dense vector
843  , IsSame< UnderlyingNumeric<VT>, UnderlyingNumeric<VT2> > > >
844  smpAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
845  {
847 
848  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
849 
850  smpAssign( ~lhs, rhs.dv_ );
851  smpAssign( ~lhs, rhs.op_( ~lhs ) );
852  }
854  //**********************************************************************************************
855 
856  //**SMP assignment to dense vectors*************************************************************
871  template< typename VT2 > // Type of the target dense vector
873  , Not< IsSame< UnderlyingNumeric<VT>, UnderlyingNumeric<VT2> > > > >
874  smpAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
875  {
877 
881 
882  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
883 
884  const RT tmp( rhs.dv_ );
885  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
886  }
888  //**********************************************************************************************
889 
890  //**SMP assignment to sparse vectors************************************************************
904  template< typename VT2 > // Type of the target sparse vector
905  friend inline EnableIf_< UseSMPAssign<VT2> >
906  smpAssign( SparseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
907  {
909 
913 
914  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
915 
916  const RT tmp( rhs.dv_ );
917  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
918  }
920  //**********************************************************************************************
921 
922  //**SMP addition assignment to dense vectors****************************************************
936  template< typename VT2 > // Type of the target dense vector
937  friend inline EnableIf_< UseSMPAssign<VT2> >
938  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
939  {
941 
945 
946  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
947 
948  const RT tmp( rhs.dv_ );
949  smpAddAssign( ~lhs, map( tmp, rhs.op_ ) );
950  }
952  //**********************************************************************************************
953 
954  //**SMP addition assignment to sparse vectors***************************************************
955  // No special implementation for the SMP addition assignment to sparse vectors.
956  //**********************************************************************************************
957 
958  //**SMP subtraction assignment to dense vectors*************************************************
972  template< typename VT2 > // Type of the target dense vector
973  friend inline EnableIf_< UseSMPAssign<VT2> >
974  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
975  {
977 
981 
982  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
983 
984  const RT tmp( rhs.dv_ );
985  smpSubAssign( ~lhs, map( tmp, rhs.op_ ) );
986  }
988  //**********************************************************************************************
989 
990  //**SMP subtraction assignment to sparse vectors************************************************
991  // No special implementation for the SMP subtraction assignment to sparse vectors.
992  //**********************************************************************************************
993 
994  //**SMP multiplication assignment to dense vectors**********************************************
1008  template< typename VT2 > // Type of the target dense vector
1009  friend inline EnableIf_< UseSMPAssign<VT2> >
1010  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
1011  {
1013 
1017 
1018  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1019 
1020  const RT tmp( rhs.dv_ );
1021  smpMultAssign( ~lhs, map( tmp, rhs.op_ ) );
1022  }
1024  //**********************************************************************************************
1025 
1026  //**SMP multiplication assignment to sparse vectors*********************************************
1027  // No special implementation for the SMP multiplication assignment to sparse vectors.
1028  //**********************************************************************************************
1029 
1030  //**SMP division assignment to dense vectors****************************************************
1044  template< typename VT2 > // Type of the target dense vector
1045  friend inline EnableIf_< UseSMPAssign<VT2> >
1046  smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
1047  {
1049 
1053 
1054  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1055 
1056  const RT tmp( rhs.dv_ );
1057  smpDivAssign( ~lhs, map( tmp, rhs.op_ ) );
1058  }
1060  //**********************************************************************************************
1061 
1062  //**SMP division assignment to sparse vectors***************************************************
1063  // No special implementation for the SMP division assignment to sparse vectors.
1064  //**********************************************************************************************
1065 
1066  //**Compile time checks*************************************************************************
1071  //**********************************************************************************************
1072 };
1073 //*************************************************************************************************
1074 
1075 
1076 
1077 
1078 //=================================================================================================
1079 //
1080 // GLOBAL FUNCTIONS
1081 //
1082 //=================================================================================================
1083 
1084 //*************************************************************************************************
1102 template< typename VT // Type of the dense vector
1103  , bool TF // Transpose flag
1104  , typename OP > // Type of the custom operation
1105 inline decltype(auto) map( const DenseVector<VT,TF>& dv, OP op )
1106 {
1108 
1109  using ReturnType = const DVecMapExpr<VT,OP,TF>;
1110  return ReturnType( ~dv, op );
1111 }
1112 //*************************************************************************************************
1113 
1114 
1115 //*************************************************************************************************
1133 template< typename VT // Type of the dense vector
1134  , bool TF // Transpose flag
1135  , typename OP > // Type of the custom operation
1136 inline decltype(auto) forEach( const DenseVector<VT,TF>& dv, OP op )
1137 {
1139 
1140  using ReturnType = const DVecMapExpr<VT,OP,TF>;
1141  return ReturnType( ~dv, op );
1142 }
1143 //*************************************************************************************************
1144 
1145 
1146 //*************************************************************************************************
1163 template< typename VT // Type of the dense vector
1164  , bool TF > // Transpose flag
1165 inline decltype(auto) abs( const DenseVector<VT,TF>& dv )
1166 {
1168 
1169  using ReturnType = const DVecMapExpr<VT,Abs,TF>;
1170  return ReturnType( ~dv, Abs() );
1171 }
1172 //*************************************************************************************************
1173 
1174 
1175 //*************************************************************************************************
1192 template< typename VT // Type of the dense vector
1193  , bool TF > // Transpose flag
1194 inline decltype(auto) floor( const DenseVector<VT,TF>& dv )
1195 {
1197 
1198  using ReturnType = const DVecMapExpr<VT,Floor,TF>;
1199  return ReturnType( ~dv, Floor() );
1200 }
1201 //*************************************************************************************************
1202 
1203 
1204 //*************************************************************************************************
1221 template< typename VT // Type of the dense vector
1222  , bool TF > // Transpose flag
1223 inline decltype(auto) ceil( const DenseVector<VT,TF>& dv )
1224 {
1226 
1227  using ReturnType = const DVecMapExpr<VT,Ceil,TF>;
1228  return ReturnType( ~dv, Ceil() );
1229 }
1230 //*************************************************************************************************
1231 
1232 
1233 //*************************************************************************************************
1250 template< typename VT // Type of the dense vector
1251  , bool TF > // Transpose flag
1252 inline decltype(auto) trunc( const DenseVector<VT,TF>& dv )
1253 {
1255 
1256  using ReturnType = const DVecMapExpr<VT,Trunc,TF>;
1257  return ReturnType( ~dv, Trunc() );
1258 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1279 template< typename VT // Type of the dense vector
1280  , bool TF > // Transpose flag
1281 inline decltype(auto) round( const DenseVector<VT,TF>& dv )
1282 {
1284 
1285  using ReturnType = const DVecMapExpr<VT,Round,TF>;
1286  return ReturnType( ~dv, Round() );
1287 }
1288 //*************************************************************************************************
1289 
1290 
1291 //*************************************************************************************************
1308 template< typename VT // Type of the dense vector
1309  , bool TF > // Transpose flag
1310 inline decltype(auto) conj( const DenseVector<VT,TF>& dv )
1311 {
1313 
1314  using ReturnType = const DVecMapExpr<VT,Conj,TF>;
1315  return ReturnType( ~dv, Conj() );
1316 }
1317 //*************************************************************************************************
1318 
1319 
1320 //*************************************************************************************************
1346 template< typename VT // Type of the dense vector
1347  , bool TF > // Transpose flag
1348 inline decltype(auto) ctrans( const DenseVector<VT,TF>& dv )
1349 {
1351 
1352  return trans( conj( ~dv ) );
1353 }
1354 //*************************************************************************************************
1355 
1356 
1357 //*************************************************************************************************
1374 template< typename VT // Type of the dense vector
1375  , bool TF > // Transpose flag
1376 inline decltype(auto) real( const DenseVector<VT,TF>& dv )
1377 {
1379 
1380  using ReturnType = const DVecMapExpr<VT,Real,TF>;
1381  return ReturnType( ~dv, Real() );
1382 }
1383 //*************************************************************************************************
1384 
1385 
1386 //*************************************************************************************************
1403 template< typename VT // Type of the dense vector
1404  , bool TF > // Transpose flag
1405 inline decltype(auto) imag( const DenseVector<VT,TF>& dv )
1406 {
1408 
1409  using ReturnType = const DVecMapExpr<VT,Imag,TF>;
1410  return ReturnType( ~dv, Imag() );
1411 }
1412 //*************************************************************************************************
1413 
1414 
1415 //*************************************************************************************************
1435 template< typename VT // Type of the dense vector
1436  , bool TF > // Transpose flag
1437 inline decltype(auto) sqrt( const DenseVector<VT,TF>& dv )
1438 {
1440 
1441  using ReturnType = const DVecMapExpr<VT,Sqrt,TF>;
1442  return ReturnType( ~dv, Sqrt() );
1443 }
1444 //*************************************************************************************************
1445 
1446 
1447 //*************************************************************************************************
1467 template< typename VT // Type of the dense vector
1468  , bool TF > // Transpose flag
1469 inline decltype(auto) invsqrt( const DenseVector<VT,TF>& dv )
1470 {
1472 
1473  using ReturnType = const DVecMapExpr<VT,InvSqrt,TF>;
1474  return ReturnType( ~dv, InvSqrt() );
1475 }
1476 //*************************************************************************************************
1477 
1478 
1479 //*************************************************************************************************
1499 template< typename VT // Type of the dense vector
1500  , bool TF > // Transpose flag
1501 inline decltype(auto) cbrt( const DenseVector<VT,TF>& dv )
1502 {
1504 
1505  using ReturnType = const DVecMapExpr<VT,Cbrt,TF>;
1506  return ReturnType( ~dv, Cbrt() );
1507 }
1508 //*************************************************************************************************
1509 
1510 
1511 //*************************************************************************************************
1531 template< typename VT // Type of the dense vector
1532  , bool TF > // Transpose flag
1533 inline decltype(auto) invcbrt( const DenseVector<VT,TF>& dv )
1534 {
1536 
1537  using ReturnType = const DVecMapExpr<VT,InvCbrt,TF>;
1538  return ReturnType( ~dv, InvCbrt() );
1539 }
1540 //*************************************************************************************************
1541 
1542 
1543 //*************************************************************************************************
1562 template< typename VT // Type of the dense vector
1563  , bool TF // Transpose flag
1564  , typename DT > // Type of the delimiters
1565 inline decltype(auto) clamp( const DenseVector<VT,TF>& dv, const DT& min, const DT& max )
1566 {
1568 
1569  using ReturnType = const DVecMapExpr<VT,Clamp<DT>,TF>;
1570  return ReturnType( ~dv, Clamp<DT>( min, max ) );
1571 }
1572 //*************************************************************************************************
1573 
1574 
1575 //*************************************************************************************************
1593 template< typename VT // Type of the dense vector
1594  , bool TF // Transpose flag
1595  , typename ET > // Type of the exponent
1596 inline decltype(auto) pow( const DenseVector<VT,TF>& dv, ET exp )
1597 {
1599 
1601 
1602  using ReturnType = const DVecMapExpr<VT,Pow<ET>,TF>;
1603  return ReturnType( ~dv, Pow<ET>( exp ) );
1604 }
1605 //*************************************************************************************************
1606 
1607 
1608 //*************************************************************************************************
1625 template< typename VT // Type of the dense vector
1626  , bool TF > // Transpose flag
1627 inline decltype(auto) exp( const DenseVector<VT,TF>& dv )
1628 {
1630 
1631  using ReturnType = const DVecMapExpr<VT,Exp,TF>;
1632  return ReturnType( ~dv, Exp() );
1633 }
1634 //*************************************************************************************************
1635 
1636 
1637 //*************************************************************************************************
1654 template< typename VT // Type of the dense vector
1655  , bool TF > // Transpose flag
1656 inline decltype(auto) exp2( const DenseVector<VT,TF>& dv )
1657 {
1659 
1660  using ReturnType = const DVecMapExpr<VT,Exp2,TF>;
1661  return ReturnType( ~dv, Exp2() );
1662 }
1663 //*************************************************************************************************
1664 
1665 
1666 //*************************************************************************************************
1683 template< typename VT // Type of the dense vector
1684  , bool TF > // Transpose flag
1685 inline decltype(auto) exp10( const DenseVector<VT,TF>& dv )
1686 {
1688 
1689  using ReturnType = const DVecMapExpr<VT,Exp10,TF>;
1690  return ReturnType( ~dv, Exp10() );
1691 }
1692 //*************************************************************************************************
1693 
1694 
1695 //*************************************************************************************************
1715 template< typename VT // Type of the dense vector
1716  , bool TF > // Transpose flag
1717 inline decltype(auto) log( const DenseVector<VT,TF>& dv )
1718 {
1720 
1721  using ReturnType = const DVecMapExpr<VT,Log,TF>;
1722  return ReturnType( ~dv, Log() );
1723 }
1724 //*************************************************************************************************
1725 
1726 
1727 //*************************************************************************************************
1747 template< typename VT // Type of the dense vector
1748  , bool TF > // Transpose flag
1749 inline decltype(auto) log2( const DenseVector<VT,TF>& dv )
1750 {
1752 
1753  using ReturnType = const DVecMapExpr<VT,Log2,TF>;
1754  return ReturnType( ~dv, Log2() );
1755 }
1756 //*************************************************************************************************
1757 
1758 
1759 //*************************************************************************************************
1779 template< typename VT // Type of the dense vector
1780  , bool TF > // Transpose flag
1781 inline decltype(auto) log10( const DenseVector<VT,TF>& dv )
1782 {
1784 
1785  using ReturnType = const DVecMapExpr<VT,Log10,TF>;
1786  return ReturnType( ~dv, Log10() );
1787 }
1788 //*************************************************************************************************
1789 
1790 
1791 //*************************************************************************************************
1808 template< typename VT // Type of the dense vector
1809  , bool TF > // Transpose flag
1810 inline decltype(auto) sin( const DenseVector<VT,TF>& dv )
1811 {
1813 
1814  using ReturnType = const DVecMapExpr<VT,Sin,TF>;
1815  return ReturnType( ~dv, Sin() );
1816 }
1817 //*************************************************************************************************
1818 
1819 
1820 //*************************************************************************************************
1840 template< typename VT // Type of the dense vector
1841  , bool TF > // Transpose flag
1842 inline decltype(auto) asin( const DenseVector<VT,TF>& dv )
1843 {
1845 
1846  using ReturnType = const DVecMapExpr<VT,Asin,TF>;
1847  return ReturnType( ~dv, Asin() );
1848 }
1849 //*************************************************************************************************
1850 
1851 
1852 //*************************************************************************************************
1869 template< typename VT // Type of the dense vector
1870  , bool TF > // Transpose flag
1871 inline decltype(auto) sinh( const DenseVector<VT,TF>& dv )
1872 {
1874 
1875  using ReturnType = const DVecMapExpr<VT,Sinh,TF>;
1876  return ReturnType( ~dv, Sinh() );
1877 }
1878 //*************************************************************************************************
1879 
1880 
1881 //*************************************************************************************************
1898 template< typename VT // Type of the dense vector
1899  , bool TF > // Transpose flag
1900 inline decltype(auto) asinh( const DenseVector<VT,TF>& dv )
1901 {
1903 
1904  using ReturnType = const DVecMapExpr<VT,Asinh,TF>;
1905  return ReturnType( ~dv, Asinh() );
1906 }
1907 //*************************************************************************************************
1908 
1909 
1910 //*************************************************************************************************
1927 template< typename VT // Type of the dense vector
1928  , bool TF > // Transpose flag
1929 inline decltype(auto) cos( const DenseVector<VT,TF>& dv )
1930 {
1932 
1933  using ReturnType = const DVecMapExpr<VT,Cos,TF>;
1934  return ReturnType( ~dv, Cos() );
1935 }
1936 //*************************************************************************************************
1937 
1938 
1939 //*************************************************************************************************
1959 template< typename VT // Type of the dense vector
1960  , bool TF > // Transpose flag
1961 inline decltype(auto) acos( const DenseVector<VT,TF>& dv )
1962 {
1964 
1965  using ReturnType = const DVecMapExpr<VT,Acos,TF>;
1966  return ReturnType( ~dv, Acos() );
1967 }
1968 //*************************************************************************************************
1969 
1970 
1971 //*************************************************************************************************
1988 template< typename VT // Type of the dense vector
1989  , bool TF > // Transpose flag
1990 inline decltype(auto) cosh( const DenseVector<VT,TF>& dv )
1991 {
1993 
1994  using ReturnType = const DVecMapExpr<VT,Cosh,TF>;
1995  return ReturnType( ~dv, Cosh() );
1996 }
1997 //*************************************************************************************************
1998 
1999 
2000 //*************************************************************************************************
2020 template< typename VT // Type of the dense vector
2021  , bool TF > // Transpose flag
2022 inline decltype(auto) acosh( const DenseVector<VT,TF>& dv )
2023 {
2025 
2026  using ReturnType = const DVecMapExpr<VT,Acosh,TF>;
2027  return ReturnType( ~dv, Acosh() );
2028 }
2029 //*************************************************************************************************
2030 
2031 
2032 //*************************************************************************************************
2049 template< typename VT // Type of the dense vector
2050  , bool TF > // Transpose flag
2051 inline decltype(auto) tan( const DenseVector<VT,TF>& dv )
2052 {
2054 
2055  using ReturnType = const DVecMapExpr<VT,Tan,TF>;
2056  return ReturnType( ~dv, Tan() );
2057 }
2058 //*************************************************************************************************
2059 
2060 
2061 //*************************************************************************************************
2078 template< typename VT // Type of the dense vector
2079  , bool TF > // Transpose flag
2080 inline decltype(auto) atan( const DenseVector<VT,TF>& dv )
2081 {
2083 
2084  using ReturnType = const DVecMapExpr<VT,Atan,TF>;
2085  return ReturnType( ~dv, Atan() );
2086 }
2087 //*************************************************************************************************
2088 
2089 
2090 //*************************************************************************************************
2110 template< typename VT // Type of the dense vector
2111  , bool TF > // Transpose flag
2112 inline decltype(auto) tanh( const DenseVector<VT,TF>& dv )
2113 {
2115 
2116  using ReturnType = const DVecMapExpr<VT,Tanh,TF>;
2117  return ReturnType( ~dv, Tanh() );
2118 }
2119 //*************************************************************************************************
2120 
2121 
2122 //*************************************************************************************************
2142 template< typename VT // Type of the dense vector
2143  , bool TF > // Transpose flag
2144 inline decltype(auto) atanh( const DenseVector<VT,TF>& dv )
2145 {
2147 
2148  using ReturnType = const DVecMapExpr<VT,Atanh,TF>;
2149  return ReturnType( ~dv, Atanh() );
2150 }
2151 //*************************************************************************************************
2152 
2153 
2154 //*************************************************************************************************
2171 template< typename VT // Type of the dense vector
2172  , bool TF > // Transpose flag
2173 inline decltype(auto) erf( const DenseVector<VT,TF>& dv )
2174 {
2176 
2177  using ReturnType = const DVecMapExpr<VT,Erf,TF>;
2178  return ReturnType( ~dv, Erf() );
2179 }
2180 //*************************************************************************************************
2181 
2182 
2183 //*************************************************************************************************
2200 template< typename VT // Type of the dense vector
2201  , bool TF > // Transpose flag
2202 inline decltype(auto) erfc( const DenseVector<VT,TF>& dv )
2203 {
2205 
2206  using ReturnType = const DVecMapExpr<VT,Erfc,TF>;
2207  return ReturnType( ~dv, Erfc() );
2208 }
2209 //*************************************************************************************************
2210 
2211 
2212 
2213 
2214 //=================================================================================================
2215 //
2216 // GLOBAL RESTRUCTURING FUNCTIONS
2217 //
2218 //=================================================================================================
2219 
2220 //*************************************************************************************************
2231 template< typename VT // Type of the dense vector
2232  , bool TF > // Transpose flag
2233 inline decltype(auto) abs( const DVecMapExpr<VT,Abs,TF>& dv )
2234 {
2236 
2237  return dv;
2238 }
2240 //*************************************************************************************************
2241 
2242 
2243 //*************************************************************************************************
2254 template< typename VT // Type of the dense vector
2255  , bool TF > // Transpose flag
2256 inline decltype(auto) floor( const DVecMapExpr<VT,Floor,TF>& dv )
2257 {
2259 
2260  return dv;
2261 }
2263 //*************************************************************************************************
2264 
2265 
2266 //*************************************************************************************************
2277 template< typename VT // Type of the dense vector
2278  , bool TF > // Transpose flag
2279 inline decltype(auto) ceil( const DVecMapExpr<VT,Ceil,TF>& dv )
2280 {
2282 
2283  return dv;
2284 }
2286 //*************************************************************************************************
2287 
2288 
2289 //*************************************************************************************************
2300 template< typename VT // Type of the dense vector
2301  , bool TF > // Transpose flag
2302 inline decltype(auto) trunc( const DVecMapExpr<VT,Trunc,TF>& dv )
2303 {
2305 
2306  return dv;
2307 }
2309 //*************************************************************************************************
2310 
2311 
2312 //*************************************************************************************************
2323 template< typename VT // Type of the dense vector
2324  , bool TF > // Transpose flag
2325 inline decltype(auto) round( const DVecMapExpr<VT,Round,TF>& dv )
2326 {
2328 
2329  return dv;
2330 }
2332 //*************************************************************************************************
2333 
2334 
2335 //*************************************************************************************************
2353 template< typename VT // Type of the dense vector
2354  , bool TF > // Transpose flag
2355 inline decltype(auto) conj( const DVecMapExpr<VT,Conj,TF>& dv )
2356 {
2358 
2359  return dv.operand();
2360 }
2362 //*************************************************************************************************
2363 
2364 
2365 //*************************************************************************************************
2383 template< typename VT // Type of the dense vector
2384  , bool TF > // Transpose flag
2385 inline decltype(auto) conj( const DVecTransExpr<DVecMapExpr<VT,Conj,TF>,!TF>& dv )
2386 {
2388 
2389  using ReturnType = const DVecTransExpr<VT,!TF>;
2390  return ReturnType( dv.operand().operand() );
2391 }
2393 //*************************************************************************************************
2394 
2395 
2396 //*************************************************************************************************
2407 template< typename VT // Type of the dense vector
2408  , bool TF > // Transpose flag
2409 inline decltype(auto) real( const DVecMapExpr<VT,Real,TF>& dv )
2410 {
2412 
2413  return dv;
2414 }
2416 //*************************************************************************************************
2417 
2418 
2419 
2420 
2421 //=================================================================================================
2422 //
2423 // SIZE SPECIALIZATIONS
2424 //
2425 //=================================================================================================
2426 
2427 //*************************************************************************************************
2429 template< typename VT, typename OP, bool TF >
2430 struct Size< DVecMapExpr<VT,OP,TF> >
2431  : public Size<VT>
2432 {};
2434 //*************************************************************************************************
2435 
2436 
2437 
2438 
2439 //=================================================================================================
2440 //
2441 // ISALIGNED SPECIALIZATIONS
2442 //
2443 //=================================================================================================
2444 
2445 //*************************************************************************************************
2447 template< typename VT, typename OP, bool TF >
2448 struct IsAligned< DVecMapExpr<VT,OP,TF> >
2449  : public BoolConstant< IsAligned<VT>::value >
2450 {};
2452 //*************************************************************************************************
2453 
2454 
2455 
2456 
2457 //=================================================================================================
2458 //
2459 // ISPADDED SPECIALIZATIONS
2460 //
2461 //=================================================================================================
2462 
2463 //*************************************************************************************************
2465 template< typename VT, typename OP, bool TF >
2466 struct IsPadded< DVecMapExpr<VT,OP,TF> >
2467  : public BoolConstant< IsPadded<VT>::value >
2468 {};
2470 //*************************************************************************************************
2471 
2472 } // namespace blaze
2473 
2474 #endif
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecMapExpr.h:479
Header file for the UnderlyingNumeric type trait.
Generic wrapper for the trunc() function.
Definition: Trunc.h:62
ElementType * PointerType
Pointer return type.
Definition: DVecMapExpr.h:185
Pointer difference type of the Blaze library.
decltype(auto) acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2033
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:62
decltype(auto) exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1696
ReturnType_< VT > RN
Return type of the dense vector expression.
Definition: DVecMapExpr.h:104
OP op_
The custom unary operation.
Definition: DVecMapExpr.h:414
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:62
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecMapExpr.h:555
ElementType_< VT > ET
Element type of the dense vector expression.
Definition: DVecMapExpr.h:103
Header file for basic type definitions.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecMapExpr.h:394
IfTrue_< useAssign, const ResultType, const DVecMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecMapExpr.h:167
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecMapExpr.h:160
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecMapExpr.h:370
Generic wrapper for the sin() function.
Definition: Sin.h:62
Generic wrapper for the conj() function.
Definition: Conj.h:62
Generic wrapper for the invsqrt() function.
Definition: InvSqrt.h:62
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the serial shim.
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1387
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the IsSame and IsStrictlySame type traits.
decltype(auto) ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1234
Generic wrapper for the clamp() function.
Definition: Clamp.h:60
Header file for the VecMapExpr base class.
Generic wrapper for the acosh() function.
Definition: Acosh.h:62
ElementType & ReferenceType
Reference return type.
Definition: DVecMapExpr.h:186
decltype(auto) clamp(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatMapExpr.h:1576
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecMapExpr.h:183
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1762
Header file for the DenseVector base class.
Operation op_
The custom unary operation.
Definition: DVecMapExpr.h:583
DVecMapExpr(const VT &dv, OP op) noexcept
Constructor for the DVecMapExpr class.
Definition: DVecMapExpr.h:440
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
Header file for the RequiresEvaluation type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
decltype(auto) acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1972
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
IteratorCategory iterator_category
The iterator category.
Definition: DVecMapExpr.h:190
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecMapExpr.h:230
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2184
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
PointerType pointer
Pointer return type.
Definition: DVecMapExpr.h:192
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecMapExpr.h:406
Generic wrapper for the abs() function.
Definition: Abs.h:62
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecMapExpr.h:465
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:337
Header file for the unary map trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecMapExpr.h:262
decltype(auto) cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1940
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1359
Header file for nested template disabiguation.
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
Generic wrapper for the exp10() function.
Definition: Exp10.h:62
decltype(auto) exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1667
decltype(auto) sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1882
decltype(auto) asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1853
decltype(auto) cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2001
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecMapExpr.h:273
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecMapExpr.h:382
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecMapExpr.h:575
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1512
#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
Generic wrapper for the log10() function.
Definition: Log10.h:62
decltype(auto) trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1263
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
Header file for all functors.
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: DVecMapExpr.h:206
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecMapExpr.h:241
ConstIterator_< VT > IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecMapExpr.h:197
UnaryMapTrait_< RT, OP > ResultType
Result type for expression template evaluations.
Definition: DVecMapExpr.h:159
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the IsAligned type trait.
Generic wrapper for the exp2() function.
Definition: Exp2.h:62
Generic wrapper for the asin() function.
Definition: Asin.h:62
Constraint on the data type.
decltype(auto) atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2091
decltype(auto) asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1911
Generic wrapper for the erf() function.
Definition: Erf.h:62
ElementType ValueType
Type of the underlying elements.
Definition: DVecMapExpr.h:184
BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT(HasSIMDEnabled, simdEnabled)
Definition of the HasSIMDEnabled type trait.
Constraint on the data type.
Base class for all unary vector map expression templates.The VecMapExpr class serves as a tag for all...
Definition: VecMapExpr.h:66
Header file for the exception macros of the math module.
Constraint on the data type.
Evaluation of the underlying numeric element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingNumeric.h:81
Header file for all forward declarations for expression class templates.
Generic wrapper for the floor() function.
Definition: Floor.h:62
decltype(auto) exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1638
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:326
decltype(std::declval< OP >()(std::declval< RN >())) ReturnType
Return type for expression template evaluations.
Definition: DVecMapExpr.h:164
Header file for the EnableIf class template.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:304
Header file for the IsPadded type trait.
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1176
decltype(auto) log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1728
Operation operation() const
Returns a copy of the custom operation.
Definition: DVecMapExpr.h:531
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecMapExpr.h:501
decltype(auto) floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1205
decltype(auto) pow(const DenseMatrix< MT, SO > &dm, ET exp)
Computes the exponential value for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1607
Operand dv_
Dense vector of the map expression.
Definition: DVecMapExpr.h:582
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecMapExpr.h:543
decltype(auto) round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1292
decltype(auto) tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2123
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecMapExpr.h:565
decltype(auto) forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1147
OP Operation
Data type of the custom unary operation.
Definition: DVecMapExpr.h:173
Header file for run time assertion macros.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecMapExpr.h:252
Generic wrapper for the pow() function.
Definition: Forward.h:84
Generic wrapper for the atanh() function.
Definition: Atanh.h:62
Iterator over the elements of the dense vector map expression.
Definition: DVecMapExpr.h:179
Generic wrapper for the invcbrt() function.
Definition: InvCbrt.h:62
Generic wrapper for the real() function.
Definition: Real.h:59
IteratorType it_
Iterator to the current vector element.
Definition: DVecMapExpr.h:413
Generic wrapper for the asinh() function.
Definition: Asinh.h:62
ReferenceType reference
Reference return type.
Definition: DVecMapExpr.h:193
decltype(auto) invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1544
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
#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
Generic wrapper for the tan() function.
Definition: Tan.h:62
Generic wrapper for the log() function.
Definition: Log.h:62
decltype(auto) atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2155
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecMapExpr.h:161
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#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
Compile time type negation.The Not alias declaration negates the given compile time condition...
Definition: Not.h:70
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the HasMember type traits.
Generic wrapper for the cos() function.
Definition: Cos.h:62
#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
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:359
Expression object for the dense vector map() function.The DVecMapExpr class represents the compile ti...
Definition: DVecMapExpr.h:96
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecMapExpr.h:283
ValueType value_type
Type of the underlying elements.
Definition: DVecMapExpr.h:191
ResultType_< VT > RT
Result type of the dense vector expression.
Definition: DVecMapExpr.h:102
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1821
decltype(auto) erfc(const DenseMatrix< MT, SO > &dm)
Computes the complementary error function for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2213
typename UnaryMapTrait< T, OP >::Type UnaryMapTrait_
Auxiliary alias declaration for the UnaryMapTrait class template.The UnaryMapTrait_ alias declaration...
Definition: UnaryMapTrait.h:156
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1448
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecMapExpr.h:218
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecMapExpr.h:293
Generic wrapper for the acos() function.
Definition: Acos.h:62
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2062
If_< IsExpression< VT >, const VT, const VT &> Operand
Composite data type of the dense vector expression.
Definition: DVecMapExpr.h:170
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:74
Generic wrapper for the atan() function.
Definition: Atan.h:62
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Generic wrapper for the round() function.
Definition: Round.h:62
Generic wrapper for the sinh() function.
Definition: Sinh.h:62
Header file for the IntegralConstant class template.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecMapExpr.h:452
Expression object for dense vector transpositions.The DVecTransExpr class represents the compile time...
Definition: DVecTransExpr.h:89
decltype(auto) log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1792
Generic wrapper for the log2() function.
Definition: Log2.h:62
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecMapExpr.h:521
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1416
Generic wrapper for the cosh() function.
Definition: Cosh.h:62
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
decltype(auto) log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1760
decltype(auto) invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1480
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecMapExpr.h:511
Generic wrapper for the tanh() function.
Definition: Tanh.h:62
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:348
Generic wrapper for the exp() function.
Definition: Exp.h:62
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecMapExpr.h:491
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:315
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
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:1133