DMatDMatMapExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATDMATMAPEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATDMATMAPEXPR_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>
57 #include <blaze/math/SIMD.h>
73 #include <blaze/system/Inline.h>
74 #include <blaze/util/Assert.h>
75 #include <blaze/util/EnableIf.h>
78 #include <blaze/util/mpl/And.h>
79 #include <blaze/util/mpl/If.h>
80 #include <blaze/util/mpl/Maximum.h>
81 #include <blaze/util/Template.h>
82 #include <blaze/util/Types.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS DMATDMATMAPEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
102 template< typename MT1 // Type of the left-hand side dense matrix
103  , typename MT2 // Type of the right-hand side dense matrix
104  , typename OP // Type of the custom operation
105  , bool SO > // Storage order
107  : public MatMatMapExpr< DenseMatrix< DMatDMatMapExpr<MT1,MT2,OP,SO>, SO > >
108  , private Computation
109 {
110  private:
111  //**Type definitions****************************************************************************
120 
122  BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( HasSIMDEnabled, simdEnabled );
123 
126  //**********************************************************************************************
127 
128  //**Serial evaluation strategy******************************************************************
130 
136  enum : bool { useAssign = ( RequiresEvaluation<MT1>::value || RequiresEvaluation<MT2>::value ) };
137 
139  template< typename MT >
141  struct UseAssign {
142  enum : bool { value = useAssign };
143  };
145  //**********************************************************************************************
146 
147  //**Parallel evaluation strategy****************************************************************
149 
155  template< typename MT >
156  struct UseSMPAssign {
157  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) && useAssign };
158  };
160  //**********************************************************************************************
161 
162  //**SIMD support detection**********************************************************************
164  struct UseSIMDEnabledFlag {
166  enum : bool { value = OP::BLAZE_TEMPLATE simdEnabled<ET1,ET2>() };
167  };
169  //**********************************************************************************************
170 
171  public:
172  //**Type definitions****************************************************************************
178 
180  using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
181 
184 
186  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
187 
189  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
190 
192  using Operation = OP;
193 
196 
199  //**********************************************************************************************
200 
201  //**ConstIterator class definition**************************************************************
205  {
206  public:
207  //**Type definitions*************************************************************************
208  using IteratorCategory = std::random_access_iterator_tag;
213 
214  // STL iterator requirements
220 
223 
226  //*******************************************************************************************
227 
228  //**Constructor******************************************************************************
235  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right, OP op )
236  : left_ ( left ) // Iterator to the current left-hand side element
237  , right_( right ) // Iterator to the current right-hand side element
238  , op_ ( op ) // The custom unary operation
239  {}
240  //*******************************************************************************************
241 
242  //**Addition assignment operator*************************************************************
248  inline ConstIterator& operator+=( size_t inc ) {
249  left_ += inc;
250  right_ += inc;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Subtraction assignment operator**********************************************************
261  inline ConstIterator& operator-=( size_t dec ) {
262  left_ -= dec;
263  right_ -= dec;
264  return *this;
265  }
266  //*******************************************************************************************
267 
268  //**Prefix increment operator****************************************************************
274  ++left_;
275  ++right_;
276  return *this;
277  }
278  //*******************************************************************************************
279 
280  //**Postfix increment operator***************************************************************
285  inline const ConstIterator operator++( int ) {
286  return ConstIterator( left_++, right_++, op_ );
287  }
288  //*******************************************************************************************
289 
290  //**Prefix decrement operator****************************************************************
296  --left_;
297  --right_;
298  return *this;
299  }
300  //*******************************************************************************************
301 
302  //**Postfix decrement operator***************************************************************
307  inline const ConstIterator operator--( int ) {
308  return ConstIterator( left_--, right_--, op_ );
309  }
310  //*******************************************************************************************
311 
312  //**Element access operator******************************************************************
317  inline ReturnType operator*() const {
318  return op_( *left_, *right_ );
319  }
320  //*******************************************************************************************
321 
322  //**Load function****************************************************************************
327  inline auto load() const noexcept {
328  return op_.load( left_.load(), right_.load() );
329  }
330  //*******************************************************************************************
331 
332  //**Equality operator************************************************************************
338  inline bool operator==( const ConstIterator& rhs ) const {
339  return left_ == rhs.left_;
340  }
341  //*******************************************************************************************
342 
343  //**Inequality operator**********************************************************************
349  inline bool operator!=( const ConstIterator& rhs ) const {
350  return left_ != rhs.left_;
351  }
352  //*******************************************************************************************
353 
354  //**Less-than operator***********************************************************************
360  inline bool operator<( const ConstIterator& rhs ) const {
361  return left_ < rhs.left_;
362  }
363  //*******************************************************************************************
364 
365  //**Greater-than operator********************************************************************
371  inline bool operator>( const ConstIterator& rhs ) const {
372  return left_ > rhs.left_;
373  }
374  //*******************************************************************************************
375 
376  //**Less-or-equal-than operator**************************************************************
382  inline bool operator<=( const ConstIterator& rhs ) const {
383  return left_ <= rhs.left_;
384  }
385  //*******************************************************************************************
386 
387  //**Greater-or-equal-than operator***********************************************************
393  inline bool operator>=( const ConstIterator& rhs ) const {
394  return left_ >= rhs.left_;
395  }
396  //*******************************************************************************************
397 
398  //**Subtraction operator*********************************************************************
404  inline DifferenceType operator-( const ConstIterator& rhs ) const {
405  return left_ - rhs.left_;
406  }
407  //*******************************************************************************************
408 
409  //**Addition operator************************************************************************
416  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
417  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
418  }
419  //*******************************************************************************************
420 
421  //**Addition operator************************************************************************
428  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
429  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
430  }
431  //*******************************************************************************************
432 
433  //**Subtraction operator*********************************************************************
440  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
441  return ConstIterator( it.left_ - dec, it.right_ - dec, it.op_ );
442  }
443  //*******************************************************************************************
444 
445  private:
446  //**Member variables*************************************************************************
449  OP op_;
450  //*******************************************************************************************
451  };
452  //**********************************************************************************************
453 
454  //**Compilation flags***************************************************************************
456  enum : bool { simdEnabled = MT1::simdEnabled && MT2::simdEnabled &&
457  If_< HasSIMDEnabled<OP>, UseSIMDEnabledFlag, HasLoad<OP> >::value };
458 
460  enum : bool { smpAssignable = MT1::smpAssignable && MT2::smpAssignable };
461  //**********************************************************************************************
462 
463  //**SIMD properties*****************************************************************************
465  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
466  //**********************************************************************************************
467 
468  //**Constructor*********************************************************************************
475  explicit inline DMatDMatMapExpr( const MT1& lhs, const MT2& rhs, OP op ) noexcept
476  : lhs_( lhs ) // Left-hand side dense matrix of the map expression
477  , rhs_( rhs ) // Right-hand side dense matrix of the map expression
478  , op_ ( op ) // The custom unary operation
479  {}
480  //**********************************************************************************************
481 
482  //**Access operator*****************************************************************************
489  inline ReturnType operator()( size_t i, size_t j ) const {
490  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
491  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
492  return op_( lhs_(i,j), rhs_(i,j) );
493  }
494  //**********************************************************************************************
495 
496  //**At function*********************************************************************************
504  inline ReturnType at( size_t i, size_t j ) const {
505  if( i >= lhs_.rows() ) {
506  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
507  }
508  if( j >= lhs_.columns() ) {
509  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
510  }
511  return (*this)(i,j);
512  }
513  //**********************************************************************************************
514 
515  //**Load function*******************************************************************************
522  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
523  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
524  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
525  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
526  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
527  return op_.load( lhs_.load(i,j), rhs_.load(i,j) );
528  }
529  //**********************************************************************************************
530 
531  //**Begin function******************************************************************************
537  inline ConstIterator begin( size_t i ) const {
538  return ConstIterator( lhs_.begin(i), rhs_.begin(i), op_ );
539  }
540  //**********************************************************************************************
541 
542  //**End function********************************************************************************
548  inline ConstIterator end( size_t i ) const {
549  return ConstIterator( lhs_.end(i), rhs_.end(i), op_ );
550  }
551  //**********************************************************************************************
552 
553  //**Rows function*******************************************************************************
558  inline size_t rows() const noexcept {
559  return lhs_.rows();
560  }
561  //**********************************************************************************************
562 
563  //**Columns function****************************************************************************
568  inline size_t columns() const noexcept {
569  return lhs_.columns();
570  }
571  //**********************************************************************************************
572 
573  //**Left operand access*************************************************************************
578  inline LeftOperand leftOperand() const noexcept {
579  return lhs_;
580  }
581  //**********************************************************************************************
582 
583  //**Right operand access************************************************************************
588  inline RightOperand rightOperand() const noexcept {
589  return rhs_;
590  }
591  //**********************************************************************************************
592 
593  //**Operation access****************************************************************************
598  inline Operation operation() const {
599  return op_;
600  }
601  //**********************************************************************************************
602 
603  //**********************************************************************************************
609  template< typename T >
610  inline bool canAlias( const T* alias ) const noexcept {
611  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
612  ( IsExpression<MT2>::value && rhs_.canAlias( alias ) );
613  }
614  //**********************************************************************************************
615 
616  //**********************************************************************************************
622  template< typename T >
623  inline bool isAliased( const T* alias ) const noexcept {
624  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
625  }
626  //**********************************************************************************************
627 
628  //**********************************************************************************************
633  inline bool isAligned() const noexcept {
634  return lhs_.isAligned() && rhs_.isAligned();
635  }
636  //**********************************************************************************************
637 
638  //**********************************************************************************************
643  inline bool canSMPAssign() const noexcept {
644  return lhs_.canSMPAssign() && rhs_.canSMPAssign();
645  }
646  //**********************************************************************************************
647 
648  private:
649  //**Member variables****************************************************************************
653  //**********************************************************************************************
654 
655  //**Assignment to dense matrices****************************************************************
669  template< typename MT // Type of the target dense matrix
670  , bool SO2 > // Storage order of the target dense matrix
671  friend inline EnableIf_< UseAssign<MT> >
672  assign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
673  {
675 
676  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
677  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
678 
679  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
680  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
681 
682  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
683  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
684  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
685  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
686  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
687  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
688 
689  assign( ~lhs, map( A, B, rhs.op_ ) );
690  }
692  //**********************************************************************************************
693 
694  //**Assignment to sparse matrices***************************************************************
708  template< typename MT // Type of the target sparse matrix
709  , bool SO2 > // Storage order of the target sparse matrix
710  friend inline EnableIf_< UseAssign<MT> >
711  assign( SparseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
712  {
714 
716 
723 
724  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
725  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
726 
727  const TmpType tmp( serial( rhs ) );
728  assign( ~lhs, tmp );
729  }
731  //**********************************************************************************************
732 
733  //**Addition assignment to dense matrices*******************************************************
747  template< typename MT // Type of the target dense matrix
748  , bool SO2 > // Storage order of the target dense matrix
749  friend inline EnableIf_< UseAssign<MT> >
750  addAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
751  {
753 
754  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
755  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
756 
757  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
758  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
759 
760  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
761  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
762  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
763  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
764  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
766 
767  addAssign( ~lhs, map( A, B, rhs.op_ ) );
768  }
770  //**********************************************************************************************
771 
772  //**Addition assignment to sparse matrices******************************************************
773  // No special implementation for the addition assignment to sparse matrices.
774  //**********************************************************************************************
775 
776  //**Subtraction assignment to dense matrices****************************************************
790  template< typename MT // Type of the target dense matrix
791  , bool SO2 > // Storage order of the target dense matrix
792  friend inline EnableIf_< UseAssign<MT> >
793  subAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
794  {
796 
797  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
798  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
799 
800  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
801  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
802 
803  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
804  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
805  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
806  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
807  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
808  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
809 
810  subAssign( ~lhs, map( A, B, rhs.op_ ) );
811  }
813  //**********************************************************************************************
814 
815  //**Subtraction assignment to sparse matrices***************************************************
816  // No special implementation for the subtraction assignment to sparse matrices.
817  //**********************************************************************************************
818 
819  //**Schur product assignment to dense matrices**************************************************
833  template< typename MT // Type of the target dense matrix
834  , bool SO2 > // Storage order of the target dense matrix
835  friend inline EnableIf_< UseAssign<MT> >
836  schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
837  {
839 
840  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
841  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
842 
843  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
844  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
845 
846  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
847  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
848  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
849  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
850  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
851  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
852 
853  schurAssign( ~lhs, map( A, B, rhs.op_ ) );
854  }
856  //**********************************************************************************************
857 
858  //**Schur product assignment to sparse matrices*************************************************
859  // No special implementation for the Schur product assignment to sparse matrices.
860  //**********************************************************************************************
861 
862  //**Multiplication assignment to dense matrices*************************************************
863  // No special implementation for the multiplication assignment to dense matrices.
864  //**********************************************************************************************
865 
866  //**Multiplication assignment to sparse matrices************************************************
867  // No special implementation for the multiplication assignment to sparse matrices.
868  //**********************************************************************************************
869 
870  //**SMP assignment to dense matrices************************************************************
884  template< typename MT // Type of the target dense matrix
885  , bool SO2 > // Storage order of the target dense matrix
886  friend inline EnableIf_< UseSMPAssign<MT> >
887  smpAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
888  {
890 
891  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
892  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
893 
894  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
895  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
896 
897  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
898  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
899  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
900  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
901  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
902  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
903 
904  smpAssign( ~lhs, map( A, B, rhs.op_ ) );
905  }
907  //**********************************************************************************************
908 
909  //**SMP assignment to sparse matrices***********************************************************
923  template< typename MT // Type of the target sparse matrix
924  , bool SO2 > // Storage order of the target sparse matrix
925  friend inline EnableIf_< UseSMPAssign<MT> >
927  {
929 
931 
938 
939  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
940  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
941 
942  const TmpType tmp( rhs );
943  smpAssign( ~lhs, tmp );
944  }
946  //**********************************************************************************************
947 
948  //**SMP addition assignment to dense matrices***************************************************
963  template< typename MT // Type of the target dense matrix
964  , bool SO2 > // Storage order of the target dense matrix
965  friend inline EnableIf_< UseSMPAssign<MT> >
967  {
969 
970  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
971  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
972 
973  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
974  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
975 
976  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
977  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
978  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
979  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
980  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
981  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
982 
983  smpAddAssign( ~lhs, map( A, B, rhs.op_ ) );
984  }
986  //**********************************************************************************************
987 
988  //**SMP addition assignment to sparse matrices**************************************************
989  // No special implementation for the SMP addition assignment to sparse matrices.
990  //**********************************************************************************************
991 
992  //**SMP subtraction assignment to dense matrices************************************************
1007  template< typename MT // Type of the target dense matrix
1008  , bool SO2 > // Storage order of the target dense matrix
1009  friend inline EnableIf_< UseSMPAssign<MT> >
1011  {
1013 
1014  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1015  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1016 
1017  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1018  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
1019 
1020  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1021  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1022  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1023  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1024  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1025  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1026 
1027  smpSubAssign( ~lhs, map( A, B, rhs.op_ ) );
1028  }
1030  //**********************************************************************************************
1031 
1032  //**SMP subtraction assignment to sparse matrices***********************************************
1033  // No special implementation for the SMP subtraction assignment to sparse matrices.
1034  //**********************************************************************************************
1035 
1036  //**SMP Schur product assignment to dense matrices**********************************************
1051  template< typename MT // Type of the target dense matrix
1052  , bool SO2 > // Storage order of the target dense matrix
1053  friend inline EnableIf_< UseSMPAssign<MT> >
1055  {
1057 
1058  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1059  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1060 
1061  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1062  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
1063 
1064  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1065  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1066  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1067  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1068  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1069  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1070 
1071  smpSchurAssign( ~lhs, map( A, B, rhs.op_ ) );
1072  }
1074  //**********************************************************************************************
1075 
1076  //**SMP Schur product assignment to sparse matrices*********************************************
1077  // No special implementation for the SMP Schur product assignment to sparse matrices.
1078  //**********************************************************************************************
1079 
1080  //**SMP multiplication assignment to dense matrices*********************************************
1081  // No special implementation for the SMP multiplication assignment to dense matrices.
1082  //**********************************************************************************************
1083 
1084  //**SMP multiplication assignment to sparse matrices********************************************
1085  // No special implementation for the SMP multiplication assignment to sparse matrices.
1086  //**********************************************************************************************
1087 
1088  //**Compile time checks*************************************************************************
1094  //**********************************************************************************************
1095 };
1096 //*************************************************************************************************
1097 
1098 
1099 
1100 
1101 //=================================================================================================
1102 //
1103 // GLOBAL FUNCTIONS
1104 //
1105 //=================================================================================================
1106 
1107 //*************************************************************************************************
1128 template< typename MT1 // Type of the left-hand side dense matrix
1129  , typename MT2 // Type of the right-hand side dense matrix
1130  , bool SO // Storage order
1131  , typename OP > // Type of the custom operation
1132 inline decltype(auto)
1133  map( const DenseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& rhs, OP op )
1134 {
1136 
1137  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1138  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1139  }
1140 
1142  return ReturnType( ~lhs, ~rhs, op );
1143 }
1144 //*************************************************************************************************
1145 
1146 
1147 //*************************************************************************************************
1165 template< typename MT1 // Type of the left-hand side dense matrix
1166  , bool SO1 // Storage order of the left-hand side dense matrix
1167  , typename MT2 // Type of the right-hand side dense matrix
1168  , bool SO2 > // Storage order of the right-hand side dense matrix
1169 inline decltype(auto)
1170  min( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1171 {
1173 
1174  return map( ~lhs, ~rhs, Min() );
1175 }
1176 //*************************************************************************************************
1177 
1178 
1179 //*************************************************************************************************
1197 template< typename MT1 // Type of the left-hand side dense matrix
1198  , bool SO1 // Storage order of the left-hand side dense matrix
1199  , typename MT2 // Type of the right-hand side dense matrix
1200  , bool SO2 > // Storage order of the right-hand side dense matrix
1201 inline decltype(auto)
1202  max( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1203 {
1205 
1206  return map( ~lhs, ~rhs, Max() );
1207 }
1208 //*************************************************************************************************
1209 
1210 
1211 
1212 
1213 //=================================================================================================
1214 //
1215 // ROWS SPECIALIZATIONS
1216 //
1217 //=================================================================================================
1218 
1219 //*************************************************************************************************
1221 template< typename MT1, typename MT2, typename OP, bool SO >
1222 struct Rows< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1223  : public Maximum< Rows<MT1>, Rows<MT2> >
1224 {};
1226 //*************************************************************************************************
1227 
1228 
1229 
1230 
1231 //=================================================================================================
1232 //
1233 // COLUMNS SPECIALIZATIONS
1234 //
1235 //=================================================================================================
1236 
1237 //*************************************************************************************************
1239 template< typename MT1, typename MT2, typename OP, bool SO >
1240 struct Columns< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1241  : public Maximum< Columns<MT1>, Columns<MT2> >
1242 {};
1244 //*************************************************************************************************
1245 
1246 
1247 
1248 
1249 //=================================================================================================
1250 //
1251 // ISALIGNED SPECIALIZATIONS
1252 //
1253 //=================================================================================================
1254 
1255 //*************************************************************************************************
1257 template< typename MT1, typename MT2, typename OP, bool SO >
1258 struct IsAligned< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1259  : public BoolConstant< And< IsAligned<MT1>, IsAligned<MT2> >::value >
1260 {};
1262 //*************************************************************************************************
1263 
1264 
1265 
1266 
1267 //=================================================================================================
1268 //
1269 // ISPADDED SPECIALIZATIONS
1270 //
1271 //=================================================================================================
1272 
1273 //*************************************************************************************************
1275 template< typename MT1, typename MT2, typename OP, bool SO >
1276 struct IsPadded< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1277  : public BoolConstant< And< IsPadded<MT1>, IsPadded<MT2> >::value >
1278 {};
1280 //*************************************************************************************************
1281 
1282 
1283 
1284 
1285 //=================================================================================================
1286 //
1287 // ISSYMMETRIC SPECIALIZATIONS
1288 //
1289 //=================================================================================================
1290 
1291 //*************************************************************************************************
1293 template< typename MT1, typename MT2, bool SO >
1294 struct IsSymmetric< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1295  : public BoolConstant< And< IsSymmetric<MT1>, IsSymmetric<MT2> >::value >
1296 {};
1297 
1298 template< typename MT1, typename MT2, bool SO >
1299 struct IsSymmetric< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1300  : public BoolConstant< And< IsSymmetric<MT1>, IsSymmetric<MT2> >::value >
1301 {};
1303 //*************************************************************************************************
1304 
1305 
1306 
1307 
1308 //=================================================================================================
1309 //
1310 // ISHERMITIAN SPECIALIZATIONS
1311 //
1312 //=================================================================================================
1313 
1314 //*************************************************************************************************
1316 template< typename MT1, typename MT2, bool SO >
1317 struct IsHermitian< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1318  : public BoolConstant< And< IsHermitian<MT1>, IsHermitian<MT2> >::value >
1319 {};
1320 
1321 template< typename MT1, typename MT2, bool SO >
1322 struct IsHermitian< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1323  : public BoolConstant< And< IsHermitian<MT1>, IsHermitian<MT2> >::value >
1324 {};
1326 //*************************************************************************************************
1327 
1328 
1329 
1330 
1331 //=================================================================================================
1332 //
1333 // ISLOWER SPECIALIZATIONS
1334 //
1335 //=================================================================================================
1336 
1337 //*************************************************************************************************
1339 template< typename MT1, typename MT2, bool SO >
1340 struct IsLower< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1341  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
1342 {};
1343 
1344 template< typename MT1, typename MT2, bool SO >
1345 struct IsLower< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1346  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
1347 {};
1349 //*************************************************************************************************
1350 
1351 
1352 
1353 
1354 //=================================================================================================
1355 //
1356 // ISUNILOWER SPECIALIZATIONS
1357 //
1358 //=================================================================================================
1359 
1360 //*************************************************************************************************
1362 template< typename MT1, typename MT2, bool SO >
1363 struct IsUniLower< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1364  : public BoolConstant< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1365 {};
1366 
1367 template< typename MT1, typename MT2, bool SO >
1368 struct IsUniLower< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1369  : public BoolConstant< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1370 {};
1372 //*************************************************************************************************
1373 
1374 
1375 
1376 
1377 //=================================================================================================
1378 //
1379 // ISSTRICTLYLOWER SPECIALIZATIONS
1380 //
1381 //=================================================================================================
1382 
1383 //*************************************************************************************************
1385 template< typename MT1, typename MT2, bool SO >
1386 struct IsStrictlyLower< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1387  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
1388 {};
1389 
1390 template< typename MT1, typename MT2, bool SO >
1391 struct IsStrictlyLower< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1392  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
1393 {};
1395 //*************************************************************************************************
1396 
1397 
1398 
1399 
1400 //=================================================================================================
1401 //
1402 // ISUPPER SPECIALIZATIONS
1403 //
1404 //=================================================================================================
1405 
1406 //*************************************************************************************************
1408 template< typename MT1, typename MT2, bool SO >
1409 struct IsUpper< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1410  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1411 {};
1412 
1413 template< typename MT1, typename MT2, bool SO >
1414 struct IsUpper< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1415  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1416 {};
1418 //*************************************************************************************************
1419 
1420 
1421 
1422 
1423 //=================================================================================================
1424 //
1425 // ISUNIUPPER SPECIALIZATIONS
1426 //
1427 //=================================================================================================
1428 
1429 //*************************************************************************************************
1431 template< typename MT1, typename MT2, bool SO >
1432 struct IsUniUpper< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1433  : public BoolConstant< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1434 {};
1435 
1436 template< typename MT1, typename MT2, bool SO >
1437 struct IsUniUpper< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1438  : public BoolConstant< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1439 {};
1441 //*************************************************************************************************
1442 
1443 
1444 
1445 
1446 //=================================================================================================
1447 //
1448 // ISSTRICTLYUPPER SPECIALIZATIONS
1449 //
1450 //=================================================================================================
1451 
1452 //*************************************************************************************************
1454 template< typename MT1, typename MT2, bool SO >
1455 struct IsStrictlyUpper< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1456  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
1457 {};
1458 
1459 template< typename MT1, typename MT2, bool SO >
1460 struct IsStrictlyUpper< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1461  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
1462 {};
1464 //*************************************************************************************************
1465 
1466 } // namespace blaze
1467 
1468 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Pointer difference type of the Blaze library.
IteratorCategory iterator_category
The iterator category.
Definition: DMatDMatMapExpr.h:215
Header file for auxiliary alias declarations.
Base class for all binary matrix map expression templates.The MatMatMapExpr class serves as a tag for...
Definition: MatMatMapExpr.h:66
DMatDMatMapExpr(const MT1 &lhs, const MT2 &rhs, OP op) noexcept
Constructor for the DMatDMatMapExpr class.
Definition: DMatDMatMapExpr.h:475
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatDMatMapExpr.h:177
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: DMatDMatMapExpr.h:598
BinaryMapTrait_< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DMatDMatMapExpr.h:174
ReturnType_< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:117
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDMatMapExpr.h:568
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
decltype(std::declval< OP >()(std::declval< RN1 >(), std::declval< RN2 >())) ReturnType
Return type for expression template evaluations.
Definition: DMatDMatMapExpr.h:180
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDMatMapExpr.h:176
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatDMatMapExpr.h:440
typename BinaryMapTrait< T1, T2, OP >::Type BinaryMapTrait_
Auxiliary alias declaration for the BinaryMapTrait class template.The BinaryMapTrait_ alias declarati...
Definition: BinaryMapTrait.h:161
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDMatMapExpr.h:633
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
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
LeftOperand lhs_
Left-hand side dense matrix of the map expression.
Definition: DMatDMatMapExpr.h:650
If_< RequiresEvaluation< MT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:198
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatDMatMapExpr.h:317
Header file for the Computation base class.
ElementType * PointerType
Pointer return type.
Definition: DMatDMatMapExpr.h:210
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:349
IfTrue_< useAssign, const ResultType, const DMatDMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatDMatMapExpr.h:183
Header file for the RequiresEvaluation type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatDMatMapExpr.h:261
CompositeType_< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:118
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
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
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
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:588
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDMatMapExpr.h:643
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
BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT(HasSIMDEnabled, simdEnabled)
Definition of the HasSIMDEnabled type trait.
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
PointerType pointer
Pointer return type.
Definition: DMatDMatMapExpr.h:217
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
ElementType & ReferenceType
Reference return type.
Definition: DMatDMatMapExpr.h:211
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatDMatMapExpr.h:307
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
Header file for the Maximum class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDMatMapExpr.h:522
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
ConstIterator_< MT2 > RightIteratorType
ConstIterator type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:225
OP Operation
Data type of the custom unary operation.
Definition: DMatDMatMapExpr.h:192
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Iterator over the elements of the dense matrix map expression.
Definition: DMatDMatMapExpr.h:204
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
Header file for the If class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:578
ElementType_< MT2 > ET2
Element type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:115
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
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
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:393
Header file for the Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDMatMapExpr.h:327
Header file for the IsLower type trait.
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:112
Header file for the IsAligned type trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatDMatMapExpr.h:295
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatDMatMapExpr.h:285
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatDMatMapExpr.h:208
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DMatDMatMapExpr.h:448
Constraints on the storage order of matrix types.
ConstIterator_< MT1 > LeftIteratorType
ConstIterator type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:222
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.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatDMatMapExpr.h:428
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDMatMapExpr.h:504
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDMatMapExpr.h:175
OP op_
The custom unary operation.
Definition: DMatDMatMapExpr.h:449
Header file for the binary map trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatDMatMapExpr.h:209
Header file for run time assertion macros.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDMatMapExpr.h:489
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:186
Generic wrapper for the max() function.
Definition: Max.h:62
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:189
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DMatDMatMapExpr.h:447
Expression object for the dense matrix-dense matrix map() function.The DMatDMatMapExpr class represen...
Definition: DMatDMatMapExpr.h:106
If_< RequiresEvaluation< MT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:195
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
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:338
ValueType value_type
Type of the underlying elements.
Definition: DMatDMatMapExpr.h:216
RightOperand rhs_
Right-hand side dense matrix of the map expression.
Definition: DMatDMatMapExpr.h:651
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#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
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatDMatMapExpr.h:416
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the HasMember type traits.
#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 rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDMatMapExpr.h:558
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
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
ElementType_< MT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:114
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatDMatMapExpr.h:548
Operation op_
The custom unary operation.
Definition: DMatDMatMapExpr.h:652
Generic wrapper for the min() function.
Definition: Min.h:62
Header file for the Min functor.
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
ReferenceType reference
Reference return type.
Definition: DMatDMatMapExpr.h:218
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:360
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatDMatMapExpr.h:404
Header file for the MatMatMapExpr base class.
ConstIterator(LeftIteratorType left, RightIteratorType right, OP op)
Constructor for the ConstIterator class.
Definition: DMatDMatMapExpr.h:235
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:371
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDMatMapExpr.h:610
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatDMatMapExpr.h:537
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
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
Header file for the Max functor.
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:113
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:119
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatDMatMapExpr.h:248
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
Header file for the IsHermitian type trait.
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:116
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:382
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDMatMapExpr.h:623
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
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
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatDMatMapExpr.h:273