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>
68 #include <blaze/system/Inline.h>
69 #include <blaze/util/Assert.h>
70 #include <blaze/util/EnableIf.h>
73 #include <blaze/util/mpl/If.h>
74 #include <blaze/util/Types.h>
77 
78 
79 namespace blaze {
80 
81 //=================================================================================================
82 //
83 // CLASS DVECMAPEXPR
84 //
85 //=================================================================================================
86 
87 //*************************************************************************************************
94 template< typename VT // Type of the dense vector
95  , typename OP // Type of the custom operation
96  , bool TF > // Transpose flag
98  : public VecMapExpr< DenseVector< DVecMapExpr<VT,OP,TF>, TF > >
99  , private Computation
100 {
101  private:
102  //**Type definitions****************************************************************************
106  //**********************************************************************************************
107 
108  //**Serial evaluation strategy******************************************************************
110 
116  static constexpr bool useAssign = RequiresEvaluation_v<VT>;
117 
119  template< typename VT2 >
121  static constexpr bool UseAssign_v = useAssign;
123  //**********************************************************************************************
124 
125  //**Parallel evaluation strategy****************************************************************
127 
133  template< typename VT2 >
134  static constexpr bool UseSMPAssign_v =
137  //**********************************************************************************************
138 
139  public:
140  //**Type definitions****************************************************************************
146 
148  using ReturnType = decltype( std::declval<OP>()( std::declval<RN>() ) );
149 
152 
154  using Operand = If_t< IsExpression_v<VT>, const VT, const VT& >;
155 
157  using Operation = OP;
158  //**********************************************************************************************
159 
160  //**ConstIterator class definition**************************************************************
164  {
165  public:
166  //**Type definitions*************************************************************************
167  using IteratorCategory = std::random_access_iterator_tag;
172 
173  // STL iterator requirements
179 
182  //*******************************************************************************************
183 
184  //**Constructor******************************************************************************
190  explicit inline ConstIterator( IteratorType it, OP op )
191  : it_( it ) // Iterator to the current vector element
192  , op_( op ) // The custom unary operation
193  {}
194  //*******************************************************************************************
195 
196  //**Addition assignment operator*************************************************************
202  inline ConstIterator& operator+=( size_t inc ) {
203  it_ += inc;
204  return *this;
205  }
206  //*******************************************************************************************
207 
208  //**Subtraction assignment operator**********************************************************
214  inline ConstIterator& operator-=( size_t dec ) {
215  it_ -= dec;
216  return *this;
217  }
218  //*******************************************************************************************
219 
220  //**Prefix increment operator****************************************************************
226  ++it_;
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Postfix increment operator***************************************************************
236  inline const ConstIterator operator++( int ) {
237  return ConstIterator( it_++, op_ );
238  }
239  //*******************************************************************************************
240 
241  //**Prefix decrement operator****************************************************************
247  --it_;
248  return *this;
249  }
250  //*******************************************************************************************
251 
252  //**Postfix decrement operator***************************************************************
257  inline const ConstIterator operator--( int ) {
258  return ConstIterator( it_--, op_ );
259  }
260  //*******************************************************************************************
261 
262  //**Element access operator******************************************************************
267  inline ReturnType operator*() const {
268  return op_( *it_ );
269  }
270  //*******************************************************************************************
271 
272  //**Load function****************************************************************************
277  inline auto load() const noexcept {
278  return op_.load( it_.load() );
279  }
280  //*******************************************************************************************
281 
282  //**Equality operator************************************************************************
288  inline bool operator==( const ConstIterator& rhs ) const {
289  return it_ == rhs.it_;
290  }
291  //*******************************************************************************************
292 
293  //**Inequality operator**********************************************************************
299  inline bool operator!=( const ConstIterator& rhs ) const {
300  return it_ != rhs.it_;
301  }
302  //*******************************************************************************************
303 
304  //**Less-than operator***********************************************************************
310  inline bool operator<( const ConstIterator& rhs ) const {
311  return it_ < rhs.it_;
312  }
313  //*******************************************************************************************
314 
315  //**Greater-than operator********************************************************************
321  inline bool operator>( const ConstIterator& rhs ) const {
322  return it_ > rhs.it_;
323  }
324  //*******************************************************************************************
325 
326  //**Less-or-equal-than operator**************************************************************
332  inline bool operator<=( const ConstIterator& rhs ) const {
333  return it_ <= rhs.it_;
334  }
335  //*******************************************************************************************
336 
337  //**Greater-or-equal-than operator***********************************************************
343  inline bool operator>=( const ConstIterator& rhs ) const {
344  return it_ >= rhs.it_;
345  }
346  //*******************************************************************************************
347 
348  //**Subtraction operator*********************************************************************
354  inline DifferenceType operator-( const ConstIterator& rhs ) const {
355  return it_ - rhs.it_;
356  }
357  //*******************************************************************************************
358 
359  //**Addition operator************************************************************************
366  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
367  return ConstIterator( it.it_ + inc, it.op_ );
368  }
369  //*******************************************************************************************
370 
371  //**Addition operator************************************************************************
378  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
379  return ConstIterator( it.it_ + inc, it.op_ );
380  }
381  //*******************************************************************************************
382 
383  //**Subtraction operator*********************************************************************
390  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
391  return ConstIterator( it.it_ - dec, it.op_ );
392  }
393  //*******************************************************************************************
394 
395  private:
396  //**Member variables*************************************************************************
398  OP op_;
399  //*******************************************************************************************
400  };
401  //**********************************************************************************************
402 
403  public:
404  //**Compilation flags***************************************************************************
406  static constexpr bool simdEnabled =
407  ( VT::simdEnabled &&
408  If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET>, HasLoad<OP> >::value );
409 
411  static constexpr bool smpAssignable = VT::smpAssignable;
412  //**********************************************************************************************
413 
414  //**SIMD properties*****************************************************************************
416  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
417  //**********************************************************************************************
418 
419  //**Constructor*********************************************************************************
425  explicit inline DVecMapExpr( const VT& dv, OP op ) noexcept
426  : dv_( dv ) // Dense vector of the map expression
427  , op_( op ) // The custom unary operation
428  {}
429  //**********************************************************************************************
430 
431  //**Subscript operator**************************************************************************
437  inline ReturnType operator[]( size_t index ) const {
438  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
439  return op_( dv_[index] );
440  }
441  //**********************************************************************************************
442 
443  //**At function*********************************************************************************
450  inline ReturnType at( size_t index ) const {
451  if( index >= dv_.size() ) {
452  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
453  }
454  return (*this)[index];
455  }
456  //**********************************************************************************************
457 
458  //**Load function*******************************************************************************
464  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
465  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
466  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
467  return op_.load( dv_.load( index ) );
468  }
469  //**********************************************************************************************
470 
471  //**Begin function******************************************************************************
476  inline ConstIterator begin() const {
477  return ConstIterator( dv_.begin(), op_ );
478  }
479  //**********************************************************************************************
480 
481  //**End function********************************************************************************
486  inline ConstIterator end() const {
487  return ConstIterator( dv_.end(), op_ );
488  }
489  //**********************************************************************************************
490 
491  //**Size function*******************************************************************************
496  inline size_t size() const noexcept {
497  return dv_.size();
498  }
499  //**********************************************************************************************
500 
501  //**Operand access******************************************************************************
506  inline Operand operand() const noexcept {
507  return dv_;
508  }
509  //**********************************************************************************************
510 
511  //**Operation access****************************************************************************
516  inline Operation operation() const {
517  return op_;
518  }
519  //**********************************************************************************************
520 
521  //**********************************************************************************************
527  template< typename T >
528  inline bool canAlias( const T* alias ) const noexcept {
529  return IsExpression_v<VT> && dv_.canAlias( alias );
530  }
531  //**********************************************************************************************
532 
533  //**********************************************************************************************
539  template< typename T >
540  inline bool isAliased( const T* alias ) const noexcept {
541  return dv_.isAliased( alias );
542  }
543  //**********************************************************************************************
544 
545  //**********************************************************************************************
550  inline bool isAligned() const noexcept {
551  return dv_.isAligned();
552  }
553  //**********************************************************************************************
554 
555  //**********************************************************************************************
560  inline bool canSMPAssign() const noexcept {
561  return dv_.canSMPAssign();
562  }
563  //**********************************************************************************************
564 
565  private:
566  //**Member variables****************************************************************************
569  //**********************************************************************************************
570 
571  //**Assignment to dense vectors*****************************************************************
586  template< typename VT2 > // Type of the target dense vector
587  friend inline auto assign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
589  IsSame_v< UnderlyingNumeric_t<VT>, UnderlyingNumeric_t<VT2> > >
590  {
592 
593  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
594 
595  assign( ~lhs, rhs.dv_ );
596  assign( ~lhs, map( ~lhs, rhs.op_ ) );
597  }
599  //**********************************************************************************************
600 
601  //**Assignment to dense vectors*****************************************************************
616  template< typename VT2 > // Type of the target dense vector
617  friend inline auto assign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
619  !IsSame_v< UnderlyingNumeric_t<VT>, UnderlyingNumeric_t<VT2> > >
620  {
622 
626 
627  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
628 
629  const RT tmp( serial( rhs.dv_ ) );
630  assign( ~lhs, map( tmp, rhs.op_ ) );
631  }
633  //**********************************************************************************************
634 
635  //**Assignment to sparse vectors****************************************************************
649  template< typename VT2 > // Type of the target sparse vector
650  friend inline auto assign( SparseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
651  -> EnableIf_t< UseAssign_v<VT2> >
652  {
654 
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
660 
661  const RT tmp( serial( rhs.dv_ ) );
662  assign( ~lhs, map( tmp, rhs.op_ ) );
663  }
665  //**********************************************************************************************
666 
667  //**Addition assignment to dense vectors********************************************************
681  template< typename VT2 > // Type of the target dense vector
682  friend inline auto addAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
683  -> EnableIf_t< UseAssign_v<VT2> >
684  {
686 
690 
691  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
692 
693  const RT tmp( serial( rhs.dv_ ) );
694  addAssign( ~lhs, map( tmp, rhs.op_ ) );
695  }
697  //**********************************************************************************************
698 
699  //**Addition assignment to sparse vectors*******************************************************
700  // No special implementation for the addition assignment to sparse vectors.
701  //**********************************************************************************************
702 
703  //**Subtraction assignment to dense vectors*****************************************************
717  template< typename VT2 > // Type of the target dense vector
718  friend inline auto subAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
719  -> EnableIf_t< UseAssign_v<VT2> >
720  {
722 
726 
727  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
728 
729  const RT tmp( serial( rhs.dv_ ) );
730  subAssign( ~lhs, map( tmp, rhs.op_ ) );
731  }
733  //**********************************************************************************************
734 
735  //**Subtraction assignment to sparse vectors****************************************************
736  // No special implementation for the subtraction assignment to sparse vectors.
737  //**********************************************************************************************
738 
739  //**Multiplication assignment to dense vectors**************************************************
753  template< typename VT2 > // Type of the target dense vector
754  friend inline auto multAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
755  -> EnableIf_t< UseAssign_v<VT2> >
756  {
758 
762 
763  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
764 
765  const RT tmp( serial( rhs.dv_ ) );
766  multAssign( ~lhs, map( tmp, rhs.op_ ) );
767  }
769  //**********************************************************************************************
770 
771  //**Multiplication assignment to sparse vectors*************************************************
772  // No special implementation for the multiplication assignment to sparse vectors.
773  //**********************************************************************************************
774 
775  //**Division assignment to dense vectors********************************************************
789  template< typename VT2 > // Type of the target dense vector
790  friend inline auto divAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
791  -> EnableIf_t< UseAssign_v<VT2> >
792  {
794 
798 
799  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
800 
801  const RT tmp( serial( rhs.dv_ ) );
802  divAssign( ~lhs, map( tmp, rhs.op_ ) );
803  }
805  //**********************************************************************************************
806 
807  //**Division assignment to sparse vectors*******************************************************
808  // No special implementation for the division assignment to sparse vectors.
809  //**********************************************************************************************
810 
811  //**SMP assignment to dense vectors*************************************************************
826  template< typename VT2 > // Type of the target dense vector
827  friend inline auto smpAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
828  -> EnableIf_t< UseSMPAssign_v<VT2> &&
829  IsSame_v< UnderlyingNumeric_t<VT>, UnderlyingNumeric_t<VT2> > >
830  {
832 
833  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
834 
835  smpAssign( ~lhs, rhs.dv_ );
836  smpAssign( ~lhs, rhs.op_( ~lhs ) );
837  }
839  //**********************************************************************************************
840 
841  //**SMP assignment to dense vectors*************************************************************
856  template< typename VT2 > // Type of the target dense vector
857  friend inline auto smpAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
858  -> EnableIf_t< UseSMPAssign_v<VT2> &&
859  !IsSame_v< UnderlyingNumeric_t<VT>, UnderlyingNumeric_t<VT2> > >
860  {
862 
866 
867  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
868 
869  const RT tmp( rhs.dv_ );
870  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
871  }
873  //**********************************************************************************************
874 
875  //**SMP assignment to sparse vectors************************************************************
889  template< typename VT2 > // Type of the target sparse vector
890  friend inline auto smpAssign( SparseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
891  -> EnableIf_t< UseSMPAssign_v<VT2> >
892  {
894 
898 
899  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
900 
901  const RT tmp( rhs.dv_ );
902  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
903  }
905  //**********************************************************************************************
906 
907  //**SMP addition assignment to dense vectors****************************************************
921  template< typename VT2 > // Type of the target dense vector
922  friend inline auto smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
923  -> EnableIf_t< UseSMPAssign_v<VT2> >
924  {
926 
930 
931  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
932 
933  const RT tmp( rhs.dv_ );
934  smpAddAssign( ~lhs, map( tmp, rhs.op_ ) );
935  }
937  //**********************************************************************************************
938 
939  //**SMP addition assignment to sparse vectors***************************************************
940  // No special implementation for the SMP addition assignment to sparse vectors.
941  //**********************************************************************************************
942 
943  //**SMP subtraction assignment to dense vectors*************************************************
957  template< typename VT2 > // Type of the target dense vector
958  friend inline auto smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
959  -> EnableIf_t< UseSMPAssign_v<VT2> >
960  {
962 
966 
967  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
968 
969  const RT tmp( rhs.dv_ );
970  smpSubAssign( ~lhs, map( tmp, rhs.op_ ) );
971  }
973  //**********************************************************************************************
974 
975  //**SMP subtraction assignment to sparse vectors************************************************
976  // No special implementation for the SMP subtraction assignment to sparse vectors.
977  //**********************************************************************************************
978 
979  //**SMP multiplication assignment to dense vectors**********************************************
993  template< typename VT2 > // Type of the target dense vector
994  friend inline auto smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
995  -> EnableIf_t< UseSMPAssign_v<VT2> >
996  {
998 
1002 
1003  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1004 
1005  const RT tmp( rhs.dv_ );
1006  smpMultAssign( ~lhs, map( tmp, rhs.op_ ) );
1007  }
1009  //**********************************************************************************************
1010 
1011  //**SMP multiplication assignment to sparse vectors*********************************************
1012  // No special implementation for the SMP multiplication assignment to sparse vectors.
1013  //**********************************************************************************************
1014 
1015  //**SMP division assignment to dense vectors****************************************************
1029  template< typename VT2 > // Type of the target dense vector
1030  friend inline auto smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecMapExpr& rhs )
1031  -> EnableIf_t< UseSMPAssign_v<VT2> >
1032  {
1034 
1038 
1039  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
1040 
1041  const RT tmp( rhs.dv_ );
1042  smpDivAssign( ~lhs, map( tmp, rhs.op_ ) );
1043  }
1045  //**********************************************************************************************
1046 
1047  //**SMP division assignment to sparse vectors***************************************************
1048  // No special implementation for the SMP division assignment to sparse vectors.
1049  //**********************************************************************************************
1050 
1051  //**Compile time checks*************************************************************************
1056  //**********************************************************************************************
1057 };
1058 //*************************************************************************************************
1059 
1060 
1061 
1062 
1063 //=================================================================================================
1064 //
1065 // GLOBAL FUNCTIONS
1066 //
1067 //=================================================================================================
1068 
1069 //*************************************************************************************************
1087 template< typename VT // Type of the dense vector
1088  , bool TF // Transpose flag
1089  , typename OP > // Type of the custom operation
1090 inline decltype(auto) map( const DenseVector<VT,TF>& dv, OP op )
1091 {
1093 
1094  using ReturnType = const DVecMapExpr<VT,OP,TF>;
1095  return ReturnType( ~dv, op );
1096 }
1097 //*************************************************************************************************
1098 
1099 
1100 //*************************************************************************************************
1118 template< typename VT // Type of the dense vector
1119  , bool TF // Transpose flag
1120  , typename OP > // Type of the custom operation
1121 inline decltype(auto) forEach( const DenseVector<VT,TF>& dv, OP op )
1122 {
1124 
1125  using ReturnType = const DVecMapExpr<VT,OP,TF>;
1126  return ReturnType( ~dv, op );
1127 }
1128 //*************************************************************************************************
1129 
1130 
1131 //*************************************************************************************************
1148 template< typename VT // Type of the dense vector
1149  , bool TF > // Transpose flag
1150 inline decltype(auto) abs( const DenseVector<VT,TF>& dv )
1151 {
1153 
1154  using ReturnType = const DVecMapExpr<VT,Abs,TF>;
1155  return ReturnType( ~dv, Abs() );
1156 }
1157 //*************************************************************************************************
1158 
1159 
1160 //*************************************************************************************************
1177 template< typename VT // Type of the dense vector
1178  , bool TF > // Transpose flag
1179 inline decltype(auto) sign( const DenseVector<VT,TF>& dv )
1180 {
1182 
1183  using ReturnType = const DVecMapExpr<VT,Sign,TF>;
1184  return ReturnType( ~dv, Sign() );
1185 }
1186 //*************************************************************************************************
1187 
1188 
1189 //*************************************************************************************************
1206 template< typename VT // Type of the dense vector
1207  , bool TF > // Transpose flag
1208 inline decltype(auto) floor( const DenseVector<VT,TF>& dv )
1209 {
1211 
1212  using ReturnType = const DVecMapExpr<VT,Floor,TF>;
1213  return ReturnType( ~dv, Floor() );
1214 }
1215 //*************************************************************************************************
1216 
1217 
1218 //*************************************************************************************************
1235 template< typename VT // Type of the dense vector
1236  , bool TF > // Transpose flag
1237 inline decltype(auto) ceil( const DenseVector<VT,TF>& dv )
1238 {
1240 
1241  using ReturnType = const DVecMapExpr<VT,Ceil,TF>;
1242  return ReturnType( ~dv, Ceil() );
1243 }
1244 //*************************************************************************************************
1245 
1246 
1247 //*************************************************************************************************
1264 template< typename VT // Type of the dense vector
1265  , bool TF > // Transpose flag
1266 inline decltype(auto) trunc( const DenseVector<VT,TF>& dv )
1267 {
1269 
1270  using ReturnType = const DVecMapExpr<VT,Trunc,TF>;
1271  return ReturnType( ~dv, Trunc() );
1272 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1293 template< typename VT // Type of the dense vector
1294  , bool TF > // Transpose flag
1295 inline decltype(auto) round( const DenseVector<VT,TF>& dv )
1296 {
1298 
1299  using ReturnType = const DVecMapExpr<VT,Round,TF>;
1300  return ReturnType( ~dv, Round() );
1301 }
1302 //*************************************************************************************************
1303 
1304 
1305 //*************************************************************************************************
1322 template< typename VT // Type of the dense vector
1323  , bool TF > // Transpose flag
1324 inline decltype(auto) conj( const DenseVector<VT,TF>& dv )
1325 {
1327 
1328  using ReturnType = const DVecMapExpr<VT,Conj,TF>;
1329  return ReturnType( ~dv, Conj() );
1330 }
1331 //*************************************************************************************************
1332 
1333 
1334 //*************************************************************************************************
1360 template< typename VT // Type of the dense vector
1361  , bool TF > // Transpose flag
1362 inline decltype(auto) ctrans( const DenseVector<VT,TF>& dv )
1363 {
1365 
1366  return trans( conj( ~dv ) );
1367 }
1368 //*************************************************************************************************
1369 
1370 
1371 //*************************************************************************************************
1388 template< typename VT // Type of the dense vector
1389  , bool TF > // Transpose flag
1390 inline decltype(auto) real( const DenseVector<VT,TF>& dv )
1391 {
1393 
1394  using ReturnType = const DVecMapExpr<VT,Real,TF>;
1395  return ReturnType( ~dv, Real() );
1396 }
1397 //*************************************************************************************************
1398 
1399 
1400 //*************************************************************************************************
1417 template< typename VT // Type of the dense vector
1418  , bool TF > // Transpose flag
1419 inline decltype(auto) imag( const DenseVector<VT,TF>& dv )
1420 {
1422 
1423  using ReturnType = const DVecMapExpr<VT,Imag,TF>;
1424  return ReturnType( ~dv, Imag() );
1425 }
1426 //*************************************************************************************************
1427 
1428 
1429 //*************************************************************************************************
1449 template< typename VT // Type of the dense vector
1450  , bool TF > // Transpose flag
1451 inline decltype(auto) sqrt( const DenseVector<VT,TF>& dv )
1452 {
1454 
1455  using ReturnType = const DVecMapExpr<VT,Sqrt,TF>;
1456  return ReturnType( ~dv, Sqrt() );
1457 }
1458 //*************************************************************************************************
1459 
1460 
1461 //*************************************************************************************************
1481 template< typename VT // Type of the dense vector
1482  , bool TF > // Transpose flag
1483 inline decltype(auto) invsqrt( const DenseVector<VT,TF>& dv )
1484 {
1486 
1487  using ReturnType = const DVecMapExpr<VT,InvSqrt,TF>;
1488  return ReturnType( ~dv, InvSqrt() );
1489 }
1490 //*************************************************************************************************
1491 
1492 
1493 //*************************************************************************************************
1513 template< typename VT // Type of the dense vector
1514  , bool TF > // Transpose flag
1515 inline decltype(auto) cbrt( const DenseVector<VT,TF>& dv )
1516 {
1518 
1519  using ReturnType = const DVecMapExpr<VT,Cbrt,TF>;
1520  return ReturnType( ~dv, Cbrt() );
1521 }
1522 //*************************************************************************************************
1523 
1524 
1525 //*************************************************************************************************
1545 template< typename VT // Type of the dense vector
1546  , bool TF > // Transpose flag
1547 inline decltype(auto) invcbrt( const DenseVector<VT,TF>& dv )
1548 {
1550 
1551  using ReturnType = const DVecMapExpr<VT,InvCbrt,TF>;
1552  return ReturnType( ~dv, InvCbrt() );
1553 }
1554 //*************************************************************************************************
1555 
1556 
1557 //*************************************************************************************************
1576 template< typename VT // Type of the dense vector
1577  , bool TF // Transpose flag
1578  , typename DT > // Type of the delimiters
1579 inline decltype(auto) clamp( const DenseVector<VT,TF>& dv, const DT& min, const DT& max )
1580 {
1582 
1583  using ReturnType = const DVecMapExpr<VT,Clamp<DT>,TF>;
1584  return ReturnType( ~dv, Clamp<DT>( min, max ) );
1585 }
1586 //*************************************************************************************************
1587 
1588 
1589 //*************************************************************************************************
1607 template< typename VT // Type of the dense vector
1608  , bool TF // Transpose flag
1609  , typename ST // Type of the scalar exponent
1610  , EnableIf_t< IsNumeric_v<ST> >* = nullptr >
1611 inline decltype(auto) pow( const DenseVector<VT,TF>& dv, ST exp )
1612 {
1614 
1615  using ScalarType = MultTrait_t< UnderlyingBuiltin_t<VT>, ST >;
1617  return ReturnType( ~dv, UnaryPow<ScalarType>( exp ) );
1618 }
1619 //*************************************************************************************************
1620 
1621 
1622 //*************************************************************************************************
1639 template< typename VT // Type of the dense vector
1640  , bool TF > // Transpose flag
1641 inline decltype(auto) exp( const DenseVector<VT,TF>& dv )
1642 {
1644 
1645  using ReturnType = const DVecMapExpr<VT,Exp,TF>;
1646  return ReturnType( ~dv, Exp() );
1647 }
1648 //*************************************************************************************************
1649 
1650 
1651 //*************************************************************************************************
1668 template< typename VT // Type of the dense vector
1669  , bool TF > // Transpose flag
1670 inline decltype(auto) exp2( const DenseVector<VT,TF>& dv )
1671 {
1673 
1674  using ReturnType = const DVecMapExpr<VT,Exp2,TF>;
1675  return ReturnType( ~dv, Exp2() );
1676 }
1677 //*************************************************************************************************
1678 
1679 
1680 //*************************************************************************************************
1697 template< typename VT // Type of the dense vector
1698  , bool TF > // Transpose flag
1699 inline decltype(auto) exp10( const DenseVector<VT,TF>& dv )
1700 {
1702 
1703  using ReturnType = const DVecMapExpr<VT,Exp10,TF>;
1704  return ReturnType( ~dv, Exp10() );
1705 }
1706 //*************************************************************************************************
1707 
1708 
1709 //*************************************************************************************************
1729 template< typename VT // Type of the dense vector
1730  , bool TF > // Transpose flag
1731 inline decltype(auto) log( const DenseVector<VT,TF>& dv )
1732 {
1734 
1735  using ReturnType = const DVecMapExpr<VT,Log,TF>;
1736  return ReturnType( ~dv, Log() );
1737 }
1738 //*************************************************************************************************
1739 
1740 
1741 //*************************************************************************************************
1761 template< typename VT // Type of the dense vector
1762  , bool TF > // Transpose flag
1763 inline decltype(auto) log2( const DenseVector<VT,TF>& dv )
1764 {
1766 
1767  using ReturnType = const DVecMapExpr<VT,Log2,TF>;
1768  return ReturnType( ~dv, Log2() );
1769 }
1770 //*************************************************************************************************
1771 
1772 
1773 //*************************************************************************************************
1793 template< typename VT // Type of the dense vector
1794  , bool TF > // Transpose flag
1795 inline decltype(auto) log10( const DenseVector<VT,TF>& dv )
1796 {
1798 
1799  using ReturnType = const DVecMapExpr<VT,Log10,TF>;
1800  return ReturnType( ~dv, Log10() );
1801 }
1802 //*************************************************************************************************
1803 
1804 
1805 //*************************************************************************************************
1822 template< typename VT // Type of the dense vector
1823  , bool TF > // Transpose flag
1824 inline decltype(auto) sin( const DenseVector<VT,TF>& dv )
1825 {
1827 
1828  using ReturnType = const DVecMapExpr<VT,Sin,TF>;
1829  return ReturnType( ~dv, Sin() );
1830 }
1831 //*************************************************************************************************
1832 
1833 
1834 //*************************************************************************************************
1854 template< typename VT // Type of the dense vector
1855  , bool TF > // Transpose flag
1856 inline decltype(auto) asin( const DenseVector<VT,TF>& dv )
1857 {
1859 
1860  using ReturnType = const DVecMapExpr<VT,Asin,TF>;
1861  return ReturnType( ~dv, Asin() );
1862 }
1863 //*************************************************************************************************
1864 
1865 
1866 //*************************************************************************************************
1883 template< typename VT // Type of the dense vector
1884  , bool TF > // Transpose flag
1885 inline decltype(auto) sinh( const DenseVector<VT,TF>& dv )
1886 {
1888 
1889  using ReturnType = const DVecMapExpr<VT,Sinh,TF>;
1890  return ReturnType( ~dv, Sinh() );
1891 }
1892 //*************************************************************************************************
1893 
1894 
1895 //*************************************************************************************************
1912 template< typename VT // Type of the dense vector
1913  , bool TF > // Transpose flag
1914 inline decltype(auto) asinh( const DenseVector<VT,TF>& dv )
1915 {
1917 
1918  using ReturnType = const DVecMapExpr<VT,Asinh,TF>;
1919  return ReturnType( ~dv, Asinh() );
1920 }
1921 //*************************************************************************************************
1922 
1923 
1924 //*************************************************************************************************
1941 template< typename VT // Type of the dense vector
1942  , bool TF > // Transpose flag
1943 inline decltype(auto) cos( const DenseVector<VT,TF>& dv )
1944 {
1946 
1947  using ReturnType = const DVecMapExpr<VT,Cos,TF>;
1948  return ReturnType( ~dv, Cos() );
1949 }
1950 //*************************************************************************************************
1951 
1952 
1953 //*************************************************************************************************
1973 template< typename VT // Type of the dense vector
1974  , bool TF > // Transpose flag
1975 inline decltype(auto) acos( const DenseVector<VT,TF>& dv )
1976 {
1978 
1979  using ReturnType = const DVecMapExpr<VT,Acos,TF>;
1980  return ReturnType( ~dv, Acos() );
1981 }
1982 //*************************************************************************************************
1983 
1984 
1985 //*************************************************************************************************
2002 template< typename VT // Type of the dense vector
2003  , bool TF > // Transpose flag
2004 inline decltype(auto) cosh( const DenseVector<VT,TF>& dv )
2005 {
2007 
2008  using ReturnType = const DVecMapExpr<VT,Cosh,TF>;
2009  return ReturnType( ~dv, Cosh() );
2010 }
2011 //*************************************************************************************************
2012 
2013 
2014 //*************************************************************************************************
2034 template< typename VT // Type of the dense vector
2035  , bool TF > // Transpose flag
2036 inline decltype(auto) acosh( const DenseVector<VT,TF>& dv )
2037 {
2039 
2040  using ReturnType = const DVecMapExpr<VT,Acosh,TF>;
2041  return ReturnType( ~dv, Acosh() );
2042 }
2043 //*************************************************************************************************
2044 
2045 
2046 //*************************************************************************************************
2063 template< typename VT // Type of the dense vector
2064  , bool TF > // Transpose flag
2065 inline decltype(auto) tan( const DenseVector<VT,TF>& dv )
2066 {
2068 
2069  using ReturnType = const DVecMapExpr<VT,Tan,TF>;
2070  return ReturnType( ~dv, Tan() );
2071 }
2072 //*************************************************************************************************
2073 
2074 
2075 //*************************************************************************************************
2092 template< typename VT // Type of the dense vector
2093  , bool TF > // Transpose flag
2094 inline decltype(auto) atan( const DenseVector<VT,TF>& dv )
2095 {
2097 
2098  using ReturnType = const DVecMapExpr<VT,Atan,TF>;
2099  return ReturnType( ~dv, Atan() );
2100 }
2101 //*************************************************************************************************
2102 
2103 
2104 //*************************************************************************************************
2124 template< typename VT // Type of the dense vector
2125  , bool TF > // Transpose flag
2126 inline decltype(auto) tanh( const DenseVector<VT,TF>& dv )
2127 {
2129 
2130  using ReturnType = const DVecMapExpr<VT,Tanh,TF>;
2131  return ReturnType( ~dv, Tanh() );
2132 }
2133 //*************************************************************************************************
2134 
2135 
2136 //*************************************************************************************************
2156 template< typename VT // Type of the dense vector
2157  , bool TF > // Transpose flag
2158 inline decltype(auto) atanh( const DenseVector<VT,TF>& dv )
2159 {
2161 
2162  using ReturnType = const DVecMapExpr<VT,Atanh,TF>;
2163  return ReturnType( ~dv, Atanh() );
2164 }
2165 //*************************************************************************************************
2166 
2167 
2168 //*************************************************************************************************
2185 template< typename VT // Type of the dense vector
2186  , bool TF > // Transpose flag
2187 inline decltype(auto) erf( const DenseVector<VT,TF>& dv )
2188 {
2190 
2191  using ReturnType = const DVecMapExpr<VT,Erf,TF>;
2192  return ReturnType( ~dv, Erf() );
2193 }
2194 //*************************************************************************************************
2195 
2196 
2197 //*************************************************************************************************
2214 template< typename VT // Type of the dense vector
2215  , bool TF > // Transpose flag
2216 inline decltype(auto) erfc( const DenseVector<VT,TF>& dv )
2217 {
2219 
2220  using ReturnType = const DVecMapExpr<VT,Erfc,TF>;
2221  return ReturnType( ~dv, Erfc() );
2222 }
2223 //*************************************************************************************************
2224 
2225 
2226 
2227 
2228 //=================================================================================================
2229 //
2230 // GLOBAL RESTRUCTURING FUNCTIONS
2231 //
2232 //=================================================================================================
2233 
2234 //*************************************************************************************************
2245 template< typename VT // Type of the dense vector
2246  , bool TF > // Transpose flag
2247 inline decltype(auto) abs( const DVecMapExpr<VT,Abs,TF>& dv )
2248 {
2250 
2251  return dv;
2252 }
2254 //*************************************************************************************************
2255 
2256 
2257 //*************************************************************************************************
2268 template< typename VT // Type of the dense vector
2269  , bool TF > // Transpose flag
2270 inline decltype(auto) sign( const DVecMapExpr<VT,Sign,TF>& dv )
2271 {
2273 
2274  return dv;
2275 }
2277 //*************************************************************************************************
2278 
2279 
2280 //*************************************************************************************************
2291 template< typename VT // Type of the dense vector
2292  , bool TF > // Transpose flag
2293 inline decltype(auto) floor( const DVecMapExpr<VT,Floor,TF>& dv )
2294 {
2296 
2297  return dv;
2298 }
2300 //*************************************************************************************************
2301 
2302 
2303 //*************************************************************************************************
2314 template< typename VT // Type of the dense vector
2315  , bool TF > // Transpose flag
2316 inline decltype(auto) ceil( const DVecMapExpr<VT,Ceil,TF>& dv )
2317 {
2319 
2320  return dv;
2321 }
2323 //*************************************************************************************************
2324 
2325 
2326 //*************************************************************************************************
2337 template< typename VT // Type of the dense vector
2338  , bool TF > // Transpose flag
2339 inline decltype(auto) trunc( const DVecMapExpr<VT,Trunc,TF>& dv )
2340 {
2342 
2343  return dv;
2344 }
2346 //*************************************************************************************************
2347 
2348 
2349 //*************************************************************************************************
2360 template< typename VT // Type of the dense vector
2361  , bool TF > // Transpose flag
2362 inline decltype(auto) round( const DVecMapExpr<VT,Round,TF>& dv )
2363 {
2365 
2366  return dv;
2367 }
2369 //*************************************************************************************************
2370 
2371 
2372 //*************************************************************************************************
2390 template< typename VT // Type of the dense vector
2391  , bool TF > // Transpose flag
2392 inline decltype(auto) conj( const DVecMapExpr<VT,Conj,TF>& dv )
2393 {
2395 
2396  return dv.operand();
2397 }
2399 //*************************************************************************************************
2400 
2401 
2402 //*************************************************************************************************
2420 template< typename VT // Type of the dense vector
2421  , bool TF > // Transpose flag
2422 inline decltype(auto) conj( const DVecTransExpr<DVecMapExpr<VT,Conj,TF>,!TF>& dv )
2423 {
2425 
2426  using ReturnType = const DVecTransExpr<VT,!TF>;
2427  return ReturnType( dv.operand().operand() );
2428 }
2430 //*************************************************************************************************
2431 
2432 
2433 //*************************************************************************************************
2444 template< typename VT // Type of the dense vector
2445  , bool TF > // Transpose flag
2446 inline decltype(auto) real( const DVecMapExpr<VT,Real,TF>& dv )
2447 {
2449 
2450  return dv;
2451 }
2453 //*************************************************************************************************
2454 
2455 
2456 
2457 
2458 //=================================================================================================
2459 //
2460 // ISALIGNED SPECIALIZATIONS
2461 //
2462 //=================================================================================================
2463 
2464 //*************************************************************************************************
2466 template< typename VT, typename OP, bool TF >
2467 struct IsAligned< DVecMapExpr<VT,OP,TF> >
2468  : public IsAligned<VT>
2469 {};
2471 //*************************************************************************************************
2472 
2473 
2474 
2475 
2476 //=================================================================================================
2477 //
2478 // ISPADDED SPECIALIZATIONS
2479 //
2480 //=================================================================================================
2481 
2482 //*************************************************************************************************
2484 template< typename VT, typename OP, bool TF >
2485 struct IsPadded< DVecMapExpr<VT,OP,TF> >
2486  : public BoolConstant< IsPadded_v<VT> && IsPaddingEnabled_v<OP> >
2487 {};
2489 //*************************************************************************************************
2490 
2491 } // namespace blaze
2492 
2493 #endif
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecMapExpr.h:464
Header file for the UnderlyingNumeric type trait.
Generic wrapper for the trunc() function.
Definition: Trunc.h:80
Header file for the IsPaddingEnabled type trait.
ElementType * PointerType
Pointer return type.
Definition: DVecMapExpr.h:169
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:2038
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:80
decltype(auto) exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1701
OP op_
The custom unary operation.
Definition: DVecMapExpr.h:398
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:80
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecMapExpr.h:540
Header file for the HasLoad type trait.
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:378
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecMapExpr.h:354
Generic wrapper for the sin() function.
Definition: Sin.h:78
typename UnderlyingNumeric< T >::Type UnderlyingNumeric_t
Auxiliary alias declaration for the UnderlyingNumeric type trait.The UnderlyingNumeric_t alias declar...
Definition: UnderlyingNumeric.h:123
Generic wrapper for the conj() function.
Definition: Conj.h:82
Generic wrapper for the invsqrt() function.
Definition: InvSqrt.h:68
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1392
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.The MapTrait_t alias declaration provides...
Definition: MapTrait.h:160
ElementType_t< VT > ET
Element type of the dense vector expression.
Definition: DVecMapExpr.h:104
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:1239
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:1243
Header file for the VecMapExpr base class.
Generic wrapper for the acosh() function.
Definition: Acosh.h:68
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
ElementType & ReferenceType
Reference return type.
Definition: DVecMapExpr.h:170
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:1581
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecMapExpr.h:167
Header file for the DenseVector base class.
Generic wrapper for the pow() function with fixed exponent.
Definition: Forward.h:129
Operation op_
The custom unary operation.
Definition: DVecMapExpr.h:568
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DVecMapExpr.h:145
decltype(auto) sign(const DenseMatrix< MT, SO > &dm)
Applies the sign() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1181
DVecMapExpr(const VT &dv, OP op) noexcept
Constructor for the DVecMapExpr class.
Definition: DVecMapExpr.h:425
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
If_t< useAssign, const ResultType, const DVecMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecMapExpr.h:151
decltype(auto) acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1977
IteratorCategory iterator_category
The iterator category.
Definition: DVecMapExpr.h:174
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecMapExpr.h:214
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2189
ConstIterator_t< VT > IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecMapExpr.h:181
PointerType pointer
Pointer return type.
Definition: DVecMapExpr.h:176
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecMapExpr.h:390
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Generic wrapper for the abs() function.
Definition: Abs.h:82
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecMapExpr.h:450
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:82
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:321
If_t< IsExpression_v< VT >, const VT, const VT &> Operand
Composite data type of the dense vector expression.
Definition: DVecMapExpr.h:154
Header file for the multiplication trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecMapExpr.h:246
decltype(auto) cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1945
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:1364
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:73
Generic wrapper for the exp10() function.
Definition: Exp10.h:66
decltype(auto) exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1672
decltype(auto) sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1887
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:1858
decltype(auto) cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2006
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecMapExpr.h:257
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1147
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecMapExpr.h:366
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecMapExpr.h:560
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1517
#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:68
decltype(auto) trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1268
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
Header file for all functors.
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: DVecMapExpr.h:190
Header file for all SIMD functionality.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecMapExpr.h:225
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:66
Generic wrapper for the asin() function.
Definition: Asin.h:78
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:2096
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:1916
MapTrait_t< RT, OP > ResultType
Result type for expression template evaluations.
Definition: DVecMapExpr.h:143
Generic wrapper for the erf() function.
Definition: Erf.h:76
ElementType ValueType
Type of the underlying elements.
Definition: DVecMapExpr.h:168
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
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecMapExpr.h:411
Header file for the exception macros of the math module.
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1179
Constraint on the data type.
Header file for all forward declarations for expression class templates.
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecMapExpr.h:406
Generic wrapper for the floor() function.
Definition: Floor.h:80
decltype(auto) exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1643
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:310
decltype(std::declval< OP >()(std::declval< RN >())) ReturnType
Return type for expression template evaluations.
Definition: DVecMapExpr.h:148
Header file for the EnableIf class template.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:288
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:1152
decltype(auto) log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1733
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
Operation operation() const
Returns a copy of the custom operation.
Definition: DVecMapExpr.h:516
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:486
decltype(auto) floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1210
Operand dv_
Dense vector of the map expression.
Definition: DVecMapExpr.h:567
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecMapExpr.h:528
decltype(auto) round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1297
Header file for the IsSIMDEnabled type trait.
decltype(auto) tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2128
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecMapExpr.h:550
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:1123
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
OP Operation
Data type of the custom unary operation.
Definition: DVecMapExpr.h:157
Header file for run time assertion macros.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecMapExpr.h:236
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DVecMapExpr.h:416
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecMapExpr.h:144
Generic wrapper for the atanh() function.
Definition: Atanh.h:78
Iterator over the elements of the dense vector map expression.
Definition: DVecMapExpr.h:163
Generic wrapper for the invcbrt() function.
Definition: InvCbrt.h:66
Generic wrapper for the real() function.
Definition: Real.h:79
IteratorType it_
Iterator to the current vector element.
Definition: DVecMapExpr.h:397
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Generic wrapper for the asinh() function.
Definition: Asinh.h:78
ReferenceType reference
Reference return type.
Definition: DVecMapExpr.h:177
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:1549
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the map expression.
Definition: DVecMapExpr.h:116
Generic wrapper for the tan() function.
Definition: Tan.h:78
Generic wrapper for the log() function.
Definition: Log.h:68
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:2160
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Generic wrapper for the erfc() function.
Definition: Erfc.h:66
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Generic wrapper for the cos() function.
Definition: Cos.h:68
#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:343
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
Expression object for the dense vector map() function.The DVecMapExpr class represents the compile ti...
Definition: DVecMapExpr.h:97
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecMapExpr.h:267
ValueType value_type
Type of the underlying elements.
Definition: DVecMapExpr.h:175
Generic wrapper for the sign() function.
Definition: Sign.h:80
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecMapExpr.h:171
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1826
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:2218
ResultType_t< VT > RT
Result type of the dense vector expression.
Definition: DVecMapExpr.h:103
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1453
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecMapExpr.h:202
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecMapExpr.h:277
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Generic wrapper for the acos() function.
Definition: Acos.h:68
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:2067
Generic wrapper for the atan() function.
Definition: Atan.h:78
Generic wrapper for the round() function.
Definition: Round.h:80
Generic wrapper for the sinh() function.
Definition: Sinh.h:78
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:437
Header file for the map trait.
decltype(auto) log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1797
Generic wrapper for the log2() function.
Definition: Log2.h:66
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecMapExpr.h:506
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1421
Generic wrapper for the cosh() function.
Definition: Cosh.h:68
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1326
decltype(auto) log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1765
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:1485
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecMapExpr.h:496
Generic wrapper for the tanh() function.
Definition: Tanh.h:78
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:332
ReturnType_t< VT > RN
Return type of the dense vector expression.
Definition: DVecMapExpr.h:105
Generic wrapper for the exp() function.
Definition: Exp.h:68
System settings for the inline keywords.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:191
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecMapExpr.h:476
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecMapExpr.h:299
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:1110