DMatTSMatSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTSMATSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTSMATSUBEXPR_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 DMATTSMATSUBEXPR
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 DMatTSMatSubExpr : public DenseMatrix< DMatTSMatSubExpr<MT1,MT2>, false >
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 DMatTSMatSubExpr( 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 DMatTSMatSubExpr& 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 DMatTSMatSubExpr& 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 DMatTSMatSubExpr& 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 DMatTSMatSubExpr& 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 DMatTSMatSubExpr& 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 DMatTSMatSubExpr& rhs )
487  {
489 
490  typedef IfTrue_< SO2, OppositeType, ResultType > 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 DMatTSMatSubExpr& 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 DMatTSMatSubExpr& 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 //*************************************************************************************************
637 template< typename T1 // Type of the left-hand side dense matrix
638  , typename T2 > // Type of the right-hand side sparse matrix
639 inline const DMatTSMatSubExpr<T1,T2>
641 {
643 
644  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
645  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
646  }
647 
648  return DMatTSMatSubExpr<T1,T2>( ~lhs, ~rhs );
649 }
650 //*************************************************************************************************
651 
652 
653 
654 
655 //=================================================================================================
656 //
657 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
658 //
659 //=================================================================================================
660 
661 //*************************************************************************************************
674 template< typename T1 // Type of the dense matrix of the left-hand side expression
675  , typename T2 // Type of the sparse matrix of the left-hand side expression
676  , typename T3 // Type of the right-hand side dense matrix
677  , bool SO > // Storage order of the right-hand side dense matrix
678 inline const AddExprTrait_< DMatTSMatSubExpr<T1,T2>, T3 >
679  operator+( const DMatTSMatSubExpr<T1,T2>& lhs, const DenseMatrix<T3,SO>& rhs )
680 {
682 
683  return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
684 }
686 //*************************************************************************************************
687 
688 
689 //*************************************************************************************************
702 template< typename T1 // Type of the dense matrix of the left-hand side expression
703  , typename T2 // Type of the sparse matrix of the left-hand side expression
704  , typename T3 // Type of the right-hand side dense matrix
705  , bool SO > // Storage order of the right-hand side dense matrix
706 inline const SubExprTrait_< DMatTSMatSubExpr<T1,T2>, T3 >
707  operator-( const DMatTSMatSubExpr<T1,T2>& lhs, const DenseMatrix<T3,SO>& rhs )
708 {
710 
711  return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
712 }
714 //*************************************************************************************************
715 
716 
717 
718 
719 //=================================================================================================
720 //
721 // ROWS SPECIALIZATIONS
722 //
723 //=================================================================================================
724 
725 //*************************************************************************************************
727 template< typename MT1, typename MT2 >
728 struct Rows< DMatTSMatSubExpr<MT1,MT2> >
729  : public Max< Rows<MT1>, Rows<MT2> >
730 {};
732 //*************************************************************************************************
733 
734 
735 
736 
737 //=================================================================================================
738 //
739 // COLUMNS SPECIALIZATIONS
740 //
741 //=================================================================================================
742 
743 //*************************************************************************************************
745 template< typename MT1, typename MT2 >
746 struct Columns< DMatTSMatSubExpr<MT1,MT2> >
747  : public Max< Columns<MT1>, Columns<MT2> >
748 {};
750 //*************************************************************************************************
751 
752 
753 
754 
755 //=================================================================================================
756 //
757 // ISSYMMETRIC SPECIALIZATIONS
758 //
759 //=================================================================================================
760 
761 //*************************************************************************************************
763 template< typename MT1, typename MT2 >
764 struct IsSymmetric< DMatTSMatSubExpr<MT1,MT2> >
765  : public BoolConstant< IsSymmetric<MT1>::value && IsSymmetric<MT2>::value >
766 {};
768 //*************************************************************************************************
769 
770 
771 
772 
773 //=================================================================================================
774 //
775 // ISHERMITIAN SPECIALIZATIONS
776 //
777 //=================================================================================================
778 
779 //*************************************************************************************************
781 template< typename MT1, typename MT2 >
782 struct IsHermitian< DMatTSMatSubExpr<MT1,MT2> >
783  : public BoolConstant< IsHermitian<MT1>::value && IsHermitian<MT2>::value >
784 {};
786 //*************************************************************************************************
787 
788 
789 
790 
791 //=================================================================================================
792 //
793 // ISLOWER SPECIALIZATIONS
794 //
795 //=================================================================================================
796 
797 //*************************************************************************************************
799 template< typename MT1, typename MT2 >
800 struct IsLower< DMatTSMatSubExpr<MT1,MT2> >
801  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
802 {};
804 //*************************************************************************************************
805 
806 
807 
808 
809 //=================================================================================================
810 //
811 // ISUNILOWER SPECIALIZATIONS
812 //
813 //=================================================================================================
814 
815 //*************************************************************************************************
817 template< typename MT1, typename MT2 >
818 struct IsUniLower< DMatTSMatSubExpr<MT1,MT2> >
819  : public BoolConstant< And< IsUniLower<MT1>, IsStrictlyLower<MT2> >::value >
820 {};
822 //*************************************************************************************************
823 
824 
825 
826 
827 //=================================================================================================
828 //
829 // ISSTRICTLYLOWER SPECIALIZATIONS
830 //
831 //=================================================================================================
832 
833 //*************************************************************************************************
835 template< typename MT1, typename MT2 >
836 struct IsStrictlyLower< DMatTSMatSubExpr<MT1,MT2> >
837  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
838 {};
840 //*************************************************************************************************
841 
842 
843 
844 
845 //=================================================================================================
846 //
847 // ISUPPER SPECIALIZATIONS
848 //
849 //=================================================================================================
850 
851 //*************************************************************************************************
853 template< typename MT1, typename MT2 >
854 struct IsUpper< DMatTSMatSubExpr<MT1,MT2> >
855  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
856 {};
858 //*************************************************************************************************
859 
860 
861 
862 
863 //=================================================================================================
864 //
865 // ISUNIUPPER SPECIALIZATIONS
866 //
867 //=================================================================================================
868 
869 //*************************************************************************************************
871 template< typename MT1, typename MT2 >
872 struct IsUniUpper< DMatTSMatSubExpr<MT1,MT2> >
873  : public BoolConstant< And< IsUniUpper<MT1>, IsStrictlyUpper<MT2> >::value >
874 {};
876 //*************************************************************************************************
877 
878 
879 
880 
881 //=================================================================================================
882 //
883 // ISSTRICTLYUPPER SPECIALIZATIONS
884 //
885 //=================================================================================================
886 
887 //*************************************************************************************************
889 template< typename MT1, typename MT2 >
890 struct IsStrictlyUpper< DMatTSMatSubExpr<MT1,MT2> >
891  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
892 {};
894 //*************************************************************************************************
895 
896 
897 
898 
899 //=================================================================================================
900 //
901 // EXPRESSION TRAIT SPECIALIZATIONS
902 //
903 //=================================================================================================
904 
905 //*************************************************************************************************
907 template< typename MT1, typename MT2, typename MT3 >
908 struct DMatDMatAddExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
909 {
910  public:
911  //**********************************************************************************************
913  using Type = If_< And< IsDenseMatrix<MT1>, IsRowMajorMatrix<MT1>
914  , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
915  , IsDenseMatrix<MT3>, IsRowMajorMatrix<MT3> >
916  , DMatTSMatSubExprTrait_< DMatDMatAddExprTrait_<MT1,MT3>, MT2 >
917  , INVALID_TYPE >;
919  //**********************************************************************************************
920 };
922 //*************************************************************************************************
923 
924 
925 //*************************************************************************************************
927 template< typename MT1, typename MT2, typename MT3 >
928 struct DMatTDMatAddExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
929 {
930  public:
931  //**********************************************************************************************
933  using Type = If_< And< IsDenseMatrix<MT1>, IsRowMajorMatrix<MT1>
934  , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
935  , IsDenseMatrix<MT3>, IsColumnMajorMatrix<MT3> >
936  , DMatTSMatSubExprTrait_< DMatTDMatAddExprTrait_<MT1,MT3>, MT2 >
937  , INVALID_TYPE >;
939  //**********************************************************************************************
940 };
942 //*************************************************************************************************
943 
944 
945 //*************************************************************************************************
947 template< typename MT1, typename MT2, typename MT3 >
948 struct DMatDMatSubExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
949 {
950  public:
951  //**********************************************************************************************
953  using Type = If_< And< IsDenseMatrix<MT1>, IsRowMajorMatrix<MT1>
954  , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
955  , IsDenseMatrix<MT3>, IsRowMajorMatrix<MT3> >
956  , DMatTSMatSubExprTrait_< DMatDMatSubExprTrait_<MT1,MT3>, MT2 >
957  , INVALID_TYPE >;
959  //**********************************************************************************************
960 };
962 //*************************************************************************************************
963 
964 
965 //*************************************************************************************************
967 template< typename MT1, typename MT2, typename MT3 >
968 struct DMatTDMatSubExprTrait< DMatTSMatSubExpr<MT1,MT2>, MT3 >
969 {
970  public:
971  //**********************************************************************************************
973  using Type = If_< And< IsDenseMatrix<MT1>, IsRowMajorMatrix<MT1>
974  , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
975  , IsDenseMatrix<MT3>, IsColumnMajorMatrix<MT3> >
976  , DMatTSMatSubExprTrait_< DMatTDMatSubExprTrait_<MT1,MT3>, MT2 >
977  , INVALID_TYPE >;
979  //**********************************************************************************************
980 };
982 //*************************************************************************************************
983 
984 
985 //*************************************************************************************************
987 template< typename MT1, typename MT2, bool AF >
988 struct SubmatrixExprTrait< DMatTSMatSubExpr<MT1,MT2>, AF >
989 {
990  public:
991  //**********************************************************************************************
992  using Type = SubExprTrait_< SubmatrixExprTrait_<const MT1,AF>
993  , SubmatrixExprTrait_<const MT2,AF> >;
994  //**********************************************************************************************
995 };
997 //*************************************************************************************************
998 
999 
1000 //*************************************************************************************************
1002 template< typename MT1, typename MT2 >
1003 struct RowExprTrait< DMatTSMatSubExpr<MT1,MT2> >
1004 {
1005  public:
1006  //**********************************************************************************************
1007  using Type = SubExprTrait_< RowExprTrait_<const MT1>
1008  , RowExprTrait_<const MT2> >;
1009  //**********************************************************************************************
1010 };
1012 //*************************************************************************************************
1013 
1014 
1015 //*************************************************************************************************
1017 template< typename MT1, typename MT2 >
1018 struct ColumnExprTrait< DMatTSMatSubExpr<MT1,MT2> >
1019 {
1020  public:
1021  //**********************************************************************************************
1022  using Type = SubExprTrait_< ColumnExprTrait_<const MT1>
1023  , ColumnExprTrait_<const MT2> >;
1024  //**********************************************************************************************
1025 };
1027 //*************************************************************************************************
1028 
1029 } // namespace blaze
1030 
1031 #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 the Max class template.
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.
LeftOperand lhs_
Left-hand side dense matrix of the subtraction expression.
Definition: DMatTSMatSubExpr.h:290
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.
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatTSMatSubExpr.h:152
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatTSMatSubExpr.h:113
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose sparse matrix operand.
Definition: DMatTSMatSubExpr.h:258
SubExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DMatTSMatSubExpr.h:129
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
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Header file for the ColumnExprTrait class template.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTSMatSubExpr.h:151
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTSMatSubExpr.h:197
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
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.
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
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTSMatSubExpr.h:150
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
Header file for the IsTemporary type trait class.
Header file for the IsStrictlyUpper type trait.
If_< IsExpression< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatTSMatSubExpr.h:164
Header file for the IsSymmetric type trait.
Base class for all matrix/matrix subtraction expression templates.The MatMatSubExpr class serves as a...
Definition: MatMatSubExpr.h:65
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Expression object for dense matrix-transpose sparse matrix subtractions.The DMatTSMatSubExpr class re...
Definition: DMatTSMatSubExpr.h:107
#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
SubTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatTSMatSubExpr.h:149
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.
DMatTSMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatTSMatSubExpr class.
Definition: DMatTSMatSubExpr.h:181
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.
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatTSMatSubExpr.h:114
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTSMatSubExpr.h:228
Header file for the IsLower type trait.
#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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTSMatSubExpr.h:283
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTSMatSubExpr.h:270
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatTSMatSubExpr.h:248
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTSMatSubExpr.h:212
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.
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
ReturnType_< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: DMatTSMatSubExpr.h:116
Constraints on the storage order of matrix types.
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
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatTSMatSubExpr.h:155
#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
RightOperand rhs_
Right-hand side sparse matrix of the subtraction expression.
Definition: DMatTSMatSubExpr.h:291
Header file for the IsRowMajorMatrix type trait.
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatTSMatSubExpr.h:115
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:245
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTSMatSubExpr.h:238
DMatTSMatSubExpr< MT1, MT2 > This
Type of this DMatTSMatSubExpr instance.
Definition: DMatTSMatSubExpr.h:148
#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.
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatTSMatSubExpr.h:158
#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
#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.
If_< IsExpression< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatTSMatSubExpr.h:161