DMatTDMatSchurExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTDMATSCHUREXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTDMATSCHUREXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/math/Aliases.h>
53 #include <blaze/math/Exception.h>
74 #include <blaze/system/Blocking.h>
76 #include <blaze/util/Assert.h>
77 #include <blaze/util/DisableIf.h>
78 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/mpl/If.h>
82 #include <blaze/util/Types.h>
83 #include <blaze/util/Unused.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS DMATTDMATSCHUREXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
101 template< typename MT1 // Type of the left-hand side dense matrix
102  , typename MT2 > // Type of the right-hand side dense matrix
104  : public SchurExpr< DenseMatrix< DMatTDMatSchurExpr<MT1,MT2>, false > >
105  , private Computation
106 {
107  private:
108  //**Type definitions****************************************************************************
115  //**********************************************************************************************
116 
117  //**Return type evaluation**********************************************************************
119 
124  static constexpr bool returnExpr = ( !IsTemporary_v<RN1> && !IsTemporary_v<RN2> );
125 
127  using ExprReturnType = decltype( std::declval<RN1>() * std::declval<RN2>() );
128  //**********************************************************************************************
129 
130  //**Serial evaluation strategy******************************************************************
132 
138  static constexpr bool useAssign =
139  ( RequiresEvaluation_v<MT1> || RequiresEvaluation_v<MT2> || !returnExpr );
140 
142  template< typename MT >
144  static constexpr bool UseAssign_v = useAssign;
146  //**********************************************************************************************
147 
148  //**Parallel evaluation strategy****************************************************************
150 
156  template< typename MT >
157  static constexpr bool UseSMPAssign_v =
160  //**********************************************************************************************
161 
162  public:
163  //**Type definitions****************************************************************************
170 
173 
175  using CompositeType = const ResultType;
176 
178  using LeftOperand = If_t< IsExpression_v<MT1>, const MT1, const MT1& >;
179 
181  using RightOperand = If_t< IsExpression_v<MT2>, const MT2, const MT2& >;
182  //**********************************************************************************************
183 
184  //**Compilation flags***************************************************************************
186  static constexpr bool simdEnabled = false;
187 
189  static constexpr bool smpAssignable = ( MT1::smpAssignable && MT2::smpAssignable );
190  //**********************************************************************************************
191 
192  //**Constructor*********************************************************************************
198  explicit inline DMatTDMatSchurExpr( const MT1& lhs, const MT2& rhs ) noexcept
199  : lhs_( lhs ) // Left-hand side dense matrix of the Schur product expression
200  , rhs_( rhs ) // Right-hand side dense matrix of the Schur product expression
201  {
202  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
203  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
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 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  //**********************************************************************************************
286  template< typename T >
287  inline bool canAlias( const T* alias ) const noexcept {
288  return ( IsExpression_v<MT1> && ( RequiresEvaluation_v<MT1> ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
289  ( IsExpression_v<MT2> && ( RequiresEvaluation_v<MT2> ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
290  }
291  //**********************************************************************************************
292 
293  //**********************************************************************************************
299  template< typename T >
300  inline bool isAliased( const T* alias ) const noexcept {
301  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
302  }
303  //**********************************************************************************************
304 
305  //**********************************************************************************************
310  inline bool isAligned() const noexcept {
311  return lhs_.isAligned() && rhs_.isAligned();
312  }
313  //**********************************************************************************************
314 
315  //**********************************************************************************************
320  inline bool canSMPAssign() const noexcept {
321  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
322  ( rows() * columns() >= SMP_DMATTDMATSCHUR_THRESHOLD );
323  }
324  //**********************************************************************************************
325 
326  private:
327  //**Member variables****************************************************************************
330  //**********************************************************************************************
331 
332  //**Assignment to dense matrices****************************************************************
346  template< typename MT // Type of the target dense matrix
347  , bool SO > // Storage order of the target dense matrix
348  friend inline auto assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
350  {
352 
353  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
354  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
355 
356  constexpr size_t block( BLOCK_SIZE );
357 
358  const size_t m( rhs.rows() );
359  const size_t n( rhs.columns() );
360 
361  for( size_t ii=0UL; ii<m; ii+=block ) {
362  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
363  for( size_t jj=0UL; jj<n; jj+=block ) {
364  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
365  for( size_t i=ii; i<iend; ++i ) {
366  for( size_t j=jj; j<jend; ++j ) {
367  (~lhs)(i,j) = rhs.lhs_(i,j) * rhs.rhs_(i,j);
368  }
369  }
370  }
371  }
372  }
374  //**********************************************************************************************
375 
376  //**Assignment to dense matrices****************************************************************
391  template< typename MT // Type of the target dense matrix
392  , bool SO > // Storage order of the target dense matrix
393  friend inline auto assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
394  -> EnableIf_t< UseAssign_v<MT> && !IsCommutative_v<MT1,MT2> >
395  {
397 
398  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
399  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
400 
401  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
402  schurAssign( ~lhs, rhs.rhs_ );
403  }
404  else {
405  CT1 A( serial( rhs.lhs_ ) );
406  CT2 B( serial( rhs.rhs_ ) );
407  assign( ~lhs, A % B );
408  }
409  }
411  //**********************************************************************************************
412 
413  //**Assignment to dense matrices****************************************************************
428  template< typename MT // Type of the target dense matrix
429  , bool SO > // Storage order of the target dense matrix
430  friend inline auto assign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
431  -> EnableIf_t< UseAssign_v<MT> && IsCommutative_v<MT1,MT2> >
432  {
434 
435  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
436  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
437 
438  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
439  schurAssign( ~lhs, rhs.rhs_ );
440  }
441  else if( !IsOperation_v<MT2> && isSame( ~lhs, rhs.rhs_ ) ) {
442  schurAssign( ~lhs, rhs.lhs_ );
443  }
444  else if( !RequiresEvaluation_v<MT2> ) {
445  assign ( ~lhs, rhs.rhs_ );
446  schurAssign( ~lhs, rhs.lhs_ );
447  }
448  else {
449  assign ( ~lhs, rhs.lhs_ );
450  schurAssign( ~lhs, rhs.rhs_ );
451  }
452  }
454  //**********************************************************************************************
455 
456  //**Assignment to sparse matrices***************************************************************
468  template< typename MT // Type of the target sparse matrix
469  , bool SO > // Storage order of the target sparse matrix
470  friend inline void assign( SparseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
471  {
473 
474  using TmpType = If_t< SO, OppositeType, ResultType >;
475 
482 
483  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
484  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
485 
486  const TmpType tmp( serial( rhs ) );
487  assign( ~lhs, tmp );
488  }
490  //**********************************************************************************************
491 
492  //**Addition assignment to dense matrices*******************************************************
507  template< typename MT // Type of the target dense matrix
508  , bool SO > // Storage order of the target dense matrix
509  friend inline auto addAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
510  -> DisableIf_t< UseAssign_v<MT> >
511  {
513 
514  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
515  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
516 
517  constexpr size_t block( BLOCK_SIZE );
518 
519  const size_t m( rhs.rows() );
520  const size_t n( rhs.columns() );
521 
522  for( size_t ii=0UL; ii<m; ii+=block ) {
523  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
524  for( size_t jj=0UL; jj<n; jj+=block ) {
525  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
526  for( size_t i=ii; i<iend; ++i ) {
527  for( size_t j=jj; j<jend; ++j ) {
528  (~lhs)(i,j) += rhs.lhs_(i,j) * rhs.rhs_(i,j);
529  }
530  }
531  }
532  }
533  }
535  //**********************************************************************************************
536 
537  //**Addition assignment to dense matrices*******************************************************
552  template< typename MT // Type of the target dense matrix
553  , bool SO > // Storage order of the target dense matrix
554  friend inline auto addAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
555  -> EnableIf_t< UseAssign_v<MT> >
556  {
558 
562 
563  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
564  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
565 
566  const ResultType tmp( serial( rhs ) );
567  addAssign( ~lhs, tmp );
568  }
570  //**********************************************************************************************
571 
572  //**Addition assignment to sparse matrices******************************************************
573  // No special implementation for the addition assignment to sparse matrices.
574  //**********************************************************************************************
575 
576  //**Subtraction assignment to dense matrices****************************************************
591  template< typename MT // Type of the target dense matrix
592  , bool SO > // Storage order of the target dense matrix
593  friend inline auto subAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
594  -> DisableIf_t< UseAssign_v<MT> >
595  {
597 
598  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
599  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
600 
601  constexpr size_t block( BLOCK_SIZE );
602 
603  const size_t m( rhs.rows() );
604  const size_t n( rhs.columns() );
605 
606  for( size_t ii=0UL; ii<m; ii+=block ) {
607  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
608  for( size_t jj=0UL; jj<n; jj+=block ) {
609  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
610  for( size_t i=ii; i<iend; ++i ) {
611  for( size_t j=jj; j<jend; ++j ) {
612  (~lhs)(i,j) -= rhs.lhs_(i,j) * rhs.rhs_(i,j);
613  }
614  }
615  }
616  }
617  }
619  //**********************************************************************************************
620 
621  //**Subtraction assignment to dense matrices****************************************************
636  template< typename MT // Type of the target dense matrix
637  , bool SO > // Storage order of the target dense matrix
638  friend inline auto subAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
639  -> EnableIf_t< UseAssign_v<MT> >
640  {
642 
646 
647  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
648  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
649 
650  const ResultType tmp( serial( rhs ) );
651  subAssign( ~lhs, tmp );
652  }
654  //**********************************************************************************************
655 
656  //**Subtraction assignment to sparse matrices***************************************************
657  // No special implementation for the subtraction assignment to sparse matrices.
658  //**********************************************************************************************
659 
660  //**Schur product assignment to dense matrices**************************************************
675  template< typename MT // Type of the target dense matrix
676  , bool SO > // Storage order of the target dense matrix
677  friend inline auto schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
678  -> DisableIf_t< UseAssign_v<MT> >
679  {
681 
682  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
683  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
684 
685  constexpr size_t block( BLOCK_SIZE );
686 
687  const size_t m( rhs.rows() );
688  const size_t n( rhs.columns() );
689 
690  for( size_t ii=0UL; ii<m; ii+=block ) {
691  const size_t iend( ( m < ii+block )?( m ):( ii+block ) );
692  for( size_t jj=0UL; jj<n; jj+=block ) {
693  const size_t jend( ( n < jj+block )?( n ):( jj+block ) );
694  for( size_t i=ii; i<iend; ++i ) {
695  for( size_t j=jj; j<jend; ++j ) {
696  (~lhs)(i,j) *= rhs.lhs_(i,j) * rhs.rhs_(i,j);
697  }
698  }
699  }
700  }
701  }
703  //**********************************************************************************************
704 
705  //**Schur product assignment to dense matrices**************************************************
721  template< typename MT // Type of the target dense matrix
722  , bool SO > // Storage order of the target dense matrix
723  friend inline auto schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
724  -> EnableIf_t< UseAssign_v<MT> && !IsCommutative_v<MT1,MT2> >
725  {
727 
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
733  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
734 
735  const ResultType tmp( serial( rhs ) );
736  schurAssign( ~lhs, tmp );
737  }
739  //**********************************************************************************************
740 
741  //**Schur product assignment to dense matrices**************************************************
757  template< typename MT // Type of the target dense matrix
758  , bool SO > // Storage order of the target dense matrix
759  friend inline auto schurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
760  -> EnableIf_t< UseAssign_v<MT> && IsCommutative_v<MT1,MT2> >
761  {
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
766 
767  if( !RequiresEvaluation_v<MT2> ) {
768  schurAssign( ~lhs, rhs.rhs_ );
769  schurAssign( ~lhs, rhs.lhs_ );
770  }
771  else {
772  schurAssign( ~lhs, rhs.lhs_ );
773  schurAssign( ~lhs, rhs.rhs_ );
774  }
775  }
777  //**********************************************************************************************
778 
779  //**Schur product assignment to sparse matrices*************************************************
780  // No special implementation for the Schur product assignment to sparse matrices.
781  //**********************************************************************************************
782 
783  //**Multiplication assignment to dense matrices*************************************************
784  // No special implementation for the multiplication assignment to dense matrices.
785  //**********************************************************************************************
786 
787  //**Multiplication assignment to sparse matrices************************************************
788  // No special implementation for the multiplication assignment to sparse matrices.
789  //**********************************************************************************************
790 
791  //**SMP assignment to dense matrices************************************************************
806  template< typename MT // Type of the target dense matrix
807  , bool SO > // Storage order of the target dense matrix
808  friend inline auto smpAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
809  -> EnableIf_t< UseSMPAssign_v<MT> && !IsCommutative_v<MT1,MT2> >
810  {
812 
813  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
814  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
815 
816  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
817  smpSchurAssign( ~lhs, rhs.rhs_ );
818  }
819  else {
820  CT1 A( rhs.lhs_ );
821  CT2 B( rhs.rhs_ );
822  smpAssign( ~lhs, A % B );
823  }
824  }
826  //**********************************************************************************************
827 
828  //**SMP assignment to dense matrices************************************************************
843  template< typename MT // Type of the target dense matrix
844  , bool SO > // Storage order of the target dense matrix
845  friend inline auto smpAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
846  -> EnableIf_t< UseSMPAssign_v<MT> && IsCommutative_v<MT1,MT2> >
847  {
849 
850  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
851  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
852 
853  if( !IsOperation_v<MT1> && isSame( ~lhs, rhs.lhs_ ) ) {
854  smpSchurAssign( ~lhs, rhs.rhs_ );
855  }
856  else if( !IsOperation_v<MT2> && isSame( ~lhs, rhs.rhs_ ) ) {
857  smpSchurAssign( ~lhs, rhs.lhs_ );
858  }
859  else if( !RequiresEvaluation_v<MT2> ) {
860  smpAssign ( ~lhs, rhs.rhs_ );
861  smpSchurAssign( ~lhs, rhs.lhs_ );
862  }
863  else {
864  smpAssign ( ~lhs, rhs.lhs_ );
865  smpSchurAssign( ~lhs, rhs.rhs_ );
866  }
867  }
869  //**********************************************************************************************
870 
871  //**SMP assignment to sparse matrices***********************************************************
886  template< typename MT // Type of the target sparse matrix
887  , bool SO > // Storage order of the target sparse matrix
888  friend inline auto smpAssign( SparseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
889  -> EnableIf_t< UseSMPAssign_v<MT> >
890  {
892 
893  using TmpType = If_t< SO, OppositeType, ResultType >;
894 
901 
902  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
903  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
904 
905  const TmpType tmp( rhs );
906  smpAssign( ~lhs, tmp );
907  }
909  //**********************************************************************************************
910 
911  //**SMP addition assignment to dense matrices***************************************************
926  template< typename MT // Type of the target dense matrix
927  , bool SO > // Storage order of the target dense matrix
928  friend inline auto smpAddAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
929  -> EnableIf_t< UseSMPAssign_v<MT> >
930  {
932 
936 
937  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
938  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
939 
940  const ResultType tmp( rhs );
941  smpAddAssign( ~lhs, tmp );
942  }
944  //**********************************************************************************************
945 
946  //**SMP addition assignment to sparse matrices**************************************************
947  // No special implementation for the SMP addition assignment to sparse matrices.
948  //**********************************************************************************************
949 
950  //**SMP subtraction assignment to dense matrices************************************************
965  template< typename MT // Type of the target dense matrix
966  , bool SO > // Storage order of the target dense matrix
967  friend inline auto smpSubAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
968  -> EnableIf_t< UseSMPAssign_v<MT> >
969  {
971 
975 
976  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
977  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
978 
979  const ResultType tmp( rhs );
980  smpSubAssign( ~lhs, tmp );
981  }
983  //**********************************************************************************************
984 
985  //**SMP subtraction assignment to sparse matrices***********************************************
986  // No special implementation for the SMP subtraction assignment to sparse matrices.
987  //**********************************************************************************************
988 
989  //**SMP Schur product assignment to dense matrices**********************************************
1005  template< typename MT // Type of the target dense matrix
1006  , bool SO > // Storage order of the target dense matrix
1007  friend inline auto smpSchurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
1008  -> EnableIf_t< UseSMPAssign_v<MT> && !IsCommutative_v<MT1,MT2> >
1009  {
1011 
1015 
1016  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1017  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1018 
1019  const ResultType tmp( rhs );
1020  smpSchurAssign( ~lhs, tmp );
1021  }
1023  //**********************************************************************************************
1024 
1025  //**SMP Schur product assignment to dense matrices**********************************************
1041  template< typename MT // Type of the target dense matrix
1042  , bool SO > // Storage order of the target dense matrix
1043  friend inline auto smpSchurAssign( DenseMatrix<MT,SO>& lhs, const DMatTDMatSchurExpr& rhs )
1044  -> EnableIf_t< UseSMPAssign_v<MT> && IsCommutative_v<MT1,MT2> >
1045  {
1047 
1048  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1049  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1050 
1051  if( !RequiresEvaluation_v<MT2> ) {
1052  smpSchurAssign( ~lhs, rhs.rhs_ );
1053  smpSchurAssign( ~lhs, rhs.lhs_ );
1054  }
1055  else {
1056  smpSchurAssign( ~lhs, rhs.lhs_ );
1057  smpSchurAssign( ~lhs, rhs.rhs_ );
1058  }
1059  }
1061  //**********************************************************************************************
1062 
1063  //**SMP Schur product assignment to sparse matrices*********************************************
1064  // No special implementation for the SMP Schur product assignment to sparse matrices.
1065  //**********************************************************************************************
1066 
1067  //**SMP multiplication assignment to dense matrices*********************************************
1068  // No special implementation for the SMP multiplication assignment to dense matrices.
1069  //**********************************************************************************************
1070 
1071  //**SMP multiplication assignment to sparse matrices********************************************
1072  // No special implementation for the SMP multiplication assignment to sparse matrices.
1073  //**********************************************************************************************
1074 
1075  //**Compile time checks*************************************************************************
1082  //**********************************************************************************************
1083 };
1084 //*************************************************************************************************
1085 
1086 
1087 
1088 
1089 //=================================================================================================
1090 //
1091 // GLOBAL BINARY ARITHMETIC OPERATORS
1092 //
1093 //=================================================================================================
1094 
1095 //*************************************************************************************************
1108 template< typename MT1 // Type of the left-hand side dense matrix
1109  , typename MT2 // Type of the right-hand side dense matrix
1110  , EnableIf_t< !IsSymmetric_v<MT1> &&
1111  !IsSymmetric_v<MT2> &&
1112  !( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) &&
1113  !( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) &&
1114  !( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) &&
1115  !( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) &&
1116  !( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) &&
1117  !( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1118 inline const DMatTDMatSchurExpr<MT1,MT2>
1119  dmattdmatschur( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs )
1120 {
1122 
1123  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1124  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1125 
1126  return DMatTDMatSchurExpr<MT1,MT2>( ~lhs, ~rhs );
1127 }
1129 //*************************************************************************************************
1130 
1131 
1132 //*************************************************************************************************
1145 template< typename MT1 // Type of the left-hand side dense matrix
1146  , typename MT2 // Type of the right-hand side dense matrix
1147  , EnableIf_t< IsSymmetric_v<MT1> &&
1148  !IsSymmetric_v<MT2> &&
1149  !( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) &&
1150  !( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) &&
1151  !( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) &&
1152  !( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) &&
1153  !( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) &&
1154  !( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1155 inline decltype(auto)
1156  dmattdmatschur( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs )
1157 {
1159 
1160  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1161  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1162 
1163  return trans( ~lhs ) % ~rhs;
1164 }
1166 //*************************************************************************************************
1167 
1168 
1169 //*************************************************************************************************
1182 template< typename MT1 // Type of the left-hand side dense matrix
1183  , typename MT2 // Type of the right-hand side dense matrix
1184  , EnableIf_t< IsSymmetric_v<MT2> &&
1185  !( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) &&
1186  !( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) &&
1187  !( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) &&
1188  !( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) &&
1189  !( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) &&
1190  !( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1191 inline decltype(auto)
1192  dmattdmatschur( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs )
1193 {
1195 
1196  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1197  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1198 
1199  return (~lhs) % trans( ~rhs );
1200 }
1202 //*************************************************************************************************
1203 
1204 
1205 //*************************************************************************************************
1219 template< typename MT1 // Type of the left-hand side dense matrix
1220  , typename MT2 // Type of the right-hand side dense matrix
1221  , EnableIf_t< ( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) ||
1222  ( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) >* = nullptr >
1223 inline decltype(auto)
1224  dmattdmatschur( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs )
1225 {
1227 
1228  UNUSED_PARAMETER( rhs );
1229 
1230  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1231  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1232 
1233  using ReturnType = const SchurTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1234 
1237 
1238  return ReturnType( (~lhs).rows() );
1239 }
1241 //*************************************************************************************************
1242 
1243 
1244 //*************************************************************************************************
1258 template< typename MT1 // Type of the left-hand side dense matrix
1259  , typename MT2 // Type of the right-hand side dense matrix
1260  , EnableIf_t< ( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) ||
1261  ( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) ||
1262  ( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) ||
1263  ( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1264 inline decltype(auto)
1265  dmattdmatschur( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs )
1266 {
1268 
1269  UNUSED_PARAMETER( rhs );
1270 
1271  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1272  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1273 
1274  using ReturnType = const SchurTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1275 
1278 
1279  return ReturnType( (~lhs).rows(), (~lhs).columns() );
1280 }
1282 //*************************************************************************************************
1283 
1284 
1285 //*************************************************************************************************
1314 template< typename MT1 // Type of the left-hand side dense matrix
1315  , typename MT2 > // Type of the right-hand side dense matrix
1316 inline decltype(auto)
1317  operator%( const DenseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,true>& rhs )
1318 {
1320 
1321  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1322  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1323  }
1324 
1325  return dmattdmatschur( ~lhs, ~rhs );
1326 }
1327 //*************************************************************************************************
1328 
1329 
1330 //*************************************************************************************************
1343 template< typename MT1 // Type of the left-hand side dense matrix
1344  , typename MT2 // Type of the right-hand side dense matrix
1345  , EnableIf_t< !IsSymmetric_v<MT1> &&
1346  !IsSymmetric_v<MT2> &&
1347  !( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) &&
1348  !( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) &&
1349  !( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) &&
1350  !( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) &&
1351  !( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) &&
1352  !( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1353 inline const DMatTDMatSchurExpr<MT1,MT2>
1354  tdmatdmatschur( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs )
1355 {
1357 
1358  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1359  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1360 
1361  return DMatTDMatSchurExpr<MT1,MT2>( ~lhs, ~rhs );
1362 }
1364 //*************************************************************************************************
1365 
1366 
1367 //*************************************************************************************************
1380 template< typename MT1 // Type of the left-hand side dense matrix
1381  , typename MT2 // Type of the right-hand side dense matrix
1382  , EnableIf_t< !IsSymmetric_v<MT1> &&
1383  IsSymmetric_v<MT2> &&
1384  !( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) &&
1385  !( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) &&
1386  !( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) &&
1387  !( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) &&
1388  !( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) &&
1389  !( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1390 inline decltype(auto)
1391  tdmatdmatschur( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs )
1392 {
1394 
1395  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1396  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1397 
1398  return (~lhs) % trans( ~rhs );
1399 }
1401 //*************************************************************************************************
1402 
1403 
1404 //*************************************************************************************************
1417 template< typename MT1 // Type of the left-hand side dense matrix
1418  , typename MT2 // Type of the right-hand side dense matrix
1419  , EnableIf_t< IsSymmetric_v<MT1> &&
1420  !( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) &&
1421  !( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) &&
1422  !( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) &&
1423  !( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) &&
1424  !( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) &&
1425  !( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1426 inline decltype(auto)
1427  tdmatdmatschur( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs )
1428 {
1430 
1431  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1432  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1433 
1434  return trans( ~lhs ) % (~rhs);
1435 }
1437 //*************************************************************************************************
1438 
1439 
1440 //*************************************************************************************************
1454 template< typename MT1 // Type of the left-hand side dense matrix
1455  , typename MT2 // Type of the right-hand side dense matrix
1456  , EnableIf_t< ( IsUniLower_v<MT1> && IsUniUpper_v<MT2> ) ||
1457  ( IsUniUpper_v<MT1> && IsUniLower_v<MT2> ) >* = nullptr >
1458 inline decltype(auto)
1459  tdmatdmatschur( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs )
1460 {
1462 
1463  UNUSED_PARAMETER( rhs );
1464 
1465  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1466  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1467 
1468  using ReturnType = const SchurTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1469 
1472 
1473  return ReturnType( (~lhs).rows() );
1474 }
1476 //*************************************************************************************************
1477 
1478 
1479 //*************************************************************************************************
1493 template< typename MT1 // Type of the left-hand side dense matrix
1494  , typename MT2 // Type of the right-hand side dense matrix
1495  , EnableIf_t< ( IsStrictlyLower_v<MT1> && IsUpper_v<MT2> ) ||
1496  ( IsStrictlyUpper_v<MT1> && IsLower_v<MT2> ) ||
1497  ( IsLower_v<MT1> && IsStrictlyUpper_v<MT2> ) ||
1498  ( IsUpper_v<MT1> && IsStrictlyLower_v<MT2> ) >* = nullptr >
1499 inline decltype(auto)
1500  tdmatdmatschur( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs )
1501 {
1503 
1504  UNUSED_PARAMETER( rhs );
1505 
1506  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
1507  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
1508 
1509  using ReturnType = const SchurTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1510 
1513 
1514  return ReturnType( (~lhs).rows(), (~lhs).columns() );
1515 }
1517 //*************************************************************************************************
1518 
1519 
1520 //*************************************************************************************************
1549 template< typename MT1 // Type of the left-hand side dense matrix
1550  , typename MT2 > // Type of the right-hand side dense matrix
1551 inline decltype(auto)
1552  operator%( const DenseMatrix<MT1,true>& lhs, const DenseMatrix<MT2,false>& rhs )
1553 {
1555 
1556  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
1557  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1558  }
1559 
1560  return tdmatdmatschur( ~lhs, ~rhs );
1561 }
1562 //*************************************************************************************************
1563 
1564 
1565 
1566 
1567 //=================================================================================================
1568 //
1569 // ISALIGNED SPECIALIZATIONS
1570 //
1571 //=================================================================================================
1572 
1573 //*************************************************************************************************
1575 template< typename MT1, typename MT2 >
1576 struct IsAligned< DMatTDMatSchurExpr<MT1,MT2> >
1577  : public BoolConstant< IsAligned_v<MT1> && IsAligned_v<MT2> >
1578 {};
1580 //*************************************************************************************************
1581 
1582 } // namespace blaze
1583 
1584 #endif
Constraint on the data type.
#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.
#define BLAZE_CONSTRAINT_MUST_BE_IDENTITY_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not an identity matrix type...
Definition: Identity.h:60
Header file for the Schur product trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
LeftOperand lhs_
Left-hand side dense matrix of the Schur product expression.
Definition: DMatTDMatSchurExpr.h:328
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTDMatSchurExpr.h:310
bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:992
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the IsCommutative type trait.
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatTDMatSchurExpr.h:169
#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
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatTDMatSchurExpr.h:265
Constraint on the data type.
ResultType_t< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:110
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose dense matrix operand.
Definition: DMatTDMatSchurExpr.h:275
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatTDMatSchurExpr.h:175
decltype(std::declval< RN1 >() *std::declval< RN2 >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DMatTDMatSchurExpr.h:127
Header file for the Computation base class.
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the IsUniLower type trait.
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:109
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_SCHUREXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: SchurExpr.h:103
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Header file for all forward declarations for sparse vectors and matrices.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTDMatSchurExpr.h:287
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatTDMatSchurExpr.h:189
If_t< IsExpression_v< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:178
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the IsTemporary type trait class.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatTDMatSchurExpr.h:172
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DMatTDMatSchurExpr.h:124
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
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.In case the given data type T is not a zero vector or matrix type...
Definition: Zero.h:61
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatTDMatSchurExpr.h:186
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTDMatSchurExpr.h:255
#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 IsOperation type trait class.
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTDMatSchurExpr.h:168
Header file for the IsLower type trait.
CompositeType_t< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:113
Header file for the IsAligned type trait.
Constraints on the storage order of matrix types.
ReturnType_t< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:111
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
If_t< IsExpression_v< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:181
Header file for the EnableIf class template.
Header file for the IsStrictlyLower 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
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTDMatSchurExpr.h:229
#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
DMatTDMatSchurExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatTDMatSchurExpr class.
Definition: DMatTDMatSchurExpr.h:198
Base class for all Schur product expression templates.The SchurExpr class serves as a tag for all exp...
Definition: SchurExpr.h:66
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the SchurExpr base class.
typename SchurTrait< T1, T2 >::Type SchurTrait_t
Auxiliary alias declaration for the SchurTrait class template.The SchurTrait_t alias declaration prov...
Definition: SchurTrait.h:164
#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
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Expression object for dense matrix-transpose dense matrix Schur product.The DMatTDMatSchurExpr class ...
Definition: DMatTDMatSchurExpr.h:103
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:808
#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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatTDMatSchurExpr.h:320
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
RightOperand rhs_
Right-hand side dense matrix of the Schur product expression.
Definition: DMatTDMatSchurExpr.h:329
SchurTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatTDMatSchurExpr.h:166
#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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTDMatSchurExpr.h:167
CompositeType_t< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:114
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Header file for the IntegralConstant class template.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTDMatSchurExpr.h:245
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTDMatSchurExpr.h:300
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the Schur product expression.
Definition: DMatTDMatSchurExpr.h:138
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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 operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTDMatSchurExpr.h:214
ReturnType_t< MT2 > RN2
Return type of the right-hand side dense matrix expression.
Definition: DMatTDMatSchurExpr.h:112
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
Constraint on the data type.