DMatForEachExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATFOREACHEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATFOREACHEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
45 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
53 #include <blaze/math/Functors.h>
55 #include <blaze/math/SIMD.h>
78 #include <blaze/system/Inline.h>
79 #include <blaze/util/Assert.h>
82 #include <blaze/util/EnableIf.h>
85 #include <blaze/util/mpl/And.h>
86 #include <blaze/util/mpl/If.h>
87 #include <blaze/util/mpl/Not.h>
88 #include <blaze/util/Template.h>
89 #include <blaze/util/Types.h>
93 
94 
95 namespace blaze {
96 
97 //=================================================================================================
98 //
99 // CLASS DMATFOREACHEXPR
100 //
101 //=================================================================================================
102 
103 //*************************************************************************************************
110 template< typename MT // Type of the dense matrix
111  , typename OP // Type of the custom operation
112  , bool SO > // Storage order
113 class DMatForEachExpr : public DenseMatrix< DMatForEachExpr<MT,OP,SO>, SO >
114  , private MatForEachExpr
115  , private Computation
116 {
117  private:
118  //**Type definitions****************************************************************************
119  typedef ResultType_<MT> RT;
122  typedef ReturnType_<MT> RN;
123 
125  BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( HasSIMDEnabled, simdEnabled );
126 
129  //**********************************************************************************************
130 
131  //**Serial evaluation strategy******************************************************************
133 
139  enum : bool { useAssign = RequiresEvaluation<MT>::value };
140 
142  template< typename MT2 >
144  struct UseAssign {
145  enum : bool { value = useAssign };
146  };
148  //**********************************************************************************************
149 
150  //**Parallel evaluation strategy****************************************************************
152 
158  template< typename MT2 >
159  struct UseSMPAssign {
160  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
161  };
163  //**********************************************************************************************
164 
165  //**SIMD support detection**********************************************************************
167  struct UseSIMDEnabledFlag {
169  enum : bool { value = OP::BLAZE_TEMPLATE simdEnabled<ET>() };
170  };
172  //**********************************************************************************************
173 
174  public:
175  //**Type definitions****************************************************************************
181 
183  typedef decltype( std::declval<OP>()( std::declval<RN>() ) ) ReturnType;
184 
186  typedef IfTrue_< useAssign, const ResultType, const DMatForEachExpr& > CompositeType;
187 
189  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
190 
192  typedef OP Operation;
193  //**********************************************************************************************
194 
195  //**ConstIterator class definition**************************************************************
199  {
200  public:
201  //**Type definitions*************************************************************************
202  typedef std::random_access_iterator_tag IteratorCategory;
203  typedef ElementType ValueType;
204  typedef ElementType* PointerType;
205  typedef ElementType& ReferenceType;
207 
208  // STL iterator requirements
209  typedef IteratorCategory iterator_category;
210  typedef ValueType value_type;
211  typedef PointerType pointer;
212  typedef ReferenceType reference;
213  typedef DifferenceType difference_type;
214 
217  //*******************************************************************************************
218 
219  //**Constructor******************************************************************************
225  explicit inline ConstIterator( IteratorType it, OP op )
226  : it_( it ) // Iterator to the current matrix element
227  , op_( op ) // The custom unary operation
228  {}
229  //*******************************************************************************************
230 
231  //**Addition assignment operator*************************************************************
237  inline ConstIterator& operator+=( size_t inc ) {
238  it_ += inc;
239  return *this;
240  }
241  //*******************************************************************************************
242 
243  //**Subtraction assignment operator**********************************************************
249  inline ConstIterator& operator-=( size_t dec ) {
250  it_ -= dec;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Prefix increment operator****************************************************************
260  inline ConstIterator& operator++() {
261  ++it_;
262  return *this;
263  }
264  //*******************************************************************************************
265 
266  //**Postfix increment operator***************************************************************
271  inline const ConstIterator operator++( int ) {
272  return ConstIterator( it_++, op_ );
273  }
274  //*******************************************************************************************
275 
276  //**Prefix decrement operator****************************************************************
281  inline ConstIterator& operator--() {
282  --it_;
283  return *this;
284  }
285  //*******************************************************************************************
286 
287  //**Postfix decrement operator***************************************************************
292  inline const ConstIterator operator--( int ) {
293  return ConstIterator( it_--, op_ );
294  }
295  //*******************************************************************************************
296 
297  //**Element access operator******************************************************************
302  inline ReturnType operator*() const {
303  return op_( *it_ );
304  }
305  //*******************************************************************************************
306 
307  //**Load function****************************************************************************
312  inline auto load() const noexcept {
313  return op_.load( it_.load() );
314  }
315  //*******************************************************************************************
316 
317  //**Equality operator************************************************************************
323  inline bool operator==( const ConstIterator& rhs ) const {
324  return it_ == rhs.it_;
325  }
326  //*******************************************************************************************
327 
328  //**Inequality operator**********************************************************************
334  inline bool operator!=( const ConstIterator& rhs ) const {
335  return it_ != rhs.it_;
336  }
337  //*******************************************************************************************
338 
339  //**Less-than operator***********************************************************************
345  inline bool operator<( const ConstIterator& rhs ) const {
346  return it_ < rhs.it_;
347  }
348  //*******************************************************************************************
349 
350  //**Greater-than operator********************************************************************
356  inline bool operator>( const ConstIterator& rhs ) const {
357  return it_ > rhs.it_;
358  }
359  //*******************************************************************************************
360 
361  //**Less-or-equal-than operator**************************************************************
367  inline bool operator<=( const ConstIterator& rhs ) const {
368  return it_ <= rhs.it_;
369  }
370  //*******************************************************************************************
371 
372  //**Greater-or-equal-than operator***********************************************************
378  inline bool operator>=( const ConstIterator& rhs ) const {
379  return it_ >= rhs.it_;
380  }
381  //*******************************************************************************************
382 
383  //**Subtraction operator*********************************************************************
389  inline DifferenceType operator-( const ConstIterator& rhs ) const {
390  return it_ - rhs.it_;
391  }
392  //*******************************************************************************************
393 
394  //**Addition operator************************************************************************
401  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
402  return ConstIterator( it.it_ + inc, it.op_ );
403  }
404  //*******************************************************************************************
405 
406  //**Addition operator************************************************************************
413  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
414  return ConstIterator( it.it_ + inc, it.op_ );
415  }
416  //*******************************************************************************************
417 
418  //**Subtraction operator*********************************************************************
425  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
426  return ConstIterator( it.it_ - dec, it.op_ );
427  }
428  //*******************************************************************************************
429 
430  private:
431  //**Member variables*************************************************************************
432  IteratorType it_;
433  OP op_;
434  //*******************************************************************************************
435  };
436  //**********************************************************************************************
437 
438  //**Compilation flags***************************************************************************
440  enum : bool { simdEnabled = MT::simdEnabled &&
441  If_< HasSIMDEnabled<OP>, UseSIMDEnabledFlag, HasLoad<OP> >::value };
442 
444  enum : bool { smpAssignable = MT::smpAssignable };
445  //**********************************************************************************************
446 
447  //**SIMD properties*****************************************************************************
449  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
450  //**********************************************************************************************
451 
452  //**Constructor*********************************************************************************
458  explicit inline DMatForEachExpr( const MT& dm, OP op ) noexcept
459  : dm_( dm ) // Dense matrix of the for-each expression
460  , op_( op ) // The custom unary operation
461  {}
462  //**********************************************************************************************
463 
464  //**Access operator*****************************************************************************
471  inline ReturnType operator()( size_t i, size_t j ) const noexcept {
472  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
473  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
474  return op_( dm_(i,j) );
475  }
476  //**********************************************************************************************
477 
478  //**At function*********************************************************************************
486  inline ReturnType at( size_t i, size_t j ) const {
487  if( i >= dm_.rows() ) {
488  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
489  }
490  if( j >= dm_.columns() ) {
491  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
492  }
493  return (*this)(i,j);
494  }
495  //**********************************************************************************************
496 
497  //**Load function*******************************************************************************
504  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
505  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
506  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
507  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
508  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
509  return op_.load( dm_.load(i,j) );
510  }
511  //**********************************************************************************************
512 
513  //**Begin function******************************************************************************
519  inline ConstIterator begin( size_t i ) const {
520  return ConstIterator( dm_.begin(i), op_ );
521  }
522  //**********************************************************************************************
523 
524  //**End function********************************************************************************
530  inline ConstIterator end( size_t i ) const {
531  return ConstIterator( dm_.end(i), op_ );
532  }
533  //**********************************************************************************************
534 
535  //**Rows function*******************************************************************************
540  inline size_t rows() const noexcept {
541  return dm_.rows();
542  }
543  //**********************************************************************************************
544 
545  //**Columns function****************************************************************************
550  inline size_t columns() const noexcept {
551  return dm_.columns();
552  }
553  //**********************************************************************************************
554 
555  //**Operand access******************************************************************************
560  inline Operand operand() const noexcept {
561  return dm_;
562  }
563  //**********************************************************************************************
564 
565  //**Operation access****************************************************************************
570  inline Operation operation() const {
571  return op_;
572  }
573  //**********************************************************************************************
574 
575  //**********************************************************************************************
581  template< typename T >
582  inline bool canAlias( const T* alias ) const noexcept {
583  return IsComputation<MT>::value && dm_.canAlias( alias );
584  }
585  //**********************************************************************************************
586 
587  //**********************************************************************************************
593  template< typename T >
594  inline bool isAliased( const T* alias ) const noexcept {
595  return dm_.isAliased( alias );
596  }
597  //**********************************************************************************************
598 
599  //**********************************************************************************************
604  inline bool isAligned() const noexcept {
605  return dm_.isAligned();
606  }
607  //**********************************************************************************************
608 
609  //**********************************************************************************************
614  inline bool canSMPAssign() const noexcept {
615  return dm_.canSMPAssign();
616  }
617  //**********************************************************************************************
618 
619  private:
620  //**Member variables****************************************************************************
623  //**********************************************************************************************
624 
625  //**Assignment to dense matrices****************************************************************
640  template< typename MT2 // Type of the target dense matrix
641  , bool SO2 > // Storage order or the target dense matrix
642  friend inline EnableIf_< And< UseAssign<MT2>
644  assign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
645  {
647 
648  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
649  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
650 
651  assign( ~lhs, rhs.dm_ );
652  assign( ~lhs, rhs.op_( ~lhs ) );
653  }
655  //**********************************************************************************************
656 
657  //**Assignment to dense matrices****************************************************************
672  template< typename MT2 // Type of the target dense matrix
673  , bool SO2 > // Storage order or the target dense matrix
674  friend inline EnableIf_< And< UseAssign<MT2>
676  assign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
677  {
679 
683 
684  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
685  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
686 
687  const RT tmp( serial( rhs.dm_ ) );
688  assign( ~lhs, forEach( tmp, rhs.op_ ) );
689  }
691  //**********************************************************************************************
692 
693  //**Assignment to sparse matrices***************************************************************
707  template< typename MT2 // Type of the target sparse matrix
708  , bool SO2 > // Storage order or the target sparse matrix
709  friend inline EnableIf_< UseAssign<MT2> >
710  assign( SparseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
711  {
713 
714  typedef IfTrue_< SO == SO2, RT, OT > TmpType;
715 
721  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<TmpType> );
722 
723  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
724  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
725 
726  const TmpType tmp( serial( rhs.dm_ ) );
727  assign( ~lhs, rhs.op_( tmp ) );
728  }
730  //**********************************************************************************************
731 
732  //**Addition assignment to dense matrices*******************************************************
746  template< typename MT2 // Type of the target dense matrix
747  , bool SO2 > // Storage order of the target dense matrix
748  friend inline EnableIf_< UseAssign<MT2> >
749  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
750  {
752 
755  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
756 
757  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
758  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
759 
760  const RT tmp( serial( rhs.dm_ ) );
761  addAssign( ~lhs, forEach( tmp, rhs.op_ ) );
762  }
764  //**********************************************************************************************
765 
766  //**Addition assignment to sparse matrices******************************************************
767  // No special implementation for the addition assignment to sparse matrices.
768  //**********************************************************************************************
769 
770  //**Subtraction assignment to dense matrices****************************************************
784  template< typename MT2 // Type of the target dense matrix
785  , bool SO2 > // Storage order of the target dense matrix
786  friend inline EnableIf_< UseAssign<MT2> >
787  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
788  {
790 
793  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
794 
795  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
796  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
797 
798  const RT tmp( serial( rhs.dm_ ) );
799  subAssign( ~lhs, forEach( tmp, rhs.op_ ) );
800  }
802  //**********************************************************************************************
803 
804  //**Subtraction assignment to sparse matrices***************************************************
805  // No special implementation for the subtraction assignment to sparse matrices.
806  //**********************************************************************************************
807 
808  //**Multiplication assignment to dense matrices*************************************************
809  // No special implementation for the multiplication assignment to dense matrices.
810  //**********************************************************************************************
811 
812  //**Multiplication assignment to sparse matrices************************************************
813  // No special implementation for the multiplication assignment to sparse matrices.
814  //**********************************************************************************************
815 
816  //**SMP assignment to dense matrices************************************************************
831  template< typename MT2 // Type of the target dense matrix
832  , bool SO2 > // Storage order or the target dense matrix
833  friend inline EnableIf_< And< UseSMPAssign<MT2>
834  , IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > >
835  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
836  {
838 
839  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
840  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
841 
842  smpAssign( ~lhs, rhs.dm_ );
843  smpAssign( ~lhs, rhs.op_( ~lhs ) );
844  }
846  //**********************************************************************************************
847 
848  //**SMP assignment to dense matrices************************************************************
863  template< typename MT2 // Type of the target dense matrix
864  , bool SO2 > // Storage order or the target dense matrix
865  friend inline EnableIf_< And< UseSMPAssign<MT2>
866  , Not< IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > > >
867  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
868  {
870 
873  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
874 
875  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
876  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
877 
878  const RT tmp( rhs.dm_ );
879  smpAssign( ~lhs, forEach( tmp, rhs.op_ ) );
880  }
882  //**********************************************************************************************
883 
884  //**SMP assignment to sparse matrices***********************************************************
898  template< typename MT2 // Type of the target sparse matrix
899  , bool SO2 > // Storage order or the target sparse matrix
900  friend inline EnableIf_< UseSMPAssign<MT2> >
901  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
902  {
904 
905  typedef IfTrue_< SO == SO2, RT, OT > TmpType;
906 
912  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<TmpType> );
913 
914  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
915  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
916 
917  const TmpType tmp( rhs.dm_ );
918  smpAssign( ~lhs, rhs.op_( tmp ) );
919  }
921  //**********************************************************************************************
922 
923  //**SMP addition assignment to dense matrices***************************************************
937  template< typename MT2 // Type of the target dense matrix
938  , bool SO2 > // Storage order of the target dense matrix
939  friend inline EnableIf_< UseSMPAssign<MT2> >
940  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
941  {
943 
946  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
947 
948  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
949  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
950 
951  const RT tmp( rhs.dm_ );
952  smpAddAssign( ~lhs, forEach( tmp, rhs.op_ ) );
953  }
955  //**********************************************************************************************
956 
957  //**SMP addition assignment to sparse matrices**************************************************
958  // No special implementation for the SMP addition assignment to sparse matrices.
959  //**********************************************************************************************
960 
961  //**SMP subtraction assignment to dense matrices************************************************
975  template< typename MT2 // Type of the target dense matrix
976  , bool SO2 > // Storage order of the target dense matrix
977  friend inline EnableIf_< UseSMPAssign<MT2> >
978  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatForEachExpr& rhs )
979  {
981 
984  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
985 
986  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
987  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
988 
989  const RT tmp( rhs.dm_ );
990  smpSubAssign( ~lhs, forEach( tmp, rhs.op_ ) );
991  }
993  //**********************************************************************************************
994 
995  //**SMP subtraction assignment to sparse matrices***********************************************
996  // No special implementation for the SMP subtraction assignment to sparse matrices.
997  //**********************************************************************************************
998 
999  //**SMP multiplication assignment to dense matrices*********************************************
1000  // No special implementation for the SMP multiplication assignment to dense matrices.
1001  //**********************************************************************************************
1002 
1003  //**SMP multiplication assignment to sparse matrices********************************************
1004  // No special implementation for the SMP multiplication assignment to sparse matrices.
1005  //**********************************************************************************************
1006 
1007  //**Compile time checks*************************************************************************
1012  //**********************************************************************************************
1013 };
1014 //*************************************************************************************************
1015 
1016 
1017 
1018 
1019 //=================================================================================================
1020 //
1021 // GLOBAL FUNCTIONS
1022 //
1023 //=================================================================================================
1024 
1025 //*************************************************************************************************
1043 template< typename MT // Type of the dense matrix
1044  , bool SO // Storage order
1045  , typename OP > // Type of the custom operation
1046 inline const DMatForEachExpr<MT,OP,SO> forEach( const DenseMatrix<MT,SO>& dm, OP op )
1047 {
1049 
1050  return DMatForEachExpr<MT,OP,SO>( ~dm, op );
1051 }
1052 //*************************************************************************************************
1053 
1054 
1055 //*************************************************************************************************
1072 template< typename MT // Type of the dense matrix
1073  , bool SO > // Storage order
1075 {
1077 
1078  return DMatForEachExpr<MT,Abs,SO>( ~dm, Abs() );
1079 }
1080 //*************************************************************************************************
1081 
1082 
1083 //*************************************************************************************************
1100 template< typename MT // Type of the dense matrix
1101  , bool SO > // Storage order
1103 {
1105 
1106  return DMatForEachExpr<MT,Floor,SO>( ~dm, Floor() );
1107 }
1108 //*************************************************************************************************
1109 
1110 
1111 //*************************************************************************************************
1128 template< typename MT // Type of the dense matrix
1129  , bool SO > // Storage order
1131 {
1133 
1134  return DMatForEachExpr<MT,Ceil,SO>( ~dm, Ceil() );
1135 }
1136 //*************************************************************************************************
1137 
1138 
1139 //*************************************************************************************************
1156 template< typename MT // Type of the dense matrix
1157  , bool SO > // Storage order
1159 {
1161 
1162  return DMatForEachExpr<MT,Conj,SO>( ~dm, Conj() );
1163 }
1164 //*************************************************************************************************
1165 
1166 
1167 //*************************************************************************************************
1193 template< typename MT // Type of the dense matrix
1194  , bool SO > // Storage order
1196 {
1198 
1199  return trans( conj( ~dm ) );
1200 }
1201 //*************************************************************************************************
1202 
1203 
1204 //*************************************************************************************************
1221 template< typename MT // Type of the dense matrix
1222  , bool SO > // Storage order
1224 {
1226 
1227  return DMatForEachExpr<MT,Real,SO>( ~dm, Real() );
1228 }
1229 //*************************************************************************************************
1230 
1231 
1232 //*************************************************************************************************
1249 template< typename MT // Type of the dense matrix
1250  , bool SO > // Storage order
1252 {
1254 
1255  return DMatForEachExpr<MT,Imag,SO>( ~dm, Imag() );
1256 }
1257 //*************************************************************************************************
1258 
1259 
1260 //*************************************************************************************************
1280 template< typename MT // Type of the dense matrix
1281  , bool SO > // Storage order
1283 {
1285 
1286  return DMatForEachExpr<MT,Sqrt,SO>( ~dm, Sqrt() );
1287 }
1288 //*************************************************************************************************
1289 
1290 
1291 //*************************************************************************************************
1311 template< typename MT // Type of the dense matrix
1312  , bool SO > // Storage order
1314 {
1316 
1317  return DMatForEachExpr<MT,InvSqrt,SO>( ~dm, InvSqrt() );
1318 }
1319 //*************************************************************************************************
1320 
1321 
1322 //*************************************************************************************************
1342 template< typename MT // Type of the dense matrix
1343  , bool SO > // Storage order
1345 {
1347 
1348  return DMatForEachExpr<MT,Cbrt,SO>( ~dm, Cbrt() );
1349 }
1350 //*************************************************************************************************
1351 
1352 
1353 //*************************************************************************************************
1373 template< typename MT // Type of the dense matrix
1374  , bool SO > // Storage order
1376 {
1378 
1379  return DMatForEachExpr<MT,InvCbrt,SO>( ~dm, InvCbrt() );
1380 }
1381 //*************************************************************************************************
1382 
1383 
1384 //*************************************************************************************************
1403 template< typename MT // Type of the dense matrix
1404  , bool SO // Storage order
1405  , typename DT > // Type of the delimiters
1406 inline const DMatForEachExpr<MT,Clip<DT>,SO>
1407  clip( const DenseMatrix<MT,SO>& dm, const DT& min, const DT& max )
1408 {
1410 
1411  return DMatForEachExpr<MT,Clip<DT>,SO>( ~dm, Clip<DT>( min, max ) );
1412 }
1413 //*************************************************************************************************
1414 
1415 
1416 //*************************************************************************************************
1434 template< typename MT // Type of the dense matrix
1435  , bool SO // Storage order
1436  , typename ET > // Type of the exponent
1437 inline const DMatForEachExpr<MT,Pow<ET>,SO> pow( const DenseMatrix<MT,SO>& dm, ET exp )
1438 {
1440 
1442 
1443  return DMatForEachExpr<MT,Pow<ET>,SO>( ~dm, Pow<ET>( exp ) );
1444 }
1445 //*************************************************************************************************
1446 
1447 
1448 //*************************************************************************************************
1465 template< typename MT // Type of the dense matrix
1466  , bool SO > // Storage order
1468 {
1470 
1471  return DMatForEachExpr<MT,Exp,SO>( ~dm, Exp() );
1472 }
1473 //*************************************************************************************************
1474 
1475 
1476 //*************************************************************************************************
1496 template< typename MT // Type of the dense matrix
1497  , bool SO > // Storage order
1499 {
1501 
1502  return DMatForEachExpr<MT,Log,SO>( ~dm, Log() );
1503 }
1504 //*************************************************************************************************
1505 
1506 
1507 //*************************************************************************************************
1527 template< typename MT // Type of the dense matrix
1528  , bool SO > // Storage order
1530 {
1532 
1533  return DMatForEachExpr<MT,Log10,SO>( ~dm, Log10() );
1534 }
1535 //*************************************************************************************************
1536 
1537 
1538 //*************************************************************************************************
1555 template< typename MT // Type of the dense matrix
1556  , bool SO > // Storage order
1558 {
1560 
1561  return DMatForEachExpr<MT,Sin,SO>( ~dm, Sin() );
1562 }
1563 //*************************************************************************************************
1564 
1565 
1566 //*************************************************************************************************
1586 template< typename MT // Type of the dense matrix
1587  , bool SO > // Storage order
1589 {
1591 
1592  return DMatForEachExpr<MT,Asin,SO>( ~dm, Asin() );
1593 }
1594 //*************************************************************************************************
1595 
1596 
1597 //*************************************************************************************************
1614 template< typename MT // Type of the dense matrix
1615  , bool SO > // Storage order
1617 {
1619 
1620  return DMatForEachExpr<MT,Sinh,SO>( ~dm, Sinh() );
1621 }
1622 //*************************************************************************************************
1623 
1624 
1625 //*************************************************************************************************
1642 template< typename MT // Type of the dense matrix
1643  , bool SO > // Storage order
1645 {
1647 
1648  return DMatForEachExpr<MT,Asinh,SO>( ~dm, Asinh() );
1649 }
1650 //*************************************************************************************************
1651 
1652 
1653 //*************************************************************************************************
1670 template< typename MT // Type of the dense matrix
1671  , bool SO > // Storage order
1673 {
1675 
1676  return DMatForEachExpr<MT,Cos,SO>( ~dm, Cos() );
1677 }
1678 //*************************************************************************************************
1679 
1680 
1681 //*************************************************************************************************
1701 template< typename MT // Type of the dense matrix
1702  , bool SO > // Storage order
1704 {
1706 
1707  return DMatForEachExpr<MT,Acos,SO>( ~dm, Acos() );
1708 }
1709 //*************************************************************************************************
1710 
1711 
1712 //*************************************************************************************************
1729 template< typename MT // Type of the dense matrix
1730  , bool SO > // Storage order
1732 {
1734 
1735  return DMatForEachExpr<MT,Cosh,SO>( ~dm, Cosh() );
1736 }
1737 //*************************************************************************************************
1738 
1739 
1740 //*************************************************************************************************
1760 template< typename MT // Type of the dense matrix
1761  , bool SO > // Storage order
1763 {
1765 
1766  return DMatForEachExpr<MT,Acosh,SO>( ~dm, Acosh() );
1767 }
1768 //*************************************************************************************************
1769 
1770 
1771 //*************************************************************************************************
1788 template< typename MT // Type of the dense matrix
1789  , bool SO > // Storage order
1791 {
1793 
1794  return DMatForEachExpr<MT,Tan,SO>( ~dm, Tan() );
1795 }
1796 //*************************************************************************************************
1797 
1798 
1799 //*************************************************************************************************
1816 template< typename MT // Type of the dense matrix
1817  , bool SO > // Storage order
1819 {
1821 
1822  return DMatForEachExpr<MT,Atan,SO>( ~dm, Atan() );
1823 }
1824 //*************************************************************************************************
1825 
1826 
1827 //*************************************************************************************************
1847 template< typename MT // Type of the dense matrix
1848  , bool SO > // Storage order
1850 {
1852 
1853  return DMatForEachExpr<MT,Tanh,SO>( ~dm, Tanh() );
1854 }
1855 //*************************************************************************************************
1856 
1857 
1858 //*************************************************************************************************
1878 template< typename MT // Type of the dense matrix
1879  , bool SO > // Storage order
1881 {
1883 
1884  return DMatForEachExpr<MT,Atanh,SO>( ~dm, Atanh() );
1885 }
1886 //*************************************************************************************************
1887 
1888 
1889 //*************************************************************************************************
1906 template< typename MT // Type of the dense matrix
1907  , bool SO > // Storage order
1909 {
1911 
1912  return DMatForEachExpr<MT,Erf,SO>( ~dm, Erf() );
1913 }
1914 //*************************************************************************************************
1915 
1916 
1917 //*************************************************************************************************
1934 template< typename MT // Type of the dense matrix
1935  , bool SO > // Storage order
1937 {
1939 
1940  return DMatForEachExpr<MT,Erfc,SO>( ~dm, Erfc() );
1941 }
1942 //*************************************************************************************************
1943 
1944 
1945 
1946 
1947 //=================================================================================================
1948 //
1949 // GLOBAL RESTRUCTURING FUNCTIONS
1950 //
1951 //=================================================================================================
1952 
1953 //*************************************************************************************************
1964 template< typename MT // Type of the dense matrix
1965  , bool SO > // Storage order
1966 inline const DMatForEachExpr<MT,Abs,SO>& abs( const DMatForEachExpr<MT,Abs,SO>& dm )
1967 {
1969 
1970  return dm;
1971 }
1973 //*************************************************************************************************
1974 
1975 
1976 //*************************************************************************************************
1987 template< typename MT // Type of the dense matrix
1988  , bool SO > // Storage order
1989 inline const DMatForEachExpr<MT,Floor,SO>& floor( const DMatForEachExpr<MT,Floor,SO>& dm )
1990 {
1992 
1993  return dm;
1994 }
1996 //*************************************************************************************************
1997 
1998 
1999 //*************************************************************************************************
2010 template< typename MT // Type of the dense matrix
2011  , bool SO > // Storage order
2012 inline const DMatForEachExpr<MT,Ceil,SO>& ceil( const DMatForEachExpr<MT,Ceil,SO>& dm )
2013 {
2015 
2016  return dm;
2017 }
2019 //*************************************************************************************************
2020 
2021 
2022 //*************************************************************************************************
2040 template< typename MT // Type of the dense matrix
2041  , bool SO > // Storage order
2042 inline typename DMatForEachExpr<MT,Conj,SO>::Operand conj( const DMatForEachExpr<MT,Conj,SO>& dm )
2043 {
2045 
2046  return dm.operand();
2047 }
2049 //*************************************************************************************************
2050 
2051 
2052 //*************************************************************************************************
2070 template< typename MT // Type of the dense matrix
2071  , bool SO > // Storage order
2072 inline const DMatTransExpr<MT,!SO> conj( const DMatTransExpr<DMatForEachExpr<MT,Conj,SO>,!SO>& dm )
2073 {
2075 
2076  return DMatTransExpr<MT,!SO>( dm.operand().operand() );
2077 }
2079 //*************************************************************************************************
2080 
2081 
2082 //*************************************************************************************************
2093 template< typename MT // Type of the dense matrix
2094  , bool SO > // Storage order
2095 inline const DMatForEachExpr<MT,Real,SO>& real( const DMatForEachExpr<MT,Real,SO>& dm )
2096 {
2098 
2099  return dm;
2100 }
2102 //*************************************************************************************************
2103 
2104 
2105 
2106 
2107 //=================================================================================================
2108 //
2109 // ROWS SPECIALIZATIONS
2110 //
2111 //=================================================================================================
2112 
2113 //*************************************************************************************************
2115 template< typename MT, typename OP, bool SO >
2116 struct Rows< DMatForEachExpr<MT,OP,SO> > : public Rows<MT>
2117 {};
2119 //*************************************************************************************************
2120 
2121 
2122 
2123 
2124 //=================================================================================================
2125 //
2126 // COLUMNS SPECIALIZATIONS
2127 //
2128 //=================================================================================================
2129 
2130 //*************************************************************************************************
2132 template< typename MT, typename OP, bool SO >
2133 struct Columns< DMatForEachExpr<MT,OP,SO> > : public Columns<MT>
2134 {};
2136 //*************************************************************************************************
2137 
2138 
2139 
2140 
2141 //=================================================================================================
2142 //
2143 // ISALIGNED SPECIALIZATIONS
2144 //
2145 //=================================================================================================
2146 
2147 //*************************************************************************************************
2149 template< typename MT, typename OP, bool SO >
2150 struct IsAligned< DMatForEachExpr<MT,OP,SO> >
2151  : public BoolConstant< IsAligned<MT>::value >
2152 {};
2154 //*************************************************************************************************
2155 
2156 
2157 
2158 
2159 //=================================================================================================
2160 //
2161 // ISPADDED SPECIALIZATIONS
2162 //
2163 //=================================================================================================
2164 
2165 //*************************************************************************************************
2167 template< typename MT, typename OP, bool SO >
2168 struct IsPadded< DMatForEachExpr<MT,OP,SO> >
2169  : public BoolConstant< IsPadded<MT>::value >
2170 {};
2172 //*************************************************************************************************
2173 
2174 
2175 
2176 
2177 //=================================================================================================
2178 //
2179 // ISSYMMETRIC SPECIALIZATIONS
2180 //
2181 //=================================================================================================
2182 
2183 //*************************************************************************************************
2185 template< typename MT, bool SO >
2186 struct IsSymmetric< DMatForEachExpr<MT,Abs,SO> >
2187  : public BoolConstant< IsSymmetric<MT>::value >
2188 {};
2189 
2190 template< typename MT, bool SO >
2191 struct IsSymmetric< DMatForEachExpr<MT,Floor,SO> >
2192  : public BoolConstant< IsSymmetric<MT>::value >
2193 {};
2194 
2195 template< typename MT, bool SO >
2196 struct IsSymmetric< DMatForEachExpr<MT,Ceil,SO> >
2197  : public BoolConstant< IsSymmetric<MT>::value >
2198 {};
2199 
2200 template< typename MT, bool SO >
2201 struct IsSymmetric< DMatForEachExpr<MT,Conj,SO> >
2202  : public BoolConstant< IsSymmetric<MT>::value >
2203 {};
2204 
2205 template< typename MT, bool SO >
2206 struct IsSymmetric< DMatForEachExpr<MT,Real,SO> >
2207  : public BoolConstant< IsSymmetric<MT>::value >
2208 {};
2209 
2210 template< typename MT, bool SO >
2211 struct IsSymmetric< DMatForEachExpr<MT,Imag,SO> >
2212  : public BoolConstant< IsSymmetric<MT>::value >
2213 {};
2214 
2215 template< typename MT, bool SO >
2216 struct IsSymmetric< DMatForEachExpr<MT,Sqrt,SO> >
2217  : public BoolConstant< IsSymmetric<MT>::value >
2218 {};
2219 
2220 template< typename MT, bool SO >
2221 struct IsSymmetric< DMatForEachExpr<MT,InvSqrt,SO> >
2222  : public BoolConstant< IsSymmetric<MT>::value >
2223 {};
2224 
2225 template< typename MT, bool SO >
2226 struct IsSymmetric< DMatForEachExpr<MT,Cbrt,SO> >
2227  : public BoolConstant< IsSymmetric<MT>::value >
2228 {};
2229 
2230 template< typename MT, bool SO >
2231 struct IsSymmetric< DMatForEachExpr<MT,InvCbrt,SO> >
2232  : public BoolConstant< IsSymmetric<MT>::value >
2233 {};
2234 
2235 template< typename MT, typename ET, bool SO >
2236 struct IsSymmetric< DMatForEachExpr<MT,Pow<ET>,SO> >
2237  : public BoolConstant< IsSymmetric<MT>::value >
2238 {};
2239 
2240 template< typename MT, bool SO >
2241 struct IsSymmetric< DMatForEachExpr<MT,Exp,SO> >
2242  : public BoolConstant< IsSymmetric<MT>::value >
2243 {};
2244 
2245 template< typename MT, bool SO >
2246 struct IsSymmetric< DMatForEachExpr<MT,Log,SO> >
2247  : public BoolConstant< IsSymmetric<MT>::value >
2248 {};
2249 
2250 template< typename MT, bool SO >
2251 struct IsSymmetric< DMatForEachExpr<MT,Log10,SO> >
2252  : public BoolConstant< IsSymmetric<MT>::value >
2253 {};
2254 
2255 template< typename MT, bool SO >
2256 struct IsSymmetric< DMatForEachExpr<MT,Sin,SO> >
2257  : public BoolConstant< IsSymmetric<MT>::value >
2258 {};
2259 
2260 template< typename MT, bool SO >
2261 struct IsSymmetric< DMatForEachExpr<MT,Asin,SO> >
2262  : public BoolConstant< IsSymmetric<MT>::value >
2263 {};
2264 
2265 template< typename MT, bool SO >
2266 struct IsSymmetric< DMatForEachExpr<MT,Sinh,SO> >
2267  : public BoolConstant< IsSymmetric<MT>::value >
2268 {};
2269 
2270 template< typename MT, bool SO >
2271 struct IsSymmetric< DMatForEachExpr<MT,Asinh,SO> >
2272  : public BoolConstant< IsSymmetric<MT>::value >
2273 {};
2274 
2275 template< typename MT, bool SO >
2276 struct IsSymmetric< DMatForEachExpr<MT,Cos,SO> >
2277  : public BoolConstant< IsSymmetric<MT>::value >
2278 {};
2279 
2280 template< typename MT, bool SO >
2281 struct IsSymmetric< DMatForEachExpr<MT,Acos,SO> >
2282  : public BoolConstant< IsSymmetric<MT>::value >
2283 {};
2284 
2285 template< typename MT, bool SO >
2286 struct IsSymmetric< DMatForEachExpr<MT,Cosh,SO> >
2287  : public BoolConstant< IsSymmetric<MT>::value >
2288 {};
2289 
2290 template< typename MT, bool SO >
2291 struct IsSymmetric< DMatForEachExpr<MT,Acosh,SO> >
2292  : public BoolConstant< IsSymmetric<MT>::value >
2293 {};
2294 
2295 template< typename MT, bool SO >
2296 struct IsSymmetric< DMatForEachExpr<MT,Tan,SO> >
2297  : public BoolConstant< IsSymmetric<MT>::value >
2298 {};
2299 
2300 template< typename MT, bool SO >
2301 struct IsSymmetric< DMatForEachExpr<MT,Atan,SO> >
2302  : public BoolConstant< IsSymmetric<MT>::value >
2303 {};
2304 
2305 template< typename MT, bool SO >
2306 struct IsSymmetric< DMatForEachExpr<MT,Tanh,SO> >
2307  : public BoolConstant< IsSymmetric<MT>::value >
2308 {};
2309 
2310 template< typename MT, bool SO >
2311 struct IsSymmetric< DMatForEachExpr<MT,Atanh,SO> >
2312  : public BoolConstant< IsSymmetric<MT>::value >
2313 {};
2314 
2315 template< typename MT, bool SO >
2316 struct IsSymmetric< DMatForEachExpr<MT,Erf,SO> >
2317  : public BoolConstant< IsSymmetric<MT>::value >
2318 {};
2319 
2320 template< typename MT, bool SO >
2321 struct IsSymmetric< DMatForEachExpr<MT,Erfc,SO> >
2322  : public BoolConstant< IsSymmetric<MT>::value >
2323 {};
2325 //*************************************************************************************************
2326 
2327 
2328 
2329 
2330 //=================================================================================================
2331 //
2332 // ISHERMITIAN SPECIALIZATIONS
2333 //
2334 //=================================================================================================
2335 
2336 //*************************************************************************************************
2338 template< typename MT, bool SO >
2339 struct IsHermitian< DMatForEachExpr<MT,Abs,SO> >
2340  : public BoolConstant< IsHermitian<MT>::value >
2341 {};
2342 
2343 template< typename MT, bool SO >
2344 struct IsHermitian< DMatForEachExpr<MT,Floor,SO> >
2345  : public BoolConstant< IsHermitian<MT>::value >
2346 {};
2347 
2348 template< typename MT, bool SO >
2349 struct IsHermitian< DMatForEachExpr<MT,Ceil,SO> >
2350  : public BoolConstant< IsHermitian<MT>::value >
2351 {};
2352 
2353 template< typename MT, bool SO >
2354 struct IsHermitian< DMatForEachExpr<MT,Conj,SO> >
2355  : public BoolConstant< IsHermitian<MT>::value >
2356 {};
2357 
2358 template< typename MT, bool SO >
2359 struct IsHermitian< DMatForEachExpr<MT,Real,SO> >
2360  : public BoolConstant< IsHermitian<MT>::value >
2361 {};
2362 
2363 template< typename MT, bool SO >
2364 struct IsHermitian< DMatForEachExpr<MT,Imag,SO> >
2365  : public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
2366 {};
2367 
2368 template< typename MT, bool SO >
2369 struct IsHermitian< DMatForEachExpr<MT,Sqrt,SO> >
2370  : public BoolConstant< IsHermitian<MT>::value >
2371 {};
2372 
2373 template< typename MT, bool SO >
2374 struct IsHermitian< DMatForEachExpr<MT,InvSqrt,SO> >
2375  : public BoolConstant< IsHermitian<MT>::value >
2376 {};
2377 
2378 template< typename MT, bool SO >
2379 struct IsHermitian< DMatForEachExpr<MT,Cbrt,SO> >
2380  : public BoolConstant< IsHermitian<MT>::value >
2381 {};
2382 
2383 template< typename MT, bool SO >
2384 struct IsHermitian< DMatForEachExpr<MT,InvCbrt,SO> >
2385  : public BoolConstant< IsHermitian<MT>::value >
2386 {};
2387 
2388 template< typename MT, typename ET, bool SO >
2389 struct IsHermitian< DMatForEachExpr<MT,Pow<ET>,SO> >
2390  : public BoolConstant< IsHermitian<MT>::value >
2391 {};
2392 
2393 template< typename MT, bool SO >
2394 struct IsHermitian< DMatForEachExpr<MT,Exp,SO> >
2395  : public BoolConstant< IsHermitian<MT>::value >
2396 {};
2397 
2398 template< typename MT, bool SO >
2399 struct IsHermitian< DMatForEachExpr<MT,Log,SO> >
2400  : public BoolConstant< IsHermitian<MT>::value >
2401 {};
2402 
2403 template< typename MT, bool SO >
2404 struct IsHermitian< DMatForEachExpr<MT,Log10,SO> >
2405  : public BoolConstant< IsHermitian<MT>::value >
2406 {};
2407 
2408 template< typename MT, bool SO >
2409 struct IsHermitian< DMatForEachExpr<MT,Sin,SO> >
2410  : public BoolConstant< IsHermitian<MT>::value >
2411 {};
2412 
2413 template< typename MT, bool SO >
2414 struct IsHermitian< DMatForEachExpr<MT,Asin,SO> >
2415  : public BoolConstant< IsHermitian<MT>::value >
2416 {};
2417 
2418 template< typename MT, bool SO >
2419 struct IsHermitian< DMatForEachExpr<MT,Sinh,SO> >
2420  : public BoolConstant< IsHermitian<MT>::value >
2421 {};
2422 
2423 template< typename MT, bool SO >
2424 struct IsHermitian< DMatForEachExpr<MT,Asinh,SO> >
2425  : public BoolConstant< IsHermitian<MT>::value >
2426 {};
2427 
2428 template< typename MT, bool SO >
2429 struct IsHermitian< DMatForEachExpr<MT,Cos,SO> >
2430  : public BoolConstant< IsHermitian<MT>::value >
2431 {};
2432 
2433 template< typename MT, bool SO >
2434 struct IsHermitian< DMatForEachExpr<MT,Acos,SO> >
2435  : public BoolConstant< IsHermitian<MT>::value >
2436 {};
2437 
2438 template< typename MT, bool SO >
2439 struct IsHermitian< DMatForEachExpr<MT,Cosh,SO> >
2440  : public BoolConstant< IsHermitian<MT>::value >
2441 {};
2442 
2443 template< typename MT, bool SO >
2444 struct IsHermitian< DMatForEachExpr<MT,Acosh,SO> >
2445  : public BoolConstant< IsHermitian<MT>::value >
2446 {};
2447 
2448 template< typename MT, bool SO >
2449 struct IsHermitian< DMatForEachExpr<MT,Tan,SO> >
2450  : public BoolConstant< IsHermitian<MT>::value >
2451 {};
2452 
2453 template< typename MT, bool SO >
2454 struct IsHermitian< DMatForEachExpr<MT,Atan,SO> >
2455  : public BoolConstant< IsHermitian<MT>::value >
2456 {};
2457 
2458 template< typename MT, bool SO >
2459 struct IsHermitian< DMatForEachExpr<MT,Tanh,SO> >
2460  : public BoolConstant< IsHermitian<MT>::value >
2461 {};
2462 
2463 template< typename MT, bool SO >
2464 struct IsHermitian< DMatForEachExpr<MT,Atanh,SO> >
2465  : public BoolConstant< IsHermitian<MT>::value >
2466 {};
2467 
2468 template< typename MT, bool SO >
2469 struct IsHermitian< DMatForEachExpr<MT,Erf,SO> >
2470  : public BoolConstant< IsHermitian<MT>::value >
2471 {};
2472 
2473 template< typename MT, bool SO >
2474 struct IsHermitian< DMatForEachExpr<MT,Erfc,SO> >
2475  : public BoolConstant< IsHermitian<MT>::value >
2476 {};
2478 //*************************************************************************************************
2479 
2480 
2481 
2482 
2483 //=================================================================================================
2484 //
2485 // ISLOWER SPECIALIZATIONS
2486 //
2487 //=================================================================================================
2488 
2489 //*************************************************************************************************
2491 template< typename MT, bool SO >
2492 struct IsLower< DMatForEachExpr<MT,Abs,SO> >
2493  : public BoolConstant< IsLower<MT>::value >
2494 {};
2495 
2496 template< typename MT, bool SO >
2497 struct IsLower< DMatForEachExpr<MT,Floor,SO> >
2498  : public BoolConstant< IsLower<MT>::value >
2499 {};
2500 
2501 template< typename MT, bool SO >
2502 struct IsLower< DMatForEachExpr<MT,Ceil,SO> >
2503  : public BoolConstant< IsLower<MT>::value >
2504 {};
2505 
2506 template< typename MT, bool SO >
2507 struct IsLower< DMatForEachExpr<MT,Conj,SO> >
2508  : public BoolConstant< IsLower<MT>::value >
2509 {};
2510 
2511 template< typename MT, bool SO >
2512 struct IsLower< DMatForEachExpr<MT,Real,SO> >
2513  : public BoolConstant< IsLower<MT>::value >
2514 {};
2515 
2516 template< typename MT, bool SO >
2517 struct IsLower< DMatForEachExpr<MT,Imag,SO> >
2518  : public BoolConstant< IsLower<MT>::value >
2519 {};
2520 
2521 template< typename MT, bool SO >
2522 struct IsLower< DMatForEachExpr<MT,Sin,SO> >
2523  : public BoolConstant< IsLower<MT>::value >
2524 {};
2525 
2526 template< typename MT, bool SO >
2527 struct IsLower< DMatForEachExpr<MT,Asin,SO> >
2528  : public BoolConstant< IsLower<MT>::value >
2529 {};
2530 
2531 template< typename MT, bool SO >
2532 struct IsLower< DMatForEachExpr<MT,Sinh,SO> >
2533  : public BoolConstant< IsLower<MT>::value >
2534 {};
2535 
2536 template< typename MT, bool SO >
2537 struct IsLower< DMatForEachExpr<MT,Asinh,SO> >
2538  : public BoolConstant< IsLower<MT>::value >
2539 {};
2540 
2541 template< typename MT, bool SO >
2542 struct IsLower< DMatForEachExpr<MT,Tan,SO> >
2543  : public BoolConstant< IsLower<MT>::value >
2544 {};
2545 
2546 template< typename MT, bool SO >
2547 struct IsLower< DMatForEachExpr<MT,Atan,SO> >
2548  : public BoolConstant< IsLower<MT>::value >
2549 {};
2550 
2551 template< typename MT, bool SO >
2552 struct IsLower< DMatForEachExpr<MT,Tanh,SO> >
2553  : public BoolConstant< IsLower<MT>::value >
2554 {};
2555 
2556 template< typename MT, bool SO >
2557 struct IsLower< DMatForEachExpr<MT,Atanh,SO> >
2558  : public BoolConstant< IsLower<MT>::value >
2559 {};
2560 
2561 template< typename MT, bool SO >
2562 struct IsLower< DMatForEachExpr<MT,Erf,SO> >
2563  : public BoolConstant< IsLower<MT>::value >
2564 {};
2566 //*************************************************************************************************
2567 
2568 
2569 
2570 
2571 //=================================================================================================
2572 //
2573 // ISUNILOWER SPECIALIZATIONS
2574 //
2575 //=================================================================================================
2576 
2577 //*************************************************************************************************
2579 template< typename MT, typename ET, bool SO >
2580 struct IsUniLower< DMatForEachExpr<MT,Pow<ET>,SO> >
2581  : public BoolConstant< IsUniLower<MT>::value >
2582 {};
2584 //*************************************************************************************************
2585 
2586 
2587 
2588 
2589 //=================================================================================================
2590 //
2591 // ISSTRICTLYLOWER SPECIALIZATIONS
2592 //
2593 //=================================================================================================
2594 
2595 //*************************************************************************************************
2597 template< typename MT, bool SO >
2598 struct IsStrictlyLower< DMatForEachExpr<MT,Abs,SO> >
2599  : public BoolConstant< IsStrictlyLower<MT>::value >
2600 {};
2601 
2602 template< typename MT, bool SO >
2603 struct IsStrictlyLower< DMatForEachExpr<MT,Floor,SO> >
2604  : public BoolConstant< IsStrictlyLower<MT>::value >
2605 {};
2606 
2607 template< typename MT, bool SO >
2608 struct IsStrictlyLower< DMatForEachExpr<MT,Ceil,SO> >
2609  : public BoolConstant< IsStrictlyLower<MT>::value >
2610 {};
2611 
2612 template< typename MT, bool SO >
2613 struct IsStrictlyLower< DMatForEachExpr<MT,Conj,SO> >
2614  : public BoolConstant< IsStrictlyLower<MT>::value >
2615 {};
2616 
2617 template< typename MT, bool SO >
2618 struct IsStrictlyLower< DMatForEachExpr<MT,Real,SO> >
2619  : public BoolConstant< IsStrictlyLower<MT>::value >
2620 {};
2621 
2622 template< typename MT, bool SO >
2623 struct IsStrictlyLower< DMatForEachExpr<MT,Imag,SO> >
2624  : public BoolConstant< IsStrictlyLower<MT>::value >
2625 {};
2626 
2627 template< typename MT, bool SO >
2628 struct IsStrictlyLower< DMatForEachExpr<MT,Sin,SO> >
2629  : public BoolConstant< IsStrictlyLower<MT>::value >
2630 {};
2631 
2632 template< typename MT, bool SO >
2633 struct IsStrictlyLower< DMatForEachExpr<MT,Asin,SO> >
2634  : public BoolConstant< IsStrictlyLower<MT>::value >
2635 {};
2636 
2637 template< typename MT, bool SO >
2638 struct IsStrictlyLower< DMatForEachExpr<MT,Sinh,SO> >
2639  : public BoolConstant< IsStrictlyLower<MT>::value >
2640 {};
2641 
2642 template< typename MT, bool SO >
2643 struct IsStrictlyLower< DMatForEachExpr<MT,Asinh,SO> >
2644  : public BoolConstant< IsStrictlyLower<MT>::value >
2645 {};
2646 
2647 template< typename MT, bool SO >
2648 struct IsStrictlyLower< DMatForEachExpr<MT,Tan,SO> >
2649  : public BoolConstant< IsStrictlyLower<MT>::value >
2650 {};
2651 
2652 template< typename MT, bool SO >
2653 struct IsStrictlyLower< DMatForEachExpr<MT,Atan,SO> >
2654  : public BoolConstant< IsStrictlyLower<MT>::value >
2655 {};
2656 
2657 template< typename MT, bool SO >
2658 struct IsStrictlyLower< DMatForEachExpr<MT,Tanh,SO> >
2659  : public BoolConstant< IsStrictlyLower<MT>::value >
2660 {};
2661 
2662 template< typename MT, bool SO >
2663 struct IsStrictlyLower< DMatForEachExpr<MT,Atanh,SO> >
2664  : public BoolConstant< IsStrictlyLower<MT>::value >
2665 {};
2666 
2667 template< typename MT, bool SO >
2668 struct IsStrictlyLower< DMatForEachExpr<MT,Erf,SO> >
2669  : public BoolConstant< IsStrictlyLower<MT>::value >
2670 {};
2672 //*************************************************************************************************
2673 
2674 
2675 
2676 
2677 //=================================================================================================
2678 //
2679 // ISUPPER SPECIALIZATIONS
2680 //
2681 //=================================================================================================
2682 
2683 //*************************************************************************************************
2685 template< typename MT, bool SO >
2686 struct IsUpper< DMatForEachExpr<MT,Abs,SO> >
2687  : public BoolConstant< IsUpper<MT>::value >
2688 {};
2689 
2690 template< typename MT, bool SO >
2691 struct IsUpper< DMatForEachExpr<MT,Floor,SO> >
2692  : public BoolConstant< IsUpper<MT>::value >
2693 {};
2694 
2695 template< typename MT, bool SO >
2696 struct IsUpper< DMatForEachExpr<MT,Ceil,SO> >
2697  : public BoolConstant< IsUpper<MT>::value >
2698 {};
2699 
2700 template< typename MT, bool SO >
2701 struct IsUpper< DMatForEachExpr<MT,Conj,SO> >
2702  : public BoolConstant< IsUpper<MT>::value >
2703 {};
2704 
2705 template< typename MT, bool SO >
2706 struct IsUpper< DMatForEachExpr<MT,Real,SO> >
2707  : public BoolConstant< IsUpper<MT>::value >
2708 {};
2709 
2710 template< typename MT, bool SO >
2711 struct IsUpper< DMatForEachExpr<MT,Imag,SO> >
2712  : public BoolConstant< IsUpper<MT>::value >
2713 {};
2714 
2715 template< typename MT, bool SO >
2716 struct IsUpper< DMatForEachExpr<MT,Sin,SO> >
2717  : public BoolConstant< IsUpper<MT>::value >
2718 {};
2719 
2720 template< typename MT, bool SO >
2721 struct IsUpper< DMatForEachExpr<MT,Asin,SO> >
2722  : public BoolConstant< IsUpper<MT>::value >
2723 {};
2724 
2725 template< typename MT, bool SO >
2726 struct IsUpper< DMatForEachExpr<MT,Sinh,SO> >
2727  : public BoolConstant< IsUpper<MT>::value >
2728 {};
2729 
2730 template< typename MT, bool SO >
2731 struct IsUpper< DMatForEachExpr<MT,Asinh,SO> >
2732  : public BoolConstant< IsUpper<MT>::value >
2733 {};
2734 
2735 template< typename MT, bool SO >
2736 struct IsUpper< DMatForEachExpr<MT,Tan,SO> >
2737  : public BoolConstant< IsUpper<MT>::value >
2738 {};
2739 
2740 template< typename MT, bool SO >
2741 struct IsUpper< DMatForEachExpr<MT,Atan,SO> >
2742  : public BoolConstant< IsUpper<MT>::value >
2743 {};
2744 
2745 template< typename MT, bool SO >
2746 struct IsUpper< DMatForEachExpr<MT,Tanh,SO> >
2747  : public BoolConstant< IsUpper<MT>::value >
2748 {};
2749 
2750 template< typename MT, bool SO >
2751 struct IsUpper< DMatForEachExpr<MT,Atanh,SO> >
2752  : public BoolConstant< IsUpper<MT>::value >
2753 {};
2754 
2755 template< typename MT, bool SO >
2756 struct IsUpper< DMatForEachExpr<MT,Erf,SO> >
2757  : public BoolConstant< IsUpper<MT>::value >
2758 {};
2760 //*************************************************************************************************
2761 
2762 
2763 
2764 
2765 //=================================================================================================
2766 //
2767 // ISUNIUPPER SPECIALIZATIONS
2768 //
2769 //=================================================================================================
2770 
2771 //*************************************************************************************************
2773 template< typename MT, typename ET, bool SO >
2774 struct IsUniUpper< DMatForEachExpr<MT,Pow<ET>,SO> >
2775  : public BoolConstant< IsUniUpper<MT>::value >
2776 {};
2778 //*************************************************************************************************
2779 
2780 
2781 
2782 
2783 //=================================================================================================
2784 //
2785 // ISSTRICTLYUPPER SPECIALIZATIONS
2786 //
2787 //=================================================================================================
2788 
2789 //*************************************************************************************************
2791 template< typename MT, bool SO >
2792 struct IsStrictlyUpper< DMatForEachExpr<MT,Abs,SO> >
2793  : public BoolConstant< IsStrictlyUpper<MT>::value >
2794 {};
2795 
2796 template< typename MT, bool SO >
2797 struct IsStrictlyUpper< DMatForEachExpr<MT,Floor,SO> >
2798  : public BoolConstant< IsStrictlyUpper<MT>::value >
2799 {};
2800 
2801 template< typename MT, bool SO >
2802 struct IsStrictlyUpper< DMatForEachExpr<MT,Ceil,SO> >
2803  : public BoolConstant< IsStrictlyUpper<MT>::value >
2804 {};
2805 
2806 template< typename MT, bool SO >
2807 struct IsStrictlyUpper< DMatForEachExpr<MT,Conj,SO> >
2808  : public BoolConstant< IsStrictlyUpper<MT>::value >
2809 {};
2810 
2811 template< typename MT, bool SO >
2812 struct IsStrictlyUpper< DMatForEachExpr<MT,Real,SO> >
2813  : public BoolConstant< IsStrictlyUpper<MT>::value >
2814 {};
2815 
2816 template< typename MT, bool SO >
2817 struct IsStrictlyUpper< DMatForEachExpr<MT,Imag,SO> >
2818  : public BoolConstant< IsStrictlyUpper<MT>::value >
2819 {};
2820 
2821 template< typename MT, bool SO >
2822 struct IsStrictlyUpper< DMatForEachExpr<MT,Sin,SO> >
2823  : public BoolConstant< IsStrictlyUpper<MT>::value >
2824 {};
2825 
2826 template< typename MT, bool SO >
2827 struct IsStrictlyUpper< DMatForEachExpr<MT,Asin,SO> >
2828  : public BoolConstant< IsStrictlyUpper<MT>::value >
2829 {};
2830 
2831 template< typename MT, bool SO >
2832 struct IsStrictlyUpper< DMatForEachExpr<MT,Sinh,SO> >
2833  : public BoolConstant< IsStrictlyUpper<MT>::value >
2834 {};
2835 
2836 template< typename MT, bool SO >
2837 struct IsStrictlyUpper< DMatForEachExpr<MT,Asinh,SO> >
2838  : public BoolConstant< IsStrictlyUpper<MT>::value >
2839 {};
2840 
2841 template< typename MT, bool SO >
2842 struct IsStrictlyUpper< DMatForEachExpr<MT,Tan,SO> >
2843  : public BoolConstant< IsStrictlyUpper<MT>::value >
2844 {};
2845 
2846 template< typename MT, bool SO >
2847 struct IsStrictlyUpper< DMatForEachExpr<MT,Atan,SO> >
2848  : public BoolConstant< IsStrictlyUpper<MT>::value >
2849 {};
2850 
2851 template< typename MT, bool SO >
2852 struct IsStrictlyUpper< DMatForEachExpr<MT,Tanh,SO> >
2853  : public BoolConstant< IsStrictlyUpper<MT>::value >
2854 {};
2855 
2856 template< typename MT, bool SO >
2857 struct IsStrictlyUpper< DMatForEachExpr<MT,Atanh,SO> >
2858  : public BoolConstant< IsStrictlyUpper<MT>::value >
2859 {};
2860 
2861 template< typename MT, bool SO >
2862 struct IsStrictlyUpper< DMatForEachExpr<MT,Erf,SO> >
2863  : public BoolConstant< IsStrictlyUpper<MT>::value >
2864 {};
2866 //*************************************************************************************************
2867 
2868 
2869 
2870 
2871 //=================================================================================================
2872 //
2873 // EXPRESSION TRAIT SPECIALIZATIONS
2874 //
2875 //=================================================================================================
2876 
2877 //*************************************************************************************************
2879 template< typename MT >
2880 struct DMatForEachExprTrait< DMatForEachExpr<MT,Abs,false>, Abs >
2881 {
2882  public:
2883  //**********************************************************************************************
2884  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
2885  , DMatForEachExpr<MT,Abs,false>
2886  , INVALID_TYPE >;
2887  //**********************************************************************************************
2888 };
2890 //*************************************************************************************************
2891 
2892 
2893 //*************************************************************************************************
2895 template< typename MT >
2896 struct TDMatForEachExprTrait< DMatForEachExpr<MT,Abs,true>, Abs >
2897 {
2898  public:
2899  //**********************************************************************************************
2900  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
2901  , DMatForEachExpr<MT,Abs,true>
2902  , INVALID_TYPE >;
2903  //**********************************************************************************************
2904 };
2906 //*************************************************************************************************
2907 
2908 
2909 //*************************************************************************************************
2911 template< typename MT >
2912 struct DMatForEachExprTrait< DMatForEachExpr<MT,Floor,false>, Floor >
2913 {
2914  public:
2915  //**********************************************************************************************
2916  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
2917  , DMatForEachExpr<MT,Floor,false>
2918  , INVALID_TYPE >;
2919  //**********************************************************************************************
2920 };
2922 //*************************************************************************************************
2923 
2924 
2925 //*************************************************************************************************
2927 template< typename MT >
2928 struct TDMatForEachExprTrait< DMatForEachExpr<MT,Floor,true>, Floor >
2929 {
2930  public:
2931  //**********************************************************************************************
2932  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
2933  , DMatForEachExpr<MT,Floor,true>
2934  , INVALID_TYPE >;
2935  //**********************************************************************************************
2936 };
2938 //*************************************************************************************************
2939 
2940 
2941 //*************************************************************************************************
2943 template< typename MT >
2944 struct DMatForEachExprTrait< DMatForEachExpr<MT,Ceil,false>, Ceil >
2945 {
2946  public:
2947  //**********************************************************************************************
2948  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
2949  , DMatForEachExpr<MT,Ceil,false>
2950  , INVALID_TYPE >;
2951  //**********************************************************************************************
2952 };
2954 //*************************************************************************************************
2955 
2956 
2957 //*************************************************************************************************
2959 template< typename MT >
2960 struct TDMatForEachExprTrait< DMatForEachExpr<MT,Ceil,true>, Ceil >
2961 {
2962  public:
2963  //**********************************************************************************************
2964  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
2965  , DMatForEachExpr<MT,Ceil,true>
2966  , INVALID_TYPE >;
2967  //**********************************************************************************************
2968 };
2970 //*************************************************************************************************
2971 
2972 
2973 //*************************************************************************************************
2975 template< typename MT >
2976 struct DMatForEachExprTrait< DMatForEachExpr<MT,Conj,false>, Conj >
2977 {
2978  public:
2979  //**********************************************************************************************
2980  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
2981  , Operand_< DMatForEachExpr<MT,Conj,false> >
2982  , INVALID_TYPE >;
2983  //**********************************************************************************************
2984 };
2986 //*************************************************************************************************
2987 
2988 
2989 //*************************************************************************************************
2991 template< typename MT >
2992 struct TDMatForEachExprTrait< DMatForEachExpr<MT,Conj,true>, Conj >
2993 {
2994  public:
2995  //**********************************************************************************************
2996  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
2997  , Operand_< DMatForEachExpr<MT,Conj,true> >
2998  , INVALID_TYPE >;
2999  //**********************************************************************************************
3000 };
3002 //*************************************************************************************************
3003 
3004 
3005 //*************************************************************************************************
3007 template< typename MT >
3008 struct DMatForEachExprTrait< DMatTransExpr< DMatForEachExpr<MT,Conj,true>, false >, Conj >
3009 {
3010  public:
3011  //**********************************************************************************************
3012  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
3013  , DMatTransExpr<MT,false>
3014  , INVALID_TYPE >;
3015  //**********************************************************************************************
3016 };
3018 //*************************************************************************************************
3019 
3020 
3021 //*************************************************************************************************
3023 template< typename MT >
3024 struct TDMatForEachExprTrait< DMatTransExpr< DMatForEachExpr<MT,Conj,false>, true >, Conj >
3025 {
3026  public:
3027  //**********************************************************************************************
3028  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
3029  , DMatTransExpr<MT,true>
3030  , INVALID_TYPE >;
3031  //**********************************************************************************************
3032 };
3034 //*************************************************************************************************
3035 
3036 
3037 //*************************************************************************************************
3039 template< typename MT >
3040 struct DMatForEachExprTrait< DMatForEachExpr<MT,Real,false>, Real >
3041 {
3042  public:
3043  //**********************************************************************************************
3044  using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
3045  , DMatForEachExpr<MT,Real,false>
3046  , INVALID_TYPE >;
3047  //**********************************************************************************************
3048 };
3050 //*************************************************************************************************
3051 
3052 
3053 //*************************************************************************************************
3055 template< typename MT >
3056 struct TDMatForEachExprTrait< DMatForEachExpr<MT,Real,true>, Real >
3057 {
3058  public:
3059  //**********************************************************************************************
3060  using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
3061  , DMatForEachExpr<MT,Real,true>
3062  , INVALID_TYPE >;
3063  //**********************************************************************************************
3064 };
3066 //*************************************************************************************************
3067 
3068 
3069 //*************************************************************************************************
3071 template< typename MT, typename OP, bool SO, bool AF >
3072 struct SubmatrixExprTrait< DMatForEachExpr<MT,OP,SO>, AF >
3073 {
3074  public:
3075  //**********************************************************************************************
3076  using Type = ForEachExprTrait_< SubmatrixExprTrait_<const MT,AF>, OP >;
3077  //**********************************************************************************************
3078 };
3080 //*************************************************************************************************
3081 
3082 
3083 //*************************************************************************************************
3085 template< typename MT, typename OP, bool SO >
3086 struct RowExprTrait< DMatForEachExpr<MT,OP,SO> >
3087 {
3088  public:
3089  //**********************************************************************************************
3090  using Type = ForEachExprTrait_< RowExprTrait_<const MT>, OP >;
3091  //**********************************************************************************************
3092 };
3094 //*************************************************************************************************
3095 
3096 
3097 //*************************************************************************************************
3099 template< typename MT, typename OP, bool SO >
3100 struct ColumnExprTrait< DMatForEachExpr<MT,OP,SO> >
3101 {
3102  public:
3103  //**********************************************************************************************
3104  using Type = ForEachExprTrait_< ColumnExprTrait_<const MT>, OP >;
3105  //**********************************************************************************************
3106 };
3108 //*************************************************************************************************
3109 
3110 } // namespace blaze
3111 
3112 #endif
Header file for the UnderlyingNumeric type trait.
Pointer difference type of the Blaze library.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatForEachExpr.h:281
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatForEachExpr.h:540
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1158
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Constraint on the data type.
Generic wrapper for the ceil() function.
Definition: Ceil.h:62
Operand dm_
Dense matrix of the for-each expression.
Definition: DMatForEachExpr.h:621
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatForEachExpr.h:302
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatForEachExpr.h:530
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatForEachExpr.h:413
const DMatForEachExpr< MT, Log, SO > log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1498
const DMatForEachExpr< MT, Sin, SO > sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1557
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:62
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT(HasSIMDEnabled, simdEnabled)
Definition of the HasSIMDEnabled type trait.
Header file for basic type definitions.
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatForEachExpr.h:312
const DMatForEachExpr< MT, Log10, SO > log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1529
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:160
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
const DMatForEachExpr< MT, Tanh, SO > tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1849
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
DifferenceType difference_type
Difference between two iterators.
Definition: DMatForEachExpr.h:213
const CTransExprTrait_< MT > ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatForEachExpr.h:1195
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Operation op_
The custom unary operation.
Definition: DMatForEachExpr.h:622
Header file for the ColumnExprTrait class template.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the ForEachExprTrait class template.
const DMatForEachExpr< MT, Cos, SO > cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1672
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatForEachExpr.h:560
const DMatForEachExpr< MT, Atan, SO > atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1818
Generic wrapper for the acosh() function.
Definition: Acosh.h:62
const DMatForEachExpr< MT, Imag, SO > imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatForEachExpr.h:1251
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:1669
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatForEachExpr.h:425
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatForEachExpr.h:604
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
const DMatForEachExpr< MT, Sinh, SO > sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1616
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatForEachExpr.h:504
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:138
Header file for the RequiresEvaluation type trait.
Header file for the MatForEachExpr base class.
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
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:129
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatForEachExpr.h:292
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatForEachExpr.h:519
const DMatForEachExpr< MT, Exp, SO > exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1467
Constraint on the data type.
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
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatForEachExpr.h:550
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Constraint on the data type.
Generic wrapper for the abs() function.
Definition: Abs.h:62
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
typename ForEachTrait< T, OP >::Type ForEachTrait_
Auxiliary alias declaration for the ForEachTrait class template.The ForEachTrait_ alias declaration p...
Definition: ForEachTrait.h:146
const DMatForEachExpr< MT, Acosh, SO > acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1762
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatForEachExpr.h:594
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatForEachExpr.h:260
Header file for the IsStrictlyUpper type trait.
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: DMatForEachExpr.h:225
Header file for the IsSymmetric type trait.
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:143
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
const DMatForEachExpr< MT, Abs, SO > abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1074
IteratorType it_
Iterator to the current matrix element.
Definition: DMatForEachExpr.h:432
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatForEachExpr.h:389
ConstIterator_< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatForEachExpr.h:216
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatForEachExpr.h:401
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
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:98
ReturnType operator()(size_t i, size_t j) const noexcept
2D-access to the matrix elements.
Definition: DMatForEachExpr.h:471
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatForEachExpr.h:178
#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
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
const DMatForEachExpr< MT, OP, SO > forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1046
Generic wrapper for the log10() function.
Definition: Log10.h:62
Operation operation() const
Returns a copy of the custom operation.
Definition: DMatForEachExpr.h:570
Header file for the Not class template.
Header file for all functors.
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.
ResultType_< MT > RT
Result type of the dense matrix expression.
Definition: DMatForEachExpr.h:119
const DMatForEachExpr< MT, InvCbrt, SO > invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1375
Iterator over the elements of the dense matrix.
Definition: DMatForEachExpr.h:198
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatForEachExpr.h:203
Generic wrapper for the asin() function.
Definition: Asin.h:62
const DMatForEachExpr< MT, Floor, SO > floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1102
ElementType * PointerType
Pointer return type.
Definition: DMatForEachExpr.h:204
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatForEachExpr.h:237
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatForEachExpr.h:271
const DMatForEachExpr< MT, Erf, SO > erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1908
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
const DMatForEachExpr< MT, Tan, SO > tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1790
Generic wrapper for the erf() function.
Definition: Erf.h:62
PointerType pointer
Pointer return type.
Definition: DMatForEachExpr.h:211
Constraints on the storage order of matrix types.
const DMatForEachExpr< MT, Pow< ET >, SO > pow(const DenseMatrix< MT, SO > &dm, ET exp)
Computes the exponential value for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1437
Header file for the exception macros of the math module.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatForEachExpr.h:323
Expression object for the dense matrix forEach() function.The DMatForEachExpr class represents the co...
Definition: DMatForEachExpr.h:113
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatForEachExpr.h:345
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 the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Generic wrapper for the floor() function.
Definition: Floor.h:62
ValueType value_type
Type of the underlying elements.
Definition: DMatForEachExpr.h:210
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatForEachExpr.h:582
const DMatForEachExpr< MT, Cosh, SO > cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1731
const DMatForEachExpr< MT, Sqrt, SO > sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1282
If_< IsExpression< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatForEachExpr.h:189
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
const DMatForEachExpr< MT, Real, SO > real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatForEachExpr.h:1223
Header file for the IsPadded type trait.
const DMatForEachExpr< MT, Atanh, SO > atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1880
Generic wrapper for the clip() function.
Definition: Clip.h:60
const DMatForEachExpr< MT, Acos, SO > acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1703
IteratorCategory iterator_category
The iterator category.
Definition: DMatForEachExpr.h:209
OP Operation
Data type of the custom unary operation.
Definition: DMatForEachExpr.h:192
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatForEachExpr.h:249
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatForEachExpr.h:356
Header file for run time assertion macros.
const DMatForEachExpr< MT, InvSqrt, SO > invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1313
Base class for all matrix for-each expression templates.The MatForEachExpr class serves as a tag for ...
Definition: MatForEachExpr.h:65
Generic wrapper for the pow() function.
Definition: Forward.h:72
const DMatForEachExpr< MT, Cbrt, SO > cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1344
Generic wrapper for the atanh() function.
Definition: Atanh.h:62
Generic wrapper for the invcbrt() function.
Definition: InvCbrt.h:62
Generic wrapper for the real() function.
Definition: Real.h:59
OP op_
The custom unary operation.
Definition: DMatForEachExpr.h:433
Generic wrapper for the asinh() function.
Definition: Asinh.h:62
const DMatForEachExpr< MT, Asin, SO > asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1588
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:160
ElementType_< MT > ET
Element type of the dense matrix expression.
Definition: DMatForEachExpr.h:121
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
Generic wrapper for the tan() function.
Definition: Tan.h:62
Generic wrapper for the log() function.
Definition: Log.h:62
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatForEachExpr.h:378
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatForEachExpr.h:486
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatForEachExpr.h:334
ReferenceType reference
Reference return type.
Definition: DMatForEachExpr.h:212
Compile time type negation.The Not class template negates the given compile time condition. In case the given condition would evaluate to true, the nested member enumeration is set to false and vice versa:
Definition: Not.h:70
IfTrue_< useAssign, const ResultType, const DMatForEachExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatForEachExpr.h:186
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatForEachExpr.h:367
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
Header file for the HasMember type traits.
Generic wrapper for the cos() function.
Definition: Cos.h:62
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
OppositeType_< MT > OT
Opposite type of the dense matrix expression.
Definition: DMatForEachExpr.h:120
const DMatForEachExpr< MT, Clip< DT >, SO > clip(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatForEachExpr.h:1407
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatForEachExpr.h:180
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatForEachExpr.h:179
const DMatForEachExpr< MT, Erfc, SO > erfc(const DenseMatrix< MT, SO > &dm)
Computes the complementary error function for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1936
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
DMatForEachExpr< MT, OP, SO > This
Type of this DMatForEachExpr instance.
Definition: DMatForEachExpr.h:176
Header file for the IsBuiltin type trait.
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:59
ElementType & ReferenceType
Reference return type.
Definition: DMatForEachExpr.h:205
Header file for the for-each trait.
Generic wrapper for the atan() function.
Definition: Atan.h:62
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
const DMatForEachExpr< MT, Asinh, SO > asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1644
Generic wrapper for the sinh() function.
Definition: Sinh.h:62
Header file for the IntegralConstant class template.
ForEachTrait_< MT, OP > ResultType
Result type for expression template evaluations.
Definition: DMatForEachExpr.h:177
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatForEachExpr.h:202
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatForEachExpr.h:614
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Header file for the CTransExprTrait class template.
Generic wrapper for the cosh() function.
Definition: Cosh.h:62
ReturnType_< MT > RN
Return type of the dense matrix expression.
Definition: DMatForEachExpr.h:122
Generic wrapper for the tanh() function.
Definition: Tanh.h:62
Header file for the IsHermitian type trait.
Generic wrapper for the exp() function.
Definition: Exp.h:62
System settings for the inline keywords.
#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:71
const DMatForEachExpr< MT, Ceil, SO > ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1130
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatForEachExpr.h:206
DMatForEachExpr(const MT &dm, OP op) noexcept
Constructor for the DMatForEachExpr class.
Definition: DMatForEachExpr.h:458