SMatForEachExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATFOREACHEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATFOREACHEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
45 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
54 #include <blaze/math/Functors.h>
76 #include <blaze/util/Assert.h>
78 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/mpl/And.h>
82 #include <blaze/util/mpl/If.h>
83 #include <blaze/util/mpl/Not.h>
84 #include <blaze/util/Types.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS SMATFOREACHEXPR
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
105 template< typename MT // Type of the sparse matrix
106  , typename OP // Type of the custom operation
107  , bool SO > // Storage order
108 class SMatForEachExpr : public SparseMatrix< SMatForEachExpr<MT,OP,SO>, SO >
109  , private MatForEachExpr
110  , private Computation
111 {
112  private:
113  //**Type definitions****************************************************************************
114  typedef ResultType_<MT> RT;
116  typedef ReturnType_<MT> RN;
117  //**********************************************************************************************
118 
119  //**Serial evaluation strategy******************************************************************
121 
127  enum : bool { useAssign = RequiresEvaluation<MT>::value };
128 
130  template< typename MT2 >
132  struct UseAssign {
133  enum : bool { value = useAssign };
134  };
136  //**********************************************************************************************
137 
138  //**Parallel evaluation strategy****************************************************************
140 
146  template< typename MT2 >
147  struct UseSMPAssign {
148  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
149  };
151  //**********************************************************************************************
152 
153  public:
154  //**Type definitions****************************************************************************
160 
162  typedef decltype( std::declval<OP>()( std::declval<RN>() ) ) ReturnType;
163 
165  typedef IfTrue_< useAssign, const ResultType, const SMatForEachExpr& > CompositeType;
166 
168  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
169 
171  typedef OP Operation;
172  //**********************************************************************************************
173 
174  //**ConstIterator class definition**************************************************************
178  {
179  public:
180  //**Type definitions*************************************************************************
183 
186 
187  typedef std::forward_iterator_tag IteratorCategory;
188  typedef Element ValueType;
189  typedef ValueType* PointerType;
190  typedef ValueType& ReferenceType;
192 
193  // STL iterator requirements
194  typedef IteratorCategory iterator_category;
195  typedef ValueType value_type;
196  typedef PointerType pointer;
197  typedef ReferenceType reference;
198  typedef DifferenceType difference_type;
199  //*******************************************************************************************
200 
201  //**Constructor******************************************************************************
207  inline ConstIterator( IteratorType it, OP op )
208  : it_( it ) // Iterator over the elements of the sparse matrix expression
209  , op_( op ) // The custom unary operation
210  {}
211  //*******************************************************************************************
212 
213  //**Prefix increment operator****************************************************************
218  inline ConstIterator& operator++() {
219  ++it_;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Element access operator******************************************************************
229  inline const Element operator*() const {
230  return Element( op_( it_->value() ), it_->index() );
231  }
232  //*******************************************************************************************
233 
234  //**Element access operator******************************************************************
239  inline const ConstIterator* operator->() const {
240  return this;
241  }
242  //*******************************************************************************************
243 
244  //**Value function***************************************************************************
249  inline ReturnType value() const {
250  return op_( it_->value() );
251  }
252  //*******************************************************************************************
253 
254  //**Index function***************************************************************************
259  inline size_t index() const {
260  return it_->index();
261  }
262  //*******************************************************************************************
263 
264  //**Equality operator************************************************************************
270  inline bool operator==( const ConstIterator& rhs ) const {
271  return it_ == rhs.it_;
272  }
273  //*******************************************************************************************
274 
275  //**Inequality operator**********************************************************************
281  inline bool operator!=( const ConstIterator& rhs ) const {
282  return it_ != rhs.it_;
283  }
284  //*******************************************************************************************
285 
286  //**Subtraction operator*********************************************************************
292  inline DifferenceType operator-( const ConstIterator& rhs ) const {
293  return it_ - rhs.it_;
294  }
295  //*******************************************************************************************
296 
297  private:
298  //**Member variables*************************************************************************
299  IteratorType it_;
300  OP op_;
301  //*******************************************************************************************
302  };
303  //**********************************************************************************************
304 
305  //**Compilation flags***************************************************************************
307  enum : bool { smpAssignable = MT::smpAssignable };
308  //**********************************************************************************************
309 
310  //**Constructor*********************************************************************************
316  explicit inline SMatForEachExpr( const MT& sm, OP op ) noexcept
317  : sm_( sm ) // Sparse matrix of the for-each expression
318  , op_( op ) // The custom unary operation
319  {}
320  //**********************************************************************************************
321 
322  //**Access operator*****************************************************************************
329  inline ReturnType operator()( size_t i, size_t j ) const {
330  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
331  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
332  return op_( sm_(i,j) );
333  }
334  //**********************************************************************************************
335 
336  //**At function*********************************************************************************
344  inline ReturnType at( size_t i, size_t j ) const {
345  if( i >= sm_.rows() ) {
346  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
347  }
348  if( j >= sm_.columns() ) {
349  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
350  }
351  return (*this)(i,j);
352  }
353  //**********************************************************************************************
354 
355  //**Begin function******************************************************************************
361  inline ConstIterator begin( size_t i ) const {
362  return ConstIterator( sm_.begin(i), op_ );
363  }
364  //**********************************************************************************************
365 
366  //**End function********************************************************************************
372  inline ConstIterator end( size_t i ) const {
373  return ConstIterator( sm_.end(i), op_ );
374  }
375  //**********************************************************************************************
376 
377  //**Rows function*******************************************************************************
382  inline size_t rows() const noexcept {
383  return sm_.rows();
384  }
385  //**********************************************************************************************
386 
387  //**Columns function****************************************************************************
392  inline size_t columns() const noexcept {
393  return sm_.columns();
394  }
395  //**********************************************************************************************
396 
397  //**NonZeros function***************************************************************************
402  inline size_t nonZeros() const {
403  return sm_.nonZeros();
404  }
405  //**********************************************************************************************
406 
407  //**NonZeros function***************************************************************************
413  inline size_t nonZeros( size_t i ) const {
414  return sm_.nonZeros(i);
415  }
416  //**********************************************************************************************
417 
418  //**Find function*******************************************************************************
425  inline ConstIterator find( size_t i, size_t j ) const {
427  return ConstIterator( sm_.find( i, j ), op_ );
428  }
429  //**********************************************************************************************
430 
431  //**LowerBound function*************************************************************************
438  inline ConstIterator lowerBound( size_t i, size_t j ) const {
440  return ConstIterator( sm_.lowerBound( i, j ), op_ );
441  }
442  //**********************************************************************************************
443 
444  //**UpperBound function*************************************************************************
451  inline ConstIterator upperBound( size_t i, size_t j ) const {
453  return ConstIterator( sm_.upperBound( i, j ), op_ );
454  }
455  //**********************************************************************************************
456 
457  //**Operand access******************************************************************************
462  inline Operand operand() const noexcept {
463  return sm_;
464  }
465  //**********************************************************************************************
466 
467  //**Operation access****************************************************************************
472  inline Operation operation() const {
473  return op_;
474  }
475  //**********************************************************************************************
476 
477  //**********************************************************************************************
483  template< typename T >
484  inline bool canAlias( const T* alias ) const noexcept {
485  return sm_.canAlias( alias );
486  }
487  //**********************************************************************************************
488 
489  //**********************************************************************************************
495  template< typename T >
496  inline bool isAliased( const T* alias ) const noexcept {
497  return sm_.isAliased( alias );
498  }
499  //**********************************************************************************************
500 
501  //**********************************************************************************************
506  inline bool canSMPAssign() const noexcept {
507  return sm_.canSMPAssign();
508  }
509  //**********************************************************************************************
510 
511  private:
512  //**Member variables****************************************************************************
515  //**********************************************************************************************
516 
517  //**Assignment to dense matrices****************************************************************
531  template< typename MT2 // Type of the target dense matrix
532  , bool SO2 > // Storage order of the target dense matrix
533  friend inline EnableIf_< UseAssign<MT2> >
534  assign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
535  {
537 
541 
542  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
543  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
544 
545  const RT tmp( serial( rhs.sm_ ) );
546  assign( ~lhs, forEach( tmp, rhs.op_ ) );
547  }
549  //**********************************************************************************************
550 
551  //**Assignment to row-major sparse matrices*****************************************************
566  template< typename MT2 > // Type of the target sparse matrix
567  friend inline EnableIf_< And< UseAssign<MT2>
569  assign( SparseMatrix<MT2,false>& lhs, const SMatForEachExpr& rhs )
570  {
572 
573  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
574  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
575 
576  typedef Iterator_<MT2> Iterator;
577 
578  assign( ~lhs, rhs.sm_ );
579 
580  const size_t m( rhs.rows() );
581 
582  for( size_t i=0UL; i<m; ++i ) {
583  const Iterator end( (~lhs).end(i) );
584  for( Iterator element=(~lhs).begin(i); element!=end; ++element ) {
585  element->value() = rhs.op_( element->value() );
586  }
587  }
588  }
590  //**********************************************************************************************
591 
592  //**Assignment to column-major sparse matrices**************************************************
607  template< typename MT2 > // Type of the target sparse matrix
608  friend inline EnableIf_< And< UseAssign<MT2>
609  , IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > >
610  assign( SparseMatrix<MT2,true>& lhs, const SMatForEachExpr& rhs )
611  {
613 
614  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
615  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
616 
617  typedef Iterator_<MT2> Iterator;
618 
619  assign( ~lhs, rhs.sm_ );
620 
621  const size_t n( rhs.columns() );
622 
623  for( size_t j=0UL; j<n; ++j ) {
624  const Iterator end( (~lhs).end(j) );
625  for( Iterator element=(~lhs).begin(j); element!=end; ++element ) {
626  element->value() = rhs.op_( element->value() );
627  }
628  }
629  }
631  //**********************************************************************************************
632 
633  //**Assignment to sparse matrices***************************************************************
647  template< typename MT2 // Type of the target sparse matrix
648  , bool SO2 > // Storage order of the target sparse matrix
649  friend inline EnableIf_< And< UseAssign<MT2>
651  assign( SparseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
652  {
654 
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
660  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
661 
662  const RT tmp( serial( rhs.sm_ ) );
663  (~lhs).reserve( tmp.nonZeros() );
664  assign( ~lhs, forEach( tmp, rhs.op_ ) );
665  }
667  //**********************************************************************************************
668 
669  //**Addition assignment to dense matrices*******************************************************
683  template< typename MT2 // Type of the target dense matrix
684  , bool SO2 > // Storage order of the target dense matrix
685  friend inline EnableIf_< UseAssign<MT2> >
686  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
687  {
689 
693 
694  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
695  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
696 
697  const RT tmp( serial( rhs.sm_ ) );
698  addAssign( ~lhs, forEach( tmp, rhs.op_ ) );
699  }
701  //**********************************************************************************************
702 
703  //**Addition assignment to sparse matrices******************************************************
704  // No special implementation for the addition assignment to sparse matrices.
705  //**********************************************************************************************
706 
707  //**Subtraction assignment to dense matrices****************************************************
721  template< typename MT2 // Type of the target dense matrix
722  , bool SO2 > // Storage order of the target sparse matrix
723  friend inline EnableIf_< UseAssign<MT2> >
724  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
725  {
727 
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
733  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
734 
735  const RT tmp( serial( rhs.sm_ ) );
736  subAssign( ~lhs, forEach( tmp, rhs.op_ ) );
737  }
739  //**********************************************************************************************
740 
741  //**Subtraction assignment to sparse matrices***************************************************
742  // No special implementation for the subtraction assignment to sparse matrices.
743  //**********************************************************************************************
744 
745  //**Multiplication assignment to dense matrices*************************************************
746  // No special implementation for the multiplication assignment to dense matrices.
747  //**********************************************************************************************
748 
749  //**Multiplication assignment to sparse matrices************************************************
750  // No special implementation for the multiplication assignment to sparse matrices.
751  //**********************************************************************************************
752 
753  //**SMP assignment to dense matrices************************************************************
767  template< typename MT2 // Type of the target dense matrix
768  , bool SO2 > // Storage order of the target dense matrix
769  friend inline EnableIf_< UseSMPAssign<MT2> >
771  {
773 
777 
778  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
779  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
780 
781  const RT tmp( rhs.sm_ );
782  smpAssign( ~lhs, forEach( tmp, rhs.op_ ) );
783  }
785  //**********************************************************************************************
786 
787  //**SMP assignment to sparse matrices***********************************************************
788  // No special implementation for the SMP assignment to sparse matrices.
789  //**********************************************************************************************
790 
791  //**SMP addition assignment to dense matrices***************************************************
805  template< typename MT2 // Type of the target dense matrix
806  , bool SO2 > // Storage order of the target dense matrix
807  friend inline EnableIf_< UseSMPAssign<MT2> >
809  {
811 
815 
816  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
817  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
818 
819  const RT tmp( rhs.sm_ );
820  smpAddAssign( ~lhs, forEach( tmp, rhs.op_ ) );
821  }
823  //**********************************************************************************************
824 
825  //**SMP addition assignment to sparse matrices**************************************************
826  // No special implementation for the SMP addition assignment to sparse matrices.
827  //**********************************************************************************************
828 
829  //**SMP subtraction assignment to dense matrices************************************************
843  template< typename MT2 // Type of the target dense matrix
844  , bool SO2 > // Storage order of the target sparse matrix
845  friend inline EnableIf_< UseSMPAssign<MT2> >
847  {
849 
853 
854  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
855  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
856 
857  const RT tmp( rhs.sm_ );
858  smpSubAssign( ~lhs, forEach( tmp, rhs.op_ ) );
859  }
861  //**********************************************************************************************
862 
863  //**SMP subtraction assignment to sparse matrices***********************************************
864  // No special implementation for the SMP subtraction assignment to sparse matrices.
865  //**********************************************************************************************
866 
867  //**SMP multiplication assignment to dense matrices*********************************************
868  // No special implementation for the SMP multiplication assignment to dense matrices.
869  //**********************************************************************************************
870 
871  //**SMP multiplication assignment to sparse matrices********************************************
872  // No special implementation for the SMP multiplication assignment to sparse matrices.
873  //**********************************************************************************************
874 
875  //**Compile time checks*************************************************************************
880  //**********************************************************************************************
881 };
882 //*************************************************************************************************
883 
884 
885 
886 
887 //=================================================================================================
888 //
889 // GLOBAL FUNCTIONS
890 //
891 //=================================================================================================
892 
893 //*************************************************************************************************
911 template< typename MT // Type of the sparse matrix
912  , bool SO // Storage order
913  , typename OP > // Type of the custom operation
914 inline const SMatForEachExpr<MT,OP,SO> forEach( const SparseMatrix<MT,SO>& sm, OP op )
915 {
917 
918  return SMatForEachExpr<MT,OP,SO>( ~sm, op );
919 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
940 template< typename MT // Type of the sparse matrix
941  , bool SO > // Storage order
943 {
945 
946  return SMatForEachExpr<MT,Abs,SO>( ~sm, Abs() );
947 }
948 //*************************************************************************************************
949 
950 
951 //*************************************************************************************************
968 template< typename MT // Type of the sparse matrix
969  , bool SO > // Storage order
971 {
973 
974  return SMatForEachExpr<MT,Floor,SO>( ~sm, Floor() );
975 }
976 //*************************************************************************************************
977 
978 
979 //*************************************************************************************************
996 template< typename MT // Type of the sparse matrix
997  , bool SO > // Storage order
999 {
1001 
1002  return SMatForEachExpr<MT,Ceil,SO>( ~sm, Ceil() );
1003 }
1004 //*************************************************************************************************
1005 
1006 
1007 //*************************************************************************************************
1024 template< typename MT // Type of the sparse matrix
1025  , bool SO > // Storage order
1027 {
1029 
1030  return SMatForEachExpr<MT,Trunc,SO>( ~sm, Trunc() );
1031 }
1032 //*************************************************************************************************
1033 
1034 
1035 //*************************************************************************************************
1052 template< typename MT // Type of the sparse matrix
1053  , bool SO > // Storage order
1055 {
1057 
1058  return SMatForEachExpr<MT,Round,SO>( ~sm, Round() );
1059 }
1060 //*************************************************************************************************
1061 
1062 
1063 //*************************************************************************************************
1080 template< typename MT // Type of the sparse matrix
1081  , bool SO > // Storage order
1083 {
1085 
1086  return SMatForEachExpr<MT,Conj,SO>( ~sm, Conj() );
1087 }
1088 //*************************************************************************************************
1089 
1090 
1091 //*************************************************************************************************
1117 template< typename MT // Type of the sparse matrix
1118  , bool SO > // Storage order
1120 {
1122 
1123  return trans( conj( ~sm ) );
1124 }
1125 //*************************************************************************************************
1126 
1127 
1128 //*************************************************************************************************
1145 template< typename MT // Type of the sparse matrix
1146  , bool SO > // Storage order
1148 {
1150 
1151  return SMatForEachExpr<MT,Real,SO>( ~sm, Real() );
1152 }
1153 //*************************************************************************************************
1154 
1155 
1156 //*************************************************************************************************
1173 template< typename MT // Type of the sparse matrix
1174  , bool SO > // Storage order
1176 {
1178 
1179  return SMatForEachExpr<MT,Imag,SO>( ~sm, Imag() );
1180 }
1181 //*************************************************************************************************
1182 
1183 
1184 //*************************************************************************************************
1204 template< typename MT // Type of the sparse matrix
1205  , bool SO > // Storage order
1207 {
1209 
1210  return SMatForEachExpr<MT,Sqrt,SO>( ~sm, Sqrt() );
1211 }
1212 //*************************************************************************************************
1213 
1214 
1215 //*************************************************************************************************
1235 template< typename MT // Type of the sparse matrix
1236  , bool SO > // Storage order
1238 {
1240 
1241  return SMatForEachExpr<MT,InvSqrt,SO>( ~sm, InvSqrt() );
1242 }
1243 //*************************************************************************************************
1244 
1245 
1246 //*************************************************************************************************
1266 template< typename MT // Type of the sparse matrix
1267  , bool SO > // Storage order
1269 {
1271 
1272  return SMatForEachExpr<MT,Cbrt,SO>( ~sm, Cbrt() );
1273 }
1274 //*************************************************************************************************
1275 
1276 
1277 //*************************************************************************************************
1297 template< typename MT // Type of the sparse matrix
1298  , bool SO > // Storage order
1300 {
1302 
1303  return SMatForEachExpr<MT,InvCbrt,SO>( ~sm, InvCbrt() );
1304 }
1305 //*************************************************************************************************
1306 
1307 
1308 //*************************************************************************************************
1327 template< typename MT // Type of the sparse matrix
1328  , bool SO // Storage order
1329  , typename DT > // Type of the delimiters
1330 inline const SMatForEachExpr<MT,Clamp<DT>,SO>
1331  clamp( const SparseMatrix<MT,SO>& sm, const DT& min, const DT& max )
1332 {
1334 
1335  return SMatForEachExpr<MT,Clamp<DT>,SO>( ~sm, Clamp<DT>( min, max ) );
1336 }
1337 //*************************************************************************************************
1338 
1339 
1340 //*************************************************************************************************
1358 template< typename MT // Type of the sparse matrix
1359  , bool SO // Storage order
1360  , typename ET > // Type of the exponent
1361 inline const SMatForEachExpr<MT,Pow<ET>,SO> pow( const SparseMatrix<MT,SO>& sm, ET exp )
1362 {
1364 
1366 
1367  return SMatForEachExpr<MT,Pow<ET>,SO>( ~sm, Pow<ET>( exp ) );
1368 }
1369 //*************************************************************************************************
1370 
1371 
1372 //*************************************************************************************************
1389 template< typename MT // Type of the sparse matrix
1390  , bool SO > // Storage order
1392 {
1394 
1395  return SMatForEachExpr<MT,Exp,SO>( ~sm, Exp() );
1396 }
1397 //*************************************************************************************************
1398 
1399 
1400 //*************************************************************************************************
1417 template< typename MT // Type of the sparse matrix
1418  , bool SO > // Storage order
1420 {
1422 
1423  return SMatForEachExpr<MT,Exp2,SO>( ~sm, Exp2() );
1424 }
1425 //*************************************************************************************************
1426 
1427 
1428 //*************************************************************************************************
1445 template< typename MT // Type of the sparse matrix
1446  , bool SO > // Storage order
1448 {
1450 
1451  return SMatForEachExpr<MT,Exp10,SO>( ~sm, Exp10() );
1452 }
1453 //*************************************************************************************************
1454 
1455 
1456 //*************************************************************************************************
1476 template< typename MT // Type of the sparse matrix
1477  , bool SO > // Storage order
1479 {
1481 
1482  return SMatForEachExpr<MT,Log,SO>( ~sm, Log() );
1483 }
1484 //*************************************************************************************************
1485 
1486 
1487 //*************************************************************************************************
1507 template< typename MT // Type of the sparse matrix
1508  , bool SO > // Storage order
1510 {
1512 
1513  return SMatForEachExpr<MT,Log10,SO>( ~sm, Log10() );
1514 }
1515 //*************************************************************************************************
1516 
1517 
1518 //*************************************************************************************************
1538 template< typename MT // Type of the sparse matrix
1539  , bool SO > // Storage order
1541 {
1543 
1544  return SMatForEachExpr<MT,Log2,SO>( ~sm, Log2() );
1545 }
1546 //*************************************************************************************************
1547 
1548 
1549 //*************************************************************************************************
1566 template< typename MT // Type of the sparse matrix
1567  , bool SO > // Storage order
1569 {
1571 
1572  return SMatForEachExpr<MT,Sin,SO>( ~sm, Sin() );
1573 }
1574 //*************************************************************************************************
1575 
1576 
1577 //*************************************************************************************************
1597 template< typename MT // Type of the sparse matrix
1598  , bool SO > // Storage order
1600 {
1602 
1603  return SMatForEachExpr<MT,Asin,SO>( ~sm, Asin() );
1604 }
1605 //*************************************************************************************************
1606 
1607 
1608 //*************************************************************************************************
1625 template< typename MT // Type of the sparse matrix
1626  , bool SO > // Storage order
1628 {
1630 
1631  return SMatForEachExpr<MT,Sinh,SO>( ~sm, Sinh() );
1632 }
1633 //*************************************************************************************************
1634 
1635 
1636 //*************************************************************************************************
1653 template< typename MT // Type of the sparse matrix
1654  , bool SO > // Storage order
1656 {
1658 
1659  return SMatForEachExpr<MT,Asinh,SO>( ~sm, Asinh() );
1660 }
1661 //*************************************************************************************************
1662 
1663 
1664 //*************************************************************************************************
1681 template< typename MT // Type of the sparse matrix
1682  , bool SO > // Storage order
1684 {
1686 
1687  return SMatForEachExpr<MT,Cos,SO>( ~sm, Cos() );
1688 }
1689 //*************************************************************************************************
1690 
1691 
1692 //*************************************************************************************************
1712 template< typename MT // Type of the sparse matrix
1713  , bool SO > // Storage order
1715 {
1717 
1718  return SMatForEachExpr<MT,Acos,SO>( ~sm, Acos() );
1719 }
1720 //*************************************************************************************************
1721 
1722 
1723 //*************************************************************************************************
1740 template< typename MT // Type of the sparse matrix
1741  , bool SO > // Storage order
1743 {
1745 
1746  return SMatForEachExpr<MT,Cosh,SO>( ~sm, Cosh() );
1747 }
1748 //*************************************************************************************************
1749 
1750 
1751 //*************************************************************************************************
1771 template< typename MT // Type of the sparse matrix
1772  , bool SO > // Storage order
1774 {
1776 
1777  return SMatForEachExpr<MT,Acosh,SO>( ~sm, Acosh() );
1778 }
1779 //*************************************************************************************************
1780 
1781 
1782 //*************************************************************************************************
1799 template< typename MT // Type of the sparse matrix
1800  , bool SO > // Storage order
1802 {
1804 
1805  return SMatForEachExpr<MT,Tan,SO>( ~sm, Tan() );
1806 }
1807 //*************************************************************************************************
1808 
1809 
1810 //*************************************************************************************************
1827 template< typename MT // Type of the sparse matrix
1828  , bool SO > // Storage order
1830 {
1832 
1833  return SMatForEachExpr<MT,Atan,SO>( ~sm, Atan() );
1834 }
1835 //*************************************************************************************************
1836 
1837 
1838 //*************************************************************************************************
1858 template< typename MT // Type of the sparse matrix
1859  , bool SO > // Storage order
1861 {
1863 
1864  return SMatForEachExpr<MT,Tanh,SO>( ~sm, Tanh() );
1865 }
1866 //*************************************************************************************************
1867 
1868 
1869 //*************************************************************************************************
1889 template< typename MT // Type of the sparse matrix
1890  , bool SO > // Storage order
1892 {
1894 
1895  return SMatForEachExpr<MT,Atanh,SO>( ~sm, Atanh() );
1896 }
1897 //*************************************************************************************************
1898 
1899 
1900 //*************************************************************************************************
1917 template< typename MT // Type of the sparse matrix
1918  , bool SO > // Storage order
1920 {
1922 
1923  return SMatForEachExpr<MT,Erf,SO>( ~sm, Erf() );
1924 }
1925 //*************************************************************************************************
1926 
1927 
1928 //*************************************************************************************************
1946 template< typename MT // Type of the sparse matrix
1947  , bool SO > // Storage order
1949 {
1951 
1952  return SMatForEachExpr<MT,Erfc,SO>( ~sm, Erfc() );
1953 }
1954 //*************************************************************************************************
1955 
1956 
1957 
1958 
1959 //=================================================================================================
1960 //
1961 // GLOBAL RESTRUCTURING FUNCTIONS
1962 //
1963 //=================================================================================================
1964 
1965 //*************************************************************************************************
1976 template< typename MT // Type of the sparse matrix
1977  , bool SO > // Storage order
1979 {
1981 
1982  return sm;
1983 }
1985 //*************************************************************************************************
1986 
1987 
1988 //*************************************************************************************************
1999 template< typename MT // Type of the sparse matrix
2000  , bool SO > // Storage order
2002 {
2004 
2005  return sm;
2006 }
2008 //*************************************************************************************************
2009 
2010 
2011 //*************************************************************************************************
2022 template< typename MT // Type of the sparse matrix
2023  , bool SO > // Storage order
2025 {
2027 
2028  return sm;
2029 }
2031 //*************************************************************************************************
2032 
2033 
2034 //*************************************************************************************************
2045 template< typename MT // Type of the sparse matrix
2046  , bool SO > // Storage order
2048 {
2050 
2051  return sm;
2052 }
2054 //*************************************************************************************************
2055 
2056 
2057 //*************************************************************************************************
2068 template< typename MT // Type of the sparse matrix
2069  , bool SO > // Storage order
2071 {
2073 
2074  return sm;
2075 }
2077 //*************************************************************************************************
2078 
2079 
2080 //*************************************************************************************************
2098 template< typename MT // Type of the sparse matrix
2099  , bool TF > // Transpose flag
2101 {
2103 
2104  return sm.operand();
2105 }
2107 //*************************************************************************************************
2108 
2109 
2110 //*************************************************************************************************
2128 template< typename MT // Type of the sparse matrix
2129  , bool SO > // Storage order
2131 {
2133 
2134  return SMatTransExpr<MT,!SO>( sm.operand().operand() );
2135 }
2137 //*************************************************************************************************
2138 
2139 
2140 //*************************************************************************************************
2151 template< typename MT // Type of the sparse matrix
2152  , bool SO > // Storage order
2154 {
2156 
2157  return sm;
2158 }
2160 //*************************************************************************************************
2161 
2162 
2163 //*************************************************************************************************
2174 template< typename MT // Type of the sparse matrix
2175  , bool SO > // Storage order
2177 {
2179 
2180  return sm;
2181 }
2183 //*************************************************************************************************
2184 
2185 
2186 
2187 
2188 //=================================================================================================
2189 //
2190 // ROWS SPECIALIZATIONS
2191 //
2192 //=================================================================================================
2193 
2194 //*************************************************************************************************
2196 template< typename MT, typename OP, bool SO >
2197 struct Rows< SMatForEachExpr<MT,OP,SO> > : public Rows<MT>
2198 {};
2200 //*************************************************************************************************
2201 
2202 
2203 
2204 
2205 //=================================================================================================
2206 //
2207 // COLUMNS SPECIALIZATIONS
2208 //
2209 //=================================================================================================
2210 
2211 //*************************************************************************************************
2213 template< typename MT, typename OP, bool SO >
2214 struct Columns< SMatForEachExpr<MT,OP,SO> > : public Columns<MT>
2215 {};
2217 //*************************************************************************************************
2218 
2219 
2220 
2221 
2222 //=================================================================================================
2223 //
2224 // ISSYMMETRIC SPECIALIZATIONS
2225 //
2226 //=================================================================================================
2227 
2228 //*************************************************************************************************
2230 template< typename MT, bool SO >
2231 struct IsSymmetric< SMatForEachExpr<MT,Abs,SO> >
2232  : public BoolConstant< IsSymmetric<MT>::value >
2233 {};
2234 
2235 template< typename MT, bool SO >
2236 struct IsSymmetric< SMatForEachExpr<MT,Floor,SO> >
2237  : public BoolConstant< IsSymmetric<MT>::value >
2238 {};
2239 
2240 template< typename MT, bool SO >
2241 struct IsSymmetric< SMatForEachExpr<MT,Ceil,SO> >
2242  : public BoolConstant< IsSymmetric<MT>::value >
2243 {};
2244 
2245 template< typename MT, bool SO >
2246 struct IsSymmetric< SMatForEachExpr<MT,Trunc,SO> >
2247  : public BoolConstant< IsSymmetric<MT>::value >
2248 {};
2249 
2250 template< typename MT, bool SO >
2251 struct IsSymmetric< SMatForEachExpr<MT,Round,SO> >
2252  : public BoolConstant< IsSymmetric<MT>::value >
2253 {};
2254 
2255 template< typename MT, bool SO >
2256 struct IsSymmetric< SMatForEachExpr<MT,Conj,SO> >
2257  : public BoolConstant< IsSymmetric<MT>::value >
2258 {};
2259 
2260 template< typename MT, bool SO >
2261 struct IsSymmetric< SMatForEachExpr<MT,Real,SO> >
2262  : public BoolConstant< IsSymmetric<MT>::value >
2263 {};
2264 
2265 template< typename MT, bool SO >
2266 struct IsSymmetric< SMatForEachExpr<MT,Imag,SO> >
2267  : public BoolConstant< IsSymmetric<MT>::value >
2268 {};
2269 
2270 template< typename MT, bool SO >
2271 struct IsSymmetric< SMatForEachExpr<MT,Sqrt,SO> >
2272  : public BoolConstant< IsSymmetric<MT>::value >
2273 {};
2274 
2275 template< typename MT, bool SO >
2276 struct IsSymmetric< SMatForEachExpr<MT,InvSqrt,SO> >
2277  : public BoolConstant< IsSymmetric<MT>::value >
2278 {};
2279 
2280 template< typename MT, bool SO >
2281 struct IsSymmetric< SMatForEachExpr<MT,Cbrt,SO> >
2282  : public BoolConstant< IsSymmetric<MT>::value >
2283 {};
2284 
2285 template< typename MT, bool SO >
2286 struct IsSymmetric< SMatForEachExpr<MT,InvCbrt,SO> >
2287  : public BoolConstant< IsSymmetric<MT>::value >
2288 {};
2289 
2290 template< typename MT, typename ET, bool SO >
2291 struct IsSymmetric< SMatForEachExpr<MT,Pow<ET>,SO> >
2292  : public BoolConstant< IsSymmetric<MT>::value >
2293 {};
2294 
2295 template< typename MT, bool SO >
2296 struct IsSymmetric< SMatForEachExpr<MT,Exp,SO> >
2297  : public BoolConstant< IsSymmetric<MT>::value >
2298 {};
2299 
2300 template< typename MT, bool SO >
2301 struct IsSymmetric< SMatForEachExpr<MT,Exp2,SO> >
2302  : public BoolConstant< IsSymmetric<MT>::value >
2303 {};
2304 
2305 template< typename MT, bool SO >
2306 struct IsSymmetric< SMatForEachExpr<MT,Exp10,SO> >
2307  : public BoolConstant< IsSymmetric<MT>::value >
2308 {};
2309 
2310 template< typename MT, bool SO >
2311 struct IsSymmetric< SMatForEachExpr<MT,Log,SO> >
2312  : public BoolConstant< IsSymmetric<MT>::value >
2313 {};
2314 
2315 template< typename MT, bool SO >
2316 struct IsSymmetric< SMatForEachExpr<MT,Log2,SO> >
2317  : public BoolConstant< IsSymmetric<MT>::value >
2318 {};
2319 
2320 template< typename MT, bool SO >
2321 struct IsSymmetric< SMatForEachExpr<MT,Log10,SO> >
2322  : public BoolConstant< IsSymmetric<MT>::value >
2323 {};
2324 
2325 template< typename MT, bool SO >
2326 struct IsSymmetric< SMatForEachExpr<MT,Sin,SO> >
2327  : public BoolConstant< IsSymmetric<MT>::value >
2328 {};
2329 
2330 template< typename MT, bool SO >
2331 struct IsSymmetric< SMatForEachExpr<MT,Asin,SO> >
2332  : public BoolConstant< IsSymmetric<MT>::value >
2333 {};
2334 
2335 template< typename MT, bool SO >
2336 struct IsSymmetric< SMatForEachExpr<MT,Sinh,SO> >
2337  : public BoolConstant< IsSymmetric<MT>::value >
2338 {};
2339 
2340 template< typename MT, bool SO >
2341 struct IsSymmetric< SMatForEachExpr<MT,Asinh,SO> >
2342  : public BoolConstant< IsSymmetric<MT>::value >
2343 {};
2344 
2345 template< typename MT, bool SO >
2346 struct IsSymmetric< SMatForEachExpr<MT,Cos,SO> >
2347  : public BoolConstant< IsSymmetric<MT>::value >
2348 {};
2349 
2350 template< typename MT, bool SO >
2351 struct IsSymmetric< SMatForEachExpr<MT,Acos,SO> >
2352  : public BoolConstant< IsSymmetric<MT>::value >
2353 {};
2354 
2355 template< typename MT, bool SO >
2356 struct IsSymmetric< SMatForEachExpr<MT,Cosh,SO> >
2357  : public BoolConstant< IsSymmetric<MT>::value >
2358 {};
2359 
2360 template< typename MT, bool SO >
2361 struct IsSymmetric< SMatForEachExpr<MT,Acosh,SO> >
2362  : public BoolConstant< IsSymmetric<MT>::value >
2363 {};
2364 
2365 template< typename MT, bool SO >
2366 struct IsSymmetric< SMatForEachExpr<MT,Tan,SO> >
2367  : public BoolConstant< IsSymmetric<MT>::value >
2368 {};
2369 
2370 template< typename MT, bool SO >
2371 struct IsSymmetric< SMatForEachExpr<MT,Atan,SO> >
2372  : public BoolConstant< IsSymmetric<MT>::value >
2373 {};
2374 
2375 template< typename MT, bool SO >
2376 struct IsSymmetric< SMatForEachExpr<MT,Tanh,SO> >
2377  : public BoolConstant< IsSymmetric<MT>::value >
2378 {};
2379 
2380 template< typename MT, bool SO >
2381 struct IsSymmetric< SMatForEachExpr<MT,Atanh,SO> >
2382  : public BoolConstant< IsSymmetric<MT>::value >
2383 {};
2384 
2385 template< typename MT, bool SO >
2386 struct IsSymmetric< SMatForEachExpr<MT,Erf,SO> >
2387  : public BoolConstant< IsSymmetric<MT>::value >
2388 {};
2389 
2390 template< typename MT, bool SO >
2391 struct IsSymmetric< SMatForEachExpr<MT,Erfc,SO> >
2392  : public BoolConstant< IsSymmetric<MT>::value >
2393 {};
2395 //*************************************************************************************************
2396 
2397 
2398 
2399 
2400 //=================================================================================================
2401 //
2402 // ISHERMITIAN SPECIALIZATIONS
2403 //
2404 //=================================================================================================
2405 
2406 //*************************************************************************************************
2408 template< typename MT, bool SO >
2409 struct IsHermitian< SMatForEachExpr<MT,Abs,SO> >
2410  : public BoolConstant< IsHermitian<MT>::value >
2411 {};
2412 
2413 template< typename MT, bool SO >
2414 struct IsHermitian< SMatForEachExpr<MT,Floor,SO> >
2415  : public BoolConstant< IsHermitian<MT>::value >
2416 {};
2417 
2418 template< typename MT, bool SO >
2419 struct IsHermitian< SMatForEachExpr<MT,Ceil,SO> >
2420  : public BoolConstant< IsHermitian<MT>::value >
2421 {};
2422 
2423 template< typename MT, bool SO >
2424 struct IsHermitian< SMatForEachExpr<MT,Trunc,SO> >
2425  : public BoolConstant< IsHermitian<MT>::value >
2426 {};
2427 
2428 template< typename MT, bool SO >
2429 struct IsHermitian< SMatForEachExpr<MT,Round,SO> >
2430  : public BoolConstant< IsHermitian<MT>::value >
2431 {};
2432 
2433 template< typename MT, bool SO >
2434 struct IsHermitian< SMatForEachExpr<MT,Conj,SO> >
2435  : public BoolConstant< IsHermitian<MT>::value >
2436 {};
2437 
2438 template< typename MT, bool SO >
2439 struct IsHermitian< SMatForEachExpr<MT,Real,SO> >
2440  : public BoolConstant< IsHermitian<MT>::value >
2441 {};
2442 
2443 template< typename MT, bool SO >
2444 struct IsHermitian< SMatForEachExpr<MT,Imag,SO> >
2445  : public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
2446 {};
2447 
2448 template< typename MT, bool SO >
2449 struct IsHermitian< SMatForEachExpr<MT,Sqrt,SO> >
2450  : public BoolConstant< IsHermitian<MT>::value >
2451 {};
2452 
2453 template< typename MT, bool SO >
2454 struct IsHermitian< SMatForEachExpr<MT,InvSqrt,SO> >
2455  : public BoolConstant< IsHermitian<MT>::value >
2456 {};
2457 
2458 template< typename MT, bool SO >
2459 struct IsHermitian< SMatForEachExpr<MT,Cbrt,SO> >
2460  : public BoolConstant< IsHermitian<MT>::value >
2461 {};
2462 
2463 template< typename MT, bool SO >
2464 struct IsHermitian< SMatForEachExpr<MT,InvCbrt,SO> >
2465  : public BoolConstant< IsHermitian<MT>::value >
2466 {};
2467 
2468 template< typename MT, typename ET, bool SO >
2469 struct IsHermitian< SMatForEachExpr<MT,Pow<ET>,SO> >
2470  : public BoolConstant< IsHermitian<MT>::value >
2471 {};
2472 
2473 template< typename MT, bool SO >
2474 struct IsHermitian< SMatForEachExpr<MT,Exp,SO> >
2475  : public BoolConstant< IsHermitian<MT>::value >
2476 {};
2477 
2478 template< typename MT, bool SO >
2479 struct IsHermitian< SMatForEachExpr<MT,Exp2,SO> >
2480  : public BoolConstant< IsHermitian<MT>::value >
2481 {};
2482 
2483 template< typename MT, bool SO >
2484 struct IsHermitian< SMatForEachExpr<MT,Exp10,SO> >
2485  : public BoolConstant< IsHermitian<MT>::value >
2486 {};
2487 
2488 template< typename MT, bool SO >
2489 struct IsHermitian< SMatForEachExpr<MT,Log,SO> >
2490  : public BoolConstant< IsHermitian<MT>::value >
2491 {};
2492 
2493 template< typename MT, bool SO >
2494 struct IsHermitian< SMatForEachExpr<MT,Log2,SO> >
2495  : public BoolConstant< IsHermitian<MT>::value >
2496 {};
2497 
2498 template< typename MT, bool SO >
2499 struct IsHermitian< SMatForEachExpr<MT,Log10,SO> >
2500  : public BoolConstant< IsHermitian<MT>::value >
2501 {};
2502 
2503 template< typename MT, bool SO >
2504 struct IsHermitian< SMatForEachExpr<MT,Sin,SO> >
2505  : public BoolConstant< IsHermitian<MT>::value >
2506 {};
2507 
2508 template< typename MT, bool SO >
2509 struct IsHermitian< SMatForEachExpr<MT,Asin,SO> >
2510  : public BoolConstant< IsHermitian<MT>::value >
2511 {};
2512 
2513 template< typename MT, bool SO >
2514 struct IsHermitian< SMatForEachExpr<MT,Sinh,SO> >
2515  : public BoolConstant< IsHermitian<MT>::value >
2516 {};
2517 
2518 template< typename MT, bool SO >
2519 struct IsHermitian< SMatForEachExpr<MT,Asinh,SO> >
2520  : public BoolConstant< IsHermitian<MT>::value >
2521 {};
2522 
2523 template< typename MT, bool SO >
2524 struct IsHermitian< SMatForEachExpr<MT,Cos,SO> >
2525  : public BoolConstant< IsHermitian<MT>::value >
2526 {};
2527 
2528 template< typename MT, bool SO >
2529 struct IsHermitian< SMatForEachExpr<MT,Acos,SO> >
2530  : public BoolConstant< IsHermitian<MT>::value >
2531 {};
2532 
2533 template< typename MT, bool SO >
2534 struct IsHermitian< SMatForEachExpr<MT,Cosh,SO> >
2535  : public BoolConstant< IsHermitian<MT>::value >
2536 {};
2537 
2538 template< typename MT, bool SO >
2539 struct IsHermitian< SMatForEachExpr<MT,Acosh,SO> >
2540  : public BoolConstant< IsHermitian<MT>::value >
2541 {};
2542 
2543 template< typename MT, bool SO >
2544 struct IsHermitian< SMatForEachExpr<MT,Tan,SO> >
2545  : public BoolConstant< IsHermitian<MT>::value >
2546 {};
2547 
2548 template< typename MT, bool SO >
2549 struct IsHermitian< SMatForEachExpr<MT,Atan,SO> >
2550  : public BoolConstant< IsHermitian<MT>::value >
2551 {};
2552 
2553 template< typename MT, bool SO >
2554 struct IsHermitian< SMatForEachExpr<MT,Tanh,SO> >
2555  : public BoolConstant< IsHermitian<MT>::value >
2556 {};
2557 
2558 template< typename MT, bool SO >
2559 struct IsHermitian< SMatForEachExpr<MT,Atanh,SO> >
2560  : public BoolConstant< IsHermitian<MT>::value >
2561 {};
2562 
2563 template< typename MT, bool SO >
2564 struct IsHermitian< SMatForEachExpr<MT,Erf,SO> >
2565  : public BoolConstant< IsHermitian<MT>::value >
2566 {};
2567 
2568 template< typename MT, bool SO >
2569 struct IsHermitian< SMatForEachExpr<MT,Erfc,SO> >
2570  : public BoolConstant< IsHermitian<MT>::value >
2571 {};
2573 //*************************************************************************************************
2574 
2575 
2576 
2577 
2578 //=================================================================================================
2579 //
2580 // ISLOWER SPECIALIZATIONS
2581 //
2582 //=================================================================================================
2583 
2584 //*************************************************************************************************
2586 template< typename MT, typename OP, bool SO >
2587 struct IsLower< SMatForEachExpr<MT,OP,SO> >
2588  : public BoolConstant< IsLower<MT>::value >
2589 {};
2591 //*************************************************************************************************
2592 
2593 
2594 
2595 
2596 //=================================================================================================
2597 //
2598 // ISUNILOWER SPECIALIZATIONS
2599 //
2600 //=================================================================================================
2601 
2602 //*************************************************************************************************
2604 template< typename MT, bool SO >
2605 struct IsUniLower< SMatForEachExpr<MT,Abs,SO> >
2606  : public BoolConstant< IsUniLower<MT>::value >
2607 {};
2608 
2609 template< typename MT, bool SO >
2610 struct IsUniLower< SMatForEachExpr<MT,Floor,SO> >
2611  : public BoolConstant< IsUniLower<MT>::value >
2612 {};
2613 
2614 template< typename MT, bool SO >
2615 struct IsUniLower< SMatForEachExpr<MT,Ceil,SO> >
2616  : public BoolConstant< IsUniLower<MT>::value >
2617 {};
2618 
2619 template< typename MT, bool SO >
2620 struct IsUniLower< SMatForEachExpr<MT,Trunc,SO> >
2621  : public BoolConstant< IsUniLower<MT>::value >
2622 {};
2623 
2624 template< typename MT, bool SO >
2625 struct IsUniLower< SMatForEachExpr<MT,Round,SO> >
2626  : public BoolConstant< IsUniLower<MT>::value >
2627 {};
2628 
2629 template< typename MT, typename ET, bool SO >
2630 struct IsUniLower< SMatForEachExpr<MT,Pow<ET>,SO> >
2631  : public BoolConstant< IsUniLower<MT>::value >
2632 {};
2634 //*************************************************************************************************
2635 
2636 
2637 
2638 
2639 //=================================================================================================
2640 //
2641 // ISSTRICTLYLOWER SPECIALIZATIONS
2642 //
2643 //=================================================================================================
2644 
2645 //*************************************************************************************************
2647 template< typename MT, typename OP, bool SO >
2648 struct IsStrictlyLower< SMatForEachExpr<MT,OP,SO> >
2649  : public BoolConstant< IsStrictlyLower<MT>::value >
2650 {};
2652 //*************************************************************************************************
2653 
2654 
2655 
2656 
2657 //=================================================================================================
2658 //
2659 // ISUPPER SPECIALIZATIONS
2660 //
2661 //=================================================================================================
2662 
2663 //*************************************************************************************************
2665 template< typename MT, typename OP, bool SO >
2666 struct IsUpper< SMatForEachExpr<MT,OP,SO> >
2667  : public BoolConstant< IsUpper<MT>::value >
2668 {};
2670 //*************************************************************************************************
2671 
2672 
2673 
2674 
2675 //=================================================================================================
2676 //
2677 // ISUNIUPPER SPECIALIZATIONS
2678 //
2679 //=================================================================================================
2680 
2681 //*************************************************************************************************
2683 template< typename MT, bool SO >
2684 struct IsUniUpper< SMatForEachExpr<MT,Abs,SO> >
2685  : public BoolConstant< IsUniUpper<MT>::value >
2686 {};
2687 
2688 template< typename MT, bool SO >
2689 struct IsUniUpper< SMatForEachExpr<MT,Floor,SO> >
2690  : public BoolConstant< IsUniUpper<MT>::value >
2691 {};
2692 
2693 template< typename MT, bool SO >
2694 struct IsUniUpper< SMatForEachExpr<MT,Ceil,SO> >
2695  : public BoolConstant< IsUniUpper<MT>::value >
2696 {};
2697 
2698 template< typename MT, bool SO >
2699 struct IsUniUpper< SMatForEachExpr<MT,Trunc,SO> >
2700  : public BoolConstant< IsUniUpper<MT>::value >
2701 {};
2702 
2703 template< typename MT, bool SO >
2704 struct IsUniUpper< SMatForEachExpr<MT,Round,SO> >
2705  : public BoolConstant< IsUniUpper<MT>::value >
2706 {};
2707 
2708 template< typename MT, typename ET, bool SO >
2709 struct IsUniUpper< SMatForEachExpr<MT,Pow<ET>,SO> >
2710  : public BoolConstant< IsUniUpper<MT>::value >
2711 {};
2713 //*************************************************************************************************
2714 
2715 
2716 
2717 
2718 //=================================================================================================
2719 //
2720 // ISSTRICTLYUPPER SPECIALIZATIONS
2721 //
2722 //=================================================================================================
2723 
2724 //*************************************************************************************************
2726 template< typename MT, typename OP, bool SO >
2727 struct IsStrictlyUpper< SMatForEachExpr<MT,OP,SO> >
2728  : public BoolConstant< IsStrictlyUpper<MT>::value >
2729 {};
2731 //*************************************************************************************************
2732 
2733 
2734 
2735 
2736 //=================================================================================================
2737 //
2738 // EXPRESSION TRAIT SPECIALIZATIONS
2739 //
2740 //=================================================================================================
2741 
2742 //*************************************************************************************************
2744 template< typename MT >
2745 struct SMatForEachExprTrait< SMatForEachExpr<MT,Abs,false>, Abs >
2746 {
2747  public:
2748  //**********************************************************************************************
2751  , INVALID_TYPE >;
2752  //**********************************************************************************************
2753 };
2755 //*************************************************************************************************
2756 
2757 
2758 //*************************************************************************************************
2760 template< typename MT >
2761 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Abs,true>, Abs >
2762 {
2763  public:
2764  //**********************************************************************************************
2767  , INVALID_TYPE >;
2768  //**********************************************************************************************
2769 };
2771 //*************************************************************************************************
2772 
2773 
2774 //*************************************************************************************************
2776 template< typename MT >
2777 struct SMatForEachExprTrait< SMatForEachExpr<MT,Floor,false>, Floor >
2778 {
2779  public:
2780  //**********************************************************************************************
2783  , INVALID_TYPE >;
2784  //**********************************************************************************************
2785 };
2787 //*************************************************************************************************
2788 
2789 
2790 //*************************************************************************************************
2792 template< typename MT >
2793 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Floor,true>, Floor >
2794 {
2795  public:
2796  //**********************************************************************************************
2799  , INVALID_TYPE >;
2800  //**********************************************************************************************
2801 };
2803 //*************************************************************************************************
2804 
2805 
2806 //*************************************************************************************************
2808 template< typename MT >
2809 struct SMatForEachExprTrait< SMatForEachExpr<MT,Ceil,false>, Ceil >
2810 {
2811  public:
2812  //**********************************************************************************************
2815  , INVALID_TYPE >;
2816  //**********************************************************************************************
2817 };
2819 //*************************************************************************************************
2820 
2821 
2822 //*************************************************************************************************
2824 template< typename MT >
2825 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Ceil,true>, Ceil >
2826 {
2827  public:
2828  //**********************************************************************************************
2831  , INVALID_TYPE >;
2832  //**********************************************************************************************
2833 };
2835 //*************************************************************************************************
2836 
2837 
2838 //*************************************************************************************************
2840 template< typename MT >
2841 struct SMatForEachExprTrait< SMatForEachExpr<MT,Trunc,false>, Trunc >
2842 {
2843  public:
2844  //**********************************************************************************************
2847  , INVALID_TYPE >;
2848  //**********************************************************************************************
2849 };
2851 //*************************************************************************************************
2852 
2853 
2854 //*************************************************************************************************
2856 template< typename MT >
2857 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Trunc,true>, Trunc >
2858 {
2859  public:
2860  //**********************************************************************************************
2863  , INVALID_TYPE >;
2864  //**********************************************************************************************
2865 };
2867 //*************************************************************************************************
2868 
2869 
2870 //*************************************************************************************************
2872 template< typename MT >
2873 struct SMatForEachExprTrait< SMatForEachExpr<MT,Round,false>, Round >
2874 {
2875  public:
2876  //**********************************************************************************************
2879  , INVALID_TYPE >;
2880  //**********************************************************************************************
2881 };
2883 //*************************************************************************************************
2884 
2885 
2886 //*************************************************************************************************
2888 template< typename MT >
2889 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Round,true>, Round >
2890 {
2891  public:
2892  //**********************************************************************************************
2895  , INVALID_TYPE >;
2896  //**********************************************************************************************
2897 };
2899 //*************************************************************************************************
2900 
2901 
2902 //*************************************************************************************************
2904 template< typename MT >
2905 struct SMatForEachExprTrait< SMatForEachExpr<MT,Conj,false>, Conj >
2906 {
2907  public:
2908  //**********************************************************************************************
2911  , INVALID_TYPE >;
2912  //**********************************************************************************************
2913 };
2915 //*************************************************************************************************
2916 
2917 
2918 //*************************************************************************************************
2920 template< typename MT >
2921 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Conj,true>, Conj >
2922 {
2923  public:
2924  //**********************************************************************************************
2927  , INVALID_TYPE >;
2928  //**********************************************************************************************
2929 };
2931 //*************************************************************************************************
2932 
2933 
2934 //*************************************************************************************************
2936 template< typename MT >
2937 struct SMatForEachExprTrait< SMatTransExpr< SMatForEachExpr<MT,Conj,true>, false >, Conj >
2938 {
2939  public:
2940  //**********************************************************************************************
2943  , INVALID_TYPE >;
2944  //**********************************************************************************************
2945 };
2947 //*************************************************************************************************
2948 
2949 
2950 //*************************************************************************************************
2952 template< typename MT >
2953 struct TSMatForEachExprTrait< SMatTransExpr< SMatForEachExpr<MT,Conj,false>, true >, Conj >
2954 {
2955  public:
2956  //**********************************************************************************************
2959  , INVALID_TYPE >;
2960  //**********************************************************************************************
2961 };
2963 //*************************************************************************************************
2964 
2965 
2966 //*************************************************************************************************
2968 template< typename MT >
2969 struct SMatForEachExprTrait< SMatForEachExpr<MT,Real,false>, Real >
2970 {
2971  public:
2972  //**********************************************************************************************
2975  , INVALID_TYPE >;
2976  //**********************************************************************************************
2977 };
2979 //*************************************************************************************************
2980 
2981 
2982 //*************************************************************************************************
2984 template< typename MT >
2985 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Real,true>, Real >
2986 {
2987  public:
2988  //**********************************************************************************************
2991  , INVALID_TYPE >;
2992  //**********************************************************************************************
2993 };
2995 //*************************************************************************************************
2996 
2997 
2998 //*************************************************************************************************
3000 template< typename MT, typename OP, bool SO, bool AF >
3001 struct SubmatrixExprTrait< SMatForEachExpr<MT,OP,SO>, AF >
3002 {
3003  public:
3004  //**********************************************************************************************
3006  //**********************************************************************************************
3007 };
3009 //*************************************************************************************************
3010 
3011 
3012 //*************************************************************************************************
3014 template< typename MT, typename OP, bool SO >
3015 struct RowExprTrait< SMatForEachExpr<MT,OP,SO> >
3016 {
3017  public:
3018  //**********************************************************************************************
3019  using Type = ForEachExprTrait_< RowExprTrait_<const MT>, OP >;
3020  //**********************************************************************************************
3021 };
3023 //*************************************************************************************************
3024 
3025 
3026 //*************************************************************************************************
3028 template< typename MT, typename OP, bool SO >
3029 struct ColumnExprTrait< SMatForEachExpr<MT,OP,SO> >
3030 {
3031  public:
3032  //**********************************************************************************************
3034  //**********************************************************************************************
3035 };
3037 //*************************************************************************************************
3038 
3039 } // namespace blaze
3040 
3041 #endif
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:239
Generic wrapper for the trunc() function.
Definition: Trunc.h:62
Pointer difference type of the Blaze library.
ReturnType_< MT > RN
Return type of the sparse matrix expression.
Definition: SMatForEachExpr.h:116
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatForEachExpr.h:496
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:1214
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:62
OP op_
The custom unary operation.
Definition: SMatForEachExpr.h:300
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:1610
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:1700
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:62
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatForEachExpr.h:182
SMatForEachExpr< MT, OP, SO > This
Type of this SMatForEachExpr instance.
Definition: SMatForEachExpr.h:155
DifferenceType difference_type
Difference between two iterators.
Definition: SMatForEachExpr.h:198
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:1672
Generic wrapper for the sin() function.
Definition: Sin.h:62
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatForEachExpr.h:361
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.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatForEachExpr.h:292
#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:1992
const CTransExprTrait_< MT > ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatForEachExpr.h:1251
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the ColumnExprTrait class template.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatForEachExpr.h:259
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:1815
Generic wrapper for the clamp() function.
Definition: Clamp.h:60
ReferenceType reference
Reference return type.
Definition: SMatForEachExpr.h:197
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:1961
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:1307
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:1755
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatForEachExpr.h:402
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:1759
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
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Header file for the RequiresEvaluation type trait.
Header file for the MatForEachExpr base class.
ForEachTrait_< MT, OP > ResultType
Result type for expression template evaluations.
Definition: SMatForEachExpr.h:156
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:281
const DMatForEachExpr< MT, Exp10, SO > exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1579
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:1802
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
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
const DMatForEachExpr< MT, Exp, SO > exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1523
Constraint on the data type.
const DMatForEachExpr< MT, Trunc, SO > trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1158
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatForEachExpr.h:425
Constraint on the data type.
SMatForEachExpr(const MT &sm, OP op) noexcept
Constructor for the SMatForEachExpr class.
Definition: SMatForEachExpr.h:316
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
ValueType * PointerType
Pointer return type.
Definition: SMatForEachExpr.h:189
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
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:1905
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
Header file for the ValueIndexPair class.
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatForEachExpr.h:462
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatForEachExpr.h:451
Header file for the IsStrictlyUpper type trait.
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
IteratorCategory iterator_category
The iterator category.
Definition: SMatForEachExpr.h:194
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
Generic wrapper for the exp10() function.
Definition: Exp10.h:62
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
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
ValueType value_type
Type of the underlying pointers.
Definition: SMatForEachExpr.h:195
Evaluation of the expression type of a sparse matrix for-each operation.Via this type trait it is pos...
Definition: TSMatForEachExprTrait.h:75
#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 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
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
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:1431
Element ValueType
Type of the underlying pointers.
Definition: SMatForEachExpr.h:188
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
Header file for the IsLower type trait.
Generic wrapper for the exp2() function.
Definition: Exp2.h:62
Generic wrapper for the asin() function.
Definition: Asin.h:62
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatForEachExpr.h:191
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
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:2051
#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:1933
Generic wrapper for the erf() function.
Definition: Erf.h:62
Operation op_
The custom unary operation.
Definition: SMatForEachExpr.h:514
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatForEachExpr.h:413
const DMatForEachExpr< MT, Round, SO > round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1186
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
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:1493
Header file for the exception macros of the math module.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatForEachExpr.h:484
Expression object for the sparse matrix forEach() function.The SMatForEachExpr class represents the c...
Definition: Forward.h:104
IfTrue_< useAssign, const ResultType, const SMatForEachExpr &> CompositeType
Data type for composite expression templates.
Definition: SMatForEachExpr.h:165
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatForEachExpr.h:168
OppositeType_< MT > OT
Opposite type of the sparse matrix expression.
Definition: SMatForEachExpr.h:115
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
PointerType pointer
Pointer return type.
Definition: SMatForEachExpr.h:196
Constraint on the data type.
Evaluation of the underlying numeric element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingNumeric.h:81
Header file for the RowExprTrait class template.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatForEachExpr.h:157
Header file for all forward declarations for expression class templates.
Generic wrapper for the floor() function.
Definition: Floor.h:62
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:1874
const DMatForEachExpr< MT, Exp2, SO > exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1551
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:1338
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:1279
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatForEachExpr.h:185
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:2023
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
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:1846
OP Operation
Data type of the custom unary operation.
Definition: SMatForEachExpr.h:171
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:270
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2934
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatForEachExpr.h:392
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
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:1369
Generic wrapper for the pow() function.
Definition: Forward.h:80
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:1400
Operation operation() const
Returns a copy of the custom operation.
Definition: SMatForEachExpr.h:472
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
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:1731
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
#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
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SMatForEachExpr.h:159
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2938
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatForEachExpr.h:329
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
const DMatForEachExpr< MT, Clamp< DT >, SO > clamp(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatForEachExpr.h:1463
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatForEachExpr.h:187
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatForEachExpr.h:438
Generic wrapper for the cos() function.
Definition: Cos.h:62
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Operand sm_
Sparse matrix of the absolute value expression.
Definition: SMatForEachExpr.h:513
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatForEachExpr.h:158
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatForEachExpr.h:299
Header file for the RemoveReference type trait.
ValueType & ReferenceType
Reference return type.
Definition: SMatForEachExpr.h:190
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
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
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:2079
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
const DMatForEachExpr< MT, Log2, SO > log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1641
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatForEachExpr.h:372
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Header file for the IsComputation type trait class.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatForEachExpr.h:344
Header file for the IsBuiltin type trait.
Generic wrapper for the acos() function.
Definition: Acos.h:62
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: SMatForEachExpr.h:207
Header file for the for-each trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatForEachExpr.h:382
Generic wrapper for the atan() function.
Definition: Atan.h:62
Generic wrapper for the round() function.
Definition: Round.h:62
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:1787
Expression object for sparse matrix transpositions.The SMatTransExpr class represents the compile tim...
Definition: Forward.h:114
Generic wrapper for the sinh() function.
Definition: Sinh.h:62
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
Generic wrapper for the log2() function.
Definition: Log2.h:62
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatForEachExpr.h:249
Iterator over the elements of the sparse matrix for-each expression.
Definition: SMatForEachExpr.h:177
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
typename ForEachExprTrait< T, OP >::Type ForEachExprTrait_
Auxiliary alias declaration for the ForEachExprTrait class template.The ForEachExprTrait_ alias decla...
Definition: ForEachExprTrait.h:144
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatForEachExpr.h:218
ResultType_< MT > RT
Result type of the sparse matrix expression.
Definition: SMatForEachExpr.h:114
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
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatForEachExpr.h:506
typename T::Operand Operand_
Alias declaration for nested Operand type definitions.The Operand_ alias declaration provides a conve...
Definition: Aliases.h:223
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:229
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.
Evaluation of the expression type of a sparse matrix for-each operation.Via this type trait it is pos...
Definition: SMatForEachExprTrait.h:75
Header file for the function trace functionality.