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>
60 #include <blaze/math/SIMD.h>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
77 #include <blaze/util/EnableIf.h>
79 #include <blaze/util/mpl/And.h>
80 #include <blaze/util/mpl/If.h>
81 #include <blaze/util/mpl/Maximum.h>
82 #include <blaze/util/Template.h>
83 #include <blaze/util/Types.h>
85 
86 
87 namespace blaze {
88 
89 //=================================================================================================
90 //
91 // CLASS DMATDMATMAPEXPR
92 //
93 //=================================================================================================
94 
95 //*************************************************************************************************
103 template< typename MT1 // Type of the left-hand side dense matrix
104  , typename MT2 // Type of the right-hand side dense matrix
105  , typename OP // Type of the custom operation
106  , bool SO > // Storage order
108  : public MatMatMapExpr< DenseMatrix< DMatDMatMapExpr<MT1,MT2,OP,SO>, SO > >
109  , private Computation
110 {
111  private:
112  //**Type definitions****************************************************************************
121 
123  BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( HasSIMDEnabled, simdEnabled );
124 
127  //**********************************************************************************************
128 
129  //**Serial evaluation strategy******************************************************************
131 
137  enum : bool { useAssign = ( RequiresEvaluation<MT1>::value || RequiresEvaluation<MT2>::value ) };
138 
140  template< typename MT >
142  struct UseAssign {
143  enum : bool { value = useAssign };
144  };
146  //**********************************************************************************************
147 
148  //**Parallel evaluation strategy****************************************************************
150 
156  template< typename MT >
157  struct UseSMPAssign {
158  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) && useAssign };
159  };
161  //**********************************************************************************************
162 
163  //**SIMD support detection**********************************************************************
165  struct UseSIMDEnabledFlag {
167  enum : bool { value = OP::BLAZE_TEMPLATE simdEnabled<ET1,ET2>() };
168  };
170  //**********************************************************************************************
171 
172  public:
173  //**Type definitions****************************************************************************
179 
181  using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
182 
185 
187  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
188 
190  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
191 
193  using Operation = OP;
194 
197 
200  //**********************************************************************************************
201 
202  //**ConstIterator class definition**************************************************************
206  {
207  public:
208  //**Type definitions*************************************************************************
209  using IteratorCategory = std::random_access_iterator_tag;
214 
215  // STL iterator requirements
221 
224 
227  //*******************************************************************************************
228 
229  //**Constructor******************************************************************************
236  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right, OP op )
237  : left_ ( left ) // Iterator to the current left-hand side element
238  , right_( right ) // Iterator to the current right-hand side element
239  , op_ ( op ) // The custom unary operation
240  {}
241  //*******************************************************************************************
242 
243  //**Addition assignment operator*************************************************************
249  inline ConstIterator& operator+=( size_t inc ) {
250  left_ += inc;
251  right_ += inc;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Subtraction assignment operator**********************************************************
262  inline ConstIterator& operator-=( size_t dec ) {
263  left_ -= dec;
264  right_ -= dec;
265  return *this;
266  }
267  //*******************************************************************************************
268 
269  //**Prefix increment operator****************************************************************
275  ++left_;
276  ++right_;
277  return *this;
278  }
279  //*******************************************************************************************
280 
281  //**Postfix increment operator***************************************************************
286  inline const ConstIterator operator++( int ) {
287  return ConstIterator( left_++, right_++, op_ );
288  }
289  //*******************************************************************************************
290 
291  //**Prefix decrement operator****************************************************************
297  --left_;
298  --right_;
299  return *this;
300  }
301  //*******************************************************************************************
302 
303  //**Postfix decrement operator***************************************************************
308  inline const ConstIterator operator--( int ) {
309  return ConstIterator( left_--, right_--, op_ );
310  }
311  //*******************************************************************************************
312 
313  //**Element access operator******************************************************************
318  inline ReturnType operator*() const {
319  return op_( *left_, *right_ );
320  }
321  //*******************************************************************************************
322 
323  //**Load function****************************************************************************
328  inline auto load() const noexcept {
329  return op_.load( left_.load(), right_.load() );
330  }
331  //*******************************************************************************************
332 
333  //**Equality operator************************************************************************
339  inline bool operator==( const ConstIterator& rhs ) const {
340  return left_ == rhs.left_;
341  }
342  //*******************************************************************************************
343 
344  //**Inequality operator**********************************************************************
350  inline bool operator!=( const ConstIterator& rhs ) const {
351  return left_ != rhs.left_;
352  }
353  //*******************************************************************************************
354 
355  //**Less-than operator***********************************************************************
361  inline bool operator<( const ConstIterator& rhs ) const {
362  return left_ < rhs.left_;
363  }
364  //*******************************************************************************************
365 
366  //**Greater-than operator********************************************************************
372  inline bool operator>( const ConstIterator& rhs ) const {
373  return left_ > rhs.left_;
374  }
375  //*******************************************************************************************
376 
377  //**Less-or-equal-than operator**************************************************************
383  inline bool operator<=( const ConstIterator& rhs ) const {
384  return left_ <= rhs.left_;
385  }
386  //*******************************************************************************************
387 
388  //**Greater-or-equal-than operator***********************************************************
394  inline bool operator>=( const ConstIterator& rhs ) const {
395  return left_ >= rhs.left_;
396  }
397  //*******************************************************************************************
398 
399  //**Subtraction operator*********************************************************************
405  inline DifferenceType operator-( const ConstIterator& rhs ) const {
406  return left_ - rhs.left_;
407  }
408  //*******************************************************************************************
409 
410  //**Addition operator************************************************************************
417  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
418  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
419  }
420  //*******************************************************************************************
421 
422  //**Addition operator************************************************************************
429  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
430  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
431  }
432  //*******************************************************************************************
433 
434  //**Subtraction operator*********************************************************************
441  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
442  return ConstIterator( it.left_ - dec, it.right_ - dec, it.op_ );
443  }
444  //*******************************************************************************************
445 
446  private:
447  //**Member variables*************************************************************************
450  OP op_;
451  //*******************************************************************************************
452  };
453  //**********************************************************************************************
454 
455  //**Compilation flags***************************************************************************
457  enum : bool { simdEnabled = MT1::simdEnabled && MT2::simdEnabled &&
458  If_< HasSIMDEnabled<OP>, UseSIMDEnabledFlag, HasLoad<OP> >::value };
459 
461  enum : bool { smpAssignable = MT1::smpAssignable && MT2::smpAssignable };
462  //**********************************************************************************************
463 
464  //**SIMD properties*****************************************************************************
466  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
467  //**********************************************************************************************
468 
469  //**Constructor*********************************************************************************
476  explicit inline DMatDMatMapExpr( const MT1& lhs, const MT2& rhs, OP op ) noexcept
477  : lhs_( lhs ) // Left-hand side dense matrix of the map expression
478  , rhs_( rhs ) // Right-hand side dense matrix of the map expression
479  , op_ ( op ) // The custom unary operation
480  {}
481  //**********************************************************************************************
482 
483  //**Access operator*****************************************************************************
490  inline ReturnType operator()( size_t i, size_t j ) const {
491  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
492  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
493  return op_( lhs_(i,j), rhs_(i,j) );
494  }
495  //**********************************************************************************************
496 
497  //**At function*********************************************************************************
505  inline ReturnType at( size_t i, size_t j ) const {
506  if( i >= lhs_.rows() ) {
507  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
508  }
509  if( j >= lhs_.columns() ) {
510  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
511  }
512  return (*this)(i,j);
513  }
514  //**********************************************************************************************
515 
516  //**Load function*******************************************************************************
523  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
524  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
525  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
526  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
527  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
528  return op_.load( lhs_.load(i,j), rhs_.load(i,j) );
529  }
530  //**********************************************************************************************
531 
532  //**Begin function******************************************************************************
538  inline ConstIterator begin( size_t i ) const {
539  return ConstIterator( lhs_.begin(i), rhs_.begin(i), op_ );
540  }
541  //**********************************************************************************************
542 
543  //**End function********************************************************************************
549  inline ConstIterator end( size_t i ) const {
550  return ConstIterator( lhs_.end(i), rhs_.end(i), op_ );
551  }
552  //**********************************************************************************************
553 
554  //**Rows function*******************************************************************************
559  inline size_t rows() const noexcept {
560  return lhs_.rows();
561  }
562  //**********************************************************************************************
563 
564  //**Columns function****************************************************************************
569  inline size_t columns() const noexcept {
570  return lhs_.columns();
571  }
572  //**********************************************************************************************
573 
574  //**Left operand access*************************************************************************
579  inline LeftOperand leftOperand() const noexcept {
580  return lhs_;
581  }
582  //**********************************************************************************************
583 
584  //**Right operand access************************************************************************
589  inline RightOperand rightOperand() const noexcept {
590  return rhs_;
591  }
592  //**********************************************************************************************
593 
594  //**Operation access****************************************************************************
599  inline Operation operation() const {
600  return op_;
601  }
602  //**********************************************************************************************
603 
604  //**********************************************************************************************
610  template< typename T >
611  inline bool canAlias( const T* alias ) const noexcept {
612  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
613  ( IsExpression<MT2>::value && rhs_.canAlias( alias ) );
614  }
615  //**********************************************************************************************
616 
617  //**********************************************************************************************
623  template< typename T >
624  inline bool isAliased( const T* alias ) const noexcept {
625  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
626  }
627  //**********************************************************************************************
628 
629  //**********************************************************************************************
634  inline bool isAligned() const noexcept {
635  return lhs_.isAligned() && rhs_.isAligned();
636  }
637  //**********************************************************************************************
638 
639  //**********************************************************************************************
644  inline bool canSMPAssign() const noexcept {
645  return lhs_.canSMPAssign() && rhs_.canSMPAssign();
646  }
647  //**********************************************************************************************
648 
649  private:
650  //**Member variables****************************************************************************
654  //**********************************************************************************************
655 
656  //**Assignment to dense matrices****************************************************************
670  template< typename MT // Type of the target dense matrix
671  , bool SO2 > // Storage order of the target dense matrix
672  friend inline EnableIf_< UseAssign<MT> >
673  assign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
674  {
676 
677  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
678  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
679 
680  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
681  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
682 
683  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
684  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
685  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
686  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
687  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
688  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
689 
690  assign( ~lhs, map( A, B, rhs.op_ ) );
691  }
693  //**********************************************************************************************
694 
695  //**Assignment to sparse matrices***************************************************************
709  template< typename MT // Type of the target sparse matrix
710  , bool SO2 > // Storage order of the target sparse matrix
711  friend inline EnableIf_< UseAssign<MT> >
712  assign( SparseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
713  {
715 
717 
724 
725  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
726  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
727 
728  const TmpType tmp( serial( rhs ) );
729  assign( ~lhs, tmp );
730  }
732  //**********************************************************************************************
733 
734  //**Addition assignment to dense matrices*******************************************************
748  template< typename MT // Type of the target dense matrix
749  , bool SO2 > // Storage order of the target dense matrix
750  friend inline EnableIf_< UseAssign<MT> >
751  addAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
752  {
754 
755  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
756  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
757 
758  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
759  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
760 
761  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
762  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
763  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
764  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
765  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
766  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
767 
768  addAssign( ~lhs, map( A, B, rhs.op_ ) );
769  }
771  //**********************************************************************************************
772 
773  //**Addition assignment to sparse matrices******************************************************
774  // No special implementation for the addition assignment to sparse matrices.
775  //**********************************************************************************************
776 
777  //**Subtraction assignment to dense matrices****************************************************
791  template< typename MT // Type of the target dense matrix
792  , bool SO2 > // Storage order of the target dense matrix
793  friend inline EnableIf_< UseAssign<MT> >
794  subAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
795  {
797 
798  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
799  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
800 
801  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
802  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
803 
804  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
805  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
806  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
807  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
808  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
809  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
810 
811  subAssign( ~lhs, map( A, B, rhs.op_ ) );
812  }
814  //**********************************************************************************************
815 
816  //**Subtraction assignment to sparse matrices***************************************************
817  // No special implementation for the subtraction assignment to sparse matrices.
818  //**********************************************************************************************
819 
820  //**Schur product assignment to dense matrices**************************************************
834  template< typename MT // Type of the target dense matrix
835  , bool SO2 > // Storage order of the target dense matrix
836  friend inline EnableIf_< UseAssign<MT> >
837  schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
838  {
840 
841  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
842  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
843 
844  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
845  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
846 
847  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
848  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
849  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
850  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
851  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
852  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
853 
854  schurAssign( ~lhs, map( A, B, rhs.op_ ) );
855  }
857  //**********************************************************************************************
858 
859  //**Schur product assignment to sparse matrices*************************************************
860  // No special implementation for the Schur product assignment to sparse matrices.
861  //**********************************************************************************************
862 
863  //**Multiplication assignment to dense matrices*************************************************
864  // No special implementation for the multiplication assignment to dense matrices.
865  //**********************************************************************************************
866 
867  //**Multiplication assignment to sparse matrices************************************************
868  // No special implementation for the multiplication assignment to sparse matrices.
869  //**********************************************************************************************
870 
871  //**SMP assignment to dense matrices************************************************************
885  template< typename MT // Type of the target dense matrix
886  , bool SO2 > // Storage order of the target dense matrix
887  friend inline EnableIf_< UseSMPAssign<MT> >
888  smpAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
889  {
891 
892  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
893  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
894 
895  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
896  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
897 
898  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
899  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
900  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
901  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
902  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
903  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
904 
905  smpAssign( ~lhs, map( A, B, rhs.op_ ) );
906  }
908  //**********************************************************************************************
909 
910  //**SMP assignment to sparse matrices***********************************************************
924  template< typename MT // Type of the target sparse matrix
925  , bool SO2 > // Storage order of the target sparse matrix
926  friend inline EnableIf_< UseSMPAssign<MT> >
928  {
930 
932 
939 
940  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
941  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
942 
943  const TmpType tmp( rhs );
944  smpAssign( ~lhs, tmp );
945  }
947  //**********************************************************************************************
948 
949  //**SMP addition assignment to dense matrices***************************************************
964  template< typename MT // Type of the target dense matrix
965  , bool SO2 > // Storage order of the target dense matrix
966  friend inline EnableIf_< UseSMPAssign<MT> >
968  {
970 
971  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
972  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
973 
974  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
975  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
976 
977  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
978  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
979  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
980  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
981  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
982  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
983 
984  smpAddAssign( ~lhs, map( A, B, rhs.op_ ) );
985  }
987  //**********************************************************************************************
988 
989  //**SMP addition assignment to sparse matrices**************************************************
990  // No special implementation for the SMP addition assignment to sparse matrices.
991  //**********************************************************************************************
992 
993  //**SMP subtraction assignment to dense matrices************************************************
1008  template< typename MT // Type of the target dense matrix
1009  , bool SO2 > // Storage order of the target dense matrix
1010  friend inline EnableIf_< UseSMPAssign<MT> >
1012  {
1014 
1015  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1016  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1017 
1018  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1019  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
1020 
1021  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1022  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1023  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1024  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1025  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1026  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1027 
1028  smpSubAssign( ~lhs, map( A, B, rhs.op_ ) );
1029  }
1031  //**********************************************************************************************
1032 
1033  //**SMP subtraction assignment to sparse matrices***********************************************
1034  // No special implementation for the SMP subtraction assignment to sparse matrices.
1035  //**********************************************************************************************
1036 
1037  //**SMP Schur product assignment to dense matrices**********************************************
1052  template< typename MT // Type of the target dense matrix
1053  , bool SO2 > // Storage order of the target dense matrix
1054  friend inline EnableIf_< UseSMPAssign<MT> >
1056  {
1058 
1059  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1060  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1061 
1062  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1063  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
1064 
1065  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1066  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1067  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1068  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1069  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1070  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1071 
1072  smpSchurAssign( ~lhs, map( A, B, rhs.op_ ) );
1073  }
1075  //**********************************************************************************************
1076 
1077  //**SMP Schur product assignment to sparse matrices*********************************************
1078  // No special implementation for the SMP Schur product assignment to sparse matrices.
1079  //**********************************************************************************************
1080 
1081  //**SMP multiplication assignment to dense matrices*********************************************
1082  // No special implementation for the SMP multiplication assignment to dense matrices.
1083  //**********************************************************************************************
1084 
1085  //**SMP multiplication assignment to sparse matrices********************************************
1086  // No special implementation for the SMP multiplication assignment to sparse matrices.
1087  //**********************************************************************************************
1088 
1089  //**Compile time checks*************************************************************************
1095  //**********************************************************************************************
1096 };
1097 //*************************************************************************************************
1098 
1099 
1100 
1101 
1102 //=================================================================================================
1103 //
1104 // GLOBAL FUNCTIONS
1105 //
1106 //=================================================================================================
1107 
1108 //*************************************************************************************************
1129 template< typename MT1 // Type of the left-hand side dense matrix
1130  , typename MT2 // Type of the right-hand side dense matrix
1131  , bool SO // Storage order
1132  , typename OP > // Type of the custom operation
1133 inline decltype(auto)
1134  map( const DenseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& rhs, OP op )
1135 {
1137 
1138  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1139  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1140  }
1141 
1143  return ReturnType( ~lhs, ~rhs, op );
1144 }
1145 //*************************************************************************************************
1146 
1147 
1148 //*************************************************************************************************
1166 template< typename MT1 // Type of the left-hand side dense matrix
1167  , bool SO1 // Storage order of the left-hand side dense matrix
1168  , typename MT2 // Type of the right-hand side dense matrix
1169  , bool SO2 > // Storage order of the right-hand side dense matrix
1170 inline decltype(auto)
1171  min( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1172 {
1174 
1175  return map( ~lhs, ~rhs, Min() );
1176 }
1177 //*************************************************************************************************
1178 
1179 
1180 //*************************************************************************************************
1198 template< typename MT1 // Type of the left-hand side dense matrix
1199  , bool SO1 // Storage order of the left-hand side dense matrix
1200  , typename MT2 // Type of the right-hand side dense matrix
1201  , bool SO2 > // Storage order of the right-hand side dense matrix
1202 inline decltype(auto)
1203  max( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1204 {
1206 
1207  return map( ~lhs, ~rhs, Max() );
1208 }
1209 //*************************************************************************************************
1210 
1211 
1212 //*************************************************************************************************
1230 template< typename MT1 // Type of the left-hand side dense matrix
1231  , bool SO1 // Storage order of the left-hand side dense matrix
1232  , typename MT2 // Type of the right-hand side dense matrix
1233  , bool SO2 > // Storage order of the right-hand side dense matrix
1234 inline decltype(auto)
1235  hypot( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1236 {
1238 
1239  return map( ~lhs, ~rhs, Hypot() );
1240 }
1241 //*************************************************************************************************
1242 
1243 
1244 //*************************************************************************************************
1262 template< typename MT1 // Type of the left-hand side dense matrix
1263  , bool SO1 // Storage order of the left-hand side dense matrix
1264  , typename MT2 // Type of the right-hand side dense matrix
1265  , bool SO2 > // Storage order of the right-hand side dense matrix
1266 inline decltype(auto)
1267  pow( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1268 {
1270 
1271  return map( ~lhs, ~rhs, Pow() );
1272 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1294 template< typename MT1 // Type of the left-hand side dense matrix
1295  , bool SO1 // Storage order of the left-hand side dense matrix
1296  , typename MT2 // Type of the right-hand side dense matrix
1297  , bool SO2 > // Storage order of the right-hand side dense matrix
1298 inline decltype(auto)
1299  atan2( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1300 {
1302 
1303  return map( ~lhs, ~rhs, Atan2() );
1304 }
1305 //*************************************************************************************************
1306 
1307 
1308 
1309 
1310 //=================================================================================================
1311 //
1312 // SIZE SPECIALIZATIONS
1313 //
1314 //=================================================================================================
1315 
1316 //*************************************************************************************************
1318 template< typename MT1, typename MT2, typename OP, bool SO >
1319 struct Size< DMatDMatMapExpr<MT1,MT2,OP,SO>, 0UL >
1320  : public Maximum< Size<MT1,0UL>, Size<MT2,0UL> >
1321 {};
1322 
1323 template< typename MT1, typename MT2, typename OP, bool SO >
1324 struct Size< DMatDMatMapExpr<MT1,MT2,OP,SO>, 1UL >
1325  : public Maximum< Size<MT1,1UL>, Size<MT2,1UL> >
1326 {};
1328 //*************************************************************************************************
1329 
1330 
1331 
1332 
1333 //=================================================================================================
1334 //
1335 // ISALIGNED SPECIALIZATIONS
1336 //
1337 //=================================================================================================
1338 
1339 //*************************************************************************************************
1341 template< typename MT1, typename MT2, typename OP, bool SO >
1342 struct IsAligned< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1343  : public And< IsAligned<MT1>, IsAligned<MT2> >
1344 {};
1346 //*************************************************************************************************
1347 
1348 
1349 
1350 
1351 //=================================================================================================
1352 //
1353 // ISPADDED SPECIALIZATIONS
1354 //
1355 //=================================================================================================
1356 
1357 //*************************************************************************************************
1359 template< typename MT1, typename MT2, typename OP, bool SO >
1360 struct IsPadded< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1361  : public And< IsPadded<MT1>, IsPadded<MT2> >
1362 {};
1364 //*************************************************************************************************
1365 
1366 
1367 
1368 
1369 //=================================================================================================
1370 //
1371 // ISSYMMETRIC SPECIALIZATIONS
1372 //
1373 //=================================================================================================
1374 
1375 //*************************************************************************************************
1377 template< typename MT1, typename MT2, bool SO >
1378 struct IsSymmetric< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1379  : public And< IsSymmetric<MT1>, IsSymmetric<MT2> >
1380 {};
1381 
1382 template< typename MT1, typename MT2, bool SO >
1383 struct IsSymmetric< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1384  : public And< IsSymmetric<MT1>, IsSymmetric<MT2> >
1385 {};
1387 //*************************************************************************************************
1388 
1389 
1390 
1391 
1392 //=================================================================================================
1393 //
1394 // ISHERMITIAN SPECIALIZATIONS
1395 //
1396 //=================================================================================================
1397 
1398 //*************************************************************************************************
1400 template< typename MT1, typename MT2, bool SO >
1401 struct IsHermitian< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1402  : public And< IsHermitian<MT1>, IsHermitian<MT2> >
1403 {};
1404 
1405 template< typename MT1, typename MT2, bool SO >
1406 struct IsHermitian< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1407  : public And< IsHermitian<MT1>, IsHermitian<MT2> >
1408 {};
1410 //*************************************************************************************************
1411 
1412 
1413 
1414 
1415 //=================================================================================================
1416 //
1417 // ISLOWER SPECIALIZATIONS
1418 //
1419 //=================================================================================================
1420 
1421 //*************************************************************************************************
1423 template< typename MT1, typename MT2, bool SO >
1424 struct IsLower< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1425  : public And< IsLower<MT1>, IsLower<MT2> >
1426 {};
1427 
1428 template< typename MT1, typename MT2, bool SO >
1429 struct IsLower< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1430  : public And< IsLower<MT1>, IsLower<MT2> >
1431 {};
1433 //*************************************************************************************************
1434 
1435 
1436 
1437 
1438 //=================================================================================================
1439 //
1440 // ISUNILOWER SPECIALIZATIONS
1441 //
1442 //=================================================================================================
1443 
1444 //*************************************************************************************************
1446 template< typename MT1, typename MT2, bool SO >
1447 struct IsUniLower< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1448  : public And< IsUniLower<MT1>, IsUniLower<MT2> >
1449 {};
1450 
1451 template< typename MT1, typename MT2, bool SO >
1452 struct IsUniLower< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1453  : public And< IsUniLower<MT1>, IsUniLower<MT2> >
1454 {};
1456 //*************************************************************************************************
1457 
1458 
1459 
1460 
1461 //=================================================================================================
1462 //
1463 // ISSTRICTLYLOWER SPECIALIZATIONS
1464 //
1465 //=================================================================================================
1466 
1467 //*************************************************************************************************
1469 template< typename MT1, typename MT2, bool SO >
1470 struct IsStrictlyLower< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1471  : public And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >
1472 {};
1473 
1474 template< typename MT1, typename MT2, bool SO >
1475 struct IsStrictlyLower< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1476  : public And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >
1477 {};
1479 //*************************************************************************************************
1480 
1481 
1482 
1483 
1484 //=================================================================================================
1485 //
1486 // ISUPPER SPECIALIZATIONS
1487 //
1488 //=================================================================================================
1489 
1490 //*************************************************************************************************
1492 template< typename MT1, typename MT2, bool SO >
1493 struct IsUpper< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1494  : public And< IsUpper<MT1>, IsUpper<MT2> >
1495 {};
1496 
1497 template< typename MT1, typename MT2, bool SO >
1498 struct IsUpper< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1499  : public And< IsUpper<MT1>, IsUpper<MT2> >
1500 {};
1502 //*************************************************************************************************
1503 
1504 
1505 
1506 
1507 //=================================================================================================
1508 //
1509 // ISUNIUPPER SPECIALIZATIONS
1510 //
1511 //=================================================================================================
1512 
1513 //*************************************************************************************************
1515 template< typename MT1, typename MT2, bool SO >
1516 struct IsUniUpper< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1517  : public And< IsUniUpper<MT1>, IsUniUpper<MT2> >
1518 {};
1519 
1520 template< typename MT1, typename MT2, bool SO >
1521 struct IsUniUpper< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1522  : public And< IsUniUpper<MT1>, IsUniUpper<MT2> >
1523 {};
1525 //*************************************************************************************************
1526 
1527 
1528 
1529 
1530 //=================================================================================================
1531 //
1532 // ISSTRICTLYUPPER SPECIALIZATIONS
1533 //
1534 //=================================================================================================
1535 
1536 //*************************************************************************************************
1538 template< typename MT1, typename MT2, bool SO >
1539 struct IsStrictlyUpper< DMatDMatMapExpr<MT1,MT2,Min,SO> >
1540  : public And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >
1541 {};
1542 
1543 template< typename MT1, typename MT2, bool SO >
1544 struct IsStrictlyUpper< DMatDMatMapExpr<MT1,MT2,Max,SO> >
1545  : public And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >
1546 {};
1548 //*************************************************************************************************
1549 
1550 } // namespace blaze
1551 
1552 #endif
Header file for the Pow functor.
#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:216
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:476
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatDMatMapExpr.h:178
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.
decltype(auto) hypot(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise hypotenous for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1235
Operation operation() const
Returns a copy of the custom operation.
Definition: DMatDMatMapExpr.h:599
BinaryMapTrait_< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DMatDMatMapExpr.h:175
ReturnType_< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:118
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDMatMapExpr.h:569
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:181
Header file for the Hypot functor.
Header file for the serial shim.
Generic wrapper for the atan2() function.
Definition: Atan2.h:62
#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
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDMatMapExpr.h:177
#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:441
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
typename BinaryMapTrait< T1, T2, OP >::Type BinaryMapTrait_
Auxiliary alias declaration for the BinaryMapTrait class template.The BinaryMapTrait_ alias declarati...
Definition: BinaryMapTrait.h:139
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDMatMapExpr.h:634
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
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:87
LeftOperand lhs_
Left-hand side dense matrix of the map expression.
Definition: DMatDMatMapExpr.h:651
If_< RequiresEvaluation< MT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:199
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatDMatMapExpr.h:318
Header file for the Computation base class.
ElementType * PointerType
Pointer return type.
Definition: DMatDMatMapExpr.h:211
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:350
IfTrue_< useAssign, const ResultType, const DMatDMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatDMatMapExpr.h:184
Header file for the RequiresEvaluation type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatDMatMapExpr.h:262
CompositeType_< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:119
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:1950
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:589
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDMatMapExpr.h:644
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
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:218
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:212
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatDMatMapExpr.h:308
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:71
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:523
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:226
OP Operation
Data type of the custom unary operation.
Definition: DMatDMatMapExpr.h:193
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:205
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#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:579
ElementType_< MT2 > ET2
Element type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:116
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:394
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
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:328
Header file for the IsLower type trait.
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:113
Header file for the IsAligned type trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatDMatMapExpr.h:296
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatDMatMapExpr.h:286
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatDMatMapExpr.h:209
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DMatDMatMapExpr.h:449
Constraints on the storage order of matrix types.
ConstIterator_< MT1 > LeftIteratorType
ConstIterator type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:223
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:429
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
decltype(auto) atan2(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the multi-valued inverse tangent of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1299
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:505
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDMatMapExpr.h:176
OP op_
The custom unary operation.
Definition: DMatDMatMapExpr.h:450
Header file for the binary map trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatDMatMapExpr.h:210
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:490
Generic wrapper for the pow() function.
Definition: Pow.h:62
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:187
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:190
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DMatDMatMapExpr.h:448
Expression object for the dense matrix-dense matrix map() function.The DMatDMatMapExpr class represen...
Definition: DMatDMatMapExpr.h:107
If_< RequiresEvaluation< MT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:196
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:339
ValueType value_type
Type of the underlying elements.
Definition: DMatDMatMapExpr.h:217
Header file for the Atan2 functor.
RightOperand rhs_
Right-hand side dense matrix of the map expression.
Definition: DMatDMatMapExpr.h:652
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:417
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:816
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:559
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:115
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatDMatMapExpr.h:549
Operation op_
The custom unary operation.
Definition: DMatDMatMapExpr.h:653
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:3080
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:219
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:361
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatDMatMapExpr.h:405
Header file for the MatMatMapExpr base class.
ConstIterator(LeftIteratorType left, RightIteratorType right, OP op)
Constructor for the ConstIterator class.
Definition: DMatDMatMapExpr.h:236
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:372
Generic wrapper for the hypot() function.
Definition: Hypot.h:62
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDMatMapExpr.h:611
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatDMatMapExpr.h:538
Compile time logical &#39;and&#39; evaluation.The And alias declaration performs at compile time a logical &#39;a...
Definition: And.h:76
Header file for the Max functor.
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:114
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:120
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatDMatMapExpr.h:249
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:117
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:383
System settings for the inline keywords.
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
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:624
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:1134
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatDMatMapExpr.h:274