TDMatSMatSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
78 #include <blaze/util/Assert.h>
80 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/InvalidType.h>
84 #include <blaze/util/mpl/And.h>
85 #include <blaze/util/mpl/If.h>
86 #include <blaze/util/mpl/Max.h>
87 #include <blaze/util/Types.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS TDMATSMATSUBEXPR
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
105 template< typename MT1 // Type of the left-hand side dense matrix
106  , typename MT2 > // Type of the right-hand side sparse matrix
107 class TDMatSMatSubExpr : public DenseMatrix< TDMatSMatSubExpr<MT1,MT2>, true >
108  , private MatMatSubExpr
109  , private Computation
110 {
111  private:
112  //**Type definitions****************************************************************************
117  //**********************************************************************************************
118 
119  //**Return type evaluation**********************************************************************
121 
126  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
127 
130  //**********************************************************************************************
131 
132  //**Parallel evaluation strategy****************************************************************
134 
139  template< typename MT >
140  struct UseSMPAssign {
141  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) };
142  };
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
153 
156 
158  typedef const ResultType CompositeType;
159 
161  typedef If_< IsExpression<MT1>, const MT1, const MT1& > LeftOperand;
162 
164  typedef If_< IsExpression<MT2>, const MT2, const MT2& > RightOperand;
165  //**********************************************************************************************
166 
167  //**Compilation flags***************************************************************************
169  enum : bool { simdEnabled = false };
170 
172  enum : bool { smpAssignable = false };
173  //**********************************************************************************************
174 
175  //**Constructor*********************************************************************************
181  explicit inline TDMatSMatSubExpr( const MT1& lhs, const MT2& rhs ) noexcept
182  : lhs_( lhs ) // Left-hand side dense matrix of the subtraction expression
183  , rhs_( rhs ) // Right-hand side sparse matrix of the subtraction expression
184  {
185  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
186  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
187  }
188  //**********************************************************************************************
189 
190  //**Access operator*****************************************************************************
197  inline ReturnType operator()( size_t i, size_t j ) const {
198  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
199  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
200  return lhs_(i,j) - rhs_(i,j);
201  }
202  //**********************************************************************************************
203 
204  //**At function*********************************************************************************
212  inline ReturnType at( size_t i, size_t j ) const {
213  if( i >= lhs_.rows() ) {
214  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
215  }
216  if( j >= lhs_.columns() ) {
217  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
218  }
219  return (*this)(i,j);
220  }
221  //**********************************************************************************************
222 
223  //**Rows function*******************************************************************************
228  inline size_t rows() const noexcept {
229  return lhs_.rows();
230  }
231  //**********************************************************************************************
232 
233  //**Columns function****************************************************************************
238  inline size_t columns() const noexcept {
239  return lhs_.columns();
240  }
241  //**********************************************************************************************
242 
243  //**Left operand access*************************************************************************
248  inline LeftOperand leftOperand() const noexcept {
249  return lhs_;
250  }
251  //**********************************************************************************************
252 
253  //**Right operand access************************************************************************
258  inline RightOperand rightOperand() const noexcept {
259  return rhs_;
260  }
261  //**********************************************************************************************
262 
263  //**********************************************************************************************
269  template< typename T >
270  inline bool canAlias( const T* alias ) const noexcept {
271  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
272  ( rhs_.canAlias( alias ) );
273  }
274  //**********************************************************************************************
275 
276  //**********************************************************************************************
282  template< typename T >
283  inline bool isAliased( const T* alias ) const noexcept {
284  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
285  }
286  //**********************************************************************************************
287 
288  private:
289  //**Member variables****************************************************************************
290  LeftOperand lhs_;
291  RightOperand rhs_;
292  //**********************************************************************************************
293 
294  //**Assignment to dense matrices****************************************************************
306  template< typename MT // Type of the target dense matrix
307  , bool SO2 > // Storage order of the target dense matrix
308  friend inline void assign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
309  {
311 
312  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
313  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
314 
315  if( !IsExpression<MT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
316  subAssign( ~lhs, rhs.rhs_ );
317  }
318  else {
319  assign ( ~lhs, rhs.lhs_ );
320  subAssign( ~lhs, rhs.rhs_ );
321  }
322  }
324  //**********************************************************************************************
325 
326  //**Assignment to sparse matrices***************************************************************
338  template< typename MT // Type of the target sparse matrix
339  , bool SO2 > // Storage order of the target sparse matrix
340  friend inline void assign( SparseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
341  {
343 
345 
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  const TmpType tmp( serial( rhs ) );
357  assign( ~lhs, tmp );
358  }
360  //**********************************************************************************************
361 
362  //**Addition assignment to dense matrices*******************************************************
375  template< typename MT // Type of the target dense matrix
376  , bool SO2 > // Storage order of the target dense matrix
377  friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
378  {
380 
381  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
382  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
383 
384  addAssign( ~lhs, rhs.lhs_ );
385  subAssign( ~lhs, rhs.rhs_ );
386  }
388  //**********************************************************************************************
389 
390  //**Addition assignment to sparse matrices******************************************************
391  // No special implementation for the addition assignment to sparse matrices.
392  //**********************************************************************************************
393 
394  //**Subtraction assignment to dense matrices****************************************************
407  template< typename MT // Type of the target dense matrix
408  , bool SO2 > // Storage order of the target dense matrix
409  friend inline void subAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
410  {
412 
413  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
414  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
415 
416  subAssign( ~lhs, rhs.lhs_ );
417  addAssign( ~lhs, rhs.rhs_ );
418  }
420  //**********************************************************************************************
421 
422  //**Subtraction assignment to sparse matrices***************************************************
423  // No special implementation for the subtraction assignment to sparse matrices.
424  //**********************************************************************************************
425 
426  //**Multiplication assignment to dense matrices*************************************************
427  // No special implementation for the multiplication assignment to dense matrices.
428  //**********************************************************************************************
429 
430  //**Multiplication assignment to sparse matrices************************************************
431  // No special implementation for the multiplication assignment to sparse matrices.
432  //**********************************************************************************************
433 
434  //**SMP assignment to dense matrices************************************************************
448  template< typename MT // Type of the target dense matrix
449  , bool SO2 > // Storage order of the target dense matrix
450  friend inline EnableIf_< UseSMPAssign<MT> >
451  smpAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
452  {
454 
455  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
456  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
457 
458  if( !IsExpression<MT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
459  smpSubAssign( ~lhs, rhs.rhs_ );
460  }
461  else {
462  smpAssign ( ~lhs, rhs.lhs_ );
463  smpSubAssign( ~lhs, rhs.rhs_ );
464  }
465  }
467  //**********************************************************************************************
468 
469  //**SMP assignment to sparse matrices***********************************************************
483  template< typename MT // Type of the target sparse matrix
484  , bool SO2 > // Storage order of the target sparse matrix
485  friend inline EnableIf_< UseSMPAssign<MT> >
486  smpAssign( SparseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
487  {
489 
490  typedef IfTrue_< SO2, ResultType, OppositeType > TmpType;
491 
497  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<TmpType> );
498 
499  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
500  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
501 
502  const TmpType tmp( rhs );
503  smpAssign( ~lhs, tmp );
504  }
506  //**********************************************************************************************
507 
508  //**SMP addition assignment to dense matrices***************************************************
523  template< typename MT // Type of the target dense matrix
524  , bool SO2 > // Storage order of the target dense matrix
525  friend inline EnableIf_< UseSMPAssign<MT> >
526  smpAddAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
527  {
529 
530  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
531  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
532 
533  smpAddAssign( ~lhs, rhs.lhs_ );
534  smpSubAssign( ~lhs, rhs.rhs_ );
535  }
537  //**********************************************************************************************
538 
539  //**SMP addition assignment to sparse matrices**************************************************
540  // No special implementation for the SMP addition assignment to sparse matrices.
541  //**********************************************************************************************
542 
543  //**SMP subtraction assignment to dense matrices************************************************
558  template< typename MT // Type of the target dense matrix
559  , bool SO2 > // Storage order of the target dense matrix
560  friend inline EnableIf_< UseSMPAssign<MT> >
561  smpSubAssign( DenseMatrix<MT,SO2>& lhs, const TDMatSMatSubExpr& rhs )
562  {
564 
565  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
566  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
567 
568  smpSubAssign( ~lhs, rhs.lhs_ );
569  smpAddAssign( ~lhs, rhs.rhs_ );
570  }
572  //**********************************************************************************************
573 
574  //**SMP subtraction assignment to sparse matrices***********************************************
575  // No special implementation for the SMP subtraction assignment to sparse matrices.
576  //**********************************************************************************************
577 
578  //**SMP multiplication assignment to dense matrices*********************************************
579  // No special implementation for the SMP multiplication assignment to dense matrices.
580  //**********************************************************************************************
581 
582  //**SMP multiplication assignment to sparse matrices********************************************
583  // No special implementation for the SMP multiplication assignment to sparse matrices.
584  //**********************************************************************************************
585 
586  //**Compile time checks*************************************************************************
594  //**********************************************************************************************
595 };
596 //*************************************************************************************************
597 
598 
599 
600 
601 //=================================================================================================
602 //
603 // GLOBAL BINARY ARITHMETIC OPERATORS
604 //
605 //=================================================================================================
606 
607 //*************************************************************************************************
638 template< typename T1 // Type of the left-hand side dense matrix
639  , typename T2 > // Type of the right-hand side sparse matrix
640 inline const TDMatSMatSubExpr<T1,T2>
642 {
644 
645  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
646  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
647  }
648 
649  return TDMatSMatSubExpr<T1,T2>( ~lhs, ~rhs );
650 }
651 //*************************************************************************************************
652 
653 
654 
655 
656 //=================================================================================================
657 //
658 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
659 //
660 //=================================================================================================
661 
662 //*************************************************************************************************
675 template< typename T1 // Type of the dense matrix of the left-hand side expression
676  , typename T2 // Type of the sparse matrix of the left-hand side expression
677  , typename T3 // Type of the right-hand side dense matrix
678  , bool SO > // Storage order of the right-hand side dense matrix
679 inline const AddExprTrait_< TDMatSMatSubExpr<T1,T2>, T3 >
680  operator+( const TDMatSMatSubExpr<T1,T2>& lhs, const DenseMatrix<T3,SO>& rhs )
681 {
683 
684  return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
685 }
687 //*************************************************************************************************
688 
689 
690 //*************************************************************************************************
703 template< typename T1 // Type of the dense matrix of the left-hand side expression
704  , typename T2 // Type of the sparse matrix of the left-hand side expression
705  , typename T3 // Type of the right-hand side dense matrix
706  , bool SO > // Storage order of the right-hand side dense matrix
707 inline const SubExprTrait_< TDMatSMatSubExpr<T1,T2>, T3 >
708  operator-( const TDMatSMatSubExpr<T1,T2>& lhs, const DenseMatrix<T3,SO>& rhs )
709 {
711 
712  return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
713 }
715 //*************************************************************************************************
716 
717 
718 
719 
720 //=================================================================================================
721 //
722 // ROWS SPECIALIZATIONS
723 //
724 //=================================================================================================
725 
726 //*************************************************************************************************
728 template< typename MT1, typename MT2 >
729 struct Rows< TDMatSMatSubExpr<MT1,MT2> >
730  : public Max< Rows<MT1>, Rows<MT2> >
731 {};
733 //*************************************************************************************************
734 
735 
736 
737 
738 //=================================================================================================
739 //
740 // COLUMNS SPECIALIZATIONS
741 //
742 //=================================================================================================
743 
744 //*************************************************************************************************
746 template< typename MT1, typename MT2 >
747 struct Columns< TDMatSMatSubExpr<MT1,MT2> >
748  : public Max< Columns<MT1>, Columns<MT2> >
749 {};
751 //*************************************************************************************************
752 
753 
754 
755 
756 //=================================================================================================
757 //
758 // ISSYMMETRIC SPECIALIZATIONS
759 //
760 //=================================================================================================
761 
762 //*************************************************************************************************
764 template< typename MT1, typename MT2 >
765 struct IsSymmetric< TDMatSMatSubExpr<MT1,MT2> >
766  : public BoolConstant< IsSymmetric<MT1>::value && IsSymmetric<MT2>::value >
767 {};
769 //*************************************************************************************************
770 
771 
772 
773 
774 //=================================================================================================
775 //
776 // ISHERMITIAN SPECIALIZATIONS
777 //
778 //=================================================================================================
779 
780 //*************************************************************************************************
782 template< typename MT1, typename MT2 >
783 struct IsHermitian< TDMatSMatSubExpr<MT1,MT2> >
784  : public BoolConstant< IsHermitian<MT1>::value && IsHermitian<MT2>::value >
785 {};
787 //*************************************************************************************************
788 
789 
790 
791 
792 //=================================================================================================
793 //
794 // ISLOWER SPECIALIZATIONS
795 //
796 //=================================================================================================
797 
798 //*************************************************************************************************
800 template< typename MT1, typename MT2 >
801 struct IsLower< TDMatSMatSubExpr<MT1,MT2> >
802  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
803 {};
805 //*************************************************************************************************
806 
807 
808 
809 
810 //=================================================================================================
811 //
812 // ISUNILOWER SPECIALIZATIONS
813 //
814 //=================================================================================================
815 
816 //*************************************************************************************************
818 template< typename MT1, typename MT2 >
819 struct IsUniLower< TDMatSMatSubExpr<MT1,MT2> >
820  : public BoolConstant< And< IsUniLower<MT1>, IsStrictlyLower<MT2> >::value >
821 {};
823 //*************************************************************************************************
824 
825 
826 
827 
828 //=================================================================================================
829 //
830 // ISSTRICTLYLOWER SPECIALIZATIONS
831 //
832 //=================================================================================================
833 
834 //*************************************************************************************************
836 template< typename MT1, typename MT2 >
837 struct IsStrictlyLower< TDMatSMatSubExpr<MT1,MT2> >
838  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
839 {};
841 //*************************************************************************************************
842 
843 
844 
845 
846 //=================================================================================================
847 //
848 // ISUPPER SPECIALIZATIONS
849 //
850 //=================================================================================================
851 
852 //*************************************************************************************************
854 template< typename MT1, typename MT2 >
855 struct IsUpper< TDMatSMatSubExpr<MT1,MT2> >
856  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
857 {};
859 //*************************************************************************************************
860 
861 
862 
863 
864 //=================================================================================================
865 //
866 // ISUNIUPPER SPECIALIZATIONS
867 //
868 //=================================================================================================
869 
870 //*************************************************************************************************
872 template< typename MT1, typename MT2 >
873 struct IsUniUpper< TDMatSMatSubExpr<MT1,MT2> >
874  : public BoolConstant< And< IsUniUpper<MT1>, IsStrictlyUpper<MT2> >::value >
875 {};
877 //*************************************************************************************************
878 
879 
880 
881 
882 //=================================================================================================
883 //
884 // ISSTRICTLYUPPER SPECIALIZATIONS
885 //
886 //=================================================================================================
887 
888 //*************************************************************************************************
890 template< typename MT1, typename MT2 >
891 struct IsStrictlyUpper< TDMatSMatSubExpr<MT1,MT2> >
892  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
893 {};
895 //*************************************************************************************************
896 
897 
898 
899 
900 //=================================================================================================
901 //
902 // EXPRESSION TRAIT SPECIALIZATIONS
903 //
904 //=================================================================================================
905 
906 //*************************************************************************************************
908 template< typename MT1, typename MT2, typename MT3 >
909 struct DMatDMatAddExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
910 {
911  public:
912  //**********************************************************************************************
914  using Type = If_< And< IsDenseMatrix<MT1>, IsColumnMajorMatrix<MT1>
915  , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
916  , IsDenseMatrix<MT3>, IsRowMajorMatrix<MT3> >
917  , DMatSMatSubExprTrait_< TDMatDMatAddExprTrait_<MT1,MT3>, MT2 >
918  , INVALID_TYPE >;
920  //**********************************************************************************************
921 };
923 //*************************************************************************************************
924 
925 
926 //*************************************************************************************************
928 template< typename MT1, typename MT2, typename MT3 >
929 struct DMatTDMatAddExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
930 {
931  public:
932  //**********************************************************************************************
934  using Type = If_< And< IsDenseMatrix<MT1>, IsColumnMajorMatrix<MT1>
935  , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
936  , IsDenseMatrix<MT3>, IsColumnMajorMatrix<MT3> >
937  , TDMatSMatSubExprTrait_< TDMatTDMatAddExprTrait_<MT1,MT3>, MT2 >
938  , INVALID_TYPE >;
940  //**********************************************************************************************
941 };
943 //*************************************************************************************************
944 
945 
946 //*************************************************************************************************
948 template< typename MT1, typename MT2, typename MT3 >
949 struct DMatDMatSubExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
950 {
951  public:
952  //**********************************************************************************************
954  using Type = If_< And< IsDenseMatrix<MT1>, IsColumnMajorMatrix<MT1>
955  , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
956  , IsDenseMatrix<MT3>, IsRowMajorMatrix<MT3> >
957  , DMatSMatSubExprTrait_< TDMatDMatSubExprTrait_<MT1,MT3>, MT2 >
958  , INVALID_TYPE >;
960  //**********************************************************************************************
961 };
963 //*************************************************************************************************
964 
965 
966 //*************************************************************************************************
968 template< typename MT1, typename MT2, typename MT3 >
969 struct DMatTDMatSubExprTrait< TDMatSMatSubExpr<MT1,MT2>, MT3 >
970 {
971  public:
972  //**********************************************************************************************
974  using Type = If_< And< IsDenseMatrix<MT1>, IsColumnMajorMatrix<MT1>
975  , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
976  , IsDenseMatrix<MT3>, IsColumnMajorMatrix<MT3> >
977  , TDMatSMatSubExprTrait_< TDMatTDMatSubExprTrait_<MT1,MT3>, MT2 >
978  , INVALID_TYPE >;
980  //**********************************************************************************************
981 };
983 //*************************************************************************************************
984 
985 
986 //*************************************************************************************************
988 template< typename MT1, typename MT2, bool AF >
989 struct SubmatrixExprTrait< TDMatSMatSubExpr<MT1,MT2>, AF >
990 {
991  public:
992  //**********************************************************************************************
993  using Type = SubExprTrait_< SubmatrixExprTrait_<const MT1,AF>
994  , SubmatrixExprTrait_<const MT2,AF> >;
995  //**********************************************************************************************
996 };
998 //*************************************************************************************************
999 
1000 
1001 //*************************************************************************************************
1003 template< typename MT1, typename MT2 >
1004 struct RowExprTrait< TDMatSMatSubExpr<MT1,MT2> >
1005 {
1006  public:
1007  //**********************************************************************************************
1008  using Type = SubExprTrait_< RowExprTrait_<const MT1>
1009  , RowExprTrait_<const MT2> >;
1010  //**********************************************************************************************
1011 };
1013 //*************************************************************************************************
1014 
1015 
1016 //*************************************************************************************************
1018 template< typename MT1, typename MT2 >
1019 struct ColumnExprTrait< TDMatSMatSubExpr<MT1,MT2> >
1020 {
1021  public:
1022  //**********************************************************************************************
1023  using Type = SubExprTrait_< ColumnExprTrait_<const MT1>
1024  , ColumnExprTrait_<const MT2> >;
1025  //**********************************************************************************************
1026 };
1028 //*************************************************************************************************
1029 
1030 } // namespace blaze
1031 
1032 #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.
ReturnType_< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: TDMatSMatSubExpr.h:116
Header file for the Max class template.
LeftOperand lhs_
Left-hand side dense matrix of the subtraction expression.
Definition: TDMatSMatSubExpr.h:290
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE 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:653
Header file for basic type definitions.
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:160
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatSMatSubExpr.h:158
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatSMatSubExpr.h:114
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
If_< IsExpression< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatSubExpr.h:164
#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
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatSMatSubExpr.h:197
Header file for the And class template.
Header file for the AddExprTrait class template.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the Computation base class.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
Constraints on the storage order of matrix types.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TDMatSMatSubExpr.h:270
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSMatSubExpr.h:248
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:323
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:129
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
Constraint on the data type.
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
SubTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TDMatSMatSubExpr.h:149
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
typename SubExprTrait< T1, T2 >::Type SubExprTrait_
Auxiliary alias declaration for the SubExprTrait class template.The SubExprTrait_ alias declaration p...
Definition: SubExprTrait.h:220
Constraint on the data type.
Constraint on the data type.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
If_< IsExpression< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatSubExpr.h:161
RightOperand rhs_
Right-hand side sparse matrix of the subtraction expression.
Definition: TDMatSMatSubExpr.h:291
Header file for the IsTemporary type trait class.
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
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:98
#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.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSMatSubExpr.h:283
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for the MatMatSubExpr base class.
TDMatSMatSubExpr< MT1, MT2 > This
Type of this TDMatSMatSubExpr instance.
Definition: TDMatSMatSubExpr.h:148
Header file for the IsLower type trait.
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: TDMatSMatSubExpr.h:115
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
Constraints on the storage order of matrix types.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TDMatSMatSubExpr.h:212
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TDMatSMatSubExpr.h:151
Header file for the exception macros of the math module.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
SubExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: TDMatSMatSubExpr.h:129
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: TDMatSMatSubExpr.h:155
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TDMatSMatSubExpr.h:228
Header file for the SubmatrixExprTrait class template.
#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 run time assertion macros.
Utility type for generic codes.
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatSMatSubExpr.h:113
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:160
Constraints on the storage order of matrix types.
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TDMatSMatSubExpr.h:152
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
#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
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatSMatSubExpr.h:150
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TDMatSMatSubExpr.h:238
TDMatSMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TDMatSMatSubExpr class.
Definition: TDMatSMatSubExpr.h:181
Header file for the IsRowMajorMatrix type trait.
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:245
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: TDMatSMatSubExpr.h:258
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATSUBEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatSubExpr.h:109
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Header file for the IsHermitian type trait.
Header file for the SubExprTrait class template.
#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
Expression object for transpose dense matrix-sparse matrix subtractions.The TDMatSMatSubExpr class re...
Definition: Forward.h:132
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:71
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.