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>
74 #include <blaze/system/Blocking.h>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
77 #include <blaze/util/DisableIf.h>
78 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/mpl/And.h>
82 #include <blaze/util/mpl/If.h>
83 #include <blaze/util/mpl/Maximum.h>
84 #include <blaze/util/mpl/Not.h>
85 #include <blaze/util/Types.h>
86 
87 
88 namespace blaze {
89 
90 //=================================================================================================
91 //
92 // CLASS DMATTDMATMAPEXPR
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
104 template< typename MT1 // Type of the left-hand side dense matrix
105  , typename MT2 // Type of the right-hand side dense matrix
106  , typename OP > // Type of the custom operation
108  : public MatMatMapExpr< DenseMatrix< DMatTDMatMapExpr<MT1,MT2,OP>, false > >
109  , private Computation
110 {
111  private:
112  //**Type definitions****************************************************************************
121  //**********************************************************************************************
122 
123  //**Serial evaluation strategy******************************************************************
125 
131  enum : bool { useAssign = ( RequiresEvaluation<MT1>::value || RequiresEvaluation<MT2>::value ) };
132 
134  template< typename MT >
136  struct UseAssign {
137  enum : bool { value = useAssign };
138  };
140  //**********************************************************************************************
141 
142  //**Parallel evaluation strategy****************************************************************
144 
150  template< typename MT >
151  struct UseSMPAssign {
152  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) && useAssign };
153  };
155  //**********************************************************************************************
156 
157  public:
158  //**Type definitions****************************************************************************
164 
166  using ReturnType = decltype( std::declval<OP>()( std::declval<RN1>(), std::declval<RN2>() ) );
167 
170 
172  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
173 
175  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
176 
178  using Operation = OP;
179 
182 
185  //**********************************************************************************************
186 
187  //**Compilation flags***************************************************************************
189  enum : bool { simdEnabled = false };
190 
192  enum : bool { smpAssignable = MT1::smpAssignable && MT2::smpAssignable };
193  //**********************************************************************************************
194 
195  //**Constructor*********************************************************************************
202  explicit inline DMatTDMatMapExpr( const MT1& lhs, const MT2& rhs, OP op ) noexcept
203  : lhs_( lhs ) // Left-hand side dense matrix of the map expression
204  , rhs_( rhs ) // Right-hand side dense matrix of the map expression
205  , op_ ( op ) // The custom unary operation
206  {}
207  //**********************************************************************************************
208 
209  //**Access operator*****************************************************************************
216  inline ReturnType operator()( size_t i, size_t j ) const {
217  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
218  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
219  return op_( lhs_(i,j), rhs_(i,j) );
220  }
221  //**********************************************************************************************
222 
223  //**At function*********************************************************************************
231  inline ReturnType at( size_t i, size_t j ) const {
232  if( i >= lhs_.rows() ) {
233  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
234  }
235  if( j >= lhs_.columns() ) {
236  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
237  }
238  return (*this)(i,j);
239  }
240  //**********************************************************************************************
241 
242  //**Rows function*******************************************************************************
247  inline size_t rows() const noexcept {
248  return lhs_.rows();
249  }
250  //**********************************************************************************************
251 
252  //**Columns function****************************************************************************
257  inline size_t columns() const noexcept {
258  return lhs_.columns();
259  }
260  //**********************************************************************************************
261 
262  //**Left operand access*************************************************************************
267  inline LeftOperand leftOperand() const noexcept {
268  return lhs_;
269  }
270  //**********************************************************************************************
271 
272  //**Right operand access************************************************************************
277  inline RightOperand rightOperand() const noexcept {
278  return rhs_;
279  }
280  //**********************************************************************************************
281 
282  //**Operation access****************************************************************************
287  inline Operation operation() const {
288  return op_;
289  }
290  //**********************************************************************************************
291 
292  //**********************************************************************************************
298  template< typename T >
299  inline bool canAlias( const T* alias ) const noexcept {
300  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
301  ( IsExpression<MT2>::value && rhs_.canAlias( alias ) );
302  }
303  //**********************************************************************************************
304 
305  //**********************************************************************************************
311  template< typename T >
312  inline bool isAliased( const T* alias ) const noexcept {
313  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
314  }
315  //**********************************************************************************************
316 
317  //**********************************************************************************************
322  inline bool isAligned() const noexcept {
323  return lhs_.isAligned() && rhs_.isAligned();
324  }
325  //**********************************************************************************************
326 
327  //**********************************************************************************************
332  inline bool canSMPAssign() const noexcept {
333  return lhs_.canSMPAssign() && rhs_.canSMPAssign();
334  }
335  //**********************************************************************************************
336 
337  private:
338  //**Member variables****************************************************************************
342  //**********************************************************************************************
343 
344  //**Assignment to dense matrices****************************************************************
358  template< typename MT // Type of the target dense matrix
359  , bool SO > // Storage order of the target dense matrix
360  friend inline DisableIf_< UseAssign<MT> >
361  assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
362  {
364 
365  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
366  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
367 
368  constexpr size_t block( BLOCK_SIZE );
369 
370  const size_t m( rhs.rows() );
371  const size_t n( rhs.columns() );
372 
373  for( size_t ii=0UL; ii<m; ii+=block ) {
374  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
375  for( size_t jj=0UL; jj<n; jj+=block ) {
376  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
377  for( size_t i=ii; i<iend; ++i ) {
378  for( size_t j=jj; j<jend; ++j ) {
379  (~lhs)(i,j) = rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
380  }
381  }
382  }
383  }
384  }
386  //**********************************************************************************************
387 
388  //**Assignment to dense matrices****************************************************************
402  template< typename MT // Type of the target dense matrix
403  , bool SO > // Storage order of the target dense matrix
404  friend inline EnableIf_< UseAssign<MT> >
405  assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
406  {
408 
409  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
410  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
411 
412  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
413  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
414 
415  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
416  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
417  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
418  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
419  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
420  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
421 
422  assign( ~lhs, map( A, B, rhs.op_ ) );
423  }
425  //**********************************************************************************************
426 
427  //**Assignment to sparse matrices***************************************************************
441  template< typename MT // Type of the target sparse matrix
442  , bool SO > // Storage order of the target sparse matrix
443  friend inline EnableIf_< UseAssign<MT> >
444  assign( SparseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
445  {
447 
449 
456 
457  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
458  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
459 
460  const TmpType tmp( serial( rhs ) );
461  assign( ~lhs, tmp );
462  }
464  //**********************************************************************************************
465 
466  //**Addition assignment to dense matrices*******************************************************
480  template< typename MT // Type of the target dense matrix
481  , bool SO > // Storage order of the target dense matrix
482  friend inline DisableIf_< UseAssign<MT> >
483  addAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
484  {
486 
487  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
488  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
489 
490  constexpr size_t block( BLOCK_SIZE );
491 
492  const size_t m( rhs.rows() );
493  const size_t n( rhs.columns() );
494 
495  for( size_t ii=0UL; ii<m; ii+=block ) {
496  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
497  for( size_t jj=0UL; jj<n; jj+=block ) {
498  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
499  for( size_t i=ii; i<iend; ++i ) {
500  for( size_t j=jj; j<jend; ++j ) {
501  (~lhs)(i,j) += rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
502  }
503  }
504  }
505  }
506  }
508  //**********************************************************************************************
509 
510  //**Addition assignment to dense matrices*******************************************************
524  template< typename MT // Type of the target dense matrix
525  , bool SO > // Storage order of the target dense matrix
526  friend inline EnableIf_< UseAssign<MT> >
527  addAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
528  {
530 
531  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
532  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
533 
534  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
535  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
536 
537  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
538  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
539  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
540  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
541  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
542  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
543 
544  addAssign( ~lhs, map( A, B, rhs.op_ ) );
545  }
547  //**********************************************************************************************
548 
549  //**Addition assignment to sparse matrices******************************************************
550  // No special implementation for the addition assignment to sparse matrices.
551  //**********************************************************************************************
552 
553  //**Subtraction assignment to dense matrices****************************************************
567  template< typename MT // Type of the target dense matrix
568  , bool SO > // Storage order of the target dense matrix
569  friend inline DisableIf_< UseAssign<MT> >
570  subAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
571  {
573 
574  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
575  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
576 
577  constexpr size_t block( BLOCK_SIZE );
578 
579  const size_t m( rhs.rows() );
580  const size_t n( rhs.columns() );
581 
582  for( size_t ii=0UL; ii<m; ii+=block ) {
583  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
584  for( size_t jj=0UL; jj<n; jj+=block ) {
585  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
586  for( size_t i=ii; i<iend; ++i ) {
587  for( size_t j=jj; j<jend; ++j ) {
588  (~lhs)(i,j) -= rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
589  }
590  }
591  }
592  }
593  }
595  //**********************************************************************************************
596 
597  //**Subtraction assignment to dense matrices****************************************************
611  template< typename MT // Type of the target dense matrix
612  , bool SO > // Storage order of the target dense matrix
613  friend inline EnableIf_< UseAssign<MT> >
614  subAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
615  {
617 
618  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
619  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
620 
621  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
622  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
623 
624  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
625  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
626  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
627  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
628  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
629  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
630 
631  subAssign( ~lhs, map( A, B, rhs.op_ ) );
632  }
634  //**********************************************************************************************
635 
636  //**Subtraction assignment to sparse matrices***************************************************
637  // No special implementation for the subtraction assignment to sparse matrices.
638  //**********************************************************************************************
639 
640  //**Schur product assignment to dense matrices**************************************************
654  template< typename MT // Type of the target dense matrix
655  , bool SO > // Storage order of the target dense matrix
656  friend inline DisableIf_< UseAssign<MT> >
657  schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
658  {
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
662  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
663 
664  constexpr size_t block( BLOCK_SIZE );
665 
666  const size_t m( rhs.rows() );
667  const size_t n( rhs.columns() );
668 
669  for( size_t ii=0UL; ii<m; ii+=block ) {
670  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
671  for( size_t jj=0UL; jj<n; jj+=block ) {
672  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
673  for( size_t i=ii; i<iend; ++i ) {
674  for( size_t j=jj; j<jend; ++j ) {
675  (~lhs)(i,j) *= rhs.op_( rhs.lhs_(i,j), rhs.rhs_(i,j) );
676  }
677  }
678  }
679  }
680  }
682  //**********************************************************************************************
683 
684  //**Schur product assignment to dense matrices**************************************************
698  template< typename MT // Type of the target dense matrix
699  , bool SO > // Storage order of the target dense matrix
700  friend inline EnableIf_< UseAssign<MT> >
701  schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
702  {
704 
705  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
706  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
707 
708  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
709  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense matrix operand
710 
711  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
712  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
713  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
714  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
715  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
716  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
717 
718  schurAssign( ~lhs, map( A, B, rhs.op_ ) );
719  }
721  //**********************************************************************************************
722 
723  //**Schur product assignment to sparse matrices*************************************************
724  // No special implementation for the Schur product assignment to sparse matrices.
725  //**********************************************************************************************
726 
727  //**Multiplication assignment to dense matrices*************************************************
728  // No special implementation for the multiplication assignment to dense matrices.
729  //**********************************************************************************************
730 
731  //**Multiplication assignment to sparse matrices************************************************
732  // No special implementation for the multiplication assignment to sparse matrices.
733  //**********************************************************************************************
734 
735  //**SMP assignment to dense matrices************************************************************
749  template< typename MT // Type of the target dense matrix
750  , bool SO > // Storage order of the target dense matrix
751  friend inline EnableIf_< UseSMPAssign<MT> >
752  smpAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatMapExpr& rhs )
753  {
755 
756  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
757  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
758 
759  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
760  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
761 
762  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
763  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
764  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
766  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
767  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
768 
769  smpAssign( ~lhs, map( A, B, rhs.op_ ) );
770  }
772  //**********************************************************************************************
773 
774  //**SMP assignment to sparse matrices***********************************************************
788  template< typename MT // Type of the target sparse matrix
789  , bool SO > // Storage order of the target sparse matrix
790  friend inline EnableIf_< UseSMPAssign<MT> >
792  {
794 
796 
803 
804  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
805  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
806 
807  const TmpType tmp( rhs );
808  smpAssign( ~lhs, tmp );
809  }
811  //**********************************************************************************************
812 
813  //**SMP addition assignment to dense matrices***************************************************
828  template< typename MT // Type of the target dense matrix
829  , bool SO > // Storage order of the target dense matrix
830  friend inline EnableIf_< UseSMPAssign<MT> >
832  {
834 
835  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
836  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
837 
838  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
839  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
840 
841  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
842  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
843  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
844  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
845  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
846  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
847 
848  smpAddAssign( ~lhs, map( A, B, rhs.op_ ) );
849  }
851  //**********************************************************************************************
852 
853  //**SMP addition assignment to sparse matrices**************************************************
854  // No special implementation for the SMP addition assignment to sparse matrices.
855  //**********************************************************************************************
856 
857  //**SMP subtraction assignment to dense matrices************************************************
872  template< typename MT // Type of the target dense matrix
873  , bool SO > // Storage order of the target dense matrix
874  friend inline EnableIf_< UseSMPAssign<MT> >
876  {
878 
879  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
880  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
881 
882  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
883  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
884 
885  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
886  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
887  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
888  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
889  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
890  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
891 
892  smpSubAssign( ~lhs, map( A, B, rhs.op_ ) );
893  }
895  //**********************************************************************************************
896 
897  //**SMP subtraction assignment to sparse matrices***********************************************
898  // No special implementation for the SMP subtraction assignment to sparse matrices.
899  //**********************************************************************************************
900 
901  //**SMP Schur product assignment to dense matrices**********************************************
916  template< typename MT // Type of the target dense matrix
917  , bool SO > // Storage order of the target dense matrix
918  friend inline EnableIf_< UseSMPAssign<MT> >
920  {
922 
923  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
924  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
925 
926  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
927  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
928 
929  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
930  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
931  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
932  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
933  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
934  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
935 
936  smpSchurAssign( ~lhs, map( A, B, rhs.op_ ) );
937  }
939  //**********************************************************************************************
940 
941  //**SMP Schur product assignment to sparse matrices*********************************************
942  // No special implementation for the SMP Schur product assignment to sparse matrices.
943  //**********************************************************************************************
944 
945  //**SMP multiplication assignment to dense matrices*********************************************
946  // No special implementation for the SMP multiplication assignment to dense matrices.
947  //**********************************************************************************************
948 
949  //**SMP multiplication assignment to sparse matrices********************************************
950  // No special implementation for the SMP multiplication assignment to sparse matrices.
951  //**********************************************************************************************
952 
953  //**Compile time checks*************************************************************************
959  //**********************************************************************************************
960 };
961 //*************************************************************************************************
962 
963 
964 
965 
966 //=================================================================================================
967 //
968 // GLOBAL FUNCTIONS
969 //
970 //=================================================================================================
971 
972 //*************************************************************************************************
986 template< typename MT1 // Type of the left-hand side dense matrix
987  , typename MT2 // Type of the right-hand side dense matrix
988  , typename OP > // Type of the custom operation
989 inline const DMatTDMatMapExpr<MT1,MT2,OP>
990  map_backend( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op,
991  EnableIf_< And< Not< IsSymmetric<MT1> >, Not< IsSymmetric<MT2> > > >* = nullptr )
992 {
994 
995  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
996  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
997 
998  return DMatTDMatMapExpr<MT1,MT2,OP>( ~lhs, ~rhs, op );
999 }
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1018 template< typename MT1 // Type of the left-hand side dense matrix
1019  , typename MT2 // Type of the right-hand side dense matrix
1020  , typename OP > // Type of the custom operation
1021 inline decltype(auto)
1022  map_backend( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op,
1023  EnableIf_< And< IsSymmetric<MT1>, Not< IsSymmetric<MT2> > > >* = nullptr )
1024 {
1026 
1027  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1028  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1029 
1030  return map( trans( ~lhs ), ~rhs, op );
1031 }
1033 //*************************************************************************************************
1034 
1035 
1036 //*************************************************************************************************
1051 template< typename MT1 // Type of the left-hand side dense matrix
1052  , typename MT2 // Type of the right-hand side dense matrix
1053  , typename OP > // Type of the custom operation
1054 inline decltype(auto)
1055  map_backend( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op,
1056  EnableIf_< IsSymmetric<MT2> >* = nullptr )
1057 {
1059 
1060  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1061  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1062 
1063  return map( ~lhs, trans( ~rhs ), op );
1064 }
1066 //*************************************************************************************************
1067 
1068 
1069 //*************************************************************************************************
1094 template< typename MT1 // Type of the left-hand side dense matrix
1095  , typename MT2 // Type of the right-hand side dense matrix
1096  , typename OP > // Type of the custom operation
1097 inline decltype(auto)
1098  map( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs, OP op )
1099 {
1101 
1102  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1103  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1104  }
1105 
1106  return map_backend( ~lhs, ~rhs, op );
1107 }
1108 //*************************************************************************************************
1109 
1110 
1111 //*************************************************************************************************
1125 template< typename MT1 // Type of the left-hand side dense matrix
1126  , typename MT2 // Type of the right-hand side dense matrix
1127  , typename OP > // Type of the custom operation
1128 inline const DMatTDMatMapExpr<MT1,MT2,OP>
1129  map_backend( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op,
1130  EnableIf_< And< Not< IsSymmetric<MT1> >, Not< IsSymmetric<MT2> > > >* = nullptr )
1131 {
1133 
1134  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1135  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1136 
1137  return DMatTDMatMapExpr<MT1,MT2,OP>( ~lhs, ~rhs, op );
1138 }
1140 //*************************************************************************************************
1141 
1142 
1143 //*************************************************************************************************
1157 template< typename MT1 // Type of the left-hand side dense matrix
1158  , typename MT2 // Type of the right-hand side dense matrix
1159  , typename OP > // Type of the custom operation
1160 inline decltype(auto)
1161  map_backend( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op,
1162  EnableIf_< And< Not< IsSymmetric<MT1> >, IsSymmetric<MT2> > >* = nullptr )
1163 {
1165 
1166  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1167  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1168 
1169  return map( ~lhs, trans( ~rhs ), op );
1170 }
1172 //*************************************************************************************************
1173 
1174 
1175 //*************************************************************************************************
1190 template< typename MT1 // Type of the left-hand side dense matrix
1191  , typename MT2 // Type of the right-hand side dense matrix
1192  , typename OP > // Type of the custom operation
1193 inline decltype(auto)
1194  map_backend( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op,
1195  EnableIf_< IsSymmetric<MT1> >* = nullptr )
1196 {
1198 
1199  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1200  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1201 
1202  return map( trans( ~lhs ), ~rhs, op );
1203 }
1205 //*************************************************************************************************
1206 
1207 
1208 //*************************************************************************************************
1233 template< typename MT1 // Type of the left-hand side dense matrix
1234  , typename MT2 // Type of the right-hand side dense matrix
1235  , typename OP > // Type of the custom operation
1236 inline decltype(auto)
1237  map( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs, OP op )
1238 {
1240 
1241  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1242  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1243  }
1244 
1245  return map_backend( ~lhs, ~rhs, op );
1246 }
1247 //*************************************************************************************************
1248 
1249 
1250 
1251 
1252 //=================================================================================================
1253 //
1254 // ROWS SPECIALIZATIONS
1255 //
1256 //=================================================================================================
1257 
1258 //*************************************************************************************************
1260 template< typename MT1, typename MT2, typename OP >
1261 struct Rows< DMatTDMatMapExpr<MT1,MT2,OP> >
1262  : public Maximum< Rows<MT1>, Rows<MT2> >
1263 {};
1265 //*************************************************************************************************
1266 
1267 
1268 
1269 
1270 //=================================================================================================
1271 //
1272 // COLUMNS SPECIALIZATIONS
1273 //
1274 //=================================================================================================
1275 
1276 //*************************************************************************************************
1278 template< typename MT1, typename MT2, typename OP >
1279 struct Columns< DMatTDMatMapExpr<MT1,MT2,OP> >
1280  : public Maximum< Columns<MT1>, Columns<MT2> >
1281 {};
1283 //*************************************************************************************************
1284 
1285 
1286 
1287 
1288 //=================================================================================================
1289 //
1290 // ISALIGNED SPECIALIZATIONS
1291 //
1292 //=================================================================================================
1293 
1294 //*************************************************************************************************
1296 template< typename MT1, typename MT2, typename OP >
1297 struct IsAligned< DMatTDMatMapExpr<MT1,MT2,OP> >
1298  : public BoolConstant< And< IsAligned<MT1>, IsAligned<MT2> >::value >
1299 {};
1301 //*************************************************************************************************
1302 
1303 
1304 
1305 
1306 //=================================================================================================
1307 //
1308 // ISPADDED SPECIALIZATIONS
1309 //
1310 //=================================================================================================
1311 
1312 //*************************************************************************************************
1314 template< typename MT1, typename MT2, typename OP >
1315 struct IsPadded< DMatTDMatMapExpr<MT1,MT2,OP> >
1316  : public BoolConstant< And< IsPadded<MT1>, IsPadded<MT2> >::value >
1317 {};
1319 //*************************************************************************************************
1320 
1321 
1322 
1323 
1324 //=================================================================================================
1325 //
1326 // ISSYMMETRIC SPECIALIZATIONS
1327 //
1328 //=================================================================================================
1329 
1330 //*************************************************************************************************
1332 template< typename MT1, typename MT2 >
1333 struct IsSymmetric< DMatTDMatMapExpr<MT1,MT2,Min> >
1334  : public BoolConstant< And< IsSymmetric<MT1>, IsSymmetric<MT2> >::value >
1335 {};
1336 
1337 template< typename MT1, typename MT2 >
1338 struct IsSymmetric< DMatTDMatMapExpr<MT1,MT2,Max> >
1339  : public BoolConstant< And< IsSymmetric<MT1>, IsSymmetric<MT2> >::value >
1340 {};
1342 //*************************************************************************************************
1343 
1344 
1345 
1346 
1347 //=================================================================================================
1348 //
1349 // ISHERMITIAN SPECIALIZATIONS
1350 //
1351 //=================================================================================================
1352 
1353 //*************************************************************************************************
1355 template< typename MT1, typename MT2 >
1356 struct IsHermitian< DMatTDMatMapExpr<MT1,MT2,Min> >
1357  : public BoolConstant< And< IsHermitian<MT1>, IsHermitian<MT2> >::value >
1358 {};
1359 
1360 template< typename MT1, typename MT2 >
1361 struct IsHermitian< DMatTDMatMapExpr<MT1,MT2,Max> >
1362  : public BoolConstant< And< IsHermitian<MT1>, IsHermitian<MT2> >::value >
1363 {};
1365 //*************************************************************************************************
1366 
1367 
1368 
1369 
1370 //=================================================================================================
1371 //
1372 // ISLOWER SPECIALIZATIONS
1373 //
1374 //=================================================================================================
1375 
1376 //*************************************************************************************************
1378 template< typename MT1, typename MT2 >
1379 struct IsLower< DMatTDMatMapExpr<MT1,MT2,Min> >
1380  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
1381 {};
1382 
1383 template< typename MT1, typename MT2 >
1384 struct IsLower< DMatTDMatMapExpr<MT1,MT2,Max> >
1385  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
1386 {};
1388 //*************************************************************************************************
1389 
1390 
1391 
1392 
1393 //=================================================================================================
1394 //
1395 // ISUNILOWER SPECIALIZATIONS
1396 //
1397 //=================================================================================================
1398 
1399 //*************************************************************************************************
1401 template< typename MT1, typename MT2 >
1402 struct IsUniLower< DMatTDMatMapExpr<MT1,MT2,Min> >
1403  : public BoolConstant< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1404 {};
1405 
1406 template< typename MT1, typename MT2 >
1407 struct IsUniLower< DMatTDMatMapExpr<MT1,MT2,Max> >
1408  : public BoolConstant< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1409 {};
1411 //*************************************************************************************************
1412 
1413 
1414 
1415 
1416 //=================================================================================================
1417 //
1418 // ISSTRICTLYLOWER SPECIALIZATIONS
1419 //
1420 //=================================================================================================
1421 
1422 //*************************************************************************************************
1424 template< typename MT1, typename MT2 >
1425 struct IsStrictlyLower< DMatTDMatMapExpr<MT1,MT2,Min> >
1426  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
1427 {};
1428 
1429 template< typename MT1, typename MT2 >
1430 struct IsStrictlyLower< DMatTDMatMapExpr<MT1,MT2,Max> >
1431  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
1432 {};
1434 //*************************************************************************************************
1435 
1436 
1437 
1438 
1439 //=================================================================================================
1440 //
1441 // ISUPPER SPECIALIZATIONS
1442 //
1443 //=================================================================================================
1444 
1445 //*************************************************************************************************
1447 template< typename MT1, typename MT2 >
1448 struct IsUpper< DMatTDMatMapExpr<MT1,MT2,Min> >
1449  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1450 {};
1451 
1452 template< typename MT1, typename MT2 >
1453 struct IsUpper< DMatTDMatMapExpr<MT1,MT2,Max> >
1454  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1455 {};
1457 //*************************************************************************************************
1458 
1459 
1460 
1461 
1462 //=================================================================================================
1463 //
1464 // ISUNIUPPER SPECIALIZATIONS
1465 //
1466 //=================================================================================================
1467 
1468 //*************************************************************************************************
1470 template< typename MT1, typename MT2 >
1471 struct IsUniUpper< DMatTDMatMapExpr<MT1,MT2,Min> >
1472  : public BoolConstant< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1473 {};
1474 
1475 template< typename MT1, typename MT2 >
1476 struct IsUniUpper< DMatTDMatMapExpr<MT1,MT2,Max> >
1477  : public BoolConstant< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1478 {};
1480 //*************************************************************************************************
1481 
1482 
1483 
1484 
1485 //=================================================================================================
1486 //
1487 // ISSTRICTLYUPPER SPECIALIZATIONS
1488 //
1489 //=================================================================================================
1490 
1491 //*************************************************************************************************
1493 template< typename MT1, typename MT2 >
1494 struct IsStrictlyUpper< DMatTDMatMapExpr<MT1,MT2,Min> >
1495  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
1496 {};
1497 
1498 template< typename MT1, typename MT2 >
1499 struct IsStrictlyUpper< DMatTDMatMapExpr<MT1,MT2,Max> >
1500  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
1501 {};
1503 //*************************************************************************************************
1504 
1505 } // namespace blaze
1506 
1507 #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 Rows type trait.
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for basic type definitions.
Operation operation() const
Returns a copy of the custom operation.
Definition: DMatTDMatMapExpr.h:287
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.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#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:340
typename BinaryMapTrait< T1, T2, OP >::Type BinaryMapTrait_
Auxiliary alias declaration for the BinaryMapTrait class template.The BinaryMapTrait_ alias declarati...
Definition: BinaryMapTrait.h:161
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTDMatMapExpr.h:247
Operation op_
The custom unary operation.
Definition: DMatTDMatMapExpr.h:341
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:88
Header file for the Computation base class.
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:114
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
CompositeType_< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:119
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:78
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:72
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:322
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:202
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:57
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:332
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTDMatMapExpr.h:299
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:120
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.
Header file for the Columns type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTDMatMapExpr.h:257
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTDMatMapExpr.h:162
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:107
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:231
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:172
#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:216
Header file for run time assertion macros.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTDMatMapExpr.h:161
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:113
BinaryMapTrait_< RT1, RT2, OP > ResultType
Result type for expression template evaluations.
Definition: DMatTDMatMapExpr.h:160
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:115
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:117
#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:267
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:277
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:819
LeftOperand lhs_
Left-hand side dense matrix of the map expression.
Definition: DMatTDMatMapExpr.h:339
#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:116
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:178
decltype(std::declval< OP >()(std::declval< RN1 >(), std::declval< RN2 >())) ReturnType
Return type for expression template evaluations.
Definition: DMatTDMatMapExpr.h:166
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:184
IfTrue_< useAssign, const ResultType, const DMatTDMatMapExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatTDMatMapExpr.h:169
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:790
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:163
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
Compile time logical and evaluation.The And alias declaration performs at compile time a logical and ...
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:175
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:312
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:181
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
ReturnType_< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: DMatTDMatMapExpr.h:118
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:1133