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>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS SMATFOREACHEXPR
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
104 template< typename MT // Type of the sparse matrix
105  , typename OP // Type of the custom operation
106  , bool SO > // Storage order
107 class SMatForEachExpr : public SparseMatrix< SMatForEachExpr<MT,OP,SO>, SO >
108  , private MatForEachExpr
109  , private Computation
110 {
111  private:
112  //**Type definitions****************************************************************************
113  typedef ResultType_<MT> RT;
115  typedef ReturnType_<MT> RN;
116  //**********************************************************************************************
117 
118  //**Serial evaluation strategy******************************************************************
120 
126  enum : bool { useAssign = RequiresEvaluation<MT>::value };
127 
129  template< typename MT2 >
131  struct UseAssign {
132  enum : bool { value = useAssign };
133  };
135  //**********************************************************************************************
136 
137  //**Parallel evaluation strategy****************************************************************
139 
145  template< typename MT2 >
146  struct UseSMPAssign {
147  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
148  };
150  //**********************************************************************************************
151 
152  public:
153  //**Type definitions****************************************************************************
159 
161  typedef decltype( std::declval<OP>()( std::declval<RN>() ) ) ReturnType;
162 
164  typedef IfTrue_< useAssign, const ResultType, const SMatForEachExpr& > CompositeType;
165 
167  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
168 
170  typedef OP Operation;
171  //**********************************************************************************************
172 
173  //**ConstIterator class definition**************************************************************
177  {
178  public:
179  //**Type definitions*************************************************************************
182 
185 
186  typedef std::forward_iterator_tag IteratorCategory;
187  typedef Element ValueType;
188  typedef ValueType* PointerType;
189  typedef ValueType& ReferenceType;
191 
192  // STL iterator requirements
193  typedef IteratorCategory iterator_category;
194  typedef ValueType value_type;
195  typedef PointerType pointer;
196  typedef ReferenceType reference;
197  typedef DifferenceType difference_type;
198  //*******************************************************************************************
199 
200  //**Constructor******************************************************************************
206  inline ConstIterator( IteratorType it, OP op )
207  : it_( it ) // Iterator over the elements of the sparse matrix expression
208  , op_( op ) // The custom unary operation
209  {}
210  //*******************************************************************************************
211 
212  //**Prefix increment operator****************************************************************
217  inline ConstIterator& operator++() {
218  ++it_;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Element access operator******************************************************************
228  inline const Element operator*() const {
229  return Element( op_( it_->value() ), it_->index() );
230  }
231  //*******************************************************************************************
232 
233  //**Element access operator******************************************************************
238  inline const ConstIterator* operator->() const {
239  return this;
240  }
241  //*******************************************************************************************
242 
243  //**Value function***************************************************************************
248  inline ReturnType value() const {
249  return op_( it_->value() );
250  }
251  //*******************************************************************************************
252 
253  //**Index function***************************************************************************
258  inline size_t index() const {
259  return it_->index();
260  }
261  //*******************************************************************************************
262 
263  //**Equality operator************************************************************************
269  inline bool operator==( const ConstIterator& rhs ) const {
270  return it_ == rhs.it_;
271  }
272  //*******************************************************************************************
273 
274  //**Inequality operator**********************************************************************
280  inline bool operator!=( const ConstIterator& rhs ) const {
281  return it_ != rhs.it_;
282  }
283  //*******************************************************************************************
284 
285  //**Subtraction operator*********************************************************************
291  inline DifferenceType operator-( const ConstIterator& rhs ) const {
292  return it_ - rhs.it_;
293  }
294  //*******************************************************************************************
295 
296  private:
297  //**Member variables*************************************************************************
298  IteratorType it_;
299  OP op_;
300  //*******************************************************************************************
301  };
302  //**********************************************************************************************
303 
304  //**Compilation flags***************************************************************************
306  enum : bool { smpAssignable = MT::smpAssignable };
307  //**********************************************************************************************
308 
309  //**Constructor*********************************************************************************
315  explicit inline SMatForEachExpr( const MT& sm, OP op ) noexcept
316  : sm_( sm ) // Sparse matrix of the for-each expression
317  , op_( op ) // The custom unary operation
318  {}
319  //**********************************************************************************************
320 
321  //**Access operator*****************************************************************************
328  inline ReturnType operator()( size_t i, size_t j ) const {
329  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
330  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
331  return op_( sm_(i,j) );
332  }
333  //**********************************************************************************************
334 
335  //**At function*********************************************************************************
343  inline ReturnType at( size_t i, size_t j ) const {
344  if( i >= sm_.rows() ) {
345  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
346  }
347  if( j >= sm_.columns() ) {
348  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
349  }
350  return (*this)(i,j);
351  }
352  //**********************************************************************************************
353 
354  //**Begin function******************************************************************************
360  inline ConstIterator begin( size_t i ) const {
361  return ConstIterator( sm_.begin(i), op_ );
362  }
363  //**********************************************************************************************
364 
365  //**End function********************************************************************************
371  inline ConstIterator end( size_t i ) const {
372  return ConstIterator( sm_.end(i), op_ );
373  }
374  //**********************************************************************************************
375 
376  //**Rows function*******************************************************************************
381  inline size_t rows() const noexcept {
382  return sm_.rows();
383  }
384  //**********************************************************************************************
385 
386  //**Columns function****************************************************************************
391  inline size_t columns() const noexcept {
392  return sm_.columns();
393  }
394  //**********************************************************************************************
395 
396  //**NonZeros function***************************************************************************
401  inline size_t nonZeros() const {
402  return sm_.nonZeros();
403  }
404  //**********************************************************************************************
405 
406  //**NonZeros function***************************************************************************
412  inline size_t nonZeros( size_t i ) const {
413  return sm_.nonZeros(i);
414  }
415  //**********************************************************************************************
416 
417  //**Find function*******************************************************************************
424  inline ConstIterator find( size_t i, size_t j ) const {
426  return ConstIterator( sm_.find( i, j ), op_ );
427  }
428  //**********************************************************************************************
429 
430  //**LowerBound function*************************************************************************
437  inline ConstIterator lowerBound( size_t i, size_t j ) const {
439  return ConstIterator( sm_.lowerBound( i, j ), op_ );
440  }
441  //**********************************************************************************************
442 
443  //**UpperBound function*************************************************************************
450  inline ConstIterator upperBound( size_t i, size_t j ) const {
452  return ConstIterator( sm_.upperBound( i, j ), op_ );
453  }
454  //**********************************************************************************************
455 
456  //**Operand access******************************************************************************
461  inline Operand operand() const noexcept {
462  return sm_;
463  }
464  //**********************************************************************************************
465 
466  //**Operation access****************************************************************************
471  inline Operation operation() const {
472  return op_;
473  }
474  //**********************************************************************************************
475 
476  //**********************************************************************************************
482  template< typename T >
483  inline bool canAlias( const T* alias ) const noexcept {
484  return sm_.canAlias( alias );
485  }
486  //**********************************************************************************************
487 
488  //**********************************************************************************************
494  template< typename T >
495  inline bool isAliased( const T* alias ) const noexcept {
496  return sm_.isAliased( alias );
497  }
498  //**********************************************************************************************
499 
500  //**********************************************************************************************
505  inline bool canSMPAssign() const noexcept {
506  return sm_.canSMPAssign();
507  }
508  //**********************************************************************************************
509 
510  private:
511  //**Member variables****************************************************************************
514  //**********************************************************************************************
515 
516  //**Assignment to dense matrices****************************************************************
530  template< typename MT2 // Type of the target dense matrix
531  , bool SO2 > // Storage order of the target dense matrix
532  friend inline EnableIf_< UseAssign<MT2> >
533  assign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
534  {
536 
540 
541  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
542  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
543 
544  const RT tmp( serial( rhs.sm_ ) );
545  assign( ~lhs, forEach( tmp, rhs.op_ ) );
546  }
548  //**********************************************************************************************
549 
550  //**Assignment to row-major sparse matrices*****************************************************
565  template< typename MT2 > // Type of the target sparse matrix
566  friend inline EnableIf_< And< UseAssign<MT2>
568  assign( SparseMatrix<MT2,false>& lhs, const SMatForEachExpr& rhs )
569  {
571 
572  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
573  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
574 
575  typedef Iterator_<MT2> Iterator;
576 
577  assign( ~lhs, rhs.sm_ );
578 
579  const size_t m( rhs.rows() );
580 
581  for( size_t i=0UL; i<m; ++i ) {
582  const Iterator end( (~lhs).end(i) );
583  for( Iterator element=(~lhs).begin(i); element!=end; ++element ) {
584  element->value() = rhs.op_( element->value() );
585  }
586  }
587  }
589  //**********************************************************************************************
590 
591  //**Assignment to column-major sparse matrices**************************************************
606  template< typename MT2 > // Type of the target sparse matrix
607  friend inline EnableIf_< And< UseAssign<MT2>
608  , IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > >
609  assign( SparseMatrix<MT2,true>& lhs, const SMatForEachExpr& rhs )
610  {
612 
613  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
614  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
615 
616  typedef Iterator_<MT2> Iterator;
617 
618  assign( ~lhs, rhs.sm_ );
619 
620  const size_t n( rhs.columns() );
621 
622  for( size_t j=0UL; j<n; ++j ) {
623  const Iterator end( (~lhs).end(j) );
624  for( Iterator element=(~lhs).begin(j); element!=end; ++element ) {
625  element->value() = rhs.op_( element->value() );
626  }
627  }
628  }
630  //**********************************************************************************************
631 
632  //**Assignment to sparse matrices***************************************************************
646  template< typename MT2 // Type of the target sparse matrix
647  , bool SO2 > // Storage order of the target sparse matrix
648  friend inline EnableIf_< And< UseAssign<MT2>
649  , Not< IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > > >
650  assign( SparseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
651  {
653 
656  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
657 
658  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
659  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
660 
661  const RT tmp( serial( rhs.sm_ ) );
662  (~lhs).reserve( tmp.nonZeros() );
663  assign( ~lhs, forEach( tmp, rhs.op_ ) );
664  }
666  //**********************************************************************************************
667 
668  //**Addition assignment to dense matrices*******************************************************
682  template< typename MT2 // Type of the target dense matrix
683  , bool SO2 > // Storage order of the target dense matrix
684  friend inline EnableIf_< UseAssign<MT2> >
685  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
686  {
688 
691  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
692 
693  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
694  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
695 
696  const RT tmp( serial( rhs.sm_ ) );
697  addAssign( ~lhs, forEach( tmp, rhs.op_ ) );
698  }
700  //**********************************************************************************************
701 
702  //**Addition assignment to sparse matrices******************************************************
703  // No special implementation for the addition assignment to sparse matrices.
704  //**********************************************************************************************
705 
706  //**Subtraction assignment to dense matrices****************************************************
720  template< typename MT2 // Type of the target dense matrix
721  , bool SO2 > // Storage order of the target sparse matrix
722  friend inline EnableIf_< UseAssign<MT2> >
723  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
724  {
726 
729  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
730 
731  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
732  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
733 
734  const RT tmp( serial( rhs.sm_ ) );
735  subAssign( ~lhs, forEach( tmp, rhs.op_ ) );
736  }
738  //**********************************************************************************************
739 
740  //**Subtraction assignment to sparse matrices***************************************************
741  // No special implementation for the subtraction assignment to sparse matrices.
742  //**********************************************************************************************
743 
744  //**Multiplication assignment to dense matrices*************************************************
745  // No special implementation for the multiplication assignment to dense matrices.
746  //**********************************************************************************************
747 
748  //**Multiplication assignment to sparse matrices************************************************
749  // No special implementation for the multiplication assignment to sparse matrices.
750  //**********************************************************************************************
751 
752  //**SMP assignment to dense matrices************************************************************
766  template< typename MT2 // Type of the target dense matrix
767  , bool SO2 > // Storage order of the target dense matrix
768  friend inline EnableIf_< UseSMPAssign<MT2> >
769  smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
770  {
772 
775  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
776 
777  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
778  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
779 
780  const RT tmp( rhs.sm_ );
781  smpAssign( ~lhs, forEach( tmp, rhs.op_ ) );
782  }
784  //**********************************************************************************************
785 
786  //**SMP assignment to sparse matrices***********************************************************
787  // No special implementation for the SMP assignment to sparse matrices.
788  //**********************************************************************************************
789 
790  //**SMP addition assignment to dense matrices***************************************************
804  template< typename MT2 // Type of the target dense matrix
805  , bool SO2 > // Storage order of the target dense matrix
806  friend inline EnableIf_< UseSMPAssign<MT2> >
807  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
808  {
810 
813  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
814 
815  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
816  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
817 
818  const RT tmp( rhs.sm_ );
819  smpAddAssign( ~lhs, forEach( tmp, rhs.op_ ) );
820  }
822  //**********************************************************************************************
823 
824  //**SMP addition assignment to sparse matrices**************************************************
825  // No special implementation for the SMP addition assignment to sparse matrices.
826  //**********************************************************************************************
827 
828  //**SMP subtraction assignment to dense matrices************************************************
842  template< typename MT2 // Type of the target dense matrix
843  , bool SO2 > // Storage order of the target sparse matrix
844  friend inline EnableIf_< UseSMPAssign<MT2> >
845  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatForEachExpr& rhs )
846  {
848 
851  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<RT> );
852 
853  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
854  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
855 
856  const RT tmp( rhs.sm_ );
857  smpSubAssign( ~lhs, forEach( tmp, rhs.op_ ) );
858  }
860  //**********************************************************************************************
861 
862  //**SMP subtraction assignment to sparse matrices***********************************************
863  // No special implementation for the SMP subtraction assignment to sparse matrices.
864  //**********************************************************************************************
865 
866  //**SMP multiplication assignment to dense matrices*********************************************
867  // No special implementation for the SMP multiplication assignment to dense matrices.
868  //**********************************************************************************************
869 
870  //**SMP multiplication assignment to sparse matrices********************************************
871  // No special implementation for the SMP multiplication assignment to sparse matrices.
872  //**********************************************************************************************
873 
874  //**Compile time checks*************************************************************************
879  //**********************************************************************************************
880 };
881 //*************************************************************************************************
882 
883 
884 
885 
886 //=================================================================================================
887 //
888 // GLOBAL FUNCTIONS
889 //
890 //=================================================================================================
891 
892 //*************************************************************************************************
910 template< typename MT // Type of the sparse matrix
911  , bool SO // Storage order
912  , typename OP > // Type of the custom operation
913 inline const SMatForEachExpr<MT,OP,SO> forEach( const SparseMatrix<MT,SO>& sm, OP op )
914 {
916 
917  return SMatForEachExpr<MT,OP,SO>( ~sm, op );
918 }
919 //*************************************************************************************************
920 
921 
922 //*************************************************************************************************
939 template< typename MT // Type of the sparse matrix
940  , bool SO > // Storage order
942 {
944 
945  return SMatForEachExpr<MT,Abs,SO>( ~sm, Abs() );
946 }
947 //*************************************************************************************************
948 
949 
950 //*************************************************************************************************
967 template< typename MT // Type of the sparse matrix
968  , bool SO > // Storage order
970 {
972 
973  return SMatForEachExpr<MT,Floor,SO>( ~sm, Floor() );
974 }
975 //*************************************************************************************************
976 
977 
978 //*************************************************************************************************
995 template< typename MT // Type of the sparse matrix
996  , bool SO > // Storage order
998 {
1000 
1001  return SMatForEachExpr<MT,Ceil,SO>( ~sm, Ceil() );
1002 }
1003 //*************************************************************************************************
1004 
1005 
1006 //*************************************************************************************************
1023 template< typename MT // Type of the sparse matrix
1024  , bool SO > // Storage order
1026 {
1028 
1029  return SMatForEachExpr<MT,Conj,SO>( ~sm, Conj() );
1030 }
1031 //*************************************************************************************************
1032 
1033 
1034 //*************************************************************************************************
1060 template< typename MT // Type of the sparse matrix
1061  , bool SO > // Storage order
1063 {
1065 
1066  return trans( conj( ~sm ) );
1067 }
1068 //*************************************************************************************************
1069 
1070 
1071 //*************************************************************************************************
1088 template< typename MT // Type of the sparse matrix
1089  , bool SO > // Storage order
1091 {
1093 
1094  return SMatForEachExpr<MT,Real,SO>( ~sm, Real() );
1095 }
1096 //*************************************************************************************************
1097 
1098 
1099 //*************************************************************************************************
1116 template< typename MT // Type of the sparse matrix
1117  , bool SO > // Storage order
1119 {
1121 
1122  return SMatForEachExpr<MT,Imag,SO>( ~sm, Imag() );
1123 }
1124 //*************************************************************************************************
1125 
1126 
1127 //*************************************************************************************************
1147 template< typename MT // Type of the sparse matrix
1148  , bool SO > // Storage order
1150 {
1152 
1153  return SMatForEachExpr<MT,Sqrt,SO>( ~sm, Sqrt() );
1154 }
1155 //*************************************************************************************************
1156 
1157 
1158 //*************************************************************************************************
1178 template< typename MT // Type of the sparse matrix
1179  , bool SO > // Storage order
1181 {
1183 
1184  return SMatForEachExpr<MT,InvSqrt,SO>( ~sm, InvSqrt() );
1185 }
1186 //*************************************************************************************************
1187 
1188 
1189 //*************************************************************************************************
1209 template< typename MT // Type of the sparse matrix
1210  , bool SO > // Storage order
1212 {
1214 
1215  return SMatForEachExpr<MT,Cbrt,SO>( ~sm, Cbrt() );
1216 }
1217 //*************************************************************************************************
1218 
1219 
1220 //*************************************************************************************************
1240 template< typename MT // Type of the sparse matrix
1241  , bool SO > // Storage order
1243 {
1245 
1246  return SMatForEachExpr<MT,InvCbrt,SO>( ~sm, InvCbrt() );
1247 }
1248 //*************************************************************************************************
1249 
1250 
1251 //*************************************************************************************************
1270 template< typename MT // Type of the sparse matrix
1271  , bool SO // Storage order
1272  , typename DT > // Type of the delimiters
1273 inline const SMatForEachExpr<MT,Clip<DT>,SO>
1274  clip( const SparseMatrix<MT,SO>& sm, const DT& min, const DT& max )
1275 {
1277 
1278  return SMatForEachExpr<MT,Clip<DT>,SO>( ~sm, Clip<DT>( min, max ) );
1279 }
1280 //*************************************************************************************************
1281 
1282 
1283 //*************************************************************************************************
1301 template< typename MT // Type of the sparse matrix
1302  , bool SO // Storage order
1303  , typename ET > // Type of the exponent
1304 inline const SMatForEachExpr<MT,Pow<ET>,SO> pow( const SparseMatrix<MT,SO>& sm, ET exp )
1305 {
1307 
1309 
1310  return SMatForEachExpr<MT,Pow<ET>,SO>( ~sm, Pow<ET>( exp ) );
1311 }
1312 //*************************************************************************************************
1313 
1314 
1315 //*************************************************************************************************
1332 template< typename MT // Type of the sparse matrix
1333  , bool SO > // Storage order
1335 {
1337 
1338  return SMatForEachExpr<MT,Exp,SO>( ~sm, Exp() );
1339 }
1340 //*************************************************************************************************
1341 
1342 
1343 //*************************************************************************************************
1363 template< typename MT // Type of the sparse matrix
1364  , bool SO > // Storage order
1366 {
1368 
1369  return SMatForEachExpr<MT,Log,SO>( ~sm, Log() );
1370 }
1371 //*************************************************************************************************
1372 
1373 
1374 //*************************************************************************************************
1394 template< typename MT // Type of the sparse matrix
1395  , bool SO > // Storage order
1397 {
1399 
1400  return SMatForEachExpr<MT,Log10,SO>( ~sm, Log10() );
1401 }
1402 //*************************************************************************************************
1403 
1404 
1405 //*************************************************************************************************
1422 template< typename MT // Type of the sparse matrix
1423  , bool SO > // Storage order
1425 {
1427 
1428  return SMatForEachExpr<MT,Sin,SO>( ~sm, Sin() );
1429 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1453 template< typename MT // Type of the sparse matrix
1454  , bool SO > // Storage order
1456 {
1458 
1459  return SMatForEachExpr<MT,Asin,SO>( ~sm, Asin() );
1460 }
1461 //*************************************************************************************************
1462 
1463 
1464 //*************************************************************************************************
1481 template< typename MT // Type of the sparse matrix
1482  , bool SO > // Storage order
1484 {
1486 
1487  return SMatForEachExpr<MT,Sinh,SO>( ~sm, Sinh() );
1488 }
1489 //*************************************************************************************************
1490 
1491 
1492 //*************************************************************************************************
1509 template< typename MT // Type of the sparse matrix
1510  , bool SO > // Storage order
1512 {
1514 
1515  return SMatForEachExpr<MT,Asinh,SO>( ~sm, Asinh() );
1516 }
1517 //*************************************************************************************************
1518 
1519 
1520 //*************************************************************************************************
1537 template< typename MT // Type of the sparse matrix
1538  , bool SO > // Storage order
1540 {
1542 
1543  return SMatForEachExpr<MT,Cos,SO>( ~sm, Cos() );
1544 }
1545 //*************************************************************************************************
1546 
1547 
1548 //*************************************************************************************************
1568 template< typename MT // Type of the sparse matrix
1569  , bool SO > // Storage order
1571 {
1573 
1574  return SMatForEachExpr<MT,Acos,SO>( ~sm, Acos() );
1575 }
1576 //*************************************************************************************************
1577 
1578 
1579 //*************************************************************************************************
1596 template< typename MT // Type of the sparse matrix
1597  , bool SO > // Storage order
1599 {
1601 
1602  return SMatForEachExpr<MT,Cosh,SO>( ~sm, Cosh() );
1603 }
1604 //*************************************************************************************************
1605 
1606 
1607 //*************************************************************************************************
1627 template< typename MT // Type of the sparse matrix
1628  , bool SO > // Storage order
1630 {
1632 
1633  return SMatForEachExpr<MT,Acosh,SO>( ~sm, Acosh() );
1634 }
1635 //*************************************************************************************************
1636 
1637 
1638 //*************************************************************************************************
1655 template< typename MT // Type of the sparse matrix
1656  , bool SO > // Storage order
1658 {
1660 
1661  return SMatForEachExpr<MT,Tan,SO>( ~sm, Tan() );
1662 }
1663 //*************************************************************************************************
1664 
1665 
1666 //*************************************************************************************************
1683 template< typename MT // Type of the sparse matrix
1684  , bool SO > // Storage order
1686 {
1688 
1689  return SMatForEachExpr<MT,Atan,SO>( ~sm, Atan() );
1690 }
1691 //*************************************************************************************************
1692 
1693 
1694 //*************************************************************************************************
1714 template< typename MT // Type of the sparse matrix
1715  , bool SO > // Storage order
1717 {
1719 
1720  return SMatForEachExpr<MT,Tanh,SO>( ~sm, Tanh() );
1721 }
1722 //*************************************************************************************************
1723 
1724 
1725 //*************************************************************************************************
1745 template< typename MT // Type of the sparse matrix
1746  , bool SO > // Storage order
1748 {
1750 
1751  return SMatForEachExpr<MT,Atanh,SO>( ~sm, Atanh() );
1752 }
1753 //*************************************************************************************************
1754 
1755 
1756 //*************************************************************************************************
1773 template< typename MT // Type of the sparse matrix
1774  , bool SO > // Storage order
1776 {
1778 
1779  return SMatForEachExpr<MT,Erf,SO>( ~sm, Erf() );
1780 }
1781 //*************************************************************************************************
1782 
1783 
1784 //*************************************************************************************************
1802 template< typename MT // Type of the sparse matrix
1803  , bool SO > // Storage order
1805 {
1807 
1808  return SMatForEachExpr<MT,Erfc,SO>( ~sm, Erfc() );
1809 }
1810 //*************************************************************************************************
1811 
1812 
1813 
1814 
1815 //=================================================================================================
1816 //
1817 // GLOBAL RESTRUCTURING FUNCTIONS
1818 //
1819 //=================================================================================================
1820 
1821 //*************************************************************************************************
1832 template< typename MT // Type of the sparse matrix
1833  , bool SO > // Storage order
1834 inline const SMatForEachExpr<MT,Abs,SO>& abs( const SMatForEachExpr<MT,Abs,SO>& sm )
1835 {
1837 
1838  return sm;
1839 }
1841 //*************************************************************************************************
1842 
1843 
1844 //*************************************************************************************************
1855 template< typename MT // Type of the sparse matrix
1856  , bool SO > // Storage order
1857 inline const SMatForEachExpr<MT,Floor,SO>& floor( const SMatForEachExpr<MT,Floor,SO>& sm )
1858 {
1860 
1861  return sm;
1862 }
1864 //*************************************************************************************************
1865 
1866 
1867 //*************************************************************************************************
1878 template< typename MT // Type of the sparse matrix
1879  , bool SO > // Storage order
1880 inline const SMatForEachExpr<MT,Ceil,SO>& ceil( const SMatForEachExpr<MT,Ceil,SO>& sm )
1881 {
1883 
1884  return sm;
1885 }
1887 //*************************************************************************************************
1888 
1889 
1890 //*************************************************************************************************
1908 template< typename MT // Type of the sparse matrix
1909  , bool TF > // Transpose flag
1910 inline typename SMatForEachExpr<MT,Conj,TF>::Operand conj( const SMatForEachExpr<MT,Conj,TF>& sm )
1911 {
1913 
1914  return sm.operand();
1915 }
1917 //*************************************************************************************************
1918 
1919 
1920 //*************************************************************************************************
1938 template< typename MT // Type of the sparse matrix
1939  , bool SO > // Storage order
1940 inline const SMatTransExpr<MT,!SO> conj( const SMatTransExpr<SMatForEachExpr<MT,Conj,SO>,!SO>& sm )
1941 {
1943 
1944  return SMatTransExpr<MT,!SO>( sm.operand().operand() );
1945 }
1947 //*************************************************************************************************
1948 
1949 
1950 //*************************************************************************************************
1961 template< typename MT // Type of the sparse matrix
1962  , bool SO > // Storage order
1963 inline const SMatForEachExpr<MT,Real,SO>& real( const SMatForEachExpr<MT,Real,SO>& sm )
1964 {
1966 
1967  return sm;
1968 }
1970 //*************************************************************************************************
1971 
1972 
1973 //*************************************************************************************************
1984 template< typename MT // Type of the sparse matrix
1985  , bool SO > // Storage order
1986 inline const SMatForEachExpr<MT,Imag,SO>& imag( const SMatForEachExpr<MT,Imag,SO>& sm )
1987 {
1989 
1990  return sm;
1991 }
1993 //*************************************************************************************************
1994 
1995 
1996 
1997 
1998 //=================================================================================================
1999 //
2000 // ROWS SPECIALIZATIONS
2001 //
2002 //=================================================================================================
2003 
2004 //*************************************************************************************************
2006 template< typename MT, typename OP, bool SO >
2007 struct Rows< SMatForEachExpr<MT,OP,SO> > : public Rows<MT>
2008 {};
2010 //*************************************************************************************************
2011 
2012 
2013 
2014 
2015 //=================================================================================================
2016 //
2017 // COLUMNS SPECIALIZATIONS
2018 //
2019 //=================================================================================================
2020 
2021 //*************************************************************************************************
2023 template< typename MT, typename OP, bool SO >
2024 struct Columns< SMatForEachExpr<MT,OP,SO> > : public Columns<MT>
2025 {};
2027 //*************************************************************************************************
2028 
2029 
2030 
2031 
2032 //=================================================================================================
2033 //
2034 // ISSYMMETRIC SPECIALIZATIONS
2035 //
2036 //=================================================================================================
2037 
2038 //*************************************************************************************************
2040 template< typename MT, bool SO >
2041 struct IsSymmetric< SMatForEachExpr<MT,Abs,SO> >
2042  : public BoolConstant< IsSymmetric<MT>::value >
2043 {};
2044 
2045 template< typename MT, bool SO >
2046 struct IsSymmetric< SMatForEachExpr<MT,Floor,SO> >
2047  : public BoolConstant< IsSymmetric<MT>::value >
2048 {};
2049 
2050 template< typename MT, bool SO >
2051 struct IsSymmetric< SMatForEachExpr<MT,Ceil,SO> >
2052  : public BoolConstant< IsSymmetric<MT>::value >
2053 {};
2054 
2055 template< typename MT, bool SO >
2056 struct IsSymmetric< SMatForEachExpr<MT,Conj,SO> >
2057  : public BoolConstant< IsSymmetric<MT>::value >
2058 {};
2059 
2060 template< typename MT, bool SO >
2061 struct IsSymmetric< SMatForEachExpr<MT,Real,SO> >
2062  : public BoolConstant< IsSymmetric<MT>::value >
2063 {};
2064 
2065 template< typename MT, bool SO >
2066 struct IsSymmetric< SMatForEachExpr<MT,Imag,SO> >
2067  : public BoolConstant< IsSymmetric<MT>::value >
2068 {};
2069 
2070 template< typename MT, bool SO >
2071 struct IsSymmetric< SMatForEachExpr<MT,Sqrt,SO> >
2072  : public BoolConstant< IsSymmetric<MT>::value >
2073 {};
2074 
2075 template< typename MT, bool SO >
2076 struct IsSymmetric< SMatForEachExpr<MT,InvSqrt,SO> >
2077  : public BoolConstant< IsSymmetric<MT>::value >
2078 {};
2079 
2080 template< typename MT, bool SO >
2081 struct IsSymmetric< SMatForEachExpr<MT,Cbrt,SO> >
2082  : public BoolConstant< IsSymmetric<MT>::value >
2083 {};
2084 
2085 template< typename MT, bool SO >
2086 struct IsSymmetric< SMatForEachExpr<MT,InvCbrt,SO> >
2087  : public BoolConstant< IsSymmetric<MT>::value >
2088 {};
2089 
2090 template< typename MT, typename ET, bool SO >
2091 struct IsSymmetric< SMatForEachExpr<MT,Pow<ET>,SO> >
2092  : public BoolConstant< IsSymmetric<MT>::value >
2093 {};
2094 
2095 template< typename MT, bool SO >
2096 struct IsSymmetric< SMatForEachExpr<MT,Exp,SO> >
2097  : public BoolConstant< IsSymmetric<MT>::value >
2098 {};
2099 
2100 template< typename MT, bool SO >
2101 struct IsSymmetric< SMatForEachExpr<MT,Log,SO> >
2102  : public BoolConstant< IsSymmetric<MT>::value >
2103 {};
2104 
2105 template< typename MT, bool SO >
2106 struct IsSymmetric< SMatForEachExpr<MT,Log10,SO> >
2107  : public BoolConstant< IsSymmetric<MT>::value >
2108 {};
2109 
2110 template< typename MT, bool SO >
2111 struct IsSymmetric< SMatForEachExpr<MT,Sin,SO> >
2112  : public BoolConstant< IsSymmetric<MT>::value >
2113 {};
2114 
2115 template< typename MT, bool SO >
2116 struct IsSymmetric< SMatForEachExpr<MT,Asin,SO> >
2117  : public BoolConstant< IsSymmetric<MT>::value >
2118 {};
2119 
2120 template< typename MT, bool SO >
2121 struct IsSymmetric< SMatForEachExpr<MT,Sinh,SO> >
2122  : public BoolConstant< IsSymmetric<MT>::value >
2123 {};
2124 
2125 template< typename MT, bool SO >
2126 struct IsSymmetric< SMatForEachExpr<MT,Asinh,SO> >
2127  : public BoolConstant< IsSymmetric<MT>::value >
2128 {};
2129 
2130 template< typename MT, bool SO >
2131 struct IsSymmetric< SMatForEachExpr<MT,Cos,SO> >
2132  : public BoolConstant< IsSymmetric<MT>::value >
2133 {};
2134 
2135 template< typename MT, bool SO >
2136 struct IsSymmetric< SMatForEachExpr<MT,Acos,SO> >
2137  : public BoolConstant< IsSymmetric<MT>::value >
2138 {};
2139 
2140 template< typename MT, bool SO >
2141 struct IsSymmetric< SMatForEachExpr<MT,Cosh,SO> >
2142  : public BoolConstant< IsSymmetric<MT>::value >
2143 {};
2144 
2145 template< typename MT, bool SO >
2146 struct IsSymmetric< SMatForEachExpr<MT,Acosh,SO> >
2147  : public BoolConstant< IsSymmetric<MT>::value >
2148 {};
2149 
2150 template< typename MT, bool SO >
2151 struct IsSymmetric< SMatForEachExpr<MT,Tan,SO> >
2152  : public BoolConstant< IsSymmetric<MT>::value >
2153 {};
2154 
2155 template< typename MT, bool SO >
2156 struct IsSymmetric< SMatForEachExpr<MT,Atan,SO> >
2157  : public BoolConstant< IsSymmetric<MT>::value >
2158 {};
2159 
2160 template< typename MT, bool SO >
2161 struct IsSymmetric< SMatForEachExpr<MT,Tanh,SO> >
2162  : public BoolConstant< IsSymmetric<MT>::value >
2163 {};
2164 
2165 template< typename MT, bool SO >
2166 struct IsSymmetric< SMatForEachExpr<MT,Atanh,SO> >
2167  : public BoolConstant< IsSymmetric<MT>::value >
2168 {};
2169 
2170 template< typename MT, bool SO >
2171 struct IsSymmetric< SMatForEachExpr<MT,Erf,SO> >
2172  : public BoolConstant< IsSymmetric<MT>::value >
2173 {};
2174 
2175 template< typename MT, bool SO >
2176 struct IsSymmetric< SMatForEachExpr<MT,Erfc,SO> >
2177  : public BoolConstant< IsSymmetric<MT>::value >
2178 {};
2180 //*************************************************************************************************
2181 
2182 
2183 
2184 
2185 //=================================================================================================
2186 //
2187 // ISHERMITIAN SPECIALIZATIONS
2188 //
2189 //=================================================================================================
2190 
2191 //*************************************************************************************************
2193 template< typename MT, bool SO >
2194 struct IsHermitian< SMatForEachExpr<MT,Abs,SO> >
2195  : public BoolConstant< IsHermitian<MT>::value >
2196 {};
2197 
2198 template< typename MT, bool SO >
2199 struct IsHermitian< SMatForEachExpr<MT,Floor,SO> >
2200  : public BoolConstant< IsHermitian<MT>::value >
2201 {};
2202 
2203 template< typename MT, bool SO >
2204 struct IsHermitian< SMatForEachExpr<MT,Ceil,SO> >
2205  : public BoolConstant< IsHermitian<MT>::value >
2206 {};
2207 
2208 template< typename MT, bool SO >
2209 struct IsHermitian< SMatForEachExpr<MT,Conj,SO> >
2210  : public BoolConstant< IsHermitian<MT>::value >
2211 {};
2212 
2213 template< typename MT, bool SO >
2214 struct IsHermitian< SMatForEachExpr<MT,Real,SO> >
2215  : public BoolConstant< IsHermitian<MT>::value >
2216 {};
2217 
2218 template< typename MT, bool SO >
2219 struct IsHermitian< SMatForEachExpr<MT,Imag,SO> >
2220  : public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
2221 {};
2222 
2223 template< typename MT, bool SO >
2224 struct IsHermitian< SMatForEachExpr<MT,Sqrt,SO> >
2225  : public BoolConstant< IsHermitian<MT>::value >
2226 {};
2227 
2228 template< typename MT, bool SO >
2229 struct IsHermitian< SMatForEachExpr<MT,InvSqrt,SO> >
2230  : public BoolConstant< IsHermitian<MT>::value >
2231 {};
2232 
2233 template< typename MT, bool SO >
2234 struct IsHermitian< SMatForEachExpr<MT,Cbrt,SO> >
2235  : public BoolConstant< IsHermitian<MT>::value >
2236 {};
2237 
2238 template< typename MT, bool SO >
2239 struct IsHermitian< SMatForEachExpr<MT,InvCbrt,SO> >
2240  : public BoolConstant< IsHermitian<MT>::value >
2241 {};
2242 
2243 template< typename MT, typename ET, bool SO >
2244 struct IsHermitian< SMatForEachExpr<MT,Pow<ET>,SO> >
2245  : public BoolConstant< IsHermitian<MT>::value >
2246 {};
2247 
2248 template< typename MT, bool SO >
2249 struct IsHermitian< SMatForEachExpr<MT,Exp,SO> >
2250  : public BoolConstant< IsHermitian<MT>::value >
2251 {};
2252 
2253 template< typename MT, bool SO >
2254 struct IsHermitian< SMatForEachExpr<MT,Log,SO> >
2255  : public BoolConstant< IsHermitian<MT>::value >
2256 {};
2257 
2258 template< typename MT, bool SO >
2259 struct IsHermitian< SMatForEachExpr<MT,Log10,SO> >
2260  : public BoolConstant< IsHermitian<MT>::value >
2261 {};
2262 
2263 template< typename MT, bool SO >
2264 struct IsHermitian< SMatForEachExpr<MT,Sin,SO> >
2265  : public BoolConstant< IsHermitian<MT>::value >
2266 {};
2267 
2268 template< typename MT, bool SO >
2269 struct IsHermitian< SMatForEachExpr<MT,Asin,SO> >
2270  : public BoolConstant< IsHermitian<MT>::value >
2271 {};
2272 
2273 template< typename MT, bool SO >
2274 struct IsHermitian< SMatForEachExpr<MT,Sinh,SO> >
2275  : public BoolConstant< IsHermitian<MT>::value >
2276 {};
2277 
2278 template< typename MT, bool SO >
2279 struct IsHermitian< SMatForEachExpr<MT,Asinh,SO> >
2280  : public BoolConstant< IsHermitian<MT>::value >
2281 {};
2282 
2283 template< typename MT, bool SO >
2284 struct IsHermitian< SMatForEachExpr<MT,Cos,SO> >
2285  : public BoolConstant< IsHermitian<MT>::value >
2286 {};
2287 
2288 template< typename MT, bool SO >
2289 struct IsHermitian< SMatForEachExpr<MT,Acos,SO> >
2290  : public BoolConstant< IsHermitian<MT>::value >
2291 {};
2292 
2293 template< typename MT, bool SO >
2294 struct IsHermitian< SMatForEachExpr<MT,Cosh,SO> >
2295  : public BoolConstant< IsHermitian<MT>::value >
2296 {};
2297 
2298 template< typename MT, bool SO >
2299 struct IsHermitian< SMatForEachExpr<MT,Acosh,SO> >
2300  : public BoolConstant< IsHermitian<MT>::value >
2301 {};
2302 
2303 template< typename MT, bool SO >
2304 struct IsHermitian< SMatForEachExpr<MT,Tan,SO> >
2305  : public BoolConstant< IsHermitian<MT>::value >
2306 {};
2307 
2308 template< typename MT, bool SO >
2309 struct IsHermitian< SMatForEachExpr<MT,Atan,SO> >
2310  : public BoolConstant< IsHermitian<MT>::value >
2311 {};
2312 
2313 template< typename MT, bool SO >
2314 struct IsHermitian< SMatForEachExpr<MT,Tanh,SO> >
2315  : public BoolConstant< IsHermitian<MT>::value >
2316 {};
2317 
2318 template< typename MT, bool SO >
2319 struct IsHermitian< SMatForEachExpr<MT,Atanh,SO> >
2320  : public BoolConstant< IsHermitian<MT>::value >
2321 {};
2322 
2323 template< typename MT, bool SO >
2324 struct IsHermitian< SMatForEachExpr<MT,Erf,SO> >
2325  : public BoolConstant< IsHermitian<MT>::value >
2326 {};
2327 
2328 template< typename MT, bool SO >
2329 struct IsHermitian< SMatForEachExpr<MT,Erfc,SO> >
2330  : public BoolConstant< IsHermitian<MT>::value >
2331 {};
2333 //*************************************************************************************************
2334 
2335 
2336 
2337 
2338 //=================================================================================================
2339 //
2340 // ISLOWER SPECIALIZATIONS
2341 //
2342 //=================================================================================================
2343 
2344 //*************************************************************************************************
2346 template< typename MT, typename OP, bool SO >
2347 struct IsLower< SMatForEachExpr<MT,OP,SO> >
2348  : public BoolConstant< IsLower<MT>::value >
2349 {};
2351 //*************************************************************************************************
2352 
2353 
2354 
2355 
2356 //=================================================================================================
2357 //
2358 // ISUNILOWER SPECIALIZATIONS
2359 //
2360 //=================================================================================================
2361 
2362 //*************************************************************************************************
2364 template< typename MT, typename ET, bool SO >
2365 struct IsUniLower< SMatForEachExpr<MT,Pow<ET>,SO> >
2366  : public BoolConstant< IsUniLower<MT>::value >
2367 {};
2369 //*************************************************************************************************
2370 
2371 
2372 
2373 
2374 //=================================================================================================
2375 //
2376 // ISSTRICTLYLOWER SPECIALIZATIONS
2377 //
2378 //=================================================================================================
2379 
2380 //*************************************************************************************************
2382 template< typename MT, typename OP, bool SO >
2383 struct IsStrictlyLower< SMatForEachExpr<MT,OP,SO> >
2384  : public BoolConstant< IsStrictlyLower<MT>::value >
2385 {};
2387 //*************************************************************************************************
2388 
2389 
2390 
2391 
2392 //=================================================================================================
2393 //
2394 // ISUPPER SPECIALIZATIONS
2395 //
2396 //=================================================================================================
2397 
2398 //*************************************************************************************************
2400 template< typename MT, typename OP, bool SO >
2401 struct IsUpper< SMatForEachExpr<MT,OP,SO> >
2402  : public BoolConstant< IsUpper<MT>::value >
2403 {};
2405 //*************************************************************************************************
2406 
2407 
2408 
2409 
2410 //=================================================================================================
2411 //
2412 // ISUNIUPPER SPECIALIZATIONS
2413 //
2414 //=================================================================================================
2415 
2416 //*************************************************************************************************
2418 template< typename MT, typename ET, bool SO >
2419 struct IsUniUpper< SMatForEachExpr<MT,Pow<ET>,SO> >
2420  : public BoolConstant< IsUniUpper<MT>::value >
2421 {};
2423 //*************************************************************************************************
2424 
2425 
2426 
2427 
2428 //=================================================================================================
2429 //
2430 // ISSTRICTLYUPPER SPECIALIZATIONS
2431 //
2432 //=================================================================================================
2433 
2434 //*************************************************************************************************
2436 template< typename MT, typename OP, bool SO >
2437 struct IsStrictlyUpper< SMatForEachExpr<MT,OP,SO> >
2438  : public BoolConstant< IsStrictlyUpper<MT>::value >
2439 {};
2441 //*************************************************************************************************
2442 
2443 
2444 
2445 
2446 //=================================================================================================
2447 //
2448 // EXPRESSION TRAIT SPECIALIZATIONS
2449 //
2450 //=================================================================================================
2451 
2452 //*************************************************************************************************
2454 template< typename MT >
2455 struct SMatForEachExprTrait< SMatForEachExpr<MT,Abs,false>, Abs >
2456 {
2457  public:
2458  //**********************************************************************************************
2459  using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2460  , SMatForEachExpr<MT,Abs,false>
2461  , INVALID_TYPE >;
2462  //**********************************************************************************************
2463 };
2465 //*************************************************************************************************
2466 
2467 
2468 //*************************************************************************************************
2470 template< typename MT >
2471 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Abs,true>, Abs >
2472 {
2473  public:
2474  //**********************************************************************************************
2475  using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2476  , SMatForEachExpr<MT,Abs,true>
2477  , INVALID_TYPE >;
2478  //**********************************************************************************************
2479 };
2481 //*************************************************************************************************
2482 
2483 
2484 //*************************************************************************************************
2486 template< typename MT >
2487 struct SMatForEachExprTrait< SMatForEachExpr<MT,Conj,false>, Conj >
2488 {
2489  public:
2490  //**********************************************************************************************
2491  using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2492  , Operand_< SMatForEachExpr<MT,Conj,false> >
2493  , INVALID_TYPE >;
2494  //**********************************************************************************************
2495 };
2497 //*************************************************************************************************
2498 
2499 
2500 //*************************************************************************************************
2502 template< typename MT >
2503 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Conj,true>, Conj >
2504 {
2505  public:
2506  //**********************************************************************************************
2507  using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2508  , Operand_< SMatForEachExpr<MT,Conj,true> >
2509  , INVALID_TYPE >;
2510  //**********************************************************************************************
2511 };
2513 //*************************************************************************************************
2514 
2515 
2516 //*************************************************************************************************
2518 template< typename MT >
2519 struct SMatForEachExprTrait< SMatTransExpr< SMatForEachExpr<MT,Conj,true>, false >, Conj >
2520 {
2521  public:
2522  //**********************************************************************************************
2523  using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2524  , SMatTransExpr<MT,false>
2525  , INVALID_TYPE >;
2526  //**********************************************************************************************
2527 };
2529 //*************************************************************************************************
2530 
2531 
2532 //*************************************************************************************************
2534 template< typename MT >
2535 struct TSMatForEachExprTrait< SMatTransExpr< SMatForEachExpr<MT,Conj,false>, true >, Conj >
2536 {
2537  public:
2538  //**********************************************************************************************
2539  using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2540  , SMatTransExpr<MT,true>
2541  , INVALID_TYPE >;
2542  //**********************************************************************************************
2543 };
2545 //*************************************************************************************************
2546 
2547 
2548 //*************************************************************************************************
2550 template< typename MT >
2551 struct SMatForEachExprTrait< SMatForEachExpr<MT,Real,false>, Real >
2552 {
2553  public:
2554  //**********************************************************************************************
2555  using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
2556  , SMatForEachExpr<MT,Real,false>
2557  , INVALID_TYPE >;
2558  //**********************************************************************************************
2559 };
2561 //*************************************************************************************************
2562 
2563 
2564 //*************************************************************************************************
2566 template< typename MT >
2567 struct TSMatForEachExprTrait< SMatForEachExpr<MT,Real,true>, Real >
2568 {
2569  public:
2570  //**********************************************************************************************
2571  using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
2572  , SMatForEachExpr<MT,Real,true>
2573  , INVALID_TYPE >;
2574  //**********************************************************************************************
2575 };
2577 //*************************************************************************************************
2578 
2579 
2580 //*************************************************************************************************
2582 template< typename MT, typename OP, bool SO, bool AF >
2583 struct SubmatrixExprTrait< SMatForEachExpr<MT,OP,SO>, AF >
2584 {
2585  public:
2586  //**********************************************************************************************
2587  using Type = ForEachExprTrait_< SubmatrixExprTrait_<const MT,AF>, OP >;
2588  //**********************************************************************************************
2589 };
2591 //*************************************************************************************************
2592 
2593 
2594 //*************************************************************************************************
2596 template< typename MT, typename OP, bool SO >
2597 struct RowExprTrait< SMatForEachExpr<MT,OP,SO> >
2598 {
2599  public:
2600  //**********************************************************************************************
2601  using Type = ForEachExprTrait_< RowExprTrait_<const MT>, OP >;
2602  //**********************************************************************************************
2603 };
2605 //*************************************************************************************************
2606 
2607 
2608 //*************************************************************************************************
2610 template< typename MT, typename OP, bool SO >
2611 struct ColumnExprTrait< SMatForEachExpr<MT,OP,SO> >
2612 {
2613  public:
2614  //**********************************************************************************************
2615  using Type = ForEachExprTrait_< ColumnExprTrait_<const MT>, OP >;
2616  //**********************************************************************************************
2617 };
2619 //*************************************************************************************************
2620 
2621 } // namespace blaze
2622 
2623 #endif
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:437
Pointer difference type of the Blaze library.
ReturnType_< MT > RN
Return type of the sparse matrix expression.
Definition: SMatForEachExpr.h:115
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1158
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:62
OP op_
The custom unary operation.
Definition: SMatForEachExpr.h:299
const DMatForEachExpr< MT, Log, SO > log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1498
const DMatForEachExpr< MT, Sin, SO > sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1557
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:62
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatForEachExpr.h:181
SMatForEachExpr< MT, OP, SO > This
Type of this SMatForEachExpr instance.
Definition: SMatForEachExpr.h:154
DifferenceType difference_type
Difference between two iterators.
Definition: SMatForEachExpr.h:197
const DMatForEachExpr< MT, Log10, SO > log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1529
Generic wrapper for the sin() function.
Definition: Sin.h:62
Generic wrapper for the conj() function.
Definition: Conj.h:62
Generic wrapper for the invsqrt() function.
Definition: InvSqrt.h:62
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
const DMatForEachExpr< MT, Tanh, SO > tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1849
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatForEachExpr.h:360
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:269
const CTransExprTrait_< MT > ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatForEachExpr.h:1195
Header file for the ColumnExprTrait class template.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatForEachExpr.h:401
Header file for the IsSame and IsStrictlySame type traits.
Header file for the ForEachExprTrait class template.
const DMatForEachExpr< MT, Cos, SO > cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1672
ReferenceType reference
Reference return type.
Definition: SMatForEachExpr.h:196
const DMatForEachExpr< MT, Atan, SO > atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1818
Generic wrapper for the acosh() function.
Definition: Acosh.h:62
const DMatForEachExpr< MT, Imag, SO > imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatForEachExpr.h:1251
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:238
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
const DMatForEachExpr< MT, Sinh, SO > sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1616
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:138
Header file for the RequiresEvaluation type trait.
Header file for the MatForEachExpr base class.
ForEachTrait_< MT, OP > ResultType
Result type for expression template evaluations.
Definition: SMatForEachExpr.h:155
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
const DMatForEachExpr< MT, Exp, SO > exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1467
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
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.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatForEachExpr.h:505
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatForEachExpr.h:248
Constraint on the data type.
SMatForEachExpr(const MT &sm, OP op) noexcept
Constructor for the SMatForEachExpr class.
Definition: SMatForEachExpr.h:315
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:188
typename ForEachTrait< T, OP >::Type ForEachTrait_
Auxiliary alias declaration for the ForEachTrait class template.The ForEachTrait_ alias declaration p...
Definition: ForEachTrait.h:146
const DMatForEachExpr< MT, Acosh, SO > acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1762
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
Header file for the ValueIndexPair class.
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
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatForEachExpr.h:280
IteratorCategory iterator_category
The iterator category.
Definition: SMatForEachExpr.h:193
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatForEachExpr.h:381
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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatForEachExpr.h:291
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
ValueType value_type
Type of the underlying pointers.
Definition: SMatForEachExpr.h:194
#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.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatForEachExpr.h:258
Header file for all functors.
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatForEachExpr.h:450
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:1375
Element ValueType
Type of the underlying pointers.
Definition: SMatForEachExpr.h:187
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatForEachExpr.h:343
Header file for the IsLower type trait.
Generic wrapper for the asin() function.
Definition: Asin.h:62
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatForEachExpr.h:190
Operation operation() const
Returns a copy of the custom operation.
Definition: SMatForEachExpr.h:471
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:1908
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
const DMatForEachExpr< MT, Tan, SO > tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1790
Generic wrapper for the erf() function.
Definition: Erf.h:62
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatForEachExpr.h:328
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatForEachExpr.h:461
Operation op_
The custom unary operation.
Definition: SMatForEachExpr.h:513
Constraints on the storage order of matrix types.
const DMatForEachExpr< MT, Pow< ET >, SO > pow(const DenseMatrix< MT, SO > &dm, ET exp)
Computes the exponential value for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1437
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatForEachExpr.h:228
Header file for the exception macros of the math module.
Expression object for the sparse matrix forEach() function.The SMatForEachExpr class represents the c...
Definition: Forward.h:94
IfTrue_< useAssign, const ResultType, const SMatForEachExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatForEachExpr.h:164
If_< IsExpression< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatForEachExpr.h:167
OppositeType_< MT > OT
Opposite type of the sparse matrix expression.
Definition: SMatForEachExpr.h:114
PointerType pointer
Pointer return type.
Definition: SMatForEachExpr.h:195
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatForEachExpr.h:371
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:156
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:1731
const DMatForEachExpr< MT, Sqrt, SO > sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1282
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
const DMatForEachExpr< MT, Real, SO > real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatForEachExpr.h:1223
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatForEachExpr.h:184
const DMatForEachExpr< MT, Atanh, SO > atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm...
Definition: DMatForEachExpr.h:1880
Generic wrapper for the clip() function.
Definition: Clip.h:60
const DMatForEachExpr< MT, Acos, SO > acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1703
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatForEachExpr.h:495
OP Operation
Data type of the custom unary operation.
Definition: SMatForEachExpr.h:170
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatForEachExpr.h:391
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
Header file for run time assertion macros.
const DMatForEachExpr< MT, InvSqrt, SO > invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1313
Generic wrapper for the pow() function.
Definition: Forward.h:72
const DMatForEachExpr< MT, Cbrt, SO > cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1344
Generic wrapper for the atanh() function.
Definition: Atanh.h:62
Generic wrapper for the invcbrt() function.
Definition: InvCbrt.h:62
Generic wrapper for the real() function.
Definition: Real.h:59
Generic wrapper for the asinh() function.
Definition: Asinh.h:62
const DMatForEachExpr< MT, Asin, SO > asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1588
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
#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:158
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatForEachExpr.h:483
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatForEachExpr.h:186
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:512
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatForEachExpr.h:157
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatForEachExpr.h:298
Header file for the RemoveReference type trait.
ValueType & ReferenceType
Reference return type.
Definition: SMatForEachExpr.h:189
const DMatForEachExpr< MT, Clip< DT >, SO > clip(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatForEachExpr.h:1407
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:1936
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatForEachExpr.h:412
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
Generic wrapper for the acos() function.
Definition: Acos.h:62
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: SMatForEachExpr.h:206
Header file for the for-each trait.
Generic wrapper for the atan() function.
Definition: Atan.h:62
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
const DMatForEachExpr< MT, Asinh, SO > asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1644
Generic wrapper for the sinh() function.
Definition: Sinh.h:62
Header file for the IntegralConstant class template.
Iterator over the elements of the sparse matrix for-each expression.
Definition: SMatForEachExpr.h:176
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
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatForEachExpr.h:217
ResultType_< MT > RT
Result type of the sparse matrix expression.
Definition: SMatForEachExpr.h:113
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
#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
#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
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:71
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatForEachExpr.h:424
const DMatForEachExpr< MT, Ceil, SO > ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1130
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.