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>
69 #include <blaze/system/Inline.h>
70 #include <blaze/util/Assert.h>
71 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/mpl/If.h>
75 #include <blaze/util/Types.h>
77 
78 
79 namespace blaze {
80 
81 //=================================================================================================
82 //
83 // CLASS DMATDMATMAPEXPR
84 //
85 //=================================================================================================
86 
87 //*************************************************************************************************
95 template< typename MT1 // Type of the left-hand side dense matrix
96  , typename MT2 // Type of the right-hand side dense matrix
97  , typename OP // Type of the custom operation
98  , bool SO > // Storage order
100  : public MatMatMapExpr< DenseMatrix< DMatDMatMapExpr<MT1,MT2,OP,SO>, SO > >
101  , private Computation
102 {
103  private:
104  //**Type definitions****************************************************************************
113  //**********************************************************************************************
114 
115  //**Serial evaluation strategy******************************************************************
117 
123  static constexpr bool useAssign = ( RequiresEvaluation_v<MT1> || RequiresEvaluation_v<MT2> );
124 
126  template< typename MT >
128  static constexpr bool UseAssign_v = useAssign;
130  //**********************************************************************************************
131 
132  //**Parallel evaluation strategy****************************************************************
134 
140  template< typename MT >
141  static constexpr bool UseSMPAssign_v =
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
154 
156  using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
157 
160 
162  using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
163 
165  using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
166 
168  using Operation = OP;
169 
172 
175  //**********************************************************************************************
176 
177  //**ConstIterator class definition**************************************************************
181  {
182  public:
183  //**Type definitions*************************************************************************
184  using IteratorCategory = std::random_access_iterator_tag;
189 
190  // STL iterator requirements
196 
199 
202  //*******************************************************************************************
203 
204  //**Constructor******************************************************************************
211  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right, OP op )
212  : left_ ( left ) // Iterator to the current left-hand side element
213  , right_( right ) // Iterator to the current right-hand side element
214  , op_ ( op ) // The custom unary operation
215  {}
216  //*******************************************************************************************
217 
218  //**Addition assignment operator*************************************************************
224  inline ConstIterator& operator+=( size_t inc ) {
225  left_ += inc;
226  right_ += inc;
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Subtraction assignment operator**********************************************************
237  inline ConstIterator& operator-=( size_t dec ) {
238  left_ -= dec;
239  right_ -= dec;
240  return *this;
241  }
242  //*******************************************************************************************
243 
244  //**Prefix increment operator****************************************************************
250  ++left_;
251  ++right_;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Postfix increment operator***************************************************************
261  inline const ConstIterator operator++( int ) {
262  return ConstIterator( left_++, right_++, op_ );
263  }
264  //*******************************************************************************************
265 
266  //**Prefix decrement operator****************************************************************
272  --left_;
273  --right_;
274  return *this;
275  }
276  //*******************************************************************************************
277 
278  //**Postfix decrement operator***************************************************************
283  inline const ConstIterator operator--( int ) {
284  return ConstIterator( left_--, right_--, op_ );
285  }
286  //*******************************************************************************************
287 
288  //**Element access operator******************************************************************
293  inline ReturnType operator*() const {
294  return op_( *left_, *right_ );
295  }
296  //*******************************************************************************************
297 
298  //**Load function****************************************************************************
303  inline auto load() const noexcept {
304  return op_.load( left_.load(), right_.load() );
305  }
306  //*******************************************************************************************
307 
308  //**Equality operator************************************************************************
314  inline bool operator==( const ConstIterator& rhs ) const {
315  return left_ == rhs.left_;
316  }
317  //*******************************************************************************************
318 
319  //**Inequality operator**********************************************************************
325  inline bool operator!=( const ConstIterator& rhs ) const {
326  return left_ != rhs.left_;
327  }
328  //*******************************************************************************************
329 
330  //**Less-than operator***********************************************************************
336  inline bool operator<( const ConstIterator& rhs ) const {
337  return left_ < rhs.left_;
338  }
339  //*******************************************************************************************
340 
341  //**Greater-than operator********************************************************************
347  inline bool operator>( const ConstIterator& rhs ) const {
348  return left_ > rhs.left_;
349  }
350  //*******************************************************************************************
351 
352  //**Less-or-equal-than operator**************************************************************
358  inline bool operator<=( const ConstIterator& rhs ) const {
359  return left_ <= rhs.left_;
360  }
361  //*******************************************************************************************
362 
363  //**Greater-or-equal-than operator***********************************************************
369  inline bool operator>=( const ConstIterator& rhs ) const {
370  return left_ >= rhs.left_;
371  }
372  //*******************************************************************************************
373 
374  //**Subtraction operator*********************************************************************
380  inline DifferenceType operator-( const ConstIterator& rhs ) const {
381  return left_ - rhs.left_;
382  }
383  //*******************************************************************************************
384 
385  //**Addition operator************************************************************************
392  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
393  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
394  }
395  //*******************************************************************************************
396 
397  //**Addition operator************************************************************************
404  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
405  return ConstIterator( it.left_ + inc, it.right_ + inc, it.op_ );
406  }
407  //*******************************************************************************************
408 
409  //**Subtraction operator*********************************************************************
416  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
417  return ConstIterator( it.left_ - dec, it.right_ - dec, it.op_ );
418  }
419  //*******************************************************************************************
420 
421  private:
422  //**Member variables*************************************************************************
425  OP op_;
426  //*******************************************************************************************
427  };
428  //**********************************************************************************************
429 
430  //**Compilation flags***************************************************************************
432  static constexpr bool simdEnabled =
433  ( MT1::simdEnabled && MT2::simdEnabled &&
434  If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET1,ET2>, HasLoad<OP> >::value );
435 
437  static constexpr bool smpAssignable = ( MT1::smpAssignable && MT2::smpAssignable );
438  //**********************************************************************************************
439 
440  //**SIMD properties*****************************************************************************
442  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
443  //**********************************************************************************************
444 
445  //**Constructor*********************************************************************************
452  explicit inline DMatDMatMapExpr( const MT1& lhs, const MT2& rhs, OP op ) noexcept
453  : lhs_( lhs ) // Left-hand side dense matrix of the map expression
454  , rhs_( rhs ) // Right-hand side dense matrix of the map expression
455  , op_ ( op ) // The custom unary operation
456  {}
457  //**********************************************************************************************
458 
459  //**Access operator*****************************************************************************
466  inline ReturnType operator()( size_t i, size_t j ) const {
467  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
468  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
469  return op_( lhs_(i,j), rhs_(i,j) );
470  }
471  //**********************************************************************************************
472 
473  //**At function*********************************************************************************
481  inline ReturnType at( size_t i, size_t j ) const {
482  if( i >= lhs_.rows() ) {
483  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
484  }
485  if( j >= lhs_.columns() ) {
486  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
487  }
488  return (*this)(i,j);
489  }
490  //**********************************************************************************************
491 
492  //**Load function*******************************************************************************
499  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
500  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
501  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
502  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
503  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
504  return op_.load( lhs_.load(i,j), rhs_.load(i,j) );
505  }
506  //**********************************************************************************************
507 
508  //**Begin function******************************************************************************
514  inline ConstIterator begin( size_t i ) const {
515  return ConstIterator( lhs_.begin(i), rhs_.begin(i), op_ );
516  }
517  //**********************************************************************************************
518 
519  //**End function********************************************************************************
525  inline ConstIterator end( size_t i ) const {
526  return ConstIterator( lhs_.end(i), rhs_.end(i), op_ );
527  }
528  //**********************************************************************************************
529 
530  //**Rows function*******************************************************************************
535  inline size_t rows() const noexcept {
536  return lhs_.rows();
537  }
538  //**********************************************************************************************
539 
540  //**Columns function****************************************************************************
545  inline size_t columns() const noexcept {
546  return lhs_.columns();
547  }
548  //**********************************************************************************************
549 
550  //**Left operand access*************************************************************************
555  inline LeftOperand leftOperand() const noexcept {
556  return lhs_;
557  }
558  //**********************************************************************************************
559 
560  //**Right operand access************************************************************************
565  inline RightOperand rightOperand() const noexcept {
566  return rhs_;
567  }
568  //**********************************************************************************************
569 
570  //**Operation access****************************************************************************
575  inline Operation operation() const {
576  return op_;
577  }
578  //**********************************************************************************************
579 
580  //**********************************************************************************************
586  template< typename T >
587  inline bool canAlias( const T* alias ) const noexcept {
588  return ( IsExpression_v<MT1> && lhs_.canAlias( alias ) ) ||
589  ( IsExpression_v<MT2> && rhs_.canAlias( alias ) );
590  }
591  //**********************************************************************************************
592 
593  //**********************************************************************************************
599  template< typename T >
600  inline bool isAliased( const T* alias ) const noexcept {
601  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
602  }
603  //**********************************************************************************************
604 
605  //**********************************************************************************************
610  inline bool isAligned() const noexcept {
611  return lhs_.isAligned() && rhs_.isAligned();
612  }
613  //**********************************************************************************************
614 
615  //**********************************************************************************************
620  inline bool canSMPAssign() const noexcept {
621  return lhs_.canSMPAssign() && rhs_.canSMPAssign();
622  }
623  //**********************************************************************************************
624 
625  private:
626  //**Member variables****************************************************************************
630  //**********************************************************************************************
631 
632  //**Assignment to dense matrices****************************************************************
646  template< typename MT // Type of the target dense matrix
647  , bool SO2 > // Storage order of the target dense matrix
648  friend inline auto assign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
650  {
652 
653  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
654  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
655 
656  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
657  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
658 
659  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
660  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
661  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
662  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
663  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
664  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
665 
666  assign( ~lhs, map( A, B, rhs.op_ ) );
667  }
669  //**********************************************************************************************
670 
671  //**Assignment to sparse matrices***************************************************************
685  template< typename MT // Type of the target sparse matrix
686  , bool SO2 > // Storage order of the target sparse matrix
687  friend inline auto assign( SparseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
689  {
691 
693 
700 
701  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
702  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
703 
704  const TmpType tmp( serial( rhs ) );
705  assign( ~lhs, tmp );
706  }
708  //**********************************************************************************************
709 
710  //**Addition assignment to dense matrices*******************************************************
724  template< typename MT // Type of the target dense matrix
725  , bool SO2 > // Storage order of the target dense matrix
726  friend inline auto addAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
727  -> EnableIf_t< UseAssign_v<MT> >
728  {
730 
731  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
732  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
733 
734  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
735  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
736 
737  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
738  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
739  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
740  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
741  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
742  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
743 
744  addAssign( ~lhs, map( A, B, rhs.op_ ) );
745  }
747  //**********************************************************************************************
748 
749  //**Addition assignment to sparse matrices******************************************************
750  // No special implementation for the addition assignment to sparse matrices.
751  //**********************************************************************************************
752 
753  //**Subtraction assignment to dense matrices****************************************************
767  template< typename MT // Type of the target dense matrix
768  , bool SO2 > // Storage order of the target dense matrix
769  friend inline auto subAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
770  -> EnableIf_t< UseAssign_v<MT> >
771  {
773 
774  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
775  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
776 
777  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
778  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
779 
780  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
781  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
782  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
783  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
784  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
785  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
786 
787  subAssign( ~lhs, map( A, B, rhs.op_ ) );
788  }
790  //**********************************************************************************************
791 
792  //**Subtraction assignment to sparse matrices***************************************************
793  // No special implementation for the subtraction assignment to sparse matrices.
794  //**********************************************************************************************
795 
796  //**Schur product assignment to dense matrices**************************************************
810  template< typename MT // Type of the target dense matrix
811  , bool SO2 > // Storage order of the target dense matrix
812  friend inline auto schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
813  -> EnableIf_t< UseAssign_v<MT> >
814  {
816 
817  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
818  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
819 
820  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
821  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
822 
823  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
824  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
825  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
826  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
827  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
828  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
829 
830  schurAssign( ~lhs, map( A, B, rhs.op_ ) );
831  }
833  //**********************************************************************************************
834 
835  //**Schur product assignment to sparse matrices*************************************************
836  // No special implementation for the Schur product assignment to sparse matrices.
837  //**********************************************************************************************
838 
839  //**Multiplication assignment to dense matrices*************************************************
840  // No special implementation for the multiplication assignment to dense matrices.
841  //**********************************************************************************************
842 
843  //**Multiplication assignment to sparse matrices************************************************
844  // No special implementation for the multiplication assignment to sparse matrices.
845  //**********************************************************************************************
846 
847  //**SMP assignment to dense matrices************************************************************
861  template< typename MT // Type of the target dense matrix
862  , bool SO2 > // Storage order of the target dense matrix
863  friend inline auto smpAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
864  -> EnableIf_t< UseSMPAssign_v<MT> >
865  {
867 
868  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
869  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
870 
871  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
872  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
873 
874  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
875  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
876  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
877  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
878  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
879  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
880 
881  smpAssign( ~lhs, map( A, B, rhs.op_ ) );
882  }
884  //**********************************************************************************************
885 
886  //**SMP assignment to sparse matrices***********************************************************
900  template< typename MT // Type of the target sparse matrix
901  , bool SO2 > // Storage order of the target sparse matrix
902  friend inline auto smpAssign( SparseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
903  -> EnableIf_t< UseSMPAssign_v<MT> >
904  {
906 
907  using TmpType = If_t< SO == SO2, ResultType, OppositeType >;
908 
915 
916  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
917  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
918 
919  const TmpType tmp( rhs );
920  smpAssign( ~lhs, tmp );
921  }
923  //**********************************************************************************************
924 
925  //**SMP addition assignment to dense matrices***************************************************
940  template< typename MT // Type of the target dense matrix
941  , bool SO2 > // Storage order of the target dense matrix
942  friend inline auto smpAddAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
943  -> EnableIf_t< UseSMPAssign_v<MT> >
944  {
946 
947  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
948  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
949 
950  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
951  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
952 
953  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
954  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
955  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
956  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
957  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
958  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
959 
960  smpAddAssign( ~lhs, map( A, B, rhs.op_ ) );
961  }
963  //**********************************************************************************************
964 
965  //**SMP addition assignment to sparse matrices**************************************************
966  // No special implementation for the SMP addition assignment to sparse matrices.
967  //**********************************************************************************************
968 
969  //**SMP subtraction assignment to dense matrices************************************************
984  template< typename MT // Type of the target dense matrix
985  , bool SO2 > // Storage order of the target dense matrix
986  friend inline auto smpSubAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
987  -> EnableIf_t< UseSMPAssign_v<MT> >
988  {
990 
991  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
992  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
993 
994  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
995  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
996 
997  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
998  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
999  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1000  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1001  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1002  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1003 
1004  smpSubAssign( ~lhs, map( A, B, rhs.op_ ) );
1005  }
1007  //**********************************************************************************************
1008 
1009  //**SMP subtraction assignment to sparse matrices***********************************************
1010  // No special implementation for the SMP subtraction assignment to sparse matrices.
1011  //**********************************************************************************************
1012 
1013  //**SMP Schur product assignment to dense matrices**********************************************
1028  template< typename MT // Type of the target dense matrix
1029  , bool SO2 > // Storage order of the target dense matrix
1030  friend inline auto smpSchurAssign( DenseMatrix<MT,SO2>& lhs, const DMatDMatMapExpr& rhs )
1031  -> EnableIf_t< UseSMPAssign_v<MT> >
1032  {
1034 
1035  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1036  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1037 
1038  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1039  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
1040 
1041  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1042  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1043  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1044  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1045  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1046  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1047 
1048  smpSchurAssign( ~lhs, map( A, B, rhs.op_ ) );
1049  }
1051  //**********************************************************************************************
1052 
1053  //**SMP Schur product assignment to sparse matrices*********************************************
1054  // No special implementation for the SMP Schur product assignment to sparse matrices.
1055  //**********************************************************************************************
1056 
1057  //**SMP multiplication assignment to dense matrices*********************************************
1058  // No special implementation for the SMP multiplication assignment to dense matrices.
1059  //**********************************************************************************************
1060 
1061  //**SMP multiplication assignment to sparse matrices********************************************
1062  // No special implementation for the SMP multiplication assignment to sparse matrices.
1063  //**********************************************************************************************
1064 
1065  //**Compile time checks*************************************************************************
1071  //**********************************************************************************************
1072 };
1073 //*************************************************************************************************
1074 
1075 
1076 
1077 
1078 //=================================================================================================
1079 //
1080 // GLOBAL FUNCTIONS
1081 //
1082 //=================================================================================================
1083 
1084 //*************************************************************************************************
1105 template< typename MT1 // Type of the left-hand side dense matrix
1106  , typename MT2 // Type of the right-hand side dense matrix
1107  , bool SO // Storage order
1108  , typename OP > // Type of the custom operation
1109 inline decltype(auto)
1110  map( const DenseMatrix<MT1,SO>& lhs, const DenseMatrix<MT2,SO>& rhs, OP op )
1111 {
1113 
1114  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1115  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1116  }
1117 
1119  return ReturnType( ~lhs, ~rhs, op );
1120 }
1121 //*************************************************************************************************
1122 
1123 
1124 //*************************************************************************************************
1142 template< typename MT1 // Type of the left-hand side dense matrix
1143  , bool SO1 // Storage order of the left-hand side dense matrix
1144  , typename MT2 // Type of the right-hand side dense matrix
1145  , bool SO2 > // Storage order of the right-hand side dense matrix
1146 inline decltype(auto)
1147  min( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1148 {
1150 
1151  return map( ~lhs, ~rhs, Min() );
1152 }
1153 //*************************************************************************************************
1154 
1155 
1156 //*************************************************************************************************
1174 template< typename MT1 // Type of the left-hand side dense matrix
1175  , bool SO1 // Storage order of the left-hand side dense matrix
1176  , typename MT2 // Type of the right-hand side dense matrix
1177  , bool SO2 > // Storage order of the right-hand side dense matrix
1178 inline decltype(auto)
1179  max( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1180 {
1182 
1183  return map( ~lhs, ~rhs, Max() );
1184 }
1185 //*************************************************************************************************
1186 
1187 
1188 //*************************************************************************************************
1206 template< typename MT1 // Type of the left-hand side dense matrix
1207  , bool SO1 // Storage order of the left-hand side dense matrix
1208  , typename MT2 // Type of the right-hand side dense matrix
1209  , bool SO2 > // Storage order of the right-hand side dense matrix
1210 inline decltype(auto)
1211  hypot( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1212 {
1214 
1215  return map( ~lhs, ~rhs, Hypot() );
1216 }
1217 //*************************************************************************************************
1218 
1219 
1220 //*************************************************************************************************
1238 template< typename MT1 // Type of the left-hand side dense matrix
1239  , bool SO1 // Storage order of the left-hand side dense matrix
1240  , typename MT2 // Type of the right-hand side dense matrix
1241  , bool SO2 > // Storage order of the right-hand side dense matrix
1242 inline decltype(auto)
1243  pow( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1244 {
1246 
1247  return map( ~lhs, ~rhs, Pow() );
1248 }
1249 //*************************************************************************************************
1250 
1251 
1252 //*************************************************************************************************
1270 template< typename MT1 // Type of the left-hand side dense matrix
1271  , bool SO1 // Storage order of the left-hand side dense matrix
1272  , typename MT2 // Type of the right-hand side dense matrix
1273  , bool SO2 > // Storage order of the right-hand side dense matrix
1274 inline decltype(auto)
1275  atan2( const DenseMatrix<MT1,SO1>& lhs, const DenseMatrix<MT2,SO2>& rhs )
1276 {
1278 
1279  return map( ~lhs, ~rhs, Atan2() );
1280 }
1281 //*************************************************************************************************
1282 
1283 
1284 
1285 
1286 //=================================================================================================
1287 //
1288 // ISALIGNED SPECIALIZATIONS
1289 //
1290 //=================================================================================================
1291 
1292 //*************************************************************************************************
1294 template< typename MT1, typename MT2, typename OP, bool SO >
1295 struct IsAligned< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1296  : public BoolConstant< IsAligned_v<MT1> && IsAligned_v<MT2> >
1297 {};
1299 //*************************************************************************************************
1300 
1301 
1302 
1303 
1304 //=================================================================================================
1305 //
1306 // ISPADDED SPECIALIZATIONS
1307 //
1308 //=================================================================================================
1309 
1310 //*************************************************************************************************
1312 template< typename MT1, typename MT2, typename OP, bool SO >
1313 struct IsPadded< DMatDMatMapExpr<MT1,MT2,OP,SO> >
1314  : public BoolConstant< IsPadded_v<MT1> && IsPadded_v<MT2> && IsPaddingEnabled_v<OP> >
1315 {};
1317 //*************************************************************************************************
1318 
1319 } // namespace blaze
1320 
1321 #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
Header file for the IsPaddingEnabled type trait.
Pointer difference type of the Blaze library.
IteratorCategory iterator_category
The iterator category.
Definition: DMatDMatMapExpr.h:191
Header file for auxiliary alias declarations.
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDMatMapExpr.h:432
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:452
Header file for the HasLoad type trait.
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:1211
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
Operation operation() const
Returns a copy of the custom operation.
Definition: DMatDMatMapExpr.h:575
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:105
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDMatMapExpr.h:545
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
decltype(std::declval< OP >()(std::declval< RN1 >(), std::declval< RN2 >())) ReturnType
Return type for expression template evaluations.
Definition: DMatDMatMapExpr.h:156
Header file for the Hypot functor.
Header file for the serial shim.
Generic wrapper for the atan2() function.
Definition: Atan2.h:75
#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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:224
If_t< useAssign, const ResultType, const DMatDMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatDMatMapExpr.h:159
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.The MapTrait_t alias declaration provides...
Definition: MapTrait.h:160
#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
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatDMatMapExpr.h:153
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatDMatMapExpr.h:416
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:1243
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDMatMapExpr.h:610
LeftOperand lhs_
Left-hand side dense matrix of the map expression.
Definition: DMatDMatMapExpr.h:627
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatDMatMapExpr.h:293
Header file for the Computation base class.
ElementType * PointerType
Pointer return type.
Definition: DMatDMatMapExpr.h:186
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:325
ResultType_t< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:106
Header file for the RequiresEvaluation type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatDMatMapExpr.h:237
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:565
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDMatMapExpr.h:620
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:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
PointerType pointer
Pointer return type.
Definition: DMatDMatMapExpr.h:193
ElementType & ReferenceType
Reference return type.
Definition: DMatDMatMapExpr.h:187
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatDMatMapExpr.h:283
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDMatMapExpr.h:499
ReturnType_t< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:110
OP Operation
Data type of the custom unary operation.
Definition: DMatDMatMapExpr.h:168
ConstIterator_t< MT2 > RightIteratorType
ConstIterator type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:201
Iterator over the elements of the dense matrix map expression.
Definition: DMatDMatMapExpr.h:180
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 the If class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:555
CompositeType_t< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:111
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1147
#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:369
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
Header file for all SIMD functionality.
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDMatMapExpr.h:303
Header file for the IsAligned type trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatDMatMapExpr.h:271
ConstIterator_t< MT1 > LeftIteratorType
ConstIterator type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:198
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatDMatMapExpr.h:261
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatDMatMapExpr.h:184
If_t< RequiresEvaluation_v< MT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:174
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDMatMapExpr.h:442
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DMatDMatMapExpr.h:424
Constraints on the storage order of matrix types.
If_t< IsExpression_v< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:165
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:404
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1179
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:1275
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 IsPadded type trait.
ReturnType_t< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:109
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDMatMapExpr.h:481
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDMatMapExpr.h:437
OP op_
The custom unary operation.
Definition: DMatDMatMapExpr.h:425
Header file for the IsSIMDEnabled type trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatDMatMapExpr.h:185
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
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:466
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
MapTrait_t< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DMatDMatMapExpr.h:150
Generic wrapper for the pow() function.
Definition: Pow.h:62
Generic wrapper for the max() function.
Definition: Max.h:79
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DMatDMatMapExpr.h:423
Expression object for the dense matrix-dense matrix map() function.The DMatDMatMapExpr class represen...
Definition: DMatDMatMapExpr.h:99
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:314
ValueType value_type
Type of the underlying elements.
Definition: DMatDMatMapExpr.h:192
Header file for the Atan2 functor.
ElementType_t< MT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:107
RightOperand rhs_
Right-hand side dense matrix of the map expression.
Definition: DMatDMatMapExpr.h:628
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#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:392
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the map expression.
Definition: DMatDMatMapExpr.h:123
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
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
CompositeType_t< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:112
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDMatMapExpr.h:535
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
#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
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatDMatMapExpr.h:525
Operation op_
The custom unary operation.
Definition: DMatDMatMapExpr.h:629
Generic wrapper for the min() function.
Definition: Min.h:79
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.The ConstIterator_t alias declaration pro...
Definition: Aliases.h:110
Header file for the Min functor.
If_t< IsExpression_v< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:162
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDMatMapExpr.h:152
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDMatMapExpr.h:151
ReferenceType reference
Reference return type.
Definition: DMatDMatMapExpr.h:194
ElementType_t< MT2 > ET2
Element type of the right-hand side dense matrix expression.
Definition: DMatDMatMapExpr.h:108
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:336
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatDMatMapExpr.h:380
Header file for the MatMatMapExpr base class.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
ConstIterator(LeftIteratorType left, RightIteratorType right, OP op)
Constructor for the ConstIterator class.
Definition: DMatDMatMapExpr.h:211
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:347
Generic wrapper for the hypot() function.
Definition: Hypot.h:75
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDMatMapExpr.h:587
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatDMatMapExpr.h:514
Header file for the IntegralConstant class template.
Header file for the map trait.
Header file for the Max functor.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatDMatMapExpr.h:224
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatDMatMapExpr.h:358
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
If_t< RequiresEvaluation_v< MT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatDMatMapExpr.h:171
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDMatMapExpr.h:600
Header file for the IsExpression type trait class.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatDMatMapExpr.h:188
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:1110
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatDMatMapExpr.h:249