SMatMapExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATMAPEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATMAPEXPR_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>
72 #include <blaze/util/Assert.h>
73 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/mpl/And.h>
77 #include <blaze/util/mpl/If.h>
78 #include <blaze/util/mpl/Not.h>
79 #include <blaze/util/Types.h>
83 
84 
85 namespace blaze {
86 
87 //=================================================================================================
88 //
89 // CLASS SMATMAPEXPR
90 //
91 //=================================================================================================
92 
93 //*************************************************************************************************
100 template< typename MT // Type of the sparse matrix
101  , typename OP // Type of the custom operation
102  , bool SO > // Storage order
103 class SMatMapExpr
104  : public MatMapExpr< SparseMatrix< SMatMapExpr<MT,OP,SO>, SO > >
105  , private Computation
106 {
107  private:
108  //**Type definitions****************************************************************************
109  using RT = ResultType_<MT>;
111  using RN = ReturnType_<MT>;
112  //**********************************************************************************************
113 
114  //**Serial evaluation strategy******************************************************************
116 
122  enum : bool { useAssign = RequiresEvaluation<MT>::value };
123 
125  template< typename MT2 >
127  struct UseAssign {
128  enum : bool { value = useAssign };
129  };
131  //**********************************************************************************************
132 
133  //**Parallel evaluation strategy****************************************************************
135 
141  template< typename MT2 >
142  struct UseSMPAssign {
143  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
144  };
146  //**********************************************************************************************
147 
148  public:
149  //**Type definitions****************************************************************************
155 
157  using ReturnType = decltype( std::declval<OP>()( std::declval<RN>() ) );
158 
161 
163  using Operand = If_< IsExpression<MT>, const MT, const MT& >;
164 
166  using Operation = OP;
167  //**********************************************************************************************
168 
169  //**ConstIterator class definition**************************************************************
173  {
174  public:
175  //**Type definitions*************************************************************************
178 
181 
182  using IteratorCategory = std::forward_iterator_tag;
183  using ValueType = Element;
187 
188  // STL iterator requirements
194  //*******************************************************************************************
195 
196  //**Constructor******************************************************************************
202  inline ConstIterator( IteratorType it, OP op )
203  : it_( it ) // Iterator over the elements of the sparse matrix expression
204  , op_( op ) // The custom unary operation
205  {}
206  //*******************************************************************************************
207 
208  //**Prefix increment operator****************************************************************
214  ++it_;
215  return *this;
216  }
217  //*******************************************************************************************
218 
219  //**Element access operator******************************************************************
224  inline const Element operator*() const {
225  return Element( op_( it_->value() ), it_->index() );
226  }
227  //*******************************************************************************************
228 
229  //**Element access operator******************************************************************
234  inline const ConstIterator* operator->() const {
235  return this;
236  }
237  //*******************************************************************************************
238 
239  //**Value function***************************************************************************
244  inline ReturnType value() const {
245  return op_( it_->value() );
246  }
247  //*******************************************************************************************
248 
249  //**Index function***************************************************************************
254  inline size_t index() const {
255  return it_->index();
256  }
257  //*******************************************************************************************
258 
259  //**Equality operator************************************************************************
265  inline bool operator==( const ConstIterator& rhs ) const {
266  return it_ == rhs.it_;
267  }
268  //*******************************************************************************************
269 
270  //**Inequality operator**********************************************************************
276  inline bool operator!=( const ConstIterator& rhs ) const {
277  return it_ != rhs.it_;
278  }
279  //*******************************************************************************************
280 
281  //**Subtraction operator*********************************************************************
287  inline DifferenceType operator-( const ConstIterator& rhs ) const {
288  return it_ - rhs.it_;
289  }
290  //*******************************************************************************************
291 
292  private:
293  //**Member variables*************************************************************************
295  OP op_;
296  //*******************************************************************************************
297  };
298  //**********************************************************************************************
299 
300  //**Compilation flags***************************************************************************
302  enum : bool { smpAssignable = MT::smpAssignable };
303  //**********************************************************************************************
304 
305  //**Constructor*********************************************************************************
311  explicit inline SMatMapExpr( const MT& sm, OP op ) noexcept
312  : sm_( sm ) // Sparse matrix of the map expression
313  , op_( op ) // The custom unary operation
314  {}
315  //**********************************************************************************************
316 
317  //**Access operator*****************************************************************************
324  inline ReturnType operator()( size_t i, size_t j ) const {
325  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
326  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
327  return op_( sm_(i,j) );
328  }
329  //**********************************************************************************************
330 
331  //**At function*********************************************************************************
339  inline ReturnType at( size_t i, size_t j ) const {
340  if( i >= sm_.rows() ) {
341  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
342  }
343  if( j >= sm_.columns() ) {
344  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
345  }
346  return (*this)(i,j);
347  }
348  //**********************************************************************************************
349 
350  //**Begin function******************************************************************************
356  inline ConstIterator begin( size_t i ) const {
357  return ConstIterator( sm_.begin(i), op_ );
358  }
359  //**********************************************************************************************
360 
361  //**End function********************************************************************************
367  inline ConstIterator end( size_t i ) const {
368  return ConstIterator( sm_.end(i), op_ );
369  }
370  //**********************************************************************************************
371 
372  //**Rows function*******************************************************************************
377  inline size_t rows() const noexcept {
378  return sm_.rows();
379  }
380  //**********************************************************************************************
381 
382  //**Columns function****************************************************************************
387  inline size_t columns() const noexcept {
388  return sm_.columns();
389  }
390  //**********************************************************************************************
391 
392  //**NonZeros function***************************************************************************
397  inline size_t nonZeros() const {
398  return sm_.nonZeros();
399  }
400  //**********************************************************************************************
401 
402  //**NonZeros function***************************************************************************
408  inline size_t nonZeros( size_t i ) const {
409  return sm_.nonZeros(i);
410  }
411  //**********************************************************************************************
412 
413  //**Find function*******************************************************************************
420  inline ConstIterator find( size_t i, size_t j ) const {
422  return ConstIterator( sm_.find( i, j ), op_ );
423  }
424  //**********************************************************************************************
425 
426  //**LowerBound function*************************************************************************
433  inline ConstIterator lowerBound( size_t i, size_t j ) const {
435  return ConstIterator( sm_.lowerBound( i, j ), op_ );
436  }
437  //**********************************************************************************************
438 
439  //**UpperBound function*************************************************************************
446  inline ConstIterator upperBound( size_t i, size_t j ) const {
448  return ConstIterator( sm_.upperBound( i, j ), op_ );
449  }
450  //**********************************************************************************************
451 
452  //**Operand access******************************************************************************
457  inline Operand operand() const noexcept {
458  return sm_;
459  }
460  //**********************************************************************************************
461 
462  //**Operation access****************************************************************************
467  inline Operation operation() const {
468  return op_;
469  }
470  //**********************************************************************************************
471 
472  //**********************************************************************************************
478  template< typename T >
479  inline bool canAlias( const T* alias ) const noexcept {
480  return sm_.canAlias( alias );
481  }
482  //**********************************************************************************************
483 
484  //**********************************************************************************************
490  template< typename T >
491  inline bool isAliased( const T* alias ) const noexcept {
492  return sm_.isAliased( alias );
493  }
494  //**********************************************************************************************
495 
496  //**********************************************************************************************
501  inline bool canSMPAssign() const noexcept {
502  return sm_.canSMPAssign();
503  }
504  //**********************************************************************************************
505 
506  private:
507  //**Member variables****************************************************************************
510  //**********************************************************************************************
511 
512  //**Assignment to dense matrices****************************************************************
526  template< typename MT2 // Type of the target dense matrix
527  , bool SO2 > // Storage order of the target dense matrix
528  friend inline EnableIf_< UseAssign<MT2> >
529  assign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
530  {
532 
536 
537  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
538  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
539 
540  const RT tmp( serial( rhs.sm_ ) );
541  assign( ~lhs, map( tmp, rhs.op_ ) );
542  }
544  //**********************************************************************************************
545 
546  //**Assignment to row-major sparse matrices*****************************************************
561  template< typename MT2 > // Type of the target sparse matrix
562  friend inline EnableIf_< And< UseAssign<MT2>
564  assign( SparseMatrix<MT2,false>& lhs, const SMatMapExpr& rhs )
565  {
567 
568  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
569  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
570 
571  using Iterator = Iterator_<MT2>;
572 
573  assign( ~lhs, rhs.sm_ );
574 
575  const size_t m( rhs.rows() );
576 
577  for( size_t i=0UL; i<m; ++i ) {
578  const Iterator end( (~lhs).end(i) );
579  for( Iterator element=(~lhs).begin(i); element!=end; ++element ) {
580  element->value() = rhs.op_( element->value() );
581  }
582  }
583  }
585  //**********************************************************************************************
586 
587  //**Assignment to column-major sparse matrices**************************************************
602  template< typename MT2 > // Type of the target sparse matrix
603  friend inline EnableIf_< And< UseAssign<MT2>
604  , IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > >
605  assign( SparseMatrix<MT2,true>& lhs, const SMatMapExpr& rhs )
606  {
608 
609  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
610  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
611 
612  using Iterator = Iterator_<MT2>;
613 
614  assign( ~lhs, rhs.sm_ );
615 
616  const size_t n( rhs.columns() );
617 
618  for( size_t j=0UL; j<n; ++j ) {
619  const Iterator end( (~lhs).end(j) );
620  for( Iterator element=(~lhs).begin(j); element!=end; ++element ) {
621  element->value() = rhs.op_( element->value() );
622  }
623  }
624  }
626  //**********************************************************************************************
627 
628  //**Assignment to sparse matrices***************************************************************
643  template< typename MT2 // Type of the target sparse matrix
644  , bool SO2 > // Storage order of the target sparse matrix
645  friend inline EnableIf_< And< UseAssign<MT2>
647  assign( SparseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
648  {
650 
654 
655  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
656  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
657 
658  const RT tmp( serial( rhs.sm_ ) );
659  (~lhs).reserve( tmp.nonZeros() );
660  assign( ~lhs, map( tmp, rhs.op_ ) );
661  }
663  //**********************************************************************************************
664 
665  //**Addition assignment to dense matrices*******************************************************
679  template< typename MT2 // Type of the target dense matrix
680  , bool SO2 > // Storage order of the target dense matrix
681  friend inline EnableIf_< UseAssign<MT2> >
682  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
683  {
685 
689 
690  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
691  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
692 
693  const RT tmp( serial( rhs.sm_ ) );
694  addAssign( ~lhs, map( tmp, rhs.op_ ) );
695  }
697  //**********************************************************************************************
698 
699  //**Addition assignment to sparse matrices******************************************************
700  // No special implementation for the addition assignment to sparse matrices.
701  //**********************************************************************************************
702 
703  //**Subtraction assignment to dense matrices****************************************************
717  template< typename MT2 // Type of the target dense matrix
718  , bool SO2 > // Storage order of the target sparse matrix
719  friend inline EnableIf_< UseAssign<MT2> >
720  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
721  {
723 
727 
728  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
729  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
730 
731  const RT tmp( serial( rhs.sm_ ) );
732  subAssign( ~lhs, map( tmp, rhs.op_ ) );
733  }
735  //**********************************************************************************************
736 
737  //**Subtraction assignment to sparse matrices***************************************************
738  // No special implementation for the subtraction assignment to sparse matrices.
739  //**********************************************************************************************
740 
741  //**Schur product assignment to dense matrices**************************************************
755  template< typename MT2 // Type of the target dense matrix
756  , bool SO2 > // Storage order of the target dense matrix
757  friend inline EnableIf_< UseAssign<MT2> >
758  schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
759  {
761 
765 
766  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
767  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
768 
769  const RT tmp( serial( rhs.sm_ ) );
770  schurAssign( ~lhs, map( tmp, rhs.op_ ) );
771  }
773  //**********************************************************************************************
774 
775  //**Schur product assignment to sparse matrices*************************************************
776  // No special implementation for the Schur product assignment to sparse matrices.
777  //**********************************************************************************************
778 
779  //**Multiplication assignment to dense matrices*************************************************
780  // No special implementation for the multiplication assignment to dense matrices.
781  //**********************************************************************************************
782 
783  //**Multiplication assignment to sparse matrices************************************************
784  // No special implementation for the multiplication assignment to sparse matrices.
785  //**********************************************************************************************
786 
787  //**SMP assignment to dense matrices************************************************************
801  template< typename MT2 // Type of the target dense matrix
802  , bool SO2 > // Storage order of the target dense matrix
803  friend inline EnableIf_< UseSMPAssign<MT2> >
804  smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
805  {
807 
811 
812  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
813  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
814 
815  const RT tmp( rhs.sm_ );
816  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
817  }
819  //**********************************************************************************************
820 
821  //**SMP assignment to sparse matrices***********************************************************
822  // No special implementation for the SMP assignment to sparse matrices.
823  //**********************************************************************************************
824 
825  //**SMP addition assignment to dense matrices***************************************************
839  template< typename MT2 // Type of the target dense matrix
840  , bool SO2 > // Storage order of the target dense matrix
841  friend inline EnableIf_< UseSMPAssign<MT2> >
842  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
843  {
845 
849 
850  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
851  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
852 
853  const RT tmp( rhs.sm_ );
854  smpAddAssign( ~lhs, map( tmp, rhs.op_ ) );
855  }
857  //**********************************************************************************************
858 
859  //**SMP addition assignment to sparse matrices**************************************************
860  // No special implementation for the SMP addition assignment to sparse matrices.
861  //**********************************************************************************************
862 
863  //**SMP subtraction assignment to dense matrices************************************************
877  template< typename MT2 // Type of the target dense matrix
878  , bool SO2 > // Storage order of the target sparse matrix
879  friend inline EnableIf_< UseSMPAssign<MT2> >
880  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
881  {
883 
887 
888  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
889  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
890 
891  const RT tmp( rhs.sm_ );
892  smpSubAssign( ~lhs, map( tmp, rhs.op_ ) );
893  }
895  //**********************************************************************************************
896 
897  //**SMP subtraction assignment to sparse matrices***********************************************
898  // No special implementation for the SMP subtraction assignment to sparse matrices.
899  //**********************************************************************************************
900 
901  //**SMP Schur product assignment to dense matrices**********************************************
915  template< typename MT2 // Type of the target dense matrix
916  , bool SO2 > // Storage order of the target dense matrix
917  friend inline EnableIf_< UseSMPAssign<MT2> >
919  {
921 
925 
926  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
927  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
928 
929  const RT tmp( rhs.sm_ );
930  smpSchurAssign( ~lhs, map( tmp, rhs.op_ ) );
931  }
933  //**********************************************************************************************
934 
935  //**SMP Schur product assignment to sparse matrices*********************************************
936  // No special implementation for the SMP Schur product assignment to sparse matrices.
937  //**********************************************************************************************
938 
939  //**SMP multiplication assignment to dense matrices*********************************************
940  // No special implementation for the SMP multiplication assignment to dense matrices.
941  //**********************************************************************************************
942 
943  //**SMP multiplication assignment to sparse matrices********************************************
944  // No special implementation for the SMP multiplication assignment to sparse matrices.
945  //**********************************************************************************************
946 
947  //**Compile time checks*************************************************************************
952  //**********************************************************************************************
953 };
954 //*************************************************************************************************
955 
956 
957 
958 
959 //=================================================================================================
960 //
961 // GLOBAL FUNCTIONS
962 //
963 //=================================================================================================
964 
965 //*************************************************************************************************
983 template< typename MT // Type of the sparse matrix
984  , bool SO // Storage order
985  , typename OP > // Type of the custom operation
986 inline decltype(auto) map( const SparseMatrix<MT,SO>& sm, OP op )
987 {
989 
990  using ReturnType = const SMatMapExpr<MT,OP,SO>;
991  return ReturnType( ~sm, op );
992 }
993 //*************************************************************************************************
994 
995 
996 //*************************************************************************************************
1014 template< typename MT // Type of the sparse matrix
1015  , bool SO // Storage order
1016  , typename OP > // Type of the custom operation
1017 inline decltype(auto) forEach( const SparseMatrix<MT,SO>& sm, OP op )
1018 {
1020 
1021  using ReturnType = const SMatMapExpr<MT,OP,SO>;
1022  return ReturnType( ~sm, op );
1023 }
1024 //*************************************************************************************************
1025 
1026 
1027 //*************************************************************************************************
1044 template< typename MT // Type of the sparse matrix
1045  , bool SO > // Storage order
1046 inline decltype(auto) abs( const SparseMatrix<MT,SO>& sm )
1047 {
1049 
1050  using ReturnType = const SMatMapExpr<MT,Abs,SO>;
1051  return ReturnType( ~sm, Abs() );
1052 }
1053 //*************************************************************************************************
1054 
1055 
1056 //*************************************************************************************************
1073 template< typename MT // Type of the sparse matrix
1074  , bool SO > // Storage order
1075 inline decltype(auto) floor( const SparseMatrix<MT,SO>& sm )
1076 {
1078 
1079  using ReturnType = const SMatMapExpr<MT,Floor,SO>;
1080  return ReturnType( ~sm, Floor() );
1081 }
1082 //*************************************************************************************************
1083 
1084 
1085 //*************************************************************************************************
1102 template< typename MT // Type of the sparse matrix
1103  , bool SO > // Storage order
1104 inline decltype(auto) ceil( const SparseMatrix<MT,SO>& sm )
1105 {
1107 
1108  using ReturnType = const SMatMapExpr<MT,Ceil,SO>;
1109  return ReturnType( ~sm, Ceil() );
1110 }
1111 //*************************************************************************************************
1112 
1113 
1114 //*************************************************************************************************
1131 template< typename MT // Type of the sparse matrix
1132  , bool SO > // Storage order
1133 inline decltype(auto) trunc( const SparseMatrix<MT,SO>& sm )
1134 {
1136 
1137  using ReturnType = const SMatMapExpr<MT,Trunc,SO>;
1138  return ReturnType( ~sm, Trunc() );
1139 }
1140 //*************************************************************************************************
1141 
1142 
1143 //*************************************************************************************************
1160 template< typename MT // Type of the sparse matrix
1161  , bool SO > // Storage order
1162 inline decltype(auto) round( const SparseMatrix<MT,SO>& sm )
1163 {
1165 
1166  using ReturnType = const SMatMapExpr<MT,Round,SO>;
1167  return ReturnType( ~sm, Round() );
1168 }
1169 //*************************************************************************************************
1170 
1171 
1172 //*************************************************************************************************
1189 template< typename MT // Type of the sparse matrix
1190  , bool SO > // Storage order
1191 inline decltype(auto) conj( const SparseMatrix<MT,SO>& sm )
1192 {
1194 
1195  using ReturnType = const SMatMapExpr<MT,Conj,SO>;
1196  return ReturnType( ~sm, Conj() );
1197 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
1227 template< typename MT // Type of the sparse matrix
1228  , bool SO > // Storage order
1229 inline decltype(auto) ctrans( const SparseMatrix<MT,SO>& sm )
1230 {
1232 
1233  return trans( conj( ~sm ) );
1234 }
1235 //*************************************************************************************************
1236 
1237 
1238 //*************************************************************************************************
1255 template< typename MT // Type of the sparse matrix
1256  , bool SO > // Storage order
1257 inline decltype(auto) real( const SparseMatrix<MT,SO>& sm )
1258 {
1260 
1261  using ReturnType = const SMatMapExpr<MT,Real,SO>;
1262  return ReturnType( ~sm, Real() );
1263 }
1264 //*************************************************************************************************
1265 
1266 
1267 //*************************************************************************************************
1284 template< typename MT // Type of the sparse matrix
1285  , bool SO > // Storage order
1286 inline decltype(auto) imag( const SparseMatrix<MT,SO>& sm )
1287 {
1289 
1290  using ReturnType = const SMatMapExpr<MT,Imag,SO>;
1291  return ReturnType( ~sm, Imag() );
1292 }
1293 //*************************************************************************************************
1294 
1295 
1296 //*************************************************************************************************
1316 template< typename MT // Type of the sparse matrix
1317  , bool SO > // Storage order
1318 inline decltype(auto) sqrt( const SparseMatrix<MT,SO>& sm )
1319 {
1321 
1322  using ReturnType = const SMatMapExpr<MT,Sqrt,SO>;
1323  return ReturnType( ~sm, Sqrt() );
1324 }
1325 //*************************************************************************************************
1326 
1327 
1328 //*************************************************************************************************
1348 template< typename MT // Type of the sparse matrix
1349  , bool SO > // Storage order
1350 inline decltype(auto) invsqrt( const SparseMatrix<MT,SO>& sm )
1351 {
1353 
1354  using ReturnType = const SMatMapExpr<MT,InvSqrt,SO>;
1355  return ReturnType( ~sm, InvSqrt() );
1356 }
1357 //*************************************************************************************************
1358 
1359 
1360 //*************************************************************************************************
1380 template< typename MT // Type of the sparse matrix
1381  , bool SO > // Storage order
1382 inline decltype(auto) cbrt( const SparseMatrix<MT,SO>& sm )
1383 {
1385 
1386  using ReturnType = const SMatMapExpr<MT,Cbrt,SO>;
1387  return ReturnType( ~sm, Cbrt() );
1388 }
1389 //*************************************************************************************************
1390 
1391 
1392 //*************************************************************************************************
1412 template< typename MT // Type of the sparse matrix
1413  , bool SO > // Storage order
1414 inline decltype(auto) invcbrt( const SparseMatrix<MT,SO>& sm )
1415 {
1417 
1418  using ReturnType = const SMatMapExpr<MT,InvCbrt,SO>;
1419  return ReturnType( ~sm, InvCbrt() );
1420 }
1421 //*************************************************************************************************
1422 
1423 
1424 //*************************************************************************************************
1443 template< typename MT // Type of the sparse matrix
1444  , bool SO // Storage order
1445  , typename DT > // Type of the delimiters
1446 inline decltype(auto) clamp( const SparseMatrix<MT,SO>& sm, const DT& min, const DT& max )
1447 {
1449 
1450  using ReturnType = const SMatMapExpr<MT,Clamp<DT>,SO>;
1451  return ReturnType( ~sm, Clamp<DT>( min, max ) );
1452 }
1453 //*************************************************************************************************
1454 
1455 
1456 //*************************************************************************************************
1474 template< typename MT // Type of the sparse matrix
1475  , bool SO // Storage order
1476  , typename ET > // Type of the exponent
1477 inline decltype(auto) pow( const SparseMatrix<MT,SO>& sm, ET exp )
1478 {
1480 
1482 
1483  using ReturnType = const SMatMapExpr<MT,Pow<ET>,SO>;
1484  return ReturnType( ~sm, Pow<ET>( exp ) );
1485 }
1486 //*************************************************************************************************
1487 
1488 
1489 //*************************************************************************************************
1506 template< typename MT // Type of the sparse matrix
1507  , bool SO > // Storage order
1508 inline decltype(auto) exp( const SparseMatrix<MT,SO>& sm )
1509 {
1511 
1512  using ReturnType = const SMatMapExpr<MT,Exp,SO>;
1513  return ReturnType( ~sm, Exp() );
1514 }
1515 //*************************************************************************************************
1516 
1517 
1518 //*************************************************************************************************
1535 template< typename MT // Type of the sparse matrix
1536  , bool SO > // Storage order
1537 inline decltype(auto) exp2( const SparseMatrix<MT,SO>& sm )
1538 {
1540 
1541  using ReturnType = const SMatMapExpr<MT,Exp2,SO>;
1542  return ReturnType( ~sm, Exp2() );
1543 }
1544 //*************************************************************************************************
1545 
1546 
1547 //*************************************************************************************************
1564 template< typename MT // Type of the sparse matrix
1565  , bool SO > // Storage order
1566 inline decltype(auto) exp10( const SparseMatrix<MT,SO>& sm )
1567 {
1569 
1570  using ReturnType = const SMatMapExpr<MT,Exp10,SO>;
1571  return ReturnType( ~sm, Exp10() );
1572 }
1573 //*************************************************************************************************
1574 
1575 
1576 //*************************************************************************************************
1596 template< typename MT // Type of the sparse matrix
1597  , bool SO > // Storage order
1598 inline decltype(auto) log( const SparseMatrix<MT,SO>& sm )
1599 {
1601 
1602  using ReturnType = const SMatMapExpr<MT,Log,SO>;
1603  return ReturnType( ~sm, Log() );
1604 }
1605 //*************************************************************************************************
1606 
1607 
1608 //*************************************************************************************************
1628 template< typename MT // Type of the sparse matrix
1629  , bool SO > // Storage order
1630 inline decltype(auto) log10( const SparseMatrix<MT,SO>& sm )
1631 {
1633 
1634  using ReturnType = const SMatMapExpr<MT,Log10,SO>;
1635  return ReturnType( ~sm, Log10() );
1636 }
1637 //*************************************************************************************************
1638 
1639 
1640 //*************************************************************************************************
1660 template< typename MT // Type of the sparse matrix
1661  , bool SO > // Storage order
1662 inline decltype(auto) log2( const SparseMatrix<MT,SO>& sm )
1663 {
1665 
1666  using ReturnType = const SMatMapExpr<MT,Log2,SO>;
1667  return ReturnType( ~sm, Log2() );
1668 }
1669 //*************************************************************************************************
1670 
1671 
1672 //*************************************************************************************************
1689 template< typename MT // Type of the sparse matrix
1690  , bool SO > // Storage order
1691 inline decltype(auto) sin( const SparseMatrix<MT,SO>& sm )
1692 {
1694 
1695  using ReturnType = const SMatMapExpr<MT,Sin,SO>;
1696  return ReturnType( ~sm, Sin() );
1697 }
1698 //*************************************************************************************************
1699 
1700 
1701 //*************************************************************************************************
1721 template< typename MT // Type of the sparse matrix
1722  , bool SO > // Storage order
1723 inline decltype(auto) asin( const SparseMatrix<MT,SO>& sm )
1724 {
1726 
1727  using ReturnType = const SMatMapExpr<MT,Asin,SO>;
1728  return ReturnType( ~sm, Asin() );
1729 }
1730 //*************************************************************************************************
1731 
1732 
1733 //*************************************************************************************************
1750 template< typename MT // Type of the sparse matrix
1751  , bool SO > // Storage order
1752 inline decltype(auto) sinh( const SparseMatrix<MT,SO>& sm )
1753 {
1755 
1756  using ReturnType = const SMatMapExpr<MT,Sinh,SO>;
1757  return ReturnType( ~sm, Sinh() );
1758 }
1759 //*************************************************************************************************
1760 
1761 
1762 //*************************************************************************************************
1779 template< typename MT // Type of the sparse matrix
1780  , bool SO > // Storage order
1781 inline decltype(auto) asinh( const SparseMatrix<MT,SO>& sm )
1782 {
1784 
1785  using ReturnType = const SMatMapExpr<MT,Asinh,SO>;
1786  return ReturnType( ~sm, Asinh() );
1787 }
1788 //*************************************************************************************************
1789 
1790 
1791 //*************************************************************************************************
1808 template< typename MT // Type of the sparse matrix
1809  , bool SO > // Storage order
1810 inline decltype(auto) cos( const SparseMatrix<MT,SO>& sm )
1811 {
1813 
1814  using ReturnType = const SMatMapExpr<MT,Cos,SO>;
1815  return ReturnType( ~sm, Cos() );
1816 }
1817 //*************************************************************************************************
1818 
1819 
1820 //*************************************************************************************************
1840 template< typename MT // Type of the sparse matrix
1841  , bool SO > // Storage order
1842 inline decltype(auto) acos( const SparseMatrix<MT,SO>& sm )
1843 {
1845 
1846  using ReturnType = const SMatMapExpr<MT,Acos,SO>;
1847  return ReturnType( ~sm, Acos() );
1848 }
1849 //*************************************************************************************************
1850 
1851 
1852 //*************************************************************************************************
1869 template< typename MT // Type of the sparse matrix
1870  , bool SO > // Storage order
1871 inline decltype(auto) cosh( const SparseMatrix<MT,SO>& sm )
1872 {
1874 
1875  using ReturnType = const SMatMapExpr<MT,Cosh,SO>;
1876  return ReturnType( ~sm, Cosh() );
1877 }
1878 //*************************************************************************************************
1879 
1880 
1881 //*************************************************************************************************
1901 template< typename MT // Type of the sparse matrix
1902  , bool SO > // Storage order
1903 inline decltype(auto) acosh( const SparseMatrix<MT,SO>& sm )
1904 {
1906 
1907  using ReturnType = const SMatMapExpr<MT,Acosh,SO>;
1908  return ReturnType( ~sm, Acosh() );
1909 }
1910 //*************************************************************************************************
1911 
1912 
1913 //*************************************************************************************************
1930 template< typename MT // Type of the sparse matrix
1931  , bool SO > // Storage order
1932 inline decltype(auto) tan( const SparseMatrix<MT,SO>& sm )
1933 {
1935 
1936  using ReturnType = const SMatMapExpr<MT,Tan,SO>;
1937  return ReturnType( ~sm, Tan() );
1938 }
1939 //*************************************************************************************************
1940 
1941 
1942 //*************************************************************************************************
1959 template< typename MT // Type of the sparse matrix
1960  , bool SO > // Storage order
1961 inline decltype(auto) atan( const SparseMatrix<MT,SO>& sm )
1962 {
1964 
1965  using ReturnType = const SMatMapExpr<MT,Atan,SO>;
1966  return ReturnType( ~sm, Atan() );
1967 }
1968 //*************************************************************************************************
1969 
1970 
1971 //*************************************************************************************************
1991 template< typename MT // Type of the sparse matrix
1992  , bool SO > // Storage order
1993 inline decltype(auto) tanh( const SparseMatrix<MT,SO>& sm )
1994 {
1996 
1997  using ReturnType = const SMatMapExpr<MT,Tanh,SO>;
1998  return ReturnType( ~sm, Tanh() );
1999 }
2000 //*************************************************************************************************
2001 
2002 
2003 //*************************************************************************************************
2023 template< typename MT // Type of the sparse matrix
2024  , bool SO > // Storage order
2025 inline decltype(auto) atanh( const SparseMatrix<MT,SO>& sm )
2026 {
2028 
2029  using ReturnType = const SMatMapExpr<MT,Atanh,SO>;
2030  return ReturnType( ~sm, Atanh() );
2031 }
2032 //*************************************************************************************************
2033 
2034 
2035 //*************************************************************************************************
2052 template< typename MT // Type of the sparse matrix
2053  , bool SO > // Storage order
2054 inline decltype(auto) erf( const SparseMatrix<MT,SO>& sm )
2055 {
2057 
2058  using ReturnType = const SMatMapExpr<MT,Erf,SO>;
2059  return ReturnType( ~sm, Erf() );
2060 }
2061 //*************************************************************************************************
2062 
2063 
2064 //*************************************************************************************************
2082 template< typename MT // Type of the sparse matrix
2083  , bool SO > // Storage order
2084 inline decltype(auto) erfc( const SparseMatrix<MT,SO>& sm )
2085 {
2087 
2088  using ReturnType = const SMatMapExpr<MT,Erfc,SO>;
2089  return ReturnType( ~sm, Erfc() );
2090 }
2091 //*************************************************************************************************
2092 
2093 
2094 
2095 
2096 //=================================================================================================
2097 //
2098 // GLOBAL RESTRUCTURING FUNCTIONS
2099 //
2100 //=================================================================================================
2101 
2102 //*************************************************************************************************
2113 template< typename MT // Type of the sparse matrix
2114  , bool SO > // Storage order
2115 inline decltype(auto) abs( const SMatMapExpr<MT,Abs,SO>& sm )
2116 {
2118 
2119  return sm;
2120 }
2122 //*************************************************************************************************
2123 
2124 
2125 //*************************************************************************************************
2136 template< typename MT // Type of the sparse matrix
2137  , bool SO > // Storage order
2138 inline decltype(auto) floor( const SMatMapExpr<MT,Floor,SO>& sm )
2139 {
2141 
2142  return sm;
2143 }
2145 //*************************************************************************************************
2146 
2147 
2148 //*************************************************************************************************
2159 template< typename MT // Type of the sparse matrix
2160  , bool SO > // Storage order
2161 inline decltype(auto) ceil( const SMatMapExpr<MT,Ceil,SO>& sm )
2162 {
2164 
2165  return sm;
2166 }
2168 //*************************************************************************************************
2169 
2170 
2171 //*************************************************************************************************
2182 template< typename MT // Type of the sparse matrix
2183  , bool SO > // Storage order
2184 inline decltype(auto) trunc( const SMatMapExpr<MT,Trunc,SO>& sm )
2185 {
2187 
2188  return sm;
2189 }
2191 //*************************************************************************************************
2192 
2193 
2194 //*************************************************************************************************
2205 template< typename MT // Type of the sparse matrix
2206  , bool SO > // Storage order
2207 inline decltype(auto) round( const SMatMapExpr<MT,Round,SO>& sm )
2208 {
2210 
2211  return sm;
2212 }
2214 //*************************************************************************************************
2215 
2216 
2217 //*************************************************************************************************
2235 template< typename MT // Type of the sparse matrix
2236  , bool TF > // Transpose flag
2237 inline decltype(auto) conj( const SMatMapExpr<MT,Conj,TF>& sm )
2238 {
2240 
2241  return sm.operand();
2242 }
2244 //*************************************************************************************************
2245 
2246 
2247 //*************************************************************************************************
2265 template< typename MT // Type of the sparse matrix
2266  , bool SO > // Storage order
2267 inline decltype(auto) conj( const SMatTransExpr<SMatMapExpr<MT,Conj,SO>,!SO>& sm )
2268 {
2270 
2271  using ReturnType = const SMatTransExpr<MT,!SO>;
2272  return ReturnType( sm.operand().operand() );
2273 }
2275 //*************************************************************************************************
2276 
2277 
2278 //*************************************************************************************************
2289 template< typename MT // Type of the sparse matrix
2290  , bool SO > // Storage order
2291 inline decltype(auto) real( const SMatMapExpr<MT,Real,SO>& sm )
2292 {
2294 
2295  return sm;
2296 }
2298 //*************************************************************************************************
2299 
2300 
2301 //*************************************************************************************************
2312 template< typename MT // Type of the sparse matrix
2313  , bool SO > // Storage order
2314 inline decltype(auto) imag( const SMatMapExpr<MT,Imag,SO>& sm )
2315 {
2317 
2318  return sm;
2319 }
2321 //*************************************************************************************************
2322 
2323 
2324 
2325 
2326 //=================================================================================================
2327 //
2328 // ROWS SPECIALIZATIONS
2329 //
2330 //=================================================================================================
2331 
2332 //*************************************************************************************************
2334 template< typename MT, typename OP, bool SO >
2335 struct Rows< SMatMapExpr<MT,OP,SO> >
2336  : public Rows<MT>
2337 {};
2339 //*************************************************************************************************
2340 
2341 
2342 
2343 
2344 //=================================================================================================
2345 //
2346 // COLUMNS SPECIALIZATIONS
2347 //
2348 //=================================================================================================
2349 
2350 //*************************************************************************************************
2352 template< typename MT, typename OP, bool SO >
2353 struct Columns< SMatMapExpr<MT,OP,SO> >
2354  : public Columns<MT>
2355 {};
2357 //*************************************************************************************************
2358 
2359 
2360 
2361 
2362 //=================================================================================================
2363 //
2364 // ISSYMMETRIC SPECIALIZATIONS
2365 //
2366 //=================================================================================================
2367 
2368 //*************************************************************************************************
2370 template< typename MT, bool SO >
2371 struct IsSymmetric< SMatMapExpr<MT,Abs,SO> >
2372  : public BoolConstant< IsSymmetric<MT>::value >
2373 {};
2374 
2375 template< typename MT, bool SO >
2376 struct IsSymmetric< SMatMapExpr<MT,Floor,SO> >
2377  : public BoolConstant< IsSymmetric<MT>::value >
2378 {};
2379 
2380 template< typename MT, bool SO >
2381 struct IsSymmetric< SMatMapExpr<MT,Ceil,SO> >
2382  : public BoolConstant< IsSymmetric<MT>::value >
2383 {};
2384 
2385 template< typename MT, bool SO >
2386 struct IsSymmetric< SMatMapExpr<MT,Trunc,SO> >
2387  : public BoolConstant< IsSymmetric<MT>::value >
2388 {};
2389 
2390 template< typename MT, bool SO >
2391 struct IsSymmetric< SMatMapExpr<MT,Round,SO> >
2392  : public BoolConstant< IsSymmetric<MT>::value >
2393 {};
2394 
2395 template< typename MT, bool SO >
2396 struct IsSymmetric< SMatMapExpr<MT,Conj,SO> >
2397  : public BoolConstant< IsSymmetric<MT>::value >
2398 {};
2399 
2400 template< typename MT, bool SO >
2401 struct IsSymmetric< SMatMapExpr<MT,Real,SO> >
2402  : public BoolConstant< IsSymmetric<MT>::value >
2403 {};
2404 
2405 template< typename MT, bool SO >
2406 struct IsSymmetric< SMatMapExpr<MT,Imag,SO> >
2407  : public BoolConstant< IsSymmetric<MT>::value >
2408 {};
2409 
2410 template< typename MT, bool SO >
2411 struct IsSymmetric< SMatMapExpr<MT,Sqrt,SO> >
2412  : public BoolConstant< IsSymmetric<MT>::value >
2413 {};
2414 
2415 template< typename MT, bool SO >
2416 struct IsSymmetric< SMatMapExpr<MT,InvSqrt,SO> >
2417  : public BoolConstant< IsSymmetric<MT>::value >
2418 {};
2419 
2420 template< typename MT, bool SO >
2421 struct IsSymmetric< SMatMapExpr<MT,Cbrt,SO> >
2422  : public BoolConstant< IsSymmetric<MT>::value >
2423 {};
2424 
2425 template< typename MT, bool SO >
2426 struct IsSymmetric< SMatMapExpr<MT,InvCbrt,SO> >
2427  : public BoolConstant< IsSymmetric<MT>::value >
2428 {};
2429 
2430 template< typename MT, typename ET, bool SO >
2431 struct IsSymmetric< SMatMapExpr<MT,Pow<ET>,SO> >
2432  : public BoolConstant< IsSymmetric<MT>::value >
2433 {};
2434 
2435 template< typename MT, bool SO >
2436 struct IsSymmetric< SMatMapExpr<MT,Exp,SO> >
2437  : public BoolConstant< IsSymmetric<MT>::value >
2438 {};
2439 
2440 template< typename MT, bool SO >
2441 struct IsSymmetric< SMatMapExpr<MT,Exp2,SO> >
2442  : public BoolConstant< IsSymmetric<MT>::value >
2443 {};
2444 
2445 template< typename MT, bool SO >
2446 struct IsSymmetric< SMatMapExpr<MT,Exp10,SO> >
2447  : public BoolConstant< IsSymmetric<MT>::value >
2448 {};
2449 
2450 template< typename MT, bool SO >
2451 struct IsSymmetric< SMatMapExpr<MT,Log,SO> >
2452  : public BoolConstant< IsSymmetric<MT>::value >
2453 {};
2454 
2455 template< typename MT, bool SO >
2456 struct IsSymmetric< SMatMapExpr<MT,Log2,SO> >
2457  : public BoolConstant< IsSymmetric<MT>::value >
2458 {};
2459 
2460 template< typename MT, bool SO >
2461 struct IsSymmetric< SMatMapExpr<MT,Log10,SO> >
2462  : public BoolConstant< IsSymmetric<MT>::value >
2463 {};
2464 
2465 template< typename MT, bool SO >
2466 struct IsSymmetric< SMatMapExpr<MT,Sin,SO> >
2467  : public BoolConstant< IsSymmetric<MT>::value >
2468 {};
2469 
2470 template< typename MT, bool SO >
2471 struct IsSymmetric< SMatMapExpr<MT,Asin,SO> >
2472  : public BoolConstant< IsSymmetric<MT>::value >
2473 {};
2474 
2475 template< typename MT, bool SO >
2476 struct IsSymmetric< SMatMapExpr<MT,Sinh,SO> >
2477  : public BoolConstant< IsSymmetric<MT>::value >
2478 {};
2479 
2480 template< typename MT, bool SO >
2481 struct IsSymmetric< SMatMapExpr<MT,Asinh,SO> >
2482  : public BoolConstant< IsSymmetric<MT>::value >
2483 {};
2484 
2485 template< typename MT, bool SO >
2486 struct IsSymmetric< SMatMapExpr<MT,Cos,SO> >
2487  : public BoolConstant< IsSymmetric<MT>::value >
2488 {};
2489 
2490 template< typename MT, bool SO >
2491 struct IsSymmetric< SMatMapExpr<MT,Acos,SO> >
2492  : public BoolConstant< IsSymmetric<MT>::value >
2493 {};
2494 
2495 template< typename MT, bool SO >
2496 struct IsSymmetric< SMatMapExpr<MT,Cosh,SO> >
2497  : public BoolConstant< IsSymmetric<MT>::value >
2498 {};
2499 
2500 template< typename MT, bool SO >
2501 struct IsSymmetric< SMatMapExpr<MT,Acosh,SO> >
2502  : public BoolConstant< IsSymmetric<MT>::value >
2503 {};
2504 
2505 template< typename MT, bool SO >
2506 struct IsSymmetric< SMatMapExpr<MT,Tan,SO> >
2507  : public BoolConstant< IsSymmetric<MT>::value >
2508 {};
2509 
2510 template< typename MT, bool SO >
2511 struct IsSymmetric< SMatMapExpr<MT,Atan,SO> >
2512  : public BoolConstant< IsSymmetric<MT>::value >
2513 {};
2514 
2515 template< typename MT, bool SO >
2516 struct IsSymmetric< SMatMapExpr<MT,Tanh,SO> >
2517  : public BoolConstant< IsSymmetric<MT>::value >
2518 {};
2519 
2520 template< typename MT, bool SO >
2521 struct IsSymmetric< SMatMapExpr<MT,Atanh,SO> >
2522  : public BoolConstant< IsSymmetric<MT>::value >
2523 {};
2524 
2525 template< typename MT, bool SO >
2526 struct IsSymmetric< SMatMapExpr<MT,Erf,SO> >
2527  : public BoolConstant< IsSymmetric<MT>::value >
2528 {};
2529 
2530 template< typename MT, bool SO >
2531 struct IsSymmetric< SMatMapExpr<MT,Erfc,SO> >
2532  : public BoolConstant< IsSymmetric<MT>::value >
2533 {};
2535 //*************************************************************************************************
2536 
2537 
2538 
2539 
2540 //=================================================================================================
2541 //
2542 // ISHERMITIAN SPECIALIZATIONS
2543 //
2544 //=================================================================================================
2545 
2546 //*************************************************************************************************
2548 template< typename MT, bool SO >
2549 struct IsHermitian< SMatMapExpr<MT,Abs,SO> >
2550  : public BoolConstant< IsHermitian<MT>::value >
2551 {};
2552 
2553 template< typename MT, bool SO >
2554 struct IsHermitian< SMatMapExpr<MT,Floor,SO> >
2555  : public BoolConstant< IsHermitian<MT>::value >
2556 {};
2557 
2558 template< typename MT, bool SO >
2559 struct IsHermitian< SMatMapExpr<MT,Ceil,SO> >
2560  : public BoolConstant< IsHermitian<MT>::value >
2561 {};
2562 
2563 template< typename MT, bool SO >
2564 struct IsHermitian< SMatMapExpr<MT,Trunc,SO> >
2565  : public BoolConstant< IsHermitian<MT>::value >
2566 {};
2567 
2568 template< typename MT, bool SO >
2569 struct IsHermitian< SMatMapExpr<MT,Round,SO> >
2570  : public BoolConstant< IsHermitian<MT>::value >
2571 {};
2572 
2573 template< typename MT, bool SO >
2574 struct IsHermitian< SMatMapExpr<MT,Conj,SO> >
2575  : public BoolConstant< IsHermitian<MT>::value >
2576 {};
2577 
2578 template< typename MT, bool SO >
2579 struct IsHermitian< SMatMapExpr<MT,Real,SO> >
2580  : public BoolConstant< IsHermitian<MT>::value >
2581 {};
2582 
2583 template< typename MT, bool SO >
2584 struct IsHermitian< SMatMapExpr<MT,Imag,SO> >
2585  : public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
2586 {};
2587 
2588 template< typename MT, bool SO >
2589 struct IsHermitian< SMatMapExpr<MT,Sqrt,SO> >
2590  : public BoolConstant< IsHermitian<MT>::value >
2591 {};
2592 
2593 template< typename MT, bool SO >
2594 struct IsHermitian< SMatMapExpr<MT,InvSqrt,SO> >
2595  : public BoolConstant< IsHermitian<MT>::value >
2596 {};
2597 
2598 template< typename MT, bool SO >
2599 struct IsHermitian< SMatMapExpr<MT,Cbrt,SO> >
2600  : public BoolConstant< IsHermitian<MT>::value >
2601 {};
2602 
2603 template< typename MT, bool SO >
2604 struct IsHermitian< SMatMapExpr<MT,InvCbrt,SO> >
2605  : public BoolConstant< IsHermitian<MT>::value >
2606 {};
2607 
2608 template< typename MT, typename ET, bool SO >
2609 struct IsHermitian< SMatMapExpr<MT,Pow<ET>,SO> >
2610  : public BoolConstant< IsHermitian<MT>::value >
2611 {};
2612 
2613 template< typename MT, bool SO >
2614 struct IsHermitian< SMatMapExpr<MT,Exp,SO> >
2615  : public BoolConstant< IsHermitian<MT>::value >
2616 {};
2617 
2618 template< typename MT, bool SO >
2619 struct IsHermitian< SMatMapExpr<MT,Exp2,SO> >
2620  : public BoolConstant< IsHermitian<MT>::value >
2621 {};
2622 
2623 template< typename MT, bool SO >
2624 struct IsHermitian< SMatMapExpr<MT,Exp10,SO> >
2625  : public BoolConstant< IsHermitian<MT>::value >
2626 {};
2627 
2628 template< typename MT, bool SO >
2629 struct IsHermitian< SMatMapExpr<MT,Log,SO> >
2630  : public BoolConstant< IsHermitian<MT>::value >
2631 {};
2632 
2633 template< typename MT, bool SO >
2634 struct IsHermitian< SMatMapExpr<MT,Log2,SO> >
2635  : public BoolConstant< IsHermitian<MT>::value >
2636 {};
2637 
2638 template< typename MT, bool SO >
2639 struct IsHermitian< SMatMapExpr<MT,Log10,SO> >
2640  : public BoolConstant< IsHermitian<MT>::value >
2641 {};
2642 
2643 template< typename MT, bool SO >
2644 struct IsHermitian< SMatMapExpr<MT,Sin,SO> >
2645  : public BoolConstant< IsHermitian<MT>::value >
2646 {};
2647 
2648 template< typename MT, bool SO >
2649 struct IsHermitian< SMatMapExpr<MT,Asin,SO> >
2650  : public BoolConstant< IsHermitian<MT>::value >
2651 {};
2652 
2653 template< typename MT, bool SO >
2654 struct IsHermitian< SMatMapExpr<MT,Sinh,SO> >
2655  : public BoolConstant< IsHermitian<MT>::value >
2656 {};
2657 
2658 template< typename MT, bool SO >
2659 struct IsHermitian< SMatMapExpr<MT,Asinh,SO> >
2660  : public BoolConstant< IsHermitian<MT>::value >
2661 {};
2662 
2663 template< typename MT, bool SO >
2664 struct IsHermitian< SMatMapExpr<MT,Cos,SO> >
2665  : public BoolConstant< IsHermitian<MT>::value >
2666 {};
2667 
2668 template< typename MT, bool SO >
2669 struct IsHermitian< SMatMapExpr<MT,Acos,SO> >
2670  : public BoolConstant< IsHermitian<MT>::value >
2671 {};
2672 
2673 template< typename MT, bool SO >
2674 struct IsHermitian< SMatMapExpr<MT,Cosh,SO> >
2675  : public BoolConstant< IsHermitian<MT>::value >
2676 {};
2677 
2678 template< typename MT, bool SO >
2679 struct IsHermitian< SMatMapExpr<MT,Acosh,SO> >
2680  : public BoolConstant< IsHermitian<MT>::value >
2681 {};
2682 
2683 template< typename MT, bool SO >
2684 struct IsHermitian< SMatMapExpr<MT,Tan,SO> >
2685  : public BoolConstant< IsHermitian<MT>::value >
2686 {};
2687 
2688 template< typename MT, bool SO >
2689 struct IsHermitian< SMatMapExpr<MT,Atan,SO> >
2690  : public BoolConstant< IsHermitian<MT>::value >
2691 {};
2692 
2693 template< typename MT, bool SO >
2694 struct IsHermitian< SMatMapExpr<MT,Tanh,SO> >
2695  : public BoolConstant< IsHermitian<MT>::value >
2696 {};
2697 
2698 template< typename MT, bool SO >
2699 struct IsHermitian< SMatMapExpr<MT,Atanh,SO> >
2700  : public BoolConstant< IsHermitian<MT>::value >
2701 {};
2702 
2703 template< typename MT, bool SO >
2704 struct IsHermitian< SMatMapExpr<MT,Erf,SO> >
2705  : public BoolConstant< IsHermitian<MT>::value >
2706 {};
2707 
2708 template< typename MT, bool SO >
2709 struct IsHermitian< SMatMapExpr<MT,Erfc,SO> >
2710  : public BoolConstant< IsHermitian<MT>::value >
2711 {};
2713 //*************************************************************************************************
2714 
2715 
2716 
2717 
2718 //=================================================================================================
2719 //
2720 // ISLOWER SPECIALIZATIONS
2721 //
2722 //=================================================================================================
2723 
2724 //*************************************************************************************************
2726 template< typename MT, typename OP, bool SO >
2727 struct IsLower< SMatMapExpr<MT,OP,SO> >
2728  : public BoolConstant< IsLower<MT>::value >
2729 {};
2731 //*************************************************************************************************
2732 
2733 
2734 
2735 
2736 //=================================================================================================
2737 //
2738 // ISUNILOWER SPECIALIZATIONS
2739 //
2740 //=================================================================================================
2741 
2742 //*************************************************************************************************
2744 template< typename MT, bool SO >
2745 struct IsUniLower< SMatMapExpr<MT,Abs,SO> >
2746  : public BoolConstant< IsUniLower<MT>::value >
2747 {};
2748 
2749 template< typename MT, bool SO >
2750 struct IsUniLower< SMatMapExpr<MT,Floor,SO> >
2751  : public BoolConstant< IsUniLower<MT>::value >
2752 {};
2753 
2754 template< typename MT, bool SO >
2755 struct IsUniLower< SMatMapExpr<MT,Ceil,SO> >
2756  : public BoolConstant< IsUniLower<MT>::value >
2757 {};
2758 
2759 template< typename MT, bool SO >
2760 struct IsUniLower< SMatMapExpr<MT,Trunc,SO> >
2761  : public BoolConstant< IsUniLower<MT>::value >
2762 {};
2763 
2764 template< typename MT, bool SO >
2765 struct IsUniLower< SMatMapExpr<MT,Round,SO> >
2766  : public BoolConstant< IsUniLower<MT>::value >
2767 {};
2768 
2769 template< typename MT, bool SO >
2770 struct IsUniLower< SMatMapExpr<MT,Conj,SO> >
2771  : public BoolConstant< IsUniLower<MT>::value >
2772 {};
2773 
2774 template< typename MT, bool SO >
2775 struct IsUniLower< SMatMapExpr<MT,Real,SO> >
2776  : public BoolConstant< IsUniLower<MT>::value >
2777 {};
2778 
2779 template< typename MT, bool SO >
2780 struct IsUniLower< SMatMapExpr<MT,Sqrt,SO> >
2781  : public BoolConstant< IsUniLower<MT>::value >
2782 {};
2783 
2784 template< typename MT, bool SO >
2785 struct IsUniLower< SMatMapExpr<MT,Cbrt,SO> >
2786  : public BoolConstant< IsUniLower<MT>::value >
2787 {};
2788 
2789 template< typename MT, typename ET, bool SO >
2790 struct IsUniLower< SMatMapExpr<MT,Pow<ET>,SO> >
2791  : public BoolConstant< IsUniLower<MT>::value >
2792 {};
2794 //*************************************************************************************************
2795 
2796 
2797 
2798 
2799 //=================================================================================================
2800 //
2801 // ISSTRICTLYLOWER SPECIALIZATIONS
2802 //
2803 //=================================================================================================
2804 
2805 //*************************************************************************************************
2807 template< typename MT, typename OP, bool SO >
2808 struct IsStrictlyLower< SMatMapExpr<MT,OP,SO> >
2809  : public BoolConstant< IsStrictlyLower<MT>::value >
2810 {};
2812 //*************************************************************************************************
2813 
2814 
2815 
2816 
2817 //=================================================================================================
2818 //
2819 // ISUPPER SPECIALIZATIONS
2820 //
2821 //=================================================================================================
2822 
2823 //*************************************************************************************************
2825 template< typename MT, typename OP, bool SO >
2826 struct IsUpper< SMatMapExpr<MT,OP,SO> >
2827  : public BoolConstant< IsUpper<MT>::value >
2828 {};
2830 //*************************************************************************************************
2831 
2832 
2833 
2834 
2835 //=================================================================================================
2836 //
2837 // ISUNIUPPER SPECIALIZATIONS
2838 //
2839 //=================================================================================================
2840 
2841 //*************************************************************************************************
2843 template< typename MT, bool SO >
2844 struct IsUniUpper< SMatMapExpr<MT,Abs,SO> >
2845  : public BoolConstant< IsUniUpper<MT>::value >
2846 {};
2847 
2848 template< typename MT, bool SO >
2849 struct IsUniUpper< SMatMapExpr<MT,Floor,SO> >
2850  : public BoolConstant< IsUniUpper<MT>::value >
2851 {};
2852 
2853 template< typename MT, bool SO >
2854 struct IsUniUpper< SMatMapExpr<MT,Ceil,SO> >
2855  : public BoolConstant< IsUniUpper<MT>::value >
2856 {};
2857 
2858 template< typename MT, bool SO >
2859 struct IsUniUpper< SMatMapExpr<MT,Trunc,SO> >
2860  : public BoolConstant< IsUniUpper<MT>::value >
2861 {};
2862 
2863 template< typename MT, bool SO >
2864 struct IsUniUpper< SMatMapExpr<MT,Round,SO> >
2865  : public BoolConstant< IsUniUpper<MT>::value >
2866 {};
2867 
2868 template< typename MT, bool SO >
2869 struct IsUniUpper< SMatMapExpr<MT,Conj,SO> >
2870  : public BoolConstant< IsUniUpper<MT>::value >
2871 {};
2872 
2873 template< typename MT, bool SO >
2874 struct IsUniUpper< SMatMapExpr<MT,Real,SO> >
2875  : public BoolConstant< IsUniUpper<MT>::value >
2876 {};
2877 
2878 template< typename MT, bool SO >
2879 struct IsUniUpper< SMatMapExpr<MT,Sqrt,SO> >
2880  : public BoolConstant< IsUniUpper<MT>::value >
2881 {};
2882 
2883 template< typename MT, bool SO >
2884 struct IsUniUpper< SMatMapExpr<MT,Cbrt,SO> >
2885  : public BoolConstant< IsUniUpper<MT>::value >
2886 {};
2887 
2888 template< typename MT, typename ET, bool SO >
2889 struct IsUniUpper< SMatMapExpr<MT,Pow<ET>,SO> >
2890  : public BoolConstant< IsUniUpper<MT>::value >
2891 {};
2893 //*************************************************************************************************
2894 
2895 
2896 
2897 
2898 //=================================================================================================
2899 //
2900 // ISSTRICTLYUPPER SPECIALIZATIONS
2901 //
2902 //=================================================================================================
2903 
2904 //*************************************************************************************************
2906 template< typename MT, typename OP, bool SO >
2907 struct IsStrictlyUpper< SMatMapExpr<MT,OP,SO> >
2908  : public BoolConstant< IsStrictlyUpper<MT>::value >
2909 {};
2911 //*************************************************************************************************
2912 
2913 } // namespace blaze
2914 
2915 #endif
Header file for the UnderlyingNumeric type trait.
Generic wrapper for the trunc() function.
Definition: Trunc.h:62
Pointer difference type of the Blaze library.
decltype(auto) acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2033
Header file for auxiliary alias declarations.
Generic wrapper for the ceil() function.
Definition: Ceil.h:62
decltype(auto) exp10(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1696
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:62
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for basic type definitions.
Operation operation() const
Returns a copy of the custom operation.
Definition: SMatMapExpr.h:467
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatMapExpr.h:420
Generic wrapper for the sin() function.
Definition: Sin.h:62
Generic wrapper for the conj() function.
Definition: Conj.h:62
Generic wrapper for the invsqrt() function.
Definition: InvSqrt.h:62
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the serial shim.
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1387
#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
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatMapExpr.h:244
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
IfTrue_< useAssign, const ResultType, const SMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: SMatMapExpr.h:160
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatMapExpr.h:294
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatMapExpr.h:433
Header file for the IsSame and IsStrictlySame type traits.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatMapExpr.h:491
UnaryMapTrait_< RT, OP > ResultType
Result type for expression template evaluations.
Definition: SMatMapExpr.h:151
decltype(auto) ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1234
Generic wrapper for the clamp() function.
Definition: Clamp.h:60
Iterator over the elements of the sparse matrix map expression.
Definition: SMatMapExpr.h:172
Generic wrapper for the acosh() function.
Definition: Acosh.h:62
decltype(auto) clamp(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatMapExpr.h:1576
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatMapExpr.h:276
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:1762
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatMapExpr.h:356
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatMapExpr.h:287
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatMapExpr.h:367
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3086
size_t index() const
Access to the current index of the sparse element.
Definition: SMatMapExpr.h:254
decltype(std::declval< OP >()(std::declval< RN >())) ReturnType
Return type for expression template evaluations.
Definition: SMatMapExpr.h:157
Header file for the RequiresEvaluation type trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatMapExpr.h:377
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:343
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatMapExpr.h:457
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
decltype(auto) acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1972
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
Expression object for the sparse matrix map() function.The SMatMapExpr class represents the compile t...
Definition: Forward.h:112
Operand sm_
Sparse matrix of the absolute value expression.
Definition: SMatMapExpr.h:508
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatMapExpr.h:153
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatMapExpr.h:152
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2184
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Header file for the SparseMatrix base class.
Constraint on the data type.
Generic wrapper for the abs() function.
Definition: Abs.h:62
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
OP op_
The custom unary operation.
Definition: SMatMapExpr.h:295
Header file for the MatMapExpr base class.
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatMapExpr.h:163
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 unary map trait.
Header file for the IsSymmetric type trait.
decltype(auto) cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1940
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1359
Header file for the If class template.
Generic wrapper for the imag() function.
Definition: Imag.h:59
Generic wrapper for the exp10() function.
Definition: Exp10.h:62
decltype(auto) exp2(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1667
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SMatMapExpr.h:154
decltype(auto) sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1882
decltype(auto) asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1853
decltype(auto) cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2001
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatMapExpr.h:265
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1512
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
Generic wrapper for the log10() function.
Definition: Log10.h:62
decltype(auto) trunc(const DenseMatrix< MT, SO > &dm)
Applies the trunc() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1263
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
Header file for all functors.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for the IsLower type trait.
Generic wrapper for the exp2() function.
Definition: Exp2.h:62
Generic wrapper for the asin() function.
Definition: Asin.h:62
decltype(auto) atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2091
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatMapExpr.h:182
decltype(auto) asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1911
Generic wrapper for the erf() function.
Definition: Erf.h:62
ConstIterator(IteratorType it, OP op)
Constructor for the ConstIterator class.
Definition: SMatMapExpr.h:202
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
Header file for the exception macros of the math module.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatMapExpr.h:324
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
OppositeType_< MT > OT
Opposite type of the sparse matrix expression.
Definition: SMatMapExpr.h:110
Constraint on the data type.
Evaluation of the underlying numeric element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingNumeric.h:81
Header file for all forward declarations for expression class templates.
Generic wrapper for the floor() function.
Definition: Floor.h:62
decltype(auto) exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1638
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1176
decltype(auto) log(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1728
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
decltype(auto) floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1205
decltype(auto) pow(const DenseMatrix< MT, SO > &dm, ET exp)
Computes the exponential value for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1607
decltype(auto) round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1292
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatMapExpr.h:446
decltype(auto) tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2123
decltype(auto) forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1147
Header file for run time assertion macros.
Generic wrapper for the pow() function.
Definition: Forward.h:84
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
decltype(auto) invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1544
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatMapExpr.h:387
#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
decltype(auto) atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2155
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Compile time type negation.The Not alias declaration negates the given compile time condition...
Definition: Not.h:70
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Generic wrapper for the erfc() function.
Definition: Erfc.h:62
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
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
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatMapExpr.h:408
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatMapExpr.h:479
Header file for the RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
ResultType_< MT > RT
Result type of the sparse matrix expression.
Definition: SMatMapExpr.h:109
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatMapExpr.h:501
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatMapExpr.h:339
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatMapExpr.h:224
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1821
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatMapExpr.h:397
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatMapExpr.h:180
decltype(auto) erfc(const DenseMatrix< MT, SO > &dm)
Computes the complementary error function for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2213
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
typename UnaryMapTrait< T, OP >::Type UnaryMapTrait_
Auxiliary alias declaration for the UnaryMapTrait class template.The UnaryMapTrait_ alias declaration...
Definition: UnaryMapTrait.h:156
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1448
SMatMapExpr(const MT &sm, OP op) noexcept
Constructor for the SMatMapExpr class.
Definition: SMatMapExpr.h:311
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
Generic wrapper for the acos() function.
Definition: Acos.h:62
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2062
Generic wrapper for the atan() function.
Definition: Atan.h:62
Generic wrapper for the round() function.
Definition: Round.h:62
Expression object for sparse matrix transpositions.The SMatTransExpr class represents the compile tim...
Definition: Forward.h:123
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:75
OP Operation
Data type of the custom unary operation.
Definition: SMatMapExpr.h:166
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
IteratorCategory iterator_category
The iterator category.
Definition: SMatMapExpr.h:189
decltype(auto) log10(const DenseMatrix< MT, SO > &dm)
Computes the common logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1792
Generic wrapper for the log2() function.
Definition: Log2.h:62
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1416
Header file for the IsUpper type trait.
Generic wrapper for the cosh() function.
Definition: Cosh.h:62
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
decltype(auto) log2(const DenseMatrix< MT, SO > &dm)
Computes the binary logarithm for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1760
decltype(auto) invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1480
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
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatMapExpr.h:213
#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
ReturnType_< MT > RN
Return type of the sparse matrix expression.
Definition: SMatMapExpr.h:111
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
Operation op_
The custom unary operation.
Definition: SMatMapExpr.h:509
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs...
Definition: DMatDMatMapExpr.h:1133
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatMapExpr.h:234