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>
73 #include <blaze/util/Assert.h>
74 #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>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS SMATMAPEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
101 template< typename MT // Type of the sparse matrix
102  , typename OP // Type of the custom operation
103  , bool SO > // Storage order
104 class SMatMapExpr
105  : public MatMapExpr< SparseMatrix< SMatMapExpr<MT,OP,SO>, SO > >
106  , private Computation
107 {
108  private:
109  //**Type definitions****************************************************************************
110  using RT = ResultType_<MT>;
112  using RN = ReturnType_<MT>;
113  //**********************************************************************************************
114 
115  //**Serial evaluation strategy******************************************************************
117 
123  enum : bool { useAssign = RequiresEvaluation<MT>::value };
124 
126  template< typename MT2 >
128  struct UseAssign {
129  enum : bool { value = useAssign };
130  };
132  //**********************************************************************************************
133 
134  //**Parallel evaluation strategy****************************************************************
136 
142  template< typename MT2 >
143  struct UseSMPAssign {
144  enum : bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
145  };
147  //**********************************************************************************************
148 
149  public:
150  //**Type definitions****************************************************************************
156 
158  using ReturnType = decltype( std::declval<OP>()( std::declval<RN>() ) );
159 
162 
164  using Operand = If_< IsExpression<MT>, const MT, const MT& >;
165 
167  using Operation = OP;
168  //**********************************************************************************************
169 
170  //**ConstIterator class definition**************************************************************
174  {
175  public:
176  //**Type definitions*************************************************************************
179 
182 
183  using IteratorCategory = std::forward_iterator_tag;
184  using ValueType = Element;
188 
189  // STL iterator requirements
195  //*******************************************************************************************
196 
197  //**Constructor******************************************************************************
203  inline ConstIterator( IteratorType it, OP op )
204  : it_( it ) // Iterator over the elements of the sparse matrix expression
205  , op_( op ) // The custom unary operation
206  {}
207  //*******************************************************************************************
208 
209  //**Prefix increment operator****************************************************************
215  ++it_;
216  return *this;
217  }
218  //*******************************************************************************************
219 
220  //**Element access operator******************************************************************
225  inline const Element operator*() const {
226  return Element( op_( it_->value() ), it_->index() );
227  }
228  //*******************************************************************************************
229 
230  //**Element access operator******************************************************************
235  inline const ConstIterator* operator->() const {
236  return this;
237  }
238  //*******************************************************************************************
239 
240  //**Value function***************************************************************************
245  inline ReturnType value() const {
246  return op_( it_->value() );
247  }
248  //*******************************************************************************************
249 
250  //**Index function***************************************************************************
255  inline size_t index() const {
256  return it_->index();
257  }
258  //*******************************************************************************************
259 
260  //**Equality operator************************************************************************
266  inline bool operator==( const ConstIterator& rhs ) const {
267  return it_ == rhs.it_;
268  }
269  //*******************************************************************************************
270 
271  //**Inequality operator**********************************************************************
277  inline bool operator!=( const ConstIterator& rhs ) const {
278  return it_ != rhs.it_;
279  }
280  //*******************************************************************************************
281 
282  //**Subtraction operator*********************************************************************
288  inline DifferenceType operator-( const ConstIterator& rhs ) const {
289  return it_ - rhs.it_;
290  }
291  //*******************************************************************************************
292 
293  private:
294  //**Member variables*************************************************************************
296  OP op_;
297  //*******************************************************************************************
298  };
299  //**********************************************************************************************
300 
301  //**Compilation flags***************************************************************************
303  enum : bool { smpAssignable = MT::smpAssignable };
304  //**********************************************************************************************
305 
306  //**Constructor*********************************************************************************
312  explicit inline SMatMapExpr( const MT& sm, OP op ) noexcept
313  : sm_( sm ) // Sparse matrix of the map expression
314  , op_( op ) // The custom unary operation
315  {}
316  //**********************************************************************************************
317 
318  //**Access operator*****************************************************************************
325  inline ReturnType operator()( size_t i, size_t j ) const {
326  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
327  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
328  return op_( sm_(i,j) );
329  }
330  //**********************************************************************************************
331 
332  //**At function*********************************************************************************
340  inline ReturnType at( size_t i, size_t j ) const {
341  if( i >= sm_.rows() ) {
342  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
343  }
344  if( j >= sm_.columns() ) {
345  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
346  }
347  return (*this)(i,j);
348  }
349  //**********************************************************************************************
350 
351  //**Begin function******************************************************************************
357  inline ConstIterator begin( size_t i ) const {
358  return ConstIterator( sm_.begin(i), op_ );
359  }
360  //**********************************************************************************************
361 
362  //**End function********************************************************************************
368  inline ConstIterator end( size_t i ) const {
369  return ConstIterator( sm_.end(i), op_ );
370  }
371  //**********************************************************************************************
372 
373  //**Rows function*******************************************************************************
378  inline size_t rows() const noexcept {
379  return sm_.rows();
380  }
381  //**********************************************************************************************
382 
383  //**Columns function****************************************************************************
388  inline size_t columns() const noexcept {
389  return sm_.columns();
390  }
391  //**********************************************************************************************
392 
393  //**NonZeros function***************************************************************************
398  inline size_t nonZeros() const {
399  return sm_.nonZeros();
400  }
401  //**********************************************************************************************
402 
403  //**NonZeros function***************************************************************************
409  inline size_t nonZeros( size_t i ) const {
410  return sm_.nonZeros(i);
411  }
412  //**********************************************************************************************
413 
414  //**Find function*******************************************************************************
421  inline ConstIterator find( size_t i, size_t j ) const {
423  return ConstIterator( sm_.find( i, j ), op_ );
424  }
425  //**********************************************************************************************
426 
427  //**LowerBound function*************************************************************************
434  inline ConstIterator lowerBound( size_t i, size_t j ) const {
436  return ConstIterator( sm_.lowerBound( i, j ), op_ );
437  }
438  //**********************************************************************************************
439 
440  //**UpperBound function*************************************************************************
447  inline ConstIterator upperBound( size_t i, size_t j ) const {
449  return ConstIterator( sm_.upperBound( i, j ), op_ );
450  }
451  //**********************************************************************************************
452 
453  //**Operand access******************************************************************************
458  inline Operand operand() const noexcept {
459  return sm_;
460  }
461  //**********************************************************************************************
462 
463  //**Operation access****************************************************************************
468  inline Operation operation() const {
469  return op_;
470  }
471  //**********************************************************************************************
472 
473  //**********************************************************************************************
479  template< typename T >
480  inline bool canAlias( const T* alias ) const noexcept {
481  return sm_.canAlias( alias );
482  }
483  //**********************************************************************************************
484 
485  //**********************************************************************************************
491  template< typename T >
492  inline bool isAliased( const T* alias ) const noexcept {
493  return sm_.isAliased( alias );
494  }
495  //**********************************************************************************************
496 
497  //**********************************************************************************************
502  inline bool canSMPAssign() const noexcept {
503  return sm_.canSMPAssign();
504  }
505  //**********************************************************************************************
506 
507  private:
508  //**Member variables****************************************************************************
511  //**********************************************************************************************
512 
513  //**Assignment to dense matrices****************************************************************
527  template< typename MT2 // Type of the target dense matrix
528  , bool SO2 > // Storage order of the target dense matrix
529  friend inline EnableIf_< UseAssign<MT2> >
530  assign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
531  {
533 
537 
538  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
539  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
540 
541  const RT tmp( serial( rhs.sm_ ) );
542  assign( ~lhs, map( tmp, rhs.op_ ) );
543  }
545  //**********************************************************************************************
546 
547  //**Assignment to row-major sparse matrices*****************************************************
562  template< typename MT2 > // Type of the target sparse matrix
563  friend inline EnableIf_< And< UseAssign<MT2>
565  assign( SparseMatrix<MT2,false>& lhs, const SMatMapExpr& rhs )
566  {
568 
569  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
570  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
571 
572  using Iterator = Iterator_<MT2>;
573 
574  assign( ~lhs, rhs.sm_ );
575 
576  const size_t m( rhs.rows() );
577 
578  for( size_t i=0UL; i<m; ++i ) {
579  const Iterator end( (~lhs).end(i) );
580  for( Iterator element=(~lhs).begin(i); element!=end; ++element ) {
581  element->value() = rhs.op_( element->value() );
582  }
583  }
584  }
586  //**********************************************************************************************
587 
588  //**Assignment to column-major sparse matrices**************************************************
603  template< typename MT2 > // Type of the target sparse matrix
604  friend inline EnableIf_< And< UseAssign<MT2>
605  , IsSame< UnderlyingNumeric<MT>, UnderlyingNumeric<MT2> > > >
606  assign( SparseMatrix<MT2,true>& lhs, const SMatMapExpr& rhs )
607  {
609 
610  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
611  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
612 
613  using Iterator = Iterator_<MT2>;
614 
615  assign( ~lhs, rhs.sm_ );
616 
617  const size_t n( rhs.columns() );
618 
619  for( size_t j=0UL; j<n; ++j ) {
620  const Iterator end( (~lhs).end(j) );
621  for( Iterator element=(~lhs).begin(j); element!=end; ++element ) {
622  element->value() = rhs.op_( element->value() );
623  }
624  }
625  }
627  //**********************************************************************************************
628 
629  //**Assignment to sparse matrices***************************************************************
644  template< typename MT2 // Type of the target sparse matrix
645  , bool SO2 > // Storage order of the target sparse matrix
646  friend inline EnableIf_< And< UseAssign<MT2>
648  assign( SparseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
649  {
651 
655 
656  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
657  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
658 
659  const RT tmp( serial( rhs.sm_ ) );
660  (~lhs).reserve( tmp.nonZeros() );
661  assign( ~lhs, map( tmp, rhs.op_ ) );
662  }
664  //**********************************************************************************************
665 
666  //**Addition assignment to dense matrices*******************************************************
680  template< typename MT2 // Type of the target dense matrix
681  , bool SO2 > // Storage order of the target dense matrix
682  friend inline EnableIf_< UseAssign<MT2> >
683  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
684  {
686 
690 
691  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
692  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
693 
694  const RT tmp( serial( rhs.sm_ ) );
695  addAssign( ~lhs, map( tmp, rhs.op_ ) );
696  }
698  //**********************************************************************************************
699 
700  //**Addition assignment to sparse matrices******************************************************
701  // No special implementation for the addition assignment to sparse matrices.
702  //**********************************************************************************************
703 
704  //**Subtraction assignment to dense matrices****************************************************
718  template< typename MT2 // Type of the target dense matrix
719  , bool SO2 > // Storage order of the target sparse matrix
720  friend inline EnableIf_< UseAssign<MT2> >
721  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
722  {
724 
728 
729  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
730  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
731 
732  const RT tmp( serial( rhs.sm_ ) );
733  subAssign( ~lhs, map( tmp, rhs.op_ ) );
734  }
736  //**********************************************************************************************
737 
738  //**Subtraction assignment to sparse matrices***************************************************
739  // No special implementation for the subtraction assignment to sparse matrices.
740  //**********************************************************************************************
741 
742  //**Schur product assignment to dense matrices**************************************************
756  template< typename MT2 // Type of the target dense matrix
757  , bool SO2 > // Storage order of the target dense matrix
758  friend inline EnableIf_< UseAssign<MT2> >
759  schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
760  {
762 
766 
767  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
768  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
769 
770  const RT tmp( serial( rhs.sm_ ) );
771  schurAssign( ~lhs, map( tmp, rhs.op_ ) );
772  }
774  //**********************************************************************************************
775 
776  //**Schur product assignment to sparse matrices*************************************************
777  // No special implementation for the Schur product assignment to sparse matrices.
778  //**********************************************************************************************
779 
780  //**Multiplication assignment to dense matrices*************************************************
781  // No special implementation for the multiplication assignment to dense matrices.
782  //**********************************************************************************************
783 
784  //**Multiplication assignment to sparse matrices************************************************
785  // No special implementation for the multiplication assignment to sparse matrices.
786  //**********************************************************************************************
787 
788  //**SMP assignment to dense matrices************************************************************
802  template< typename MT2 // Type of the target dense matrix
803  , bool SO2 > // Storage order of the target dense matrix
804  friend inline EnableIf_< UseSMPAssign<MT2> >
805  smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
806  {
808 
812 
813  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
814  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
815 
816  const RT tmp( rhs.sm_ );
817  smpAssign( ~lhs, map( tmp, rhs.op_ ) );
818  }
820  //**********************************************************************************************
821 
822  //**SMP assignment to sparse matrices***********************************************************
823  // No special implementation for the SMP assignment to sparse matrices.
824  //**********************************************************************************************
825 
826  //**SMP addition assignment to dense matrices***************************************************
840  template< typename MT2 // Type of the target dense matrix
841  , bool SO2 > // Storage order of the target dense matrix
842  friend inline EnableIf_< UseSMPAssign<MT2> >
843  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
844  {
846 
850 
851  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
852  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
853 
854  const RT tmp( rhs.sm_ );
855  smpAddAssign( ~lhs, map( tmp, rhs.op_ ) );
856  }
858  //**********************************************************************************************
859 
860  //**SMP addition assignment to sparse matrices**************************************************
861  // No special implementation for the SMP addition assignment to sparse matrices.
862  //**********************************************************************************************
863 
864  //**SMP subtraction assignment to dense matrices************************************************
878  template< typename MT2 // Type of the target dense matrix
879  , bool SO2 > // Storage order of the target sparse matrix
880  friend inline EnableIf_< UseSMPAssign<MT2> >
881  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatMapExpr& rhs )
882  {
884 
888 
889  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
890  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
891 
892  const RT tmp( rhs.sm_ );
893  smpSubAssign( ~lhs, map( tmp, rhs.op_ ) );
894  }
896  //**********************************************************************************************
897 
898  //**SMP subtraction assignment to sparse matrices***********************************************
899  // No special implementation for the SMP subtraction assignment to sparse matrices.
900  //**********************************************************************************************
901 
902  //**SMP Schur product assignment to dense matrices**********************************************
916  template< typename MT2 // Type of the target dense matrix
917  , bool SO2 > // Storage order of the target dense matrix
918  friend inline EnableIf_< UseSMPAssign<MT2> >
920  {
922 
926 
927  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
928  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
929 
930  const RT tmp( rhs.sm_ );
931  smpSchurAssign( ~lhs, map( tmp, rhs.op_ ) );
932  }
934  //**********************************************************************************************
935 
936  //**SMP Schur product assignment to sparse matrices*********************************************
937  // No special implementation for the SMP Schur product assignment to sparse matrices.
938  //**********************************************************************************************
939 
940  //**SMP multiplication assignment to dense matrices*********************************************
941  // No special implementation for the SMP multiplication assignment to dense matrices.
942  //**********************************************************************************************
943 
944  //**SMP multiplication assignment to sparse matrices********************************************
945  // No special implementation for the SMP multiplication assignment to sparse matrices.
946  //**********************************************************************************************
947 
948  //**Compile time checks*************************************************************************
953  //**********************************************************************************************
954 };
955 //*************************************************************************************************
956 
957 
958 
959 
960 //=================================================================================================
961 //
962 // GLOBAL FUNCTIONS
963 //
964 //=================================================================================================
965 
966 //*************************************************************************************************
984 template< typename MT // Type of the sparse matrix
985  , bool SO // Storage order
986  , typename OP > // Type of the custom operation
987 inline decltype(auto) map( const SparseMatrix<MT,SO>& sm, OP op )
988 {
990 
991  using ReturnType = const SMatMapExpr<MT,OP,SO>;
992  return ReturnType( ~sm, op );
993 }
994 //*************************************************************************************************
995 
996 
997 //*************************************************************************************************
1015 template< typename MT // Type of the sparse matrix
1016  , bool SO // Storage order
1017  , typename OP > // Type of the custom operation
1018 inline decltype(auto) forEach( const SparseMatrix<MT,SO>& sm, OP op )
1019 {
1021 
1022  using ReturnType = const SMatMapExpr<MT,OP,SO>;
1023  return ReturnType( ~sm, op );
1024 }
1025 //*************************************************************************************************
1026 
1027 
1028 //*************************************************************************************************
1045 template< typename MT // Type of the sparse matrix
1046  , bool SO > // Storage order
1047 inline decltype(auto) abs( const SparseMatrix<MT,SO>& sm )
1048 {
1050 
1051  using ReturnType = const SMatMapExpr<MT,Abs,SO>;
1052  return ReturnType( ~sm, Abs() );
1053 }
1054 //*************************************************************************************************
1055 
1056 
1057 //*************************************************************************************************
1074 template< typename MT // Type of the sparse matrix
1075  , bool SO > // Storage order
1076 inline decltype(auto) floor( const SparseMatrix<MT,SO>& sm )
1077 {
1079 
1080  using ReturnType = const SMatMapExpr<MT,Floor,SO>;
1081  return ReturnType( ~sm, Floor() );
1082 }
1083 //*************************************************************************************************
1084 
1085 
1086 //*************************************************************************************************
1103 template< typename MT // Type of the sparse matrix
1104  , bool SO > // Storage order
1105 inline decltype(auto) ceil( const SparseMatrix<MT,SO>& sm )
1106 {
1108 
1109  using ReturnType = const SMatMapExpr<MT,Ceil,SO>;
1110  return ReturnType( ~sm, Ceil() );
1111 }
1112 //*************************************************************************************************
1113 
1114 
1115 //*************************************************************************************************
1132 template< typename MT // Type of the sparse matrix
1133  , bool SO > // Storage order
1134 inline decltype(auto) trunc( const SparseMatrix<MT,SO>& sm )
1135 {
1137 
1138  using ReturnType = const SMatMapExpr<MT,Trunc,SO>;
1139  return ReturnType( ~sm, Trunc() );
1140 }
1141 //*************************************************************************************************
1142 
1143 
1144 //*************************************************************************************************
1161 template< typename MT // Type of the sparse matrix
1162  , bool SO > // Storage order
1163 inline decltype(auto) round( const SparseMatrix<MT,SO>& sm )
1164 {
1166 
1167  using ReturnType = const SMatMapExpr<MT,Round,SO>;
1168  return ReturnType( ~sm, Round() );
1169 }
1170 //*************************************************************************************************
1171 
1172 
1173 //*************************************************************************************************
1190 template< typename MT // Type of the sparse matrix
1191  , bool SO > // Storage order
1192 inline decltype(auto) conj( const SparseMatrix<MT,SO>& sm )
1193 {
1195 
1196  using ReturnType = const SMatMapExpr<MT,Conj,SO>;
1197  return ReturnType( ~sm, Conj() );
1198 }
1199 //*************************************************************************************************
1200 
1201 
1202 //*************************************************************************************************
1228 template< typename MT // Type of the sparse matrix
1229  , bool SO > // Storage order
1230 inline decltype(auto) ctrans( const SparseMatrix<MT,SO>& sm )
1231 {
1233 
1234  return trans( conj( ~sm ) );
1235 }
1236 //*************************************************************************************************
1237 
1238 
1239 //*************************************************************************************************
1256 template< typename MT // Type of the sparse matrix
1257  , bool SO > // Storage order
1258 inline decltype(auto) real( const SparseMatrix<MT,SO>& sm )
1259 {
1261 
1262  using ReturnType = const SMatMapExpr<MT,Real,SO>;
1263  return ReturnType( ~sm, Real() );
1264 }
1265 //*************************************************************************************************
1266 
1267 
1268 //*************************************************************************************************
1285 template< typename MT // Type of the sparse matrix
1286  , bool SO > // Storage order
1287 inline decltype(auto) imag( const SparseMatrix<MT,SO>& sm )
1288 {
1290 
1291  using ReturnType = const SMatMapExpr<MT,Imag,SO>;
1292  return ReturnType( ~sm, Imag() );
1293 }
1294 //*************************************************************************************************
1295 
1296 
1297 //*************************************************************************************************
1317 template< typename MT // Type of the sparse matrix
1318  , bool SO > // Storage order
1319 inline decltype(auto) sqrt( const SparseMatrix<MT,SO>& sm )
1320 {
1322 
1323  using ReturnType = const SMatMapExpr<MT,Sqrt,SO>;
1324  return ReturnType( ~sm, Sqrt() );
1325 }
1326 //*************************************************************************************************
1327 
1328 
1329 //*************************************************************************************************
1349 template< typename MT // Type of the sparse matrix
1350  , bool SO > // Storage order
1351 inline decltype(auto) invsqrt( const SparseMatrix<MT,SO>& sm )
1352 {
1354 
1355  using ReturnType = const SMatMapExpr<MT,InvSqrt,SO>;
1356  return ReturnType( ~sm, InvSqrt() );
1357 }
1358 //*************************************************************************************************
1359 
1360 
1361 //*************************************************************************************************
1381 template< typename MT // Type of the sparse matrix
1382  , bool SO > // Storage order
1383 inline decltype(auto) cbrt( const SparseMatrix<MT,SO>& sm )
1384 {
1386 
1387  using ReturnType = const SMatMapExpr<MT,Cbrt,SO>;
1388  return ReturnType( ~sm, Cbrt() );
1389 }
1390 //*************************************************************************************************
1391 
1392 
1393 //*************************************************************************************************
1413 template< typename MT // Type of the sparse matrix
1414  , bool SO > // Storage order
1415 inline decltype(auto) invcbrt( const SparseMatrix<MT,SO>& sm )
1416 {
1418 
1419  using ReturnType = const SMatMapExpr<MT,InvCbrt,SO>;
1420  return ReturnType( ~sm, InvCbrt() );
1421 }
1422 //*************************************************************************************************
1423 
1424 
1425 //*************************************************************************************************
1444 template< typename MT // Type of the sparse matrix
1445  , bool SO // Storage order
1446  , typename DT > // Type of the delimiters
1447 inline decltype(auto) clamp( const SparseMatrix<MT,SO>& sm, const DT& min, const DT& max )
1448 {
1450 
1451  using ReturnType = const SMatMapExpr<MT,Clamp<DT>,SO>;
1452  return ReturnType( ~sm, Clamp<DT>( min, max ) );
1453 }
1454 //*************************************************************************************************
1455 
1456 
1457 //*************************************************************************************************
1475 template< typename MT // Type of the sparse matrix
1476  , bool SO // Storage order
1477  , typename ST // Type of the scalar exponent
1478  , typename = EnableIf_< IsNumeric<ST> > >
1479 inline decltype(auto) pow( const SparseMatrix<MT,SO>& sm, ST exp )
1480 {
1482 
1483  using ScalarType = MultTrait_< UnderlyingBuiltin_<MT>, ST >;
1485  return ReturnType( ~sm, UnaryPow<ScalarType>( exp ) );
1486 }
1487 //*************************************************************************************************
1488 
1489 
1490 //*************************************************************************************************
1507 template< typename MT // Type of the sparse matrix
1508  , bool SO > // Storage order
1509 inline decltype(auto) exp( const SparseMatrix<MT,SO>& sm )
1510 {
1512 
1513  using ReturnType = const SMatMapExpr<MT,Exp,SO>;
1514  return ReturnType( ~sm, Exp() );
1515 }
1516 //*************************************************************************************************
1517 
1518 
1519 //*************************************************************************************************
1536 template< typename MT // Type of the sparse matrix
1537  , bool SO > // Storage order
1538 inline decltype(auto) exp2( const SparseMatrix<MT,SO>& sm )
1539 {
1541 
1542  using ReturnType = const SMatMapExpr<MT,Exp2,SO>;
1543  return ReturnType( ~sm, Exp2() );
1544 }
1545 //*************************************************************************************************
1546 
1547 
1548 //*************************************************************************************************
1565 template< typename MT // Type of the sparse matrix
1566  , bool SO > // Storage order
1567 inline decltype(auto) exp10( const SparseMatrix<MT,SO>& sm )
1568 {
1570 
1571  using ReturnType = const SMatMapExpr<MT,Exp10,SO>;
1572  return ReturnType( ~sm, Exp10() );
1573 }
1574 //*************************************************************************************************
1575 
1576 
1577 //*************************************************************************************************
1597 template< typename MT // Type of the sparse matrix
1598  , bool SO > // Storage order
1599 inline decltype(auto) log( const SparseMatrix<MT,SO>& sm )
1600 {
1602 
1603  using ReturnType = const SMatMapExpr<MT,Log,SO>;
1604  return ReturnType( ~sm, Log() );
1605 }
1606 //*************************************************************************************************
1607 
1608 
1609 //*************************************************************************************************
1629 template< typename MT // Type of the sparse matrix
1630  , bool SO > // Storage order
1631 inline decltype(auto) log10( const SparseMatrix<MT,SO>& sm )
1632 {
1634 
1635  using ReturnType = const SMatMapExpr<MT,Log10,SO>;
1636  return ReturnType( ~sm, Log10() );
1637 }
1638 //*************************************************************************************************
1639 
1640 
1641 //*************************************************************************************************
1661 template< typename MT // Type of the sparse matrix
1662  , bool SO > // Storage order
1663 inline decltype(auto) log2( const SparseMatrix<MT,SO>& sm )
1664 {
1666 
1667  using ReturnType = const SMatMapExpr<MT,Log2,SO>;
1668  return ReturnType( ~sm, Log2() );
1669 }
1670 //*************************************************************************************************
1671 
1672 
1673 //*************************************************************************************************
1690 template< typename MT // Type of the sparse matrix
1691  , bool SO > // Storage order
1692 inline decltype(auto) sin( const SparseMatrix<MT,SO>& sm )
1693 {
1695 
1696  using ReturnType = const SMatMapExpr<MT,Sin,SO>;
1697  return ReturnType( ~sm, Sin() );
1698 }
1699 //*************************************************************************************************
1700 
1701 
1702 //*************************************************************************************************
1722 template< typename MT // Type of the sparse matrix
1723  , bool SO > // Storage order
1724 inline decltype(auto) asin( const SparseMatrix<MT,SO>& sm )
1725 {
1727 
1728  using ReturnType = const SMatMapExpr<MT,Asin,SO>;
1729  return ReturnType( ~sm, Asin() );
1730 }
1731 //*************************************************************************************************
1732 
1733 
1734 //*************************************************************************************************
1751 template< typename MT // Type of the sparse matrix
1752  , bool SO > // Storage order
1753 inline decltype(auto) sinh( const SparseMatrix<MT,SO>& sm )
1754 {
1756 
1757  using ReturnType = const SMatMapExpr<MT,Sinh,SO>;
1758  return ReturnType( ~sm, Sinh() );
1759 }
1760 //*************************************************************************************************
1761 
1762 
1763 //*************************************************************************************************
1780 template< typename MT // Type of the sparse matrix
1781  , bool SO > // Storage order
1782 inline decltype(auto) asinh( const SparseMatrix<MT,SO>& sm )
1783 {
1785 
1786  using ReturnType = const SMatMapExpr<MT,Asinh,SO>;
1787  return ReturnType( ~sm, Asinh() );
1788 }
1789 //*************************************************************************************************
1790 
1791 
1792 //*************************************************************************************************
1809 template< typename MT // Type of the sparse matrix
1810  , bool SO > // Storage order
1811 inline decltype(auto) cos( const SparseMatrix<MT,SO>& sm )
1812 {
1814 
1815  using ReturnType = const SMatMapExpr<MT,Cos,SO>;
1816  return ReturnType( ~sm, Cos() );
1817 }
1818 //*************************************************************************************************
1819 
1820 
1821 //*************************************************************************************************
1841 template< typename MT // Type of the sparse matrix
1842  , bool SO > // Storage order
1843 inline decltype(auto) acos( const SparseMatrix<MT,SO>& sm )
1844 {
1846 
1847  using ReturnType = const SMatMapExpr<MT,Acos,SO>;
1848  return ReturnType( ~sm, Acos() );
1849 }
1850 //*************************************************************************************************
1851 
1852 
1853 //*************************************************************************************************
1870 template< typename MT // Type of the sparse matrix
1871  , bool SO > // Storage order
1872 inline decltype(auto) cosh( const SparseMatrix<MT,SO>& sm )
1873 {
1875 
1876  using ReturnType = const SMatMapExpr<MT,Cosh,SO>;
1877  return ReturnType( ~sm, Cosh() );
1878 }
1879 //*************************************************************************************************
1880 
1881 
1882 //*************************************************************************************************
1902 template< typename MT // Type of the sparse matrix
1903  , bool SO > // Storage order
1904 inline decltype(auto) acosh( const SparseMatrix<MT,SO>& sm )
1905 {
1907 
1908  using ReturnType = const SMatMapExpr<MT,Acosh,SO>;
1909  return ReturnType( ~sm, Acosh() );
1910 }
1911 //*************************************************************************************************
1912 
1913 
1914 //*************************************************************************************************
1931 template< typename MT // Type of the sparse matrix
1932  , bool SO > // Storage order
1933 inline decltype(auto) tan( const SparseMatrix<MT,SO>& sm )
1934 {
1936 
1937  using ReturnType = const SMatMapExpr<MT,Tan,SO>;
1938  return ReturnType( ~sm, Tan() );
1939 }
1940 //*************************************************************************************************
1941 
1942 
1943 //*************************************************************************************************
1960 template< typename MT // Type of the sparse matrix
1961  , bool SO > // Storage order
1962 inline decltype(auto) atan( const SparseMatrix<MT,SO>& sm )
1963 {
1965 
1966  using ReturnType = const SMatMapExpr<MT,Atan,SO>;
1967  return ReturnType( ~sm, Atan() );
1968 }
1969 //*************************************************************************************************
1970 
1971 
1972 //*************************************************************************************************
1992 template< typename MT // Type of the sparse matrix
1993  , bool SO > // Storage order
1994 inline decltype(auto) tanh( const SparseMatrix<MT,SO>& sm )
1995 {
1997 
1998  using ReturnType = const SMatMapExpr<MT,Tanh,SO>;
1999  return ReturnType( ~sm, Tanh() );
2000 }
2001 //*************************************************************************************************
2002 
2003 
2004 //*************************************************************************************************
2024 template< typename MT // Type of the sparse matrix
2025  , bool SO > // Storage order
2026 inline decltype(auto) atanh( const SparseMatrix<MT,SO>& sm )
2027 {
2029 
2030  using ReturnType = const SMatMapExpr<MT,Atanh,SO>;
2031  return ReturnType( ~sm, Atanh() );
2032 }
2033 //*************************************************************************************************
2034 
2035 
2036 //*************************************************************************************************
2053 template< typename MT // Type of the sparse matrix
2054  , bool SO > // Storage order
2055 inline decltype(auto) erf( const SparseMatrix<MT,SO>& sm )
2056 {
2058 
2059  using ReturnType = const SMatMapExpr<MT,Erf,SO>;
2060  return ReturnType( ~sm, Erf() );
2061 }
2062 //*************************************************************************************************
2063 
2064 
2065 //*************************************************************************************************
2083 template< typename MT // Type of the sparse matrix
2084  , bool SO > // Storage order
2085 inline decltype(auto) erfc( const SparseMatrix<MT,SO>& sm )
2086 {
2088 
2089  using ReturnType = const SMatMapExpr<MT,Erfc,SO>;
2090  return ReturnType( ~sm, Erfc() );
2091 }
2092 //*************************************************************************************************
2093 
2094 
2095 
2096 
2097 //=================================================================================================
2098 //
2099 // GLOBAL RESTRUCTURING FUNCTIONS
2100 //
2101 //=================================================================================================
2102 
2103 //*************************************************************************************************
2114 template< typename MT // Type of the sparse matrix
2115  , bool SO > // Storage order
2116 inline decltype(auto) abs( const SMatMapExpr<MT,Abs,SO>& sm )
2117 {
2119 
2120  return sm;
2121 }
2123 //*************************************************************************************************
2124 
2125 
2126 //*************************************************************************************************
2137 template< typename MT // Type of the sparse matrix
2138  , bool SO > // Storage order
2139 inline decltype(auto) floor( const SMatMapExpr<MT,Floor,SO>& sm )
2140 {
2142 
2143  return sm;
2144 }
2146 //*************************************************************************************************
2147 
2148 
2149 //*************************************************************************************************
2160 template< typename MT // Type of the sparse matrix
2161  , bool SO > // Storage order
2162 inline decltype(auto) ceil( const SMatMapExpr<MT,Ceil,SO>& sm )
2163 {
2165 
2166  return sm;
2167 }
2169 //*************************************************************************************************
2170 
2171 
2172 //*************************************************************************************************
2183 template< typename MT // Type of the sparse matrix
2184  , bool SO > // Storage order
2185 inline decltype(auto) trunc( const SMatMapExpr<MT,Trunc,SO>& sm )
2186 {
2188 
2189  return sm;
2190 }
2192 //*************************************************************************************************
2193 
2194 
2195 //*************************************************************************************************
2206 template< typename MT // Type of the sparse matrix
2207  , bool SO > // Storage order
2208 inline decltype(auto) round( const SMatMapExpr<MT,Round,SO>& sm )
2209 {
2211 
2212  return sm;
2213 }
2215 //*************************************************************************************************
2216 
2217 
2218 //*************************************************************************************************
2236 template< typename MT // Type of the sparse matrix
2237  , bool TF > // Transpose flag
2238 inline decltype(auto) conj( const SMatMapExpr<MT,Conj,TF>& sm )
2239 {
2241 
2242  return sm.operand();
2243 }
2245 //*************************************************************************************************
2246 
2247 
2248 //*************************************************************************************************
2266 template< typename MT // Type of the sparse matrix
2267  , bool SO > // Storage order
2268 inline decltype(auto) conj( const SMatTransExpr<SMatMapExpr<MT,Conj,SO>,!SO>& sm )
2269 {
2271 
2272  using ReturnType = const SMatTransExpr<MT,!SO>;
2273  return ReturnType( sm.operand().operand() );
2274 }
2276 //*************************************************************************************************
2277 
2278 
2279 //*************************************************************************************************
2290 template< typename MT // Type of the sparse matrix
2291  , bool SO > // Storage order
2292 inline decltype(auto) real( const SMatMapExpr<MT,Real,SO>& sm )
2293 {
2295 
2296  return sm;
2297 }
2299 //*************************************************************************************************
2300 
2301 
2302 //*************************************************************************************************
2313 template< typename MT // Type of the sparse matrix
2314  , bool SO > // Storage order
2315 inline decltype(auto) imag( const SMatMapExpr<MT,Imag,SO>& sm )
2316 {
2318 
2319  return sm;
2320 }
2322 //*************************************************************************************************
2323 
2324 
2325 
2326 
2327 //=================================================================================================
2328 //
2329 // SIZE SPECIALIZATIONS
2330 //
2331 //=================================================================================================
2332 
2333 //*************************************************************************************************
2335 template< typename MT, typename OP, bool SO >
2336 struct Size< SMatMapExpr<MT,OP,SO>, 0UL >
2337  : public Size<MT,0UL>
2338 {};
2339 
2340 template< typename MT, typename OP, bool SO >
2341 struct Size< SMatMapExpr<MT,OP,SO>, 1UL >
2342  : public Size<MT,1UL>
2343 {};
2345 //*************************************************************************************************
2346 
2347 
2348 
2349 
2350 //=================================================================================================
2351 //
2352 // ISSYMMETRIC SPECIALIZATIONS
2353 //
2354 //=================================================================================================
2355 
2356 //*************************************************************************************************
2358 template< typename MT, bool SO >
2359 struct IsSymmetric< SMatMapExpr<MT,Abs,SO> >
2360  : public IsSymmetric<MT>
2361 {};
2362 
2363 template< typename MT, bool SO >
2364 struct IsSymmetric< SMatMapExpr<MT,Floor,SO> >
2365  : public IsSymmetric<MT>
2366 {};
2367 
2368 template< typename MT, bool SO >
2369 struct IsSymmetric< SMatMapExpr<MT,Ceil,SO> >
2370  : public IsSymmetric<MT>
2371 {};
2372 
2373 template< typename MT, bool SO >
2374 struct IsSymmetric< SMatMapExpr<MT,Trunc,SO> >
2375  : public IsSymmetric<MT>
2376 {};
2377 
2378 template< typename MT, bool SO >
2379 struct IsSymmetric< SMatMapExpr<MT,Round,SO> >
2380  : public IsSymmetric<MT>
2381 {};
2382 
2383 template< typename MT, bool SO >
2384 struct IsSymmetric< SMatMapExpr<MT,Conj,SO> >
2385  : public IsSymmetric<MT>
2386 {};
2387 
2388 template< typename MT, bool SO >
2389 struct IsSymmetric< SMatMapExpr<MT,Real,SO> >
2390  : public IsSymmetric<MT>
2391 {};
2392 
2393 template< typename MT, bool SO >
2394 struct IsSymmetric< SMatMapExpr<MT,Imag,SO> >
2395  : public IsSymmetric<MT>
2396 {};
2397 
2398 template< typename MT, bool SO >
2399 struct IsSymmetric< SMatMapExpr<MT,Sqrt,SO> >
2400  : public IsSymmetric<MT>
2401 {};
2402 
2403 template< typename MT, bool SO >
2404 struct IsSymmetric< SMatMapExpr<MT,InvSqrt,SO> >
2405  : public IsSymmetric<MT>
2406 {};
2407 
2408 template< typename MT, bool SO >
2409 struct IsSymmetric< SMatMapExpr<MT,Cbrt,SO> >
2410  : public IsSymmetric<MT>
2411 {};
2412 
2413 template< typename MT, bool SO >
2414 struct IsSymmetric< SMatMapExpr<MT,InvCbrt,SO> >
2415  : public IsSymmetric<MT>
2416 {};
2417 
2418 template< typename MT, typename ET, bool SO >
2419 struct IsSymmetric< SMatMapExpr<MT,UnaryPow<ET>,SO> >
2420  : public IsSymmetric<MT>
2421 {};
2422 
2423 template< typename MT, bool SO >
2424 struct IsSymmetric< SMatMapExpr<MT,Exp,SO> >
2425  : public IsSymmetric<MT>
2426 {};
2427 
2428 template< typename MT, bool SO >
2429 struct IsSymmetric< SMatMapExpr<MT,Exp2,SO> >
2430  : public IsSymmetric<MT>
2431 {};
2432 
2433 template< typename MT, bool SO >
2434 struct IsSymmetric< SMatMapExpr<MT,Exp10,SO> >
2435  : public IsSymmetric<MT>
2436 {};
2437 
2438 template< typename MT, bool SO >
2439 struct IsSymmetric< SMatMapExpr<MT,Log,SO> >
2440  : public IsSymmetric<MT>
2441 {};
2442 
2443 template< typename MT, bool SO >
2444 struct IsSymmetric< SMatMapExpr<MT,Log2,SO> >
2445  : public IsSymmetric<MT>
2446 {};
2447 
2448 template< typename MT, bool SO >
2449 struct IsSymmetric< SMatMapExpr<MT,Log10,SO> >
2450  : public IsSymmetric<MT>
2451 {};
2452 
2453 template< typename MT, bool SO >
2454 struct IsSymmetric< SMatMapExpr<MT,Sin,SO> >
2455  : public IsSymmetric<MT>
2456 {};
2457 
2458 template< typename MT, bool SO >
2459 struct IsSymmetric< SMatMapExpr<MT,Asin,SO> >
2460  : public IsSymmetric<MT>
2461 {};
2462 
2463 template< typename MT, bool SO >
2464 struct IsSymmetric< SMatMapExpr<MT,Sinh,SO> >
2465  : public IsSymmetric<MT>
2466 {};
2467 
2468 template< typename MT, bool SO >
2469 struct IsSymmetric< SMatMapExpr<MT,Asinh,SO> >
2470  : public IsSymmetric<MT>
2471 {};
2472 
2473 template< typename MT, bool SO >
2474 struct IsSymmetric< SMatMapExpr<MT,Cos,SO> >
2475  : public IsSymmetric<MT>
2476 {};
2477 
2478 template< typename MT, bool SO >
2479 struct IsSymmetric< SMatMapExpr<MT,Acos,SO> >
2480  : public IsSymmetric<MT>
2481 {};
2482 
2483 template< typename MT, bool SO >
2484 struct IsSymmetric< SMatMapExpr<MT,Cosh,SO> >
2485  : public IsSymmetric<MT>
2486 {};
2487 
2488 template< typename MT, bool SO >
2489 struct IsSymmetric< SMatMapExpr<MT,Acosh,SO> >
2490  : public IsSymmetric<MT>
2491 {};
2492 
2493 template< typename MT, bool SO >
2494 struct IsSymmetric< SMatMapExpr<MT,Tan,SO> >
2495  : public IsSymmetric<MT>
2496 {};
2497 
2498 template< typename MT, bool SO >
2499 struct IsSymmetric< SMatMapExpr<MT,Atan,SO> >
2500  : public IsSymmetric<MT>
2501 {};
2502 
2503 template< typename MT, bool SO >
2504 struct IsSymmetric< SMatMapExpr<MT,Tanh,SO> >
2505  : public IsSymmetric<MT>
2506 {};
2507 
2508 template< typename MT, bool SO >
2509 struct IsSymmetric< SMatMapExpr<MT,Atanh,SO> >
2510  : public IsSymmetric<MT>
2511 {};
2512 
2513 template< typename MT, bool SO >
2514 struct IsSymmetric< SMatMapExpr<MT,Erf,SO> >
2515  : public IsSymmetric<MT>
2516 {};
2517 
2518 template< typename MT, bool SO >
2519 struct IsSymmetric< SMatMapExpr<MT,Erfc,SO> >
2520  : public IsSymmetric<MT>
2521 {};
2523 //*************************************************************************************************
2524 
2525 
2526 
2527 
2528 //=================================================================================================
2529 //
2530 // ISHERMITIAN SPECIALIZATIONS
2531 //
2532 //=================================================================================================
2533 
2534 //*************************************************************************************************
2536 template< typename MT, bool SO >
2537 struct IsHermitian< SMatMapExpr<MT,Abs,SO> >
2538  : public IsHermitian<MT>
2539 {};
2540 
2541 template< typename MT, bool SO >
2542 struct IsHermitian< SMatMapExpr<MT,Floor,SO> >
2543  : public IsHermitian<MT>
2544 {};
2545 
2546 template< typename MT, bool SO >
2547 struct IsHermitian< SMatMapExpr<MT,Ceil,SO> >
2548  : public IsHermitian<MT>
2549 {};
2550 
2551 template< typename MT, bool SO >
2552 struct IsHermitian< SMatMapExpr<MT,Trunc,SO> >
2553  : public IsHermitian<MT>
2554 {};
2555 
2556 template< typename MT, bool SO >
2557 struct IsHermitian< SMatMapExpr<MT,Round,SO> >
2558  : public IsHermitian<MT>
2559 {};
2560 
2561 template< typename MT, bool SO >
2562 struct IsHermitian< SMatMapExpr<MT,Conj,SO> >
2563  : public IsHermitian<MT>
2564 {};
2565 
2566 template< typename MT, bool SO >
2567 struct IsHermitian< SMatMapExpr<MT,Real,SO> >
2568  : public IsHermitian<MT>
2569 {};
2570 
2571 template< typename MT, bool SO >
2572 struct IsHermitian< SMatMapExpr<MT,Imag,SO> >
2573  : public IsBuiltin< ElementType_<MT> >
2574 {};
2575 
2576 template< typename MT, bool SO >
2577 struct IsHermitian< SMatMapExpr<MT,Sqrt,SO> >
2578  : public IsHermitian<MT>
2579 {};
2580 
2581 template< typename MT, bool SO >
2582 struct IsHermitian< SMatMapExpr<MT,InvSqrt,SO> >
2583  : public IsHermitian<MT>
2584 {};
2585 
2586 template< typename MT, bool SO >
2587 struct IsHermitian< SMatMapExpr<MT,Cbrt,SO> >
2588  : public IsHermitian<MT>
2589 {};
2590 
2591 template< typename MT, bool SO >
2592 struct IsHermitian< SMatMapExpr<MT,InvCbrt,SO> >
2593  : public IsHermitian<MT>
2594 {};
2595 
2596 template< typename MT, typename ET, bool SO >
2597 struct IsHermitian< SMatMapExpr<MT,UnaryPow<ET>,SO> >
2598  : public IsHermitian<MT>
2599 {};
2600 
2601 template< typename MT, bool SO >
2602 struct IsHermitian< SMatMapExpr<MT,Exp,SO> >
2603  : public IsHermitian<MT>
2604 {};
2605 
2606 template< typename MT, bool SO >
2607 struct IsHermitian< SMatMapExpr<MT,Exp2,SO> >
2608  : public IsHermitian<MT>
2609 {};
2610 
2611 template< typename MT, bool SO >
2612 struct IsHermitian< SMatMapExpr<MT,Exp10,SO> >
2613  : public IsHermitian<MT>
2614 {};
2615 
2616 template< typename MT, bool SO >
2617 struct IsHermitian< SMatMapExpr<MT,Log,SO> >
2618  : public IsHermitian<MT>
2619 {};
2620 
2621 template< typename MT, bool SO >
2622 struct IsHermitian< SMatMapExpr<MT,Log2,SO> >
2623  : public IsHermitian<MT>
2624 {};
2625 
2626 template< typename MT, bool SO >
2627 struct IsHermitian< SMatMapExpr<MT,Log10,SO> >
2628  : public IsHermitian<MT>
2629 {};
2630 
2631 template< typename MT, bool SO >
2632 struct IsHermitian< SMatMapExpr<MT,Sin,SO> >
2633  : public IsHermitian<MT>
2634 {};
2635 
2636 template< typename MT, bool SO >
2637 struct IsHermitian< SMatMapExpr<MT,Asin,SO> >
2638  : public IsHermitian<MT>
2639 {};
2640 
2641 template< typename MT, bool SO >
2642 struct IsHermitian< SMatMapExpr<MT,Sinh,SO> >
2643  : public IsHermitian<MT>
2644 {};
2645 
2646 template< typename MT, bool SO >
2647 struct IsHermitian< SMatMapExpr<MT,Asinh,SO> >
2648  : public IsHermitian<MT>
2649 {};
2650 
2651 template< typename MT, bool SO >
2652 struct IsHermitian< SMatMapExpr<MT,Cos,SO> >
2653  : public IsHermitian<MT>
2654 {};
2655 
2656 template< typename MT, bool SO >
2657 struct IsHermitian< SMatMapExpr<MT,Acos,SO> >
2658  : public IsHermitian<MT>
2659 {};
2660 
2661 template< typename MT, bool SO >
2662 struct IsHermitian< SMatMapExpr<MT,Cosh,SO> >
2663  : public IsHermitian<MT>
2664 {};
2665 
2666 template< typename MT, bool SO >
2667 struct IsHermitian< SMatMapExpr<MT,Acosh,SO> >
2668  : public IsHermitian<MT>
2669 {};
2670 
2671 template< typename MT, bool SO >
2672 struct IsHermitian< SMatMapExpr<MT,Tan,SO> >
2673  : public IsHermitian<MT>
2674 {};
2675 
2676 template< typename MT, bool SO >
2677 struct IsHermitian< SMatMapExpr<MT,Atan,SO> >
2678  : public IsHermitian<MT>
2679 {};
2680 
2681 template< typename MT, bool SO >
2682 struct IsHermitian< SMatMapExpr<MT,Tanh,SO> >
2683  : public IsHermitian<MT>
2684 {};
2685 
2686 template< typename MT, bool SO >
2687 struct IsHermitian< SMatMapExpr<MT,Atanh,SO> >
2688  : public IsHermitian<MT>
2689 {};
2690 
2691 template< typename MT, bool SO >
2692 struct IsHermitian< SMatMapExpr<MT,Erf,SO> >
2693  : public IsHermitian<MT>
2694 {};
2695 
2696 template< typename MT, bool SO >
2697 struct IsHermitian< SMatMapExpr<MT,Erfc,SO> >
2698  : public IsHermitian<MT>
2699 {};
2701 //*************************************************************************************************
2702 
2703 
2704 
2705 
2706 //=================================================================================================
2707 //
2708 // ISLOWER SPECIALIZATIONS
2709 //
2710 //=================================================================================================
2711 
2712 //*************************************************************************************************
2714 template< typename MT, typename OP, bool SO >
2715 struct IsLower< SMatMapExpr<MT,OP,SO> >
2716  : public IsLower<MT>
2717 {};
2719 //*************************************************************************************************
2720 
2721 
2722 
2723 
2724 //=================================================================================================
2725 //
2726 // ISUNILOWER SPECIALIZATIONS
2727 //
2728 //=================================================================================================
2729 
2730 //*************************************************************************************************
2732 template< typename MT, bool SO >
2733 struct IsUniLower< SMatMapExpr<MT,Abs,SO> >
2734  : public IsUniLower<MT>
2735 {};
2736 
2737 template< typename MT, bool SO >
2738 struct IsUniLower< SMatMapExpr<MT,Floor,SO> >
2739  : public IsUniLower<MT>
2740 {};
2741 
2742 template< typename MT, bool SO >
2743 struct IsUniLower< SMatMapExpr<MT,Ceil,SO> >
2744  : public IsUniLower<MT>
2745 {};
2746 
2747 template< typename MT, bool SO >
2748 struct IsUniLower< SMatMapExpr<MT,Trunc,SO> >
2749  : public IsUniLower<MT>
2750 {};
2751 
2752 template< typename MT, bool SO >
2753 struct IsUniLower< SMatMapExpr<MT,Round,SO> >
2754  : public IsUniLower<MT>
2755 {};
2756 
2757 template< typename MT, bool SO >
2758 struct IsUniLower< SMatMapExpr<MT,Conj,SO> >
2759  : public IsUniLower<MT>
2760 {};
2761 
2762 template< typename MT, bool SO >
2763 struct IsUniLower< SMatMapExpr<MT,Real,SO> >
2764  : public IsUniLower<MT>
2765 {};
2766 
2767 template< typename MT, bool SO >
2768 struct IsUniLower< SMatMapExpr<MT,Sqrt,SO> >
2769  : public IsUniLower<MT>
2770 {};
2771 
2772 template< typename MT, bool SO >
2773 struct IsUniLower< SMatMapExpr<MT,Cbrt,SO> >
2774  : public IsUniLower<MT>
2775 {};
2776 
2777 template< typename MT, typename ET, bool SO >
2778 struct IsUniLower< SMatMapExpr<MT,UnaryPow<ET>,SO> >
2779  : public IsUniLower<MT>
2780 {};
2782 //*************************************************************************************************
2783 
2784 
2785 
2786 
2787 //=================================================================================================
2788 //
2789 // ISSTRICTLYLOWER SPECIALIZATIONS
2790 //
2791 //=================================================================================================
2792 
2793 //*************************************************************************************************
2795 template< typename MT, typename OP, bool SO >
2796 struct IsStrictlyLower< SMatMapExpr<MT,OP,SO> >
2797  : public IsStrictlyLower<MT>
2798 {};
2800 //*************************************************************************************************
2801 
2802 
2803 
2804 
2805 //=================================================================================================
2806 //
2807 // ISUPPER SPECIALIZATIONS
2808 //
2809 //=================================================================================================
2810 
2811 //*************************************************************************************************
2813 template< typename MT, typename OP, bool SO >
2814 struct IsUpper< SMatMapExpr<MT,OP,SO> >
2815  : public IsUpper<MT>
2816 {};
2818 //*************************************************************************************************
2819 
2820 
2821 
2822 
2823 //=================================================================================================
2824 //
2825 // ISUNIUPPER SPECIALIZATIONS
2826 //
2827 //=================================================================================================
2828 
2829 //*************************************************************************************************
2831 template< typename MT, bool SO >
2832 struct IsUniUpper< SMatMapExpr<MT,Abs,SO> >
2833  : public IsUniUpper<MT>
2834 {};
2835 
2836 template< typename MT, bool SO >
2837 struct IsUniUpper< SMatMapExpr<MT,Floor,SO> >
2838  : public IsUniUpper<MT>
2839 {};
2840 
2841 template< typename MT, bool SO >
2842 struct IsUniUpper< SMatMapExpr<MT,Ceil,SO> >
2843  : public IsUniUpper<MT>
2844 {};
2845 
2846 template< typename MT, bool SO >
2847 struct IsUniUpper< SMatMapExpr<MT,Trunc,SO> >
2848  : public IsUniUpper<MT>
2849 {};
2850 
2851 template< typename MT, bool SO >
2852 struct IsUniUpper< SMatMapExpr<MT,Round,SO> >
2853  : public IsUniUpper<MT>
2854 {};
2855 
2856 template< typename MT, bool SO >
2857 struct IsUniUpper< SMatMapExpr<MT,Conj,SO> >
2858  : public IsUniUpper<MT>
2859 {};
2860 
2861 template< typename MT, bool SO >
2862 struct IsUniUpper< SMatMapExpr<MT,Real,SO> >
2863  : public IsUniUpper<MT>
2864 {};
2865 
2866 template< typename MT, bool SO >
2867 struct IsUniUpper< SMatMapExpr<MT,Sqrt,SO> >
2868  : public IsUniUpper<MT>
2869 {};
2870 
2871 template< typename MT, bool SO >
2872 struct IsUniUpper< SMatMapExpr<MT,Cbrt,SO> >
2873  : public IsUniUpper<MT>
2874 {};
2875 
2876 template< typename MT, typename ET, bool SO >
2877 struct IsUniUpper< SMatMapExpr<MT,UnaryPow<ET>,SO> >
2878  : public IsUniUpper<MT>
2879 {};
2881 //*************************************************************************************************
2882 
2883 
2884 
2885 
2886 //=================================================================================================
2887 //
2888 // ISSTRICTLYUPPER SPECIALIZATIONS
2889 //
2890 //=================================================================================================
2891 
2892 //*************************************************************************************************
2894 template< typename MT, typename OP, bool SO >
2895 struct IsStrictlyUpper< SMatMapExpr<MT,OP,SO> >
2896  : public IsStrictlyUpper<MT>
2897 {};
2899 //*************************************************************************************************
2900 
2901 } // namespace blaze
2902 
2903 #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 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:468
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatMapExpr.h:421
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:245
IfTrue_< useAssign, const ResultType, const SMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: SMatMapExpr.h:161
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatMapExpr.h:295
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:434
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:492
UnaryMapTrait_< RT, OP > ResultType
Result type for expression template evaluations.
Definition: SMatMapExpr.h:152
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
decltype(auto) pow(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise exponential value for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1267
Iterator over the elements of the sparse matrix map expression.
Definition: SMatMapExpr.h:173
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:277
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:1903
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatMapExpr.h:357
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatMapExpr.h:288
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatMapExpr.h:368
Generic wrapper for the pow() function with fixed exponent.
Definition: Forward.h:119
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
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:87
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
size_t index() const
Access to the current index of the sparse element.
Definition: SMatMapExpr.h:255
decltype(std::declval< OP >()(std::declval< RN >())) ReturnType
Return type for expression template evaluations.
Definition: SMatMapExpr.h:158
Header file for the RequiresEvaluation type trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatMapExpr.h:378
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:458
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
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:509
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
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:154
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatMapExpr.h:153
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:71
OP op_
The custom unary operation.
Definition: SMatMapExpr.h:296
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:164
Generic wrapper for the sqrt() function.
Definition: Sqrt.h:62
Header file for the ValueIndexPair class.
Header file for the multiplication trait.
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:58
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:155
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
Header file for the UnderlyingBuiltin type trait.
decltype(auto) asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h: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:266
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
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:3085
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:183
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:203
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:325
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:111
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
Header file for the IsNumeric type trait.
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) 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:447
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 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:388
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
Compile time check for built-in data types.This type trait tests whether or not the given template pa...
Definition: IsBuiltin.h:75
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:816
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:409
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatMapExpr.h:480
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:110
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:502
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:3080
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:789
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatMapExpr.h:340
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatMapExpr.h:225
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:398
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatMapExpr.h:181
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:134
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:312
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
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
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
OP Operation
Data type of the custom unary operation.
Definition: SMatMapExpr.h:167
IteratorCategory iterator_category
The iterator category.
Definition: SMatMapExpr.h:190
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
Header file for the Size type trait.
#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:214
#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:112
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
Operation op_
The custom unary operation.
Definition: SMatMapExpr.h:510
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:1134
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatMapExpr.h:235