DMatTDMatMapExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTDMATMAPEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTDMATMAPEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
58 #include <blaze/math/SIMD.h>
73 #include <blaze/system/Blocking.h>
74 #include <blaze/system/Inline.h>
75 #include <blaze/util/Assert.h>
76 #include <blaze/util/DisableIf.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/mpl/Not.h>
83 #include <blaze/util/Types.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS DMATTDMATMAPEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
102 template< typename MT1 // Type of the left-hand side dense matrix
103  , typename MT2 // Type of the right-hand side dense matrix
104  , typename OP > // Type of the custom operation
106  : public MatMatMapExpr< DenseMatrix< DMatTDMatMapExpr<MT1,MT2,OP>, false > >
107  , private Computation
108 {
109  private:
110  //**Type definitions****************************************************************************
119  //**********************************************************************************************
120 
121  //**Serial evaluation strategy******************************************************************
123 
129  enum : bool { useAssign = ( RequiresEvaluation<MT1>::value || RequiresEvaluation<MT2>::value ) };
130 
132  template< typename MT >
134  struct UseAssign {
135  enum : bool { value = useAssign };
136  };
138  //**********************************************************************************************
139 
140  //**Parallel evaluation strategy****************************************************************
142 
148  template< typename MT >
149  struct UseSMPAssign {
150  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) && useAssign };
151  };
153  //**********************************************************************************************
154 
155  public:
156  //**Type definitions****************************************************************************
162 
164  using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
165 
168 
170  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
171 
173  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
174 
176  using Operation = OP;
177 
180 
183  //**********************************************************************************************
184 
185  //**Compilation flags***************************************************************************
187  enum : bool { simdEnabled = false };
188 
190  enum : bool { smpAssignable = MT1::smpAssignable && MT2::smpAssignable };
191  //**********************************************************************************************
192 
193  //**Constructor*********************************************************************************
200  explicit inline DMatTDMatMapExpr( const MT1& lhs, const MT2& rhs, OP op ) noexcept
201  : lhs_( lhs ) // Left-hand side dense matrix of the map expression
202  , rhs_( rhs ) // Right-hand side dense matrix of the map expression
203  , op_ ( op ) // The custom unary operation
204  {}
205  //**********************************************************************************************
206 
207  //**Access operator*****************************************************************************
214  inline ReturnType operator()( size_t i, size_t j ) const {
215  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
216  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
217  return op_( lhs_(i,j), rhs_(i,j) );
218  }
219  //**********************************************************************************************
220 
221  //**At function*********************************************************************************
229  inline ReturnType at( size_t i, size_t j ) const {
230  if( i >= lhs_.rows() ) {
231  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
232  }
233  if( j >= lhs_.columns() ) {
234  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
235  }
236  return (*this)(i,j);
237  }
238  //**********************************************************************************************
239 
240  //**Rows function*******************************************************************************
245  inline size_t rows() const noexcept {
246  return lhs_.rows();
247  }
248  //**********************************************************************************************
249 
250  //**Columns function****************************************************************************
255  inline size_t columns() const noexcept {
256  return lhs_.columns();
257  }
258  //**********************************************************************************************
259 
260  //**Left operand access*************************************************************************
265  inline LeftOperand leftOperand() const noexcept {
266  return lhs_;
267  }
268  //**********************************************************************************************
269 
270  //**Right operand access************************************************************************
275  inline RightOperand rightOperand() const noexcept {
276  return rhs_;
277  }
278  //**********************************************************************************************
279 
280  //**Operation access****************************************************************************
285  inline Operation operation() const {
286  return op_;
287  }
288  //**********************************************************************************************
289 
290  //**********************************************************************************************
296  template< typename T >
297  inline bool canAlias( const T* alias ) const noexcept {
298  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
299  ( IsExpression<MT2>::value && rhs_.canAlias( alias ) );
300  }
301  //**********************************************************************************************
302 
303  //**********************************************************************************************
309  template< typename T >
310  inline bool isAliased( const T* alias ) const noexcept {
311  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
312  }
313  //**********************************************************************************************
314 
315  //**********************************************************************************************
320  inline bool isAligned() const noexcept {
321  return lhs_.isAligned() && rhs_.isAligned();
322  }
323  //**********************************************************************************************
324 
325  //**********************************************************************************************
330  inline bool canSMPAssign() const noexcept {
331  return lhs_.canSMPAssign() && rhs_.canSMPAssign();
332  }
333  //**********************************************************************************************
334 
335  private:
336  //**Member variables****************************************************************************
340  //**********************************************************************************************
341 
342  //**Assignment to dense matrices****************************************************************
356  template< typename MT // Type of the target dense matrix
357  , bool SO > // Storage order of the target dense matrix
358  friend inline DisableIf_< UseAssign<MT> >
359  assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
360  {
362 
363  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
364  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
365 
366  constexpr size_t block( BLOCK_SIZE );
367 
368  const size_t m( rhs.rows() );
369  const size_t n( rhs.columns() );
370 
371  for( size_t ii=0UL; ii<m; ii+=block ) {
372  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
373  for( size_t jj=0UL; jj<n; jj+=block ) {
374  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
375  for( size_t i=ii; i<iend; ++i ) {
376  for( size_t j=jj; j<jend; ++j ) {
377  (~lhs)(i,j) = rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
378  }
379  }
380  }
381  }
382  }
384  //**********************************************************************************************
385 
386  //**Assignment to dense matrices****************************************************************
400  template< typename MT // Type of the target dense matrix
401  , bool SO > // Storage order of the target dense matrix
402  friend inline EnableIf_< UseAssign<MT> >
403  assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
404  {
406 
407  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
408  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
409 
410  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
411  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
412 
413  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
414  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
415  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
416  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
417  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
418  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
419 
420  assign( ~lhs, map( A, B, rhs.op_ ) );
421  }
423  //**********************************************************************************************
424 
425  //**Assignment to sparse matrices***************************************************************
439  template< typename MT // Type of the target sparse matrix
440  , bool SO > // Storage order of the target sparse matrix
441  friend inline EnableIf_< UseAssign<MT> >
442  assign( SparseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
443  {
445 
447 
454 
455  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
456  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
457 
458  const TmpType tmp( serial( rhs ) );
459  assign( ~lhs, tmp );
460  }
462  //**********************************************************************************************
463 
464  //**Addition assignment to dense matrices*******************************************************
478  template< typename MT // Type of the target dense matrix
479  , bool SO > // Storage order of the target dense matrix
480  friend inline DisableIf_< UseAssign<MT> >
481  addAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
482  {
484 
485  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
486  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
487 
488  constexpr size_t block( BLOCK_SIZE );
489 
490  const size_t m( rhs.rows() );
491  const size_t n( rhs.columns() );
492 
493  for( size_t ii=0UL; ii<m; ii+=block ) {
494  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
495  for( size_t jj=0UL; jj<n; jj+=block ) {
496  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
497  for( size_t i=ii; i<iend; ++i ) {
498  for( size_t j=jj; j<jend; ++j ) {
499  (~lhs)(i,j) += rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
500  }
501  }
502  }
503  }
504  }
506  //**********************************************************************************************
507 
508  //**Addition assignment to dense matrices*******************************************************
522  template< typename MT // Type of the target dense matrix
523  , bool SO > // Storage order of the target dense matrix
524  friend inline EnableIf_< UseAssign<MT> >
525  addAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
526  {
528 
529  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
530  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
531 
532  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
533  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
534 
535  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
536  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
537  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
538  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
539  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
540  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
541 
542  addAssign( ~lhs, map( A, B, rhs.op_ ) );
543  }
545  //**********************************************************************************************
546 
547  //**Addition assignment to sparse matrices******************************************************
548  // No special implementation for the addition assignment to sparse matrices.
549  //**********************************************************************************************
550 
551  //**Subtraction assignment to dense matrices****************************************************
565  template< typename MT // Type of the target dense matrix
566  , bool SO > // Storage order of the target dense matrix
567  friend inline DisableIf_< UseAssign<MT> >
568  subAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
569  {
571 
572  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
573  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
574 
575  constexpr size_t block( BLOCK_SIZE );
576 
577  const size_t m( rhs.rows() );
578  const size_t n( rhs.columns() );
579 
580  for( size_t ii=0UL; ii<m; ii+=block ) {
581  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
582  for( size_t jj=0UL; jj<n; jj+=block ) {
583  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
584  for( size_t i=ii; i<iend; ++i ) {
585  for( size_t j=jj; j<jend; ++j ) {
586  (~lhs)(i,j) -= rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
587  }
588  }
589  }
590  }
591  }
593  //**********************************************************************************************
594 
595  //**Subtraction assignment to dense matrices****************************************************
609  template< typename MT // Type of the target dense matrix
610  , bool SO > // Storage order of the target dense matrix
611  friend inline EnableIf_< UseAssign<MT> >
612  subAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
613  {
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
617  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
618 
619  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
620  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
621 
622  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
623  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
624  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
625  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
626  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
627  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
628 
629  subAssign( ~lhs, map( A, B, rhs.op_ ) );
630  }
632  //**********************************************************************************************
633 
634  //**Subtraction assignment to sparse matrices***************************************************
635  // No special implementation for the subtraction assignment to sparse matrices.
636  //**********************************************************************************************
637 
638  //**Schur product assignment to dense matrices**************************************************
652  template< typename MT // Type of the target dense matrix
653  , bool SO > // Storage order of the target dense matrix
654  friend inline DisableIf_< UseAssign<MT> >
655  schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
656  {
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
660  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
661 
662  constexpr size_t block( BLOCK_SIZE );
663 
664  const size_t m( rhs.rows() );
665  const size_t n( rhs.columns() );
666 
667  for( size_t ii=0UL; ii<m; ii+=block ) {
668  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
669  for( size_t jj=0UL; jj<n; jj+=block ) {
670  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
671  for( size_t i=ii; i<iend; ++i ) {
672  for( size_t j=jj; j<jend; ++j ) {
673  (~lhs)(i,j) *= rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
674  }
675  }
676  }
677  }
678  }
680  //**********************************************************************************************
681 
682  //**Schur product assignment to dense matrices**************************************************
696  template< typename MT // Type of the target dense matrix
697  , bool SO > // Storage order of the target dense matrix
698  friend inline EnableIf_< UseAssign<MT> >
699  schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
700  {
702 
703  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
704  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
705 
706  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
707  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
708 
709  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
710  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
711  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
712  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
713  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
714  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
715 
716  schurAssign( ~lhs, map( A, B, rhs.op_ ) );
717  }
719  //**********************************************************************************************
720 
721  //**Schur product assignment to sparse matrices*************************************************
722  // No special implementation for the Schur product assignment to sparse matrices.
723  //**********************************************************************************************
724 
725  //**Multiplication assignment to dense matrices*************************************************
726  // No special implementation for the multiplication assignment to dense matrices.
727  //**********************************************************************************************
728 
729  //**Multiplication assignment to sparse matrices************************************************
730  // No special implementation for the multiplication assignment to sparse matrices.
731  //**********************************************************************************************
732 
733  //**SMP assignment to dense matrices************************************************************
747  template< typename MT // Type of the target dense matrix
748  , bool SO > // Storage order of the target dense matrix
749  friend inline EnableIf_< UseSMPAssign<MT> >
750  smpAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
751  {
753 
754  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
755  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
756 
757  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
758  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
759 
760  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
761  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
762  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
763  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
764  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
766 
767  smpAssign( ~lhs, map( A, B, rhs.op_ ) );
768  }
770  //**********************************************************************************************
771 
772  //**SMP assignment to sparse matrices***********************************************************
786  template< typename MT // Type of the target sparse matrix
787  , bool SO > // Storage order of the target sparse matrix
788  friend inline EnableIf_< UseSMPAssign<MT> >
790  {
792 
794 
801 
802  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
803  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
804 
805  const TmpType tmp( rhs );
806  smpAssign( ~lhs, tmp );
807  }
809  //**********************************************************************************************
810 
811  //**SMP addition assignment to dense matrices***************************************************
826  template< typename MT // Type of the target dense matrix
827  , bool SO > // Storage order of the target dense matrix
828  friend inline EnableIf_< UseSMPAssign<MT> >
830  {
832 
833  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
834  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
835 
836  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
837  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
838 
839  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
840  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
841  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
842  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
843  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
844  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
845 
846  smpAddAssign( ~lhs, map( A, B, rhs.op_ ) );
847  }
849  //**********************************************************************************************
850 
851  //**SMP addition assignment to sparse matrices**************************************************
852  // No special implementation for the SMP addition assignment to sparse matrices.
853  //**********************************************************************************************
854 
855  //**SMP subtraction assignment to dense matrices************************************************
870  template< typename MT // Type of the target dense matrix
871  , bool SO > // Storage order of the target dense matrix
872  friend inline EnableIf_< UseSMPAssign<MT> >
874  {
876 
877  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
878  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
879 
880  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
881  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
882 
883  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
884  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
885  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
886  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
887  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
888  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
889 
890  smpSubAssign( ~lhs, map( A, B, rhs.op_ ) );
891  }
893  //**********************************************************************************************
894 
895  //**SMP subtraction assignment to sparse matrices***********************************************
896  // No special implementation for the SMP subtraction assignment to sparse matrices.
897  //**********************************************************************************************
898 
899  //**SMP Schur product assignment to dense matrices**********************************************
914  template< typename MT // Type of the target dense matrix
915  , bool SO > // Storage order of the target dense matrix
916  friend inline EnableIf_< UseSMPAssign<MT> >
918  {
920 
921  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
922  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
923 
924  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
925  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
926 
927  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
928  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
929  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
930  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
931  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
932  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
933 
934  smpSchurAssign( ~lhs, map( A, B, rhs.op_ ) );
935  }
937  //**********************************************************************************************
938 
939  //**SMP Schur product assignment to sparse matrices*********************************************
940  // No special implementation for the SMP Schur product assignment to sparse matrices.
941  //**********************************************************************************************
942 
943  //**SMP multiplication assignment to dense matrices*********************************************
944  // No special implementation for the SMP multiplication assignment to dense matrices.
945  //**********************************************************************************************
946 
947  //**SMP multiplication assignment to sparse matrices********************************************
948  // No special implementation for the SMP multiplication assignment to sparse matrices.
949  //**********************************************************************************************
950 
951  //**Compile time checks*************************************************************************
957  //**********************************************************************************************
958 };
959 //*************************************************************************************************
960 
961 
962 
963 
964 //=================================================================================================
965 //
966 // GLOBAL FUNCTIONS
967 //
968 //=================================================================================================
969 
970 //*************************************************************************************************
984 template< typename MT1 // Type of the left-hand side dense matrix
985  , typename MT2 // Type of the right-hand side dense matrix
986  , typename OP > // Type of the custom operation
987 inline const DMatTDMatMapExpr<MT1,MT2,OP>
988  map_backend( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op,
989  EnableIf_< And< Not< IsSymmetric<MT1> >, Not< IsSymmetric<MT2> > > >* = nullptr )
990 {
992 
993  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
994  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
995 
996  return DMatTDMatMapExpr<MT1,MT2,OP>( ~lhs, ~rhs, op );
997 }
999 //*************************************************************************************************
1000 
1001 
1002 //*************************************************************************************************
1016 template< typename MT1 // Type of the left-hand side dense matrix
1017  , typename MT2 // Type of the right-hand side dense matrix
1018  , typename OP > // Type of the custom operation
1019 inline decltype(auto)
1020  map_backend( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op,
1021  EnableIf_< And< IsSymmetric<MT1>, Not< IsSymmetric<MT2> > > >* = nullptr )
1022 {
1024 
1025  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1026  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1027 
1028  return map( trans( ~lhs ), ~rhs, op );
1029 }
1031 //*************************************************************************************************
1032 
1033 
1034 //*************************************************************************************************
1049 template< typename MT1 // Type of the left-hand side dense matrix
1050  , typename MT2 // Type of the right-hand side dense matrix
1051  , typename OP > // Type of the custom operation
1052 inline decltype(auto)
1053  map_backend( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op,
1054  EnableIf_< IsSymmetric<MT2> >* = nullptr )
1055 {
1057 
1058  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1059  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1060 
1061  return map( ~lhs, trans( ~rhs ), op );
1062 }
1064 //*************************************************************************************************
1065 
1066 
1067 //*************************************************************************************************
1092 template< typename MT1 // Type of the left-hand side dense matrix
1093  , typename MT2 // Type of the right-hand side dense matrix
1094  , typename OP > // Type of the custom operation
1095 inline decltype(auto)
1096  map( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op )
1097 {
1099 
1100  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1101  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1102  }
1103 
1104  return map_backend( ~lhs, ~rhs, op );
1105 }
1106 //*************************************************************************************************
1107 
1108 
1109 //*************************************************************************************************
1123 template< typename MT1 // Type of the left-hand side dense matrix
1124  , typename MT2 // Type of the right-hand side dense matrix
1125  , typename OP > // Type of the custom operation
1126 inline const DMatTDMatMapExpr<MT1,MT2,OP>
1127  map_backend( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op,
1128  EnableIf_< And< Not< IsSymmetric<MT1> >, Not< IsSymmetric<MT2> > > >* = nullptr )
1129 {
1131 
1132  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1133  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1134 
1135  return DMatTDMatMapExpr<MT1,MT2,OP>( ~lhs, ~rhs, op );
1136 }
1138 //*************************************************************************************************
1139 
1140 
1141 //*************************************************************************************************
1155 template< typename MT1 // Type of the left-hand side dense matrix
1156  , typename MT2 // Type of the right-hand side dense matrix
1157  , typename OP > // Type of the custom operation
1158 inline decltype(auto)
1159  map_backend( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op,
1160  EnableIf_< And< Not< IsSymmetric<MT1> >, IsSymmetric<MT2> > >* = nullptr )
1161 {
1163 
1164  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1165  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1166 
1167  return map( ~lhs, trans( ~rhs ), op );
1168 }
1170 //*************************************************************************************************
1171 
1172 
1173 //*************************************************************************************************
1188 template< typename MT1 // Type of the left-hand side dense matrix
1189  , typename MT2 // Type of the right-hand side dense matrix
1190  , typename OP > // Type of the custom operation
1191 inline decltype(auto)
1192  map_backend( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op,
1193  EnableIf_< IsSymmetric<MT1> >* = nullptr )
1194 {
1196 
1197  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1198  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1199 
1200  return map( trans( ~lhs ), ~rhs, op );
1201 }
1203 //*************************************************************************************************
1204 
1205 
1206 //*************************************************************************************************
1231 template< typename MT1 // Type of the left-hand side dense matrix
1232  , typename MT2 // Type of the right-hand side dense matrix
1233  , typename OP > // Type of the custom operation
1234 inline decltype(auto)
1235  map( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op )
1236 {
1238 
1239  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1240  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1241  }
1242 
1243  return map_backend( ~lhs, ~rhs, op );
1244 }
1245 //*************************************************************************************************
1246 
1247 
1248 
1249 
1250 //=================================================================================================
1251 //
1252 // SIZE SPECIALIZATIONS
1253 //
1254 //=================================================================================================
1255 
1256 //*************************************************************************************************
1258 template< typename MT1, typename MT2, typename OP >
1259 struct Size< DMatTDMatMapExpr<MT1,MT2,OP>, 0UL >
1260  : public Maximum< Size<MT1,0UL>, Size<MT2,0UL> >
1261 {};
1262 
1263 template< typename MT1, typename MT2, typename OP >
1264 struct Size< DMatTDMatMapExpr<MT1,MT2,OP>, 1UL >
1265  : public Maximum< Size<MT1,1UL>, Size<MT2,1UL> >
1266 {};
1268 //*************************************************************************************************
1269 
1270 
1271 
1272 
1273 //=================================================================================================
1274 //
1275 // ISALIGNED SPECIALIZATIONS
1276 //
1277 //=================================================================================================
1278 
1279 //*************************************************************************************************
1281 template< typename MT1, typename MT2, typename OP >
1282 struct IsAligned< DMatTDMatMapExpr<MT1,MT2,OP> >
1283  : public And< IsAligned<MT1>, IsAligned<MT2> >
1284 {};
1286 //*************************************************************************************************
1287 
1288 
1289 
1290 
1291 //=================================================================================================
1292 //
1293 // ISPADDED SPECIALIZATIONS
1294 //
1295 //=================================================================================================
1296 
1297 //*************************************************************************************************
1299 template< typename MT1, typename MT2, typename OP >
1300 struct IsPadded< DMatTDMatMapExpr<MT1,MT2,OP> >
1301  : public And< IsPadded<MT1>, IsPadded<MT2> >
1302 {};
1304 //*************************************************************************************************
1305 
1306 
1307 
1308 
1309 //=================================================================================================
1310 //
1311 // ISSYMMETRIC SPECIALIZATIONS
1312 //
1313 //=================================================================================================
1314 
1315 //*************************************************************************************************
1317 template< typename MT1, typename MT2 >
1318 struct IsSymmetric< DMatTDMatMapExpr<MT1,MT2,Min> >
1319  : public And< IsSymmetric<MT1>, IsSymmetric<MT2> >
1320 {};
1321 
1322 template< typename MT1, typename MT2 >
1323 struct IsSymmetric< DMatTDMatMapExpr<MT1,MT2,Max> >
1324  : public And< IsSymmetric<MT1>, IsSymmetric<MT2> >
1325 {};
1327 //*************************************************************************************************
1328 
1329 
1330 
1331 
1332 //=================================================================================================
1333 //
1334 // ISHERMITIAN SPECIALIZATIONS
1335 //
1336 //=================================================================================================
1337 
1338 //*************************************************************************************************
1340 template< typename MT1, typename MT2 >
1341 struct IsHermitian< DMatTDMatMapExpr<MT1,MT2,Min> >
1342  : public And< IsHermitian<MT1>, IsHermitian<MT2> >
1343 {};
1344 
1345 template< typename MT1, typename MT2 >
1346 struct IsHermitian< DMatTDMatMapExpr<MT1,MT2,Max> >
1347  : public And< IsHermitian<MT1>, IsHermitian<MT2> >
1348 {};
1350 //*************************************************************************************************
1351 
1352 
1353 
1354 
1355 //=================================================================================================
1356 //
1357 // ISLOWER SPECIALIZATIONS
1358 //
1359 //=================================================================================================
1360 
1361 //*************************************************************************************************
1363 template< typename MT1, typename MT2 >
1364 struct IsLower< DMatTDMatMapExpr<MT1,MT2,Min> >
1365  : public And< IsLower<MT1>, IsLower<MT2> >
1366 {};
1367 
1368 template< typename MT1, typename MT2 >
1369 struct IsLower< DMatTDMatMapExpr<MT1,MT2,Max> >
1370  : public And< IsLower<MT1>, IsLower<MT2> >
1371 {};
1373 //*************************************************************************************************
1374 
1375 
1376 
1377 
1378 //=================================================================================================
1379 //
1380 // ISUNILOWER SPECIALIZATIONS
1381 //
1382 //=================================================================================================
1383 
1384 //*************************************************************************************************
1386 template< typename MT1, typename MT2 >
1387 struct IsUniLower< DMatTDMatMapExpr<MT1,MT2,Min> >
1388  : public And< IsUniLower<MT1>, IsUniLower<MT2> >
1389 {};
1390 
1391 template< typename MT1, typename MT2 >
1392 struct IsUniLower< DMatTDMatMapExpr<MT1,MT2,Max> >
1393  : public And< IsUniLower<MT1>, IsUniLower<MT2> >
1394 {};
1396 //*************************************************************************************************
1397 
1398 
1399 
1400 
1401 //=================================================================================================
1402 //
1403 // ISSTRICTLYLOWER SPECIALIZATIONS
1404 //
1405 //=================================================================================================
1406 
1407 //*************************************************************************************************
1409 template< typename MT1, typename MT2 >
1410 struct IsStrictlyLower< DMatTDMatMapExpr<MT1,MT2,Min> >
1411  : public And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >
1412 {};
1413 
1414 template< typename MT1, typename MT2 >
1415 struct IsStrictlyLower< DMatTDMatMapExpr<MT1,MT2,Max> >
1416  : public And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >
1417 {};
1419 //*************************************************************************************************
1420 
1421 
1422 
1423 
1424 //=================================================================================================
1425 //
1426 // ISUPPER SPECIALIZATIONS
1427 //
1428 //=================================================================================================
1429 
1430 //*************************************************************************************************
1432 template< typename MT1, typename MT2 >
1433 struct IsUpper< DMatTDMatMapExpr<MT1,MT2,Min> >
1434  : public And< IsUpper<MT1>, IsUpper<MT2> >
1435 {};
1436 
1437 template< typename MT1, typename MT2 >
1438 struct IsUpper< DMatTDMatMapExpr<MT1,MT2,Max> >
1439  : public And< IsUpper<MT1>, IsUpper<MT2> >
1440 {};
1442 //*************************************************************************************************
1443 
1444 
1445 
1446 
1447 //=================================================================================================
1448 //
1449 // ISUNIUPPER SPECIALIZATIONS
1450 //
1451 //=================================================================================================
1452 
1453 //*************************************************************************************************
1455 template< typename MT1, typename MT2 >
1456 struct IsUniUpper< DMatTDMatMapExpr<MT1,MT2,Min> >
1457  : public And< IsUniUpper<MT1>, IsUniUpper<MT2> >
1458 {};
1459 
1460 template< typename MT1, typename MT2 >
1461 struct IsUniUpper< DMatTDMatMapExpr<MT1,MT2,Max> >
1462  : public And< IsUniUpper<MT1>, IsUniUpper<MT2> >
1463 {};
1465 //*************************************************************************************************
1466 
1467 
1468 
1469 
1470 //=================================================================================================
1471 //
1472 // ISSTRICTLYUPPER SPECIALIZATIONS
1473 //
1474 //=================================================================================================
1475 
1476 //*************************************************************************************************
1478 template< typename MT1, typename MT2 >
1479 struct IsStrictlyUpper< DMatTDMatMapExpr<MT1,MT2,Min> >
1480  : public And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >
1481 {};
1482 
1483 template< typename MT1, typename MT2 >
1484 struct IsStrictlyUpper< DMatTDMatMapExpr<MT1,MT2,Max> >
1485  : public And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >
1486 {};
1488 //*************************************************************************************************
1489 
1490 } // namespace blaze
1491 
1492 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Header file for kernel specific block sizes.
Base class for all binary matrix map expression templates.The MatMatMapExpr class serves as a tag for...
Definition: MatMatMapExpr.h:66
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for basic type definitions.
Operation operation() const
Returns a copy of the custom operation.
Definition: DMatTDMatMapExpr.h:285
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the serial shim.
#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
RightOperand rhs_
Right-hand side dense matrix of the map expression.
Definition: DMatTDMatMapExpr.h:338
typename BinaryMapTrait< T1, T2, OP >::Type BinaryMapTrait_
Auxiliary alias declaration for the BinaryMapTrait class template.The BinaryMapTrait_ alias declarati...
Definition: BinaryMapTrait.h:139
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTDMatMapExpr.h:245
Operation op_
The custom unary operation.
Definition: DMatTDMatMapExpr.h:339
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the And class template.
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
Header file for the Computation base class.
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:112
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
CompositeType_< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:117
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
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
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
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
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
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
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTDMatMapExpr.h:320
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
DMatTDMatMapExpr(const MT1 &lhs, const MT2 &rhs, OP op) noexcept
Constructor for the DMatTDMatMapExpr class.
Definition: DMatTDMatMapExpr.h:200
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatTDMatMapExpr.h:330
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTDMatMapExpr.h:297
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:118
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.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTDMatMapExpr.h:255
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTDMatMapExpr.h:160
Header file for the Not class template.
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.
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_DIFFERENT_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:106
Expression object for the dense matrix/tranpose dense matrix map() function.The DMatTDMatMapExpr clas...
Definition: DMatTDMatMapExpr.h:105
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: DMatTDMatMapExpr.h:229
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:170
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
Header file for the binary map trait.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTDMatMapExpr.h:214
Header file for run time assertion macros.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTDMatMapExpr.h:159
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:111
BinaryMapTrait_< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DMatTDMatMapExpr.h:158
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
ElementType_< MT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:113
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:115
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Compile time type negation.The Not alias declaration negates the given compile time condition...
Definition: Not.h:70
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatTDMatMapExpr.h:265
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: DMatTDMatMapExpr.h:275
Constraints on the storage order of matrix types.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
LeftOperand lhs_
Left-hand side dense matrix of the map expression.
Definition: DMatTDMatMapExpr.h:337
#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
ElementType_< MT2 > ET2
Element type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:114
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
OP Operation
Data type of the custom unary operation.
Definition: DMatTDMatMapExpr.h:176
decltype(std::declval< OP >()(std::declval< RN1 >(), std::declval< RN2 >())) ReturnType
Return type for expression template evaluations.
Definition: DMatTDMatMapExpr.h:164
Header file for the Min functor.
If_< RequiresEvaluation< MT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: DMatTDMatMapExpr.h:182
IfTrue_< useAssign, const ResultType, const DMatTDMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatTDMatMapExpr.h:167
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Header file for the MatMatMapExpr base class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatTDMatMapExpr.h:161
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
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.
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:173
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.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTDMatMapExpr.h:310
Header file for the IsHermitian type trait.
If_< RequiresEvaluation< MT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatTDMatMapExpr.h:179
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
ReturnType_< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:116
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
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