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>
66 #include <blaze/system/Inline.h>
67 #include <blaze/util/Assert.h>
68 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/mpl/And.h>
71 #include <blaze/util/mpl/If.h>
72 #include <blaze/util/mpl/Not.h>
73 #include <blaze/util/Template.h>
74 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DVECMAPEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename VT // Type of the dense vector
96  , typename OP // Type of the custom operation
97  , bool TF > // Transpose flag
99  : public VecMapExpr< DenseVector< DVecMapExpr<VT,OP,TF>, TF > >
100  , private Computation
101 {
102  private:
103  //**Type definitions****************************************************************************
104  using RT = ResultType_<VT>;
106  using RN = ReturnType_<VT>;
107 
109  BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( HasSIMDEnabled, simdEnabled );
110 
113  //**********************************************************************************************
114 
115  //**Serial evaluation strategy******************************************************************
117 
123  enum : bool { useAssign = RequiresEvaluation<VT>::value };
124 
126  template< typename VT2 >
128  struct UseAssign {
129  enum : bool { value = useAssign };
130  };
132  //**********************************************************************************************
133 
134  //**Parallel evaluation strategy****************************************************************
136 
142  template< typename VT2 >
143  struct UseSMPAssign {
144  enum : bool { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
145  };
147  //**********************************************************************************************
148 
149  //**SIMD support detection**********************************************************************
151  struct UseSIMDEnabledFlag {
153  enum : bool { value = OP::BLAZE_TEMPLATE simdEnabled<ET>() };
154  };
156  //**********************************************************************************************
157 
158  public:
159  //**Type definitions****************************************************************************
164 
166  using ReturnType = decltype( std::declval<OP>()( std::declval<RN>() ) );
167 
170 
172  using Operand = If_< IsExpression<VT>, const VT, const VT& >;
173 
175  using Operation = OP;
176  //**********************************************************************************************
177 
178  //**ConstIterator class definition**************************************************************
182  {
183  public:
184  //**Type definitions*************************************************************************
185  using IteratorCategory = std::random_access_iterator_tag;
190 
191  // STL iterator requirements
197 
200  //*******************************************************************************************
201 
202  //**Constructor******************************************************************************
208  explicit inline ConstIterator( IteratorType it, OP op )
209  : it_( it ) // Iterator to the current vector element
210  , op_( op ) // The custom unary operation
211  {}
212  //*******************************************************************************************
213 
214  //**Addition assignment operator*************************************************************
220  inline ConstIterator& operator+=( size_t inc ) {
221  it_ += inc;
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Subtraction assignment operator**********************************************************
232  inline ConstIterator& operator-=( size_t dec ) {
233  it_ -= dec;
234  return *this;
235  }
236  //*******************************************************************************************
237 
238  //**Prefix increment operator****************************************************************
244  ++it_;
245  return *this;
246  }
247  //*******************************************************************************************
248 
249  //**Postfix increment operator***************************************************************
254  inline const ConstIterator operator++( int ) {
255  return ConstIterator( it_++, op_ );
256  }
257  //*******************************************************************************************
258 
259  //**Prefix decrement operator****************************************************************
265  --it_;
266  return *this;
267  }
268  //*******************************************************************************************
269 
270  //**Postfix decrement operator***************************************************************
275  inline const ConstIterator operator--( int ) {
276  return ConstIterator( it_--, op_ );
277  }
278  //*******************************************************************************************
279 
280  //**Element access operator******************************************************************
285  inline ReturnType operator*() const {
286  return op_( *it_ );
287  }
288  //*******************************************************************************************
289 
290  //**Load function****************************************************************************
295  inline auto load() const noexcept {
296  return op_.load( it_.load() );
297  }
298  //*******************************************************************************************
299 
300  //**Equality operator************************************************************************
306  inline bool operator==( const ConstIterator& rhs ) const {
307  return it_ == rhs.it_;
308  }
309  //*******************************************************************************************
310 
311  //**Inequality operator**********************************************************************
317  inline bool operator!=( const ConstIterator& rhs ) const {
318  return it_ != rhs.it_;
319  }
320  //*******************************************************************************************
321 
322  //**Less-than operator***********************************************************************
328  inline bool operator<( const ConstIterator& rhs ) const {
329  return it_ < rhs.it_;
330  }
331  //*******************************************************************************************
332 
333  //**Greater-than operator********************************************************************
339  inline bool operator>( const ConstIterator& rhs ) const {
340  return it_ > rhs.it_;
341  }
342  //*******************************************************************************************
343 
344  //**Less-or-equal-than operator**************************************************************
350  inline bool operator<=( const ConstIterator& rhs ) const {
351  return it_ <= rhs.it_;
352  }
353  //*******************************************************************************************
354 
355  //**Greater-or-equal-than operator***********************************************************
361  inline bool operator>=( const ConstIterator& rhs ) const {
362  return it_ >= rhs.it_;
363  }
364  //*******************************************************************************************
365 
366  //**Subtraction operator*********************************************************************
372  inline DifferenceType operator-( const ConstIterator& rhs ) const {
373  return it_ - rhs.it_;
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
385  return ConstIterator( it.it_ + inc, it.op_ );
386  }
387  //*******************************************************************************************
388 
389  //**Addition operator************************************************************************
396  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
397  return ConstIterator( it.it_ + inc, it.op_ );
398  }
399  //*******************************************************************************************
400 
401  //**Subtraction operator*********************************************************************
408  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
409  return ConstIterator( it.it_ - dec, it.op_ );
410  }
411  //*******************************************************************************************
412 
413  private:
414  //**Member variables*************************************************************************
416  OP op_;
417  //*******************************************************************************************
418  };
419  //**********************************************************************************************
420 
421  public:
422  //**Compilation flags***************************************************************************
424  enum : bool { simdEnabled = VT::simdEnabled &&
425  If_< HasSIMDEnabled<OP>, UseSIMDEnabledFlag, HasLoad<OP> >::value };
426 
428  enum : bool { smpAssignable = VT::smpAssignable };
429  //**********************************************************************************************
430 
431  //**SIMD properties*****************************************************************************
433  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
434  //**********************************************************************************************
435 
436  //**Constructor*********************************************************************************
442  explicit inline DVecMapExpr( const VT& dv, OP op ) noexcept
443  : dv_( dv ) // Dense vector of the map expression
444  , op_( op ) // The custom unary operation
445  {}
446  //**********************************************************************************************
447 
448  //**Subscript operator**************************************************************************
454  inline ReturnType operator[]( size_t index ) const {
455  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
456  return op_( dv_[index] );
457  }
458  //**********************************************************************************************
459 
460  //**At function*********************************************************************************
467  inline ReturnType at( size_t index ) const {
468  if( index >= dv_.size() ) {
469  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
470  }
471  return (*this)[index];
472  }
473  //**********************************************************************************************
474 
475  //**Load function*******************************************************************************
481  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
482  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
483  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
484  return op_.load( dv_.load( index ) );
485  }
486  //**********************************************************************************************
487 
488  //**Begin function******************************************************************************
493  inline ConstIterator begin() const {
494  return ConstIterator( dv_.begin(), op_ );
495  }
496  //**********************************************************************************************
497 
498  //**End function********************************************************************************
503  inline ConstIterator end() const {
504  return ConstIterator( dv_.end(), op_ );
505  }
506  //**********************************************************************************************
507 
508  //**Size function*******************************************************************************
513  inline size_t size() const noexcept {
514  return dv_.size();
515  }
516  //**********************************************************************************************
517 
518  //**Operand access******************************************************************************
523  inline Operand operand() const noexcept {
524  return dv_;
525  }
526  //**********************************************************************************************
527 
528  //**Operation access****************************************************************************
533  inline Operation operation() const {
534  return op_;
535  }
536  //**********************************************************************************************
537 
538  //**********************************************************************************************
544  template< typename T >
545  inline bool canAlias( const T* alias ) const noexcept {
546  return IsExpression<VT>::value && dv_.canAlias( alias );
547  }
548  //**********************************************************************************************
549 
550  //**********************************************************************************************
556  template< typename T >
557  inline bool isAliased( const T* alias ) const noexcept {
558  return dv_.isAliased( alias );
559  }
560  //**********************************************************************************************
561 
562  //**********************************************************************************************
567  inline bool isAligned() const noexcept {
568  return dv_.isAligned();
569  }
570  //**********************************************************************************************
571 
572  //**********************************************************************************************
577  inline bool canSMPAssign() const noexcept {
578  return dv_.canSMPAssign();
579  }
580  //**********************************************************************************************
581 
582  private:
583  //**Member variables****************************************************************************
586  //**********************************************************************************************
587 
588  //**Assignment to dense vectors*****************************************************************
603  template< typename VT2 > // Type of the target dense vector
604  friend inline EnableIf_< And< UseAssign<VT2>
606  assign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
607  {
609 
610  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
611 
612  assign( ~lhs, rhs.dv_ );
613  assign( ~lhs, map( ~lhs, rhs.op_ ) );
614  }
616  //**********************************************************************************************
617 
618  //**Assignment to dense vectors*****************************************************************
633  template< typename VT2 > // Type of the target dense vector
634  friend inline EnableIf_< And< UseAssign<VT2>
636  assign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
637  {
639 
643 
644  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
645 
646  const RT tmp( serial( rhs.dv_ ) );
647  assign( ~lhs, map( tmp, rhs.op_ ) );
648  }
650  //**********************************************************************************************
651 
652  //**Assignment to sparse vectors****************************************************************
666  template< typename VT2 > // Type of the target sparse vector
667  friend inline EnableIf_< UseAssign<VT2> >
668  assign( SparseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
669  {
671 
675 
676  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
677 
678  const RT tmp( serial( rhs.dv_ ) );
679  assign( ~lhs, map( tmp, rhs.op_ ) );
680  }
682  //**********************************************************************************************
683 
684  //**Addition assignment to dense vectors********************************************************
698  template< typename VT2 > // Type of the target dense vector
699  friend inline EnableIf_< UseAssign<VT2> >
700  addAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
701  {
703 
707 
708  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
709 
710  const RT tmp( serial( rhs.dv_ ) );
711  addAssign( ~lhs, map( tmp, rhs.op_ ) );
712  }
714  //**********************************************************************************************
715 
716  //**Addition assignment to sparse vectors*******************************************************
717  // No special implementation for the addition assignment to sparse vectors.
718  //**********************************************************************************************
719 
720  //**Subtraction assignment to dense vectors*****************************************************
734  template< typename VT2 > // Type of the target dense vector
735  friend inline EnableIf_< UseAssign<VT2> >
736  subAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
737  {
739 
743 
744  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
745 
746  const RT tmp( serial( rhs.dv_ ) );
747  subAssign( ~lhs, map( tmp, rhs.op_ ) );
748  }
750  //**********************************************************************************************
751 
752  //**Subtraction assignment to sparse vectors****************************************************
753  // No special implementation for the subtraction assignment to sparse vectors.
754  //**********************************************************************************************
755 
756  //**Multiplication assignment to dense vectors**************************************************
770  template< typename VT2 > // Type of the target dense vector
771  friend inline EnableIf_< UseAssign<VT2> >
772  multAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
773  {
775 
779 
780  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
781 
782  const RT tmp( serial( rhs.dv_ ) );
783  multAssign( ~lhs, map( tmp, 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 VT2 > // Type of the target dense vector
807  friend inline EnableIf_< UseAssign<VT2> >
808  divAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
809  {
811 
815 
816  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
817 
818  const RT tmp( serial( rhs.dv_ ) );
819  divAssign( ~lhs, map( tmp, rhs.op_ ) );
820  }
822  //**********************************************************************************************
823 
824  //**Division assignment to sparse vectors*******************************************************
825  // No special implementation for the division assignment to sparse vectors.
826  //**********************************************************************************************
827 
828  //**SMP assignment to dense vectors*************************************************************
843  template< typename VT2 > // Type of the target dense vector
845  , IsSame< UnderlyingNumeric<VT>, UnderlyingNumeric<VT2> > > >
846  smpAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
847  {
849 
850  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
851 
852  smpAssign( ~lhs, rhs.dv_ );
853  smpAssign( ~lhs, rhs.op_( ~lhs ) );
854  }
856  //**********************************************************************************************
857 
858  //**SMP assignment to dense vectors*************************************************************
873  template< typename VT2 > // Type of the target dense vector
875  , Not< IsSame< UnderlyingNumeric<VT>, UnderlyingNumeric<VT2> > > > >
876  smpAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
877  {
879 
883 
884  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
885 
886  const RT tmp( rhs.dv_ );
887  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
888  }
890  //**********************************************************************************************
891 
892  //**SMP assignment to sparse vectors************************************************************
906  template< typename VT2 > // Type of the target sparse vector
907  friend inline EnableIf_< UseSMPAssign<VT2> >
908  smpAssign( SparseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
909  {
911 
915 
916  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
917 
918  const RT tmp( rhs.dv_ );
919  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
920  }
922  //**********************************************************************************************
923 
924  //**SMP addition assignment to dense vectors****************************************************
938  template< typename VT2 > // Type of the target dense vector
939  friend inline EnableIf_< UseSMPAssign<VT2> >
940  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
941  {
943 
947 
948  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
949 
950  const RT tmp( rhs.dv_ );
951  smpAddAssign( ~lhs, map( tmp, rhs.op_ ) );
952  }
954  //**********************************************************************************************
955 
956  //**SMP addition assignment to sparse vectors***************************************************
957  // No special implementation for the SMP addition assignment to sparse vectors.
958  //**********************************************************************************************
959 
960  //**SMP subtraction assignment to dense vectors*************************************************
974  template< typename VT2 > // Type of the target dense vector
975  friend inline EnableIf_< UseSMPAssign<VT2> >
976  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
977  {
979 
983 
984  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
985 
986  const RT tmp( rhs.dv_ );
987  smpSubAssign( ~lhs, map( tmp, rhs.op_ ) );
988  }
990  //**********************************************************************************************
991 
992  //**SMP subtraction assignment to sparse vectors************************************************
993  // No special implementation for the SMP subtraction assignment to sparse vectors.
994  //**********************************************************************************************
995 
996  //**SMP multiplication assignment to dense vectors**********************************************
1010  template< typename VT2 > // Type of the target dense vector
1011  friend inline EnableIf_< UseSMPAssign<VT2> >
1012  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
1013  {
1015 
1019 
1020  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1021 
1022  const RT tmp( rhs.dv_ );
1023  smpMultAssign( ~lhs, map( tmp, rhs.op_ ) );
1024  }
1026  //**********************************************************************************************
1027 
1028  //**SMP multiplication assignment to sparse vectors*********************************************
1029  // No special implementation for the SMP multiplication assignment to sparse vectors.
1030  //**********************************************************************************************
1031 
1032  //**SMP division assignment to dense vectors****************************************************
1046  template< typename VT2 > // Type of the target dense vector
1047  friend inline EnableIf_< UseSMPAssign<VT2> >
1048  smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
1049  {
1051 
1055 
1056  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1057 
1058  const RT tmp( rhs.dv_ );
1059  smpDivAssign( ~lhs, map( tmp, rhs.op_ ) );
1060  }
1062  //**********************************************************************************************
1063 
1064  //**SMP division assignment to sparse vectors***************************************************
1065  // No special implementation for the SMP division assignment to sparse vectors.
1066  //**********************************************************************************************
1067 
1068  //**Compile time checks*************************************************************************
1073  //**********************************************************************************************
1074 };
1075 //*************************************************************************************************
1076 
1077 
1078 
1079 
1080 //=================================================================================================
1081 //
1082 // GLOBAL FUNCTIONS
1083 //
1084 //=================================================================================================
1085 
1086 //*************************************************************************************************
1104 template< typename VT // Type of the dense vector
1105  , bool TF // Transpose flag
1106  , typename OP > // Type of the custom operation
1107 inline decltype(auto) map( const DenseVector<VT,TF>& dv, OP op )
1108 {
1110 
1111  using ReturnType = const DVecMapExpr<VT,OP,TF>;
1112  return ReturnType( ~dv, op );
1113 }
1114 //*************************************************************************************************
1115 
1116 
1117 //*************************************************************************************************
1135 template< typename VT // Type of the dense vector
1136  , bool TF // Transpose flag
1137  , typename OP > // Type of the custom operation
1138 inline decltype(auto) forEach( const DenseVector<VT,TF>& dv, OP op )
1139 {
1141 
1142  using ReturnType = const DVecMapExpr<VT,OP,TF>;
1143  return ReturnType( ~dv, op );
1144 }
1145 //*************************************************************************************************
1146 
1147 
1148 //*************************************************************************************************
1165 template< typename VT // Type of the dense vector
1166  , bool TF > // Transpose flag
1167 inline decltype(auto) abs( const DenseVector<VT,TF>& dv )
1168 {
1170 
1171  using ReturnType = const DVecMapExpr<VT,Abs,TF>;
1172  return ReturnType( ~dv, Abs() );
1173 }
1174 //*************************************************************************************************
1175 
1176 
1177 //*************************************************************************************************
1194 template< typename VT // Type of the dense vector
1195  , bool TF > // Transpose flag
1196 inline decltype(auto) floor( const DenseVector<VT,TF>& dv )
1197 {
1199 
1200  using ReturnType = const DVecMapExpr<VT,Floor,TF>;
1201  return ReturnType( ~dv, Floor() );
1202 }
1203 //*************************************************************************************************
1204 
1205 
1206 //*************************************************************************************************
1223 template< typename VT // Type of the dense vector
1224  , bool TF > // Transpose flag
1225 inline decltype(auto) ceil( const DenseVector<VT,TF>& dv )
1226 {
1228 
1229  using ReturnType = const DVecMapExpr<VT,Ceil,TF>;
1230  return ReturnType( ~dv, Ceil() );
1231 }
1232 //*************************************************************************************************
1233 
1234 
1235 //*************************************************************************************************
1252 template< typename VT // Type of the dense vector
1253  , bool TF > // Transpose flag
1254 inline decltype(auto) trunc( const DenseVector<VT,TF>& dv )
1255 {
1257 
1258  using ReturnType = const DVecMapExpr<VT,Trunc,TF>;
1259  return ReturnType( ~dv, Trunc() );
1260 }
1261 //*************************************************************************************************
1262 
1263 
1264 //*************************************************************************************************
1281 template< typename VT // Type of the dense vector
1282  , bool TF > // Transpose flag
1283 inline decltype(auto) round( const DenseVector<VT,TF>& dv )
1284 {
1286 
1287  using ReturnType = const DVecMapExpr<VT,Round,TF>;
1288  return ReturnType( ~dv, Round() );
1289 }
1290 //*************************************************************************************************
1291 
1292 
1293 //*************************************************************************************************
1310 template< typename VT // Type of the dense vector
1311  , bool TF > // Transpose flag
1312 inline decltype(auto) conj( const DenseVector<VT,TF>& dv )
1313 {
1315 
1316  using ReturnType = const DVecMapExpr<VT,Conj,TF>;
1317  return ReturnType( ~dv, Conj() );
1318 }
1319 //*************************************************************************************************
1320 
1321 
1322 //*************************************************************************************************
1348 template< typename VT // Type of the dense vector
1349  , bool TF > // Transpose flag
1350 inline decltype(auto) ctrans( const DenseVector<VT,TF>& dv )
1351 {
1353 
1354  return trans( conj( ~dv ) );
1355 }
1356 //*************************************************************************************************
1357 
1358 
1359 //*************************************************************************************************
1376 template< typename VT // Type of the dense vector
1377  , bool TF > // Transpose flag
1378 inline decltype(auto) real( const DenseVector<VT,TF>& dv )
1379 {
1381 
1382  using ReturnType = const DVecMapExpr<VT,Real,TF>;
1383  return ReturnType( ~dv, Real() );
1384 }
1385 //*************************************************************************************************
1386 
1387 
1388 //*************************************************************************************************
1405 template< typename VT // Type of the dense vector
1406  , bool TF > // Transpose flag
1407 inline decltype(auto) imag( const DenseVector<VT,TF>& dv )
1408 {
1410 
1411  using ReturnType = const DVecMapExpr<VT,Imag,TF>;
1412  return ReturnType( ~dv, Imag() );
1413 }
1414 //*************************************************************************************************
1415 
1416 
1417 //*************************************************************************************************
1437 template< typename VT // Type of the dense vector
1438  , bool TF > // Transpose flag
1439 inline decltype(auto) sqrt( const DenseVector<VT,TF>& dv )
1440 {
1442 
1443  using ReturnType = const DVecMapExpr<VT,Sqrt,TF>;
1444  return ReturnType( ~dv, Sqrt() );
1445 }
1446 //*************************************************************************************************
1447 
1448 
1449 //*************************************************************************************************
1469 template< typename VT // Type of the dense vector
1470  , bool TF > // Transpose flag
1471 inline decltype(auto) invsqrt( const DenseVector<VT,TF>& dv )
1472 {
1474 
1475  using ReturnType = const DVecMapExpr<VT,InvSqrt,TF>;
1476  return ReturnType( ~dv, InvSqrt() );
1477 }
1478 //*************************************************************************************************
1479 
1480 
1481 //*************************************************************************************************
1501 template< typename VT // Type of the dense vector
1502  , bool TF > // Transpose flag
1503 inline decltype(auto) cbrt( const DenseVector<VT,TF>& dv )
1504 {
1506 
1507  using ReturnType = const DVecMapExpr<VT,Cbrt,TF>;
1508  return ReturnType( ~dv, Cbrt() );
1509 }
1510 //*************************************************************************************************
1511 
1512 
1513 //*************************************************************************************************
1533 template< typename VT // Type of the dense vector
1534  , bool TF > // Transpose flag
1535 inline decltype(auto) invcbrt( const DenseVector<VT,TF>& dv )
1536 {
1538 
1539  using ReturnType = const DVecMapExpr<VT,InvCbrt,TF>;
1540  return ReturnType( ~dv, InvCbrt() );
1541 }
1542 //*************************************************************************************************
1543 
1544 
1545 //*************************************************************************************************
1564 template< typename VT // Type of the dense vector
1565  , bool TF // Transpose flag
1566  , typename DT > // Type of the delimiters
1567 inline decltype(auto) clamp( const DenseVector<VT,TF>& dv, const DT& min, const DT& max )
1568 {
1570 
1571  using ReturnType = const DVecMapExpr<VT,Clamp<DT>,TF>;
1572  return ReturnType( ~dv, Clamp<DT>( min, max ) );
1573 }
1574 //*************************************************************************************************
1575 
1576 
1577 //*************************************************************************************************
1595 template< typename VT // Type of the dense vector
1596  , bool TF // Transpose flag
1597  , typename ST // Type of the scalar exponent
1598  , typename = EnableIf_< IsNumeric<ST> > >
1599 inline decltype(auto) pow( const DenseVector<VT,TF>& dv, ST exp )
1600 {
1602 
1603  using ScalarType = MultTrait_< UnderlyingBuiltin_<VT>, ST >;
1605  return ReturnType( ~dv, UnaryPow<ScalarType>( exp ) );
1606 }
1607 //*************************************************************************************************
1608 
1609 
1610 //*************************************************************************************************
1627 template< typename VT // Type of the dense vector
1628  , bool TF > // Transpose flag
1629 inline decltype(auto) exp( const DenseVector<VT,TF>& dv )
1630 {
1632 
1633  using ReturnType = const DVecMapExpr<VT,Exp,TF>;
1634  return ReturnType( ~dv, Exp() );
1635 }
1636 //*************************************************************************************************
1637 
1638 
1639 //*************************************************************************************************
1656 template< typename VT // Type of the dense vector
1657  , bool TF > // Transpose flag
1658 inline decltype(auto) exp2( const DenseVector<VT,TF>& dv )
1659 {
1661 
1662  using ReturnType = const DVecMapExpr<VT,Exp2,TF>;
1663  return ReturnType( ~dv, Exp2() );
1664 }
1665 //*************************************************************************************************
1666 
1667 
1668 //*************************************************************************************************
1685 template< typename VT // Type of the dense vector
1686  , bool TF > // Transpose flag
1687 inline decltype(auto) exp10( const DenseVector<VT,TF>& dv )
1688 {
1690 
1691  using ReturnType = const DVecMapExpr<VT,Exp10,TF>;
1692  return ReturnType( ~dv, Exp10() );
1693 }
1694 //*************************************************************************************************
1695 
1696 
1697 //*************************************************************************************************
1717 template< typename VT // Type of the dense vector
1718  , bool TF > // Transpose flag
1719 inline decltype(auto) log( const DenseVector<VT,TF>& dv )
1720 {
1722 
1723  using ReturnType = const DVecMapExpr<VT,Log,TF>;
1724  return ReturnType( ~dv, Log() );
1725 }
1726 //*************************************************************************************************
1727 
1728 
1729 //*************************************************************************************************
1749 template< typename VT // Type of the dense vector
1750  , bool TF > // Transpose flag
1751 inline decltype(auto) log2( const DenseVector<VT,TF>& dv )
1752 {
1754 
1755  using ReturnType = const DVecMapExpr<VT,Log2,TF>;
1756  return ReturnType( ~dv, Log2() );
1757 }
1758 //*************************************************************************************************
1759 
1760 
1761 //*************************************************************************************************
1781 template< typename VT // Type of the dense vector
1782  , bool TF > // Transpose flag
1783 inline decltype(auto) log10( const DenseVector<VT,TF>& dv )
1784 {
1786 
1787  using ReturnType = const DVecMapExpr<VT,Log10,TF>;
1788  return ReturnType( ~dv, Log10() );
1789 }
1790 //*************************************************************************************************
1791 
1792 
1793 //*************************************************************************************************
1810 template< typename VT // Type of the dense vector
1811  , bool TF > // Transpose flag
1812 inline decltype(auto) sin( const DenseVector<VT,TF>& dv )
1813 {
1815 
1816  using ReturnType = const DVecMapExpr<VT,Sin,TF>;
1817  return ReturnType( ~dv, Sin() );
1818 }
1819 //*************************************************************************************************
1820 
1821 
1822 //*************************************************************************************************
1842 template< typename VT // Type of the dense vector
1843  , bool TF > // Transpose flag
1844 inline decltype(auto) asin( const DenseVector<VT,TF>& dv )
1845 {
1847 
1848  using ReturnType = const DVecMapExpr<VT,Asin,TF>;
1849  return ReturnType( ~dv, Asin() );
1850 }
1851 //*************************************************************************************************
1852 
1853 
1854 //*************************************************************************************************
1871 template< typename VT // Type of the dense vector
1872  , bool TF > // Transpose flag
1873 inline decltype(auto) sinh( const DenseVector<VT,TF>& dv )
1874 {
1876 
1877  using ReturnType = const DVecMapExpr<VT,Sinh,TF>;
1878  return ReturnType( ~dv, Sinh() );
1879 }
1880 //*************************************************************************************************
1881 
1882 
1883 //*************************************************************************************************
1900 template< typename VT // Type of the dense vector
1901  , bool TF > // Transpose flag
1902 inline decltype(auto) asinh( const DenseVector<VT,TF>& dv )
1903 {
1905 
1906  using ReturnType = const DVecMapExpr<VT,Asinh,TF>;
1907  return ReturnType( ~dv, Asinh() );
1908 }
1909 //*************************************************************************************************
1910 
1911 
1912 //*************************************************************************************************
1929 template< typename VT // Type of the dense vector
1930  , bool TF > // Transpose flag
1931 inline decltype(auto) cos( const DenseVector<VT,TF>& dv )
1932 {
1934 
1935  using ReturnType = const DVecMapExpr<VT,Cos,TF>;
1936  return ReturnType( ~dv, Cos() );
1937 }
1938 //*************************************************************************************************
1939 
1940 
1941 //*************************************************************************************************
1961 template< typename VT // Type of the dense vector
1962  , bool TF > // Transpose flag
1963 inline decltype(auto) acos( const DenseVector<VT,TF>& dv )
1964 {
1966 
1967  using ReturnType = const DVecMapExpr<VT,Acos,TF>;
1968  return ReturnType( ~dv, Acos() );
1969 }
1970 //*************************************************************************************************
1971 
1972 
1973 //*************************************************************************************************
1990 template< typename VT // Type of the dense vector
1991  , bool TF > // Transpose flag
1992 inline decltype(auto) cosh( const DenseVector<VT,TF>& dv )
1993 {
1995 
1996  using ReturnType = const DVecMapExpr<VT,Cosh,TF>;
1997  return ReturnType( ~dv, Cosh() );
1998 }
1999 //*************************************************************************************************
2000 
2001 
2002 //*************************************************************************************************
2022 template< typename VT // Type of the dense vector
2023  , bool TF > // Transpose flag
2024 inline decltype(auto) acosh( const DenseVector<VT,TF>& dv )
2025 {
2027 
2028  using ReturnType = const DVecMapExpr<VT,Acosh,TF>;
2029  return ReturnType( ~dv, Acosh() );
2030 }
2031 //*************************************************************************************************
2032 
2033 
2034 //*************************************************************************************************
2051 template< typename VT // Type of the dense vector
2052  , bool TF > // Transpose flag
2053 inline decltype(auto) tan( const DenseVector<VT,TF>& dv )
2054 {
2056 
2057  using ReturnType = const DVecMapExpr<VT,Tan,TF>;
2058  return ReturnType( ~dv, Tan() );
2059 }
2060 //*************************************************************************************************
2061 
2062 
2063 //*************************************************************************************************
2080 template< typename VT // Type of the dense vector
2081  , bool TF > // Transpose flag
2082 inline decltype(auto) atan( const DenseVector<VT,TF>& dv )
2083 {
2085 
2086  using ReturnType = const DVecMapExpr<VT,Atan,TF>;
2087  return ReturnType( ~dv, Atan() );
2088 }
2089 //*************************************************************************************************
2090 
2091 
2092 //*************************************************************************************************
2112 template< typename VT // Type of the dense vector
2113  , bool TF > // Transpose flag
2114 inline decltype(auto) tanh( const DenseVector<VT,TF>& dv )
2115 {
2117 
2118  using ReturnType = const DVecMapExpr<VT,Tanh,TF>;
2119  return ReturnType( ~dv, Tanh() );
2120 }
2121 //*************************************************************************************************
2122 
2123 
2124 //*************************************************************************************************
2144 template< typename VT // Type of the dense vector
2145  , bool TF > // Transpose flag
2146 inline decltype(auto) atanh( const DenseVector<VT,TF>& dv )
2147 {
2149 
2150  using ReturnType = const DVecMapExpr<VT,Atanh,TF>;
2151  return ReturnType( ~dv, Atanh() );
2152 }
2153 //*************************************************************************************************
2154 
2155 
2156 //*************************************************************************************************
2173 template< typename VT // Type of the dense vector
2174  , bool TF > // Transpose flag
2175 inline decltype(auto) erf( const DenseVector<VT,TF>& dv )
2176 {
2178 
2179  using ReturnType = const DVecMapExpr<VT,Erf,TF>;
2180  return ReturnType( ~dv, Erf() );
2181 }
2182 //*************************************************************************************************
2183 
2184 
2185 //*************************************************************************************************
2202 template< typename VT // Type of the dense vector
2203  , bool TF > // Transpose flag
2204 inline decltype(auto) erfc( const DenseVector<VT,TF>& dv )
2205 {
2207 
2208  using ReturnType = const DVecMapExpr<VT,Erfc,TF>;
2209  return ReturnType( ~dv, Erfc() );
2210 }
2211 //*************************************************************************************************
2212 
2213 
2214 
2215 
2216 //=================================================================================================
2217 //
2218 // GLOBAL RESTRUCTURING FUNCTIONS
2219 //
2220 //=================================================================================================
2221 
2222 //*************************************************************************************************
2233 template< typename VT // Type of the dense vector
2234  , bool TF > // Transpose flag
2235 inline decltype(auto) abs( const DVecMapExpr<VT,Abs,TF>& dv )
2236 {
2238 
2239  return dv;
2240 }
2242 //*************************************************************************************************
2243 
2244 
2245 //*************************************************************************************************
2256 template< typename VT // Type of the dense vector
2257  , bool TF > // Transpose flag
2258 inline decltype(auto) floor( const DVecMapExpr<VT,Floor,TF>& dv )
2259 {
2261 
2262  return dv;
2263 }
2265 //*************************************************************************************************
2266 
2267 
2268 //*************************************************************************************************
2279 template< typename VT // Type of the dense vector
2280  , bool TF > // Transpose flag
2281 inline decltype(auto) ceil( const DVecMapExpr<VT,Ceil,TF>& dv )
2282 {
2284 
2285  return dv;
2286 }
2288 //*************************************************************************************************
2289 
2290 
2291 //*************************************************************************************************
2302 template< typename VT // Type of the dense vector
2303  , bool TF > // Transpose flag
2304 inline decltype(auto) trunc( const DVecMapExpr<VT,Trunc,TF>& dv )
2305 {
2307 
2308  return dv;
2309 }
2311 //*************************************************************************************************
2312 
2313 
2314 //*************************************************************************************************
2325 template< typename VT // Type of the dense vector
2326  , bool TF > // Transpose flag
2327 inline decltype(auto) round( const DVecMapExpr<VT,Round,TF>& dv )
2328 {
2330 
2331  return dv;
2332 }
2334 //*************************************************************************************************
2335 
2336 
2337 //*************************************************************************************************
2355 template< typename VT // Type of the dense vector
2356  , bool TF > // Transpose flag
2357 inline decltype(auto) conj( const DVecMapExpr<VT,Conj,TF>& dv )
2358 {
2360 
2361  return dv.operand();
2362 }
2364 //*************************************************************************************************
2365 
2366 
2367 //*************************************************************************************************
2385 template< typename VT // Type of the dense vector
2386  , bool TF > // Transpose flag
2387 inline decltype(auto) conj( const DVecTransExpr<DVecMapExpr<VT,Conj,TF>,!TF>& dv )
2388 {
2390 
2391  using ReturnType = const DVecTransExpr<VT,!TF>;
2392  return ReturnType( dv.operand().operand() );
2393 }
2395 //*************************************************************************************************
2396 
2397 
2398 //*************************************************************************************************
2409 template< typename VT // Type of the dense vector
2410  , bool TF > // Transpose flag
2411 inline decltype(auto) real( const DVecMapExpr<VT,Real,TF>& dv )
2412 {
2414 
2415  return dv;
2416 }
2418 //*************************************************************************************************
2419 
2420 
2421 
2422 
2423 //=================================================================================================
2424 //
2425 // SIZE SPECIALIZATIONS
2426 //
2427 //=================================================================================================
2428 
2429 //*************************************************************************************************
2431 template< typename VT, typename OP, bool TF >
2432 struct Size< DVecMapExpr<VT,OP,TF>, 0UL >
2433  : public Size<VT,0UL>
2434 {};
2436 //*************************************************************************************************
2437 
2438 
2439 
2440 
2441 //=================================================================================================
2442 //
2443 // ISALIGNED SPECIALIZATIONS
2444 //
2445 //=================================================================================================
2446 
2447 //*************************************************************************************************
2449 template< typename VT, typename OP, bool TF >
2450 struct IsAligned< DVecMapExpr<VT,OP,TF> >
2451  : public IsAligned<VT>
2452 {};
2454 //*************************************************************************************************
2455 
2456 
2457 
2458 
2459 //=================================================================================================
2460 //
2461 // ISPADDED SPECIALIZATIONS
2462 //
2463 //=================================================================================================
2464 
2465 //*************************************************************************************************
2467 template< typename VT, typename OP, bool TF >
2468 struct IsPadded< DVecMapExpr<VT,OP,TF> >
2469  : public IsPadded<VT>
2470 {};
2472 //*************************************************************************************************
2473 
2474 } // namespace blaze
2475 
2476 #endif
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecMapExpr.h:481
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:187
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:106
OP op_
The custom unary operation.
Definition: DVecMapExpr.h:416
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:557
ElementType_< VT > ET
Element type of the dense vector expression.
Definition: DVecMapExpr.h:105
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:396
IfTrue_< useAssign, const ResultType, const DVecMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecMapExpr.h:169
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecMapExpr.h:162
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecMapExpr.h:372
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
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
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:1267
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:188
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:185
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:1903
Header file for the DenseVector base class.
Generic wrapper for the pow() function with fixed exponent.
Definition: Forward.h:119
Operation op_
The custom unary operation.
Definition: DVecMapExpr.h:585
DVecMapExpr(const VT &dv, OP op) noexcept
Constructor for the DVecMapExpr class.
Definition: DVecMapExpr.h:442
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
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:1950
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:192
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecMapExpr.h:232
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:194
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:408
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:71
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecMapExpr.h:467
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:339
Header file for the multiplication trait.
Header file for the unary map trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecMapExpr.h:264
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:58
#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
Header file for the UnderlyingBuiltin type trait.
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:275
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:384
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecMapExpr.h:577
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:3085
Header file for all functors.
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: DVecMapExpr.h:208
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:243
ConstIterator_< VT > IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecMapExpr.h:199
UnaryMapTrait_< RT, OP > ResultType
Result type for expression template evaluations.
Definition: DVecMapExpr.h:161
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.
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:186
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:328
decltype(std::declval< OP >()(std::declval< RN >())) ReturnType
Return type for expression template evaluations.
Definition: DVecMapExpr.h:166
Header file for the EnableIf class template.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:306
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:533
Header file for the IsNumeric type trait.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecMapExpr.h:503
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
Operand dv_
Dense vector of the map expression.
Definition: DVecMapExpr.h:584
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecMapExpr.h:545
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:567
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:175
Header file for run time assertion macros.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecMapExpr.h:254
Generic wrapper for the atanh() function.
Definition: Atanh.h:62
Iterator over the elements of the dense vector map expression.
Definition: DVecMapExpr.h:181
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:415
Generic wrapper for the asinh() function.
Definition: Asinh.h:62
ReferenceType reference
Reference return type.
Definition: DVecMapExpr.h:195
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
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:163
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:816
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:361
Expression object for the dense vector map() function.The DVecMapExpr class represents the compile ti...
Definition: DVecMapExpr.h:98
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:285
ValueType value_type
Type of the underlying elements.
Definition: DVecMapExpr.h:193
ResultType_< VT > RT
Result type of the dense vector expression.
Definition: DVecMapExpr.h:104
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
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:789
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:134
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:220
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecMapExpr.h:295
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:172
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
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
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecMapExpr.h:454
Expression object for dense vector transpositions.The DVecTransExpr class represents the compile time...
Definition: DVecTransExpr.h:92
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:523
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:513
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:350
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:493
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:317
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:1134