DMatSMatSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSMATSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
70 #include <blaze/util/Assert.h>
71 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/InvalidType.h>
75 #include <blaze/util/mpl/And.h>
76 #include <blaze/util/mpl/If.h>
77 #include <blaze/util/mpl/Maximum.h>
78 #include <blaze/util/Types.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // CLASS DMATSMATSUBEXPR
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
96 template< typename MT1 // Type of the left-hand side dense matrix
97  , typename MT2 // Type of the right-hand side sparse matrix
98  , bool SO > // Storage order
100  : public MatMatSubExpr< DenseMatrix< DMatSMatSubExpr<MT1,MT2,SO>, SO > >
101  , private Computation
102 {
103  private:
104  //**Type definitions****************************************************************************
109  //**********************************************************************************************
110 
111  //**Return type evaluation**********************************************************************
113 
118  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
119 
122  //**********************************************************************************************
123 
124  //**Parallel evaluation strategy****************************************************************
126 
131  template< typename MT >
132  struct UseSMPAssign {
133  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) };
134  };
136  //**********************************************************************************************
137 
138  public:
139  //**Type definitions****************************************************************************
145 
148 
150  using CompositeType = const ResultType;
151 
153  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
154 
156  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
157  //**********************************************************************************************
158 
159  //**Compilation flags***************************************************************************
161  enum : bool { simdEnabled = false };
162 
164  enum : bool { smpAssignable = false };
165  //**********************************************************************************************
166 
167  //**Constructor*********************************************************************************
173  explicit inline DMatSMatSubExpr( const MT1& lhs, const MT2& rhs ) noexcept
174  : lhs_( lhs ) // Left-hand side dense matrix of the subtraction expression
175  , rhs_( rhs ) // Right-hand side sparse matrix of the subtraction expression
176  {
177  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
178  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
179  }
180  //**********************************************************************************************
181 
182  //**Access operator*****************************************************************************
189  inline ReturnType operator()( size_t i, size_t j ) const {
190  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
191  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
192  return lhs_(i,j) - rhs_(i,j);
193  }
194  //**********************************************************************************************
195 
196  //**At function*********************************************************************************
204  inline ReturnType at( size_t i, size_t j ) const {
205  if( i >= lhs_.rows() ) {
206  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
207  }
208  if( j >= lhs_.columns() ) {
209  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
210  }
211  return (*this)(i,j);
212  }
213  //**********************************************************************************************
214 
215  //**Rows function*******************************************************************************
220  inline size_t rows() const noexcept {
221  return lhs_.rows();
222  }
223  //**********************************************************************************************
224 
225  //**Columns function****************************************************************************
230  inline size_t columns() const noexcept {
231  return lhs_.columns();
232  }
233  //**********************************************************************************************
234 
235  //**Left operand access*************************************************************************
240  inline LeftOperand leftOperand() const noexcept {
241  return lhs_;
242  }
243  //**********************************************************************************************
244 
245  //**Right operand access************************************************************************
250  inline RightOperand rightOperand() const noexcept {
251  return rhs_;
252  }
253  //**********************************************************************************************
254 
255  //**********************************************************************************************
261  template< typename T >
262  inline bool canAlias( const T* alias ) const noexcept {
263  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
264  ( rhs_.canAlias( alias ) );
265  }
266  //**********************************************************************************************
267 
268  //**********************************************************************************************
274  template< typename T >
275  inline bool isAliased( const T* alias ) const noexcept {
276  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
277  }
278  //**********************************************************************************************
279 
280  private:
281  //**Member variables****************************************************************************
284  //**********************************************************************************************
285 
286  //**Assignment to dense matrices****************************************************************
298  template< typename MT // Type of the target dense matrix
299  , bool SO2 > // Storage order of the target dense matrix
300  friend inline void assign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
301  {
303 
304  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
305  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
306 
307  if( !IsOperation<MT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
308  subAssign( ~lhs, rhs.rhs_ );
309  }
310  else {
311  assign ( ~lhs, rhs.lhs_ );
312  subAssign( ~lhs, rhs.rhs_ );
313  }
314  }
316  //**********************************************************************************************
317 
318  //**Assignment to sparse matrices***************************************************************
330  template< typename MT // Type of the target sparse matrix
331  , bool SO2 > // Storage order of the target sparse matrix
332  friend inline void assign( SparseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
333  {
335 
337 
344 
345  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
346  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
347 
348  const TmpType tmp( serial( rhs ) );
349  assign( ~lhs, tmp );
350  }
352  //**********************************************************************************************
353 
354  //**Addition assignment to dense matrices*******************************************************
366  template< typename MT // Type of the target dense matrix
367  , bool SO2 > // Storage order of the target dense matrix
368  friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
369  {
371 
372  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
373  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
374 
375  addAssign( ~lhs, rhs.lhs_ );
376  subAssign( ~lhs, rhs.rhs_ );
377  }
379  //**********************************************************************************************
380 
381  //**Addition assignment to sparse matrices******************************************************
382  // No special implementation for the addition assignment to sparse matrices.
383  //**********************************************************************************************
384 
385  //**Subtraction assignment to dense matrices****************************************************
397  template< typename MT // Type of the target dense matrix
398  , bool SO2 > // Storage order of the target dense matrix
399  friend inline void subAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
400  {
402 
403  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
404  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
405 
406  subAssign( ~lhs, rhs.lhs_ );
407  addAssign( ~lhs, rhs.rhs_ );
408  }
410  //**********************************************************************************************
411 
412  //**Subtraction assignment to sparse matrices***************************************************
413  // No special implementation for the subtraction assignment to sparse matrices.
414  //**********************************************************************************************
415 
416  //**Schur product assignment to dense matrices**************************************************
428  template< typename MT // Type of the target dense matrix
429  , bool SO2 > // Storage order of the target dense matrix
430  friend inline void schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
431  {
433 
437 
438  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
439  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
440 
441  const ResultType tmp( serial( rhs ) );
442  schurAssign( ~lhs, tmp );
443  }
445  //**********************************************************************************************
446 
447  //**Schur product assignment to sparse matrices*************************************************
448  // No special implementation for the Schur product assignment to sparse matrices.
449  //**********************************************************************************************
450 
451  //**Multiplication assignment to dense matrices*************************************************
452  // No special implementation for the multiplication assignment to dense matrices.
453  //**********************************************************************************************
454 
455  //**Multiplication assignment to sparse matrices************************************************
456  // No special implementation for the multiplication assignment to sparse matrices.
457  //**********************************************************************************************
458 
459  //**SMP assignment to dense matrices************************************************************
473  template< typename MT // Type of the target dense matrix
474  , bool SO2 > // Storage order of the target dense matrix
475  friend inline EnableIf_< UseSMPAssign<MT> >
476  smpAssign( DenseMatrix<MT,SO2>& lhs, const DMatSMatSubExpr& rhs )
477  {
479 
480  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
481  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
482 
483  if( !IsOperation<MT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
484  smpSubAssign( ~lhs, rhs.rhs_ );
485  }
486  else {
487  smpAssign ( ~lhs, rhs.lhs_ );
488  smpSubAssign( ~lhs, rhs.rhs_ );
489  }
490  }
492  //**********************************************************************************************
493 
494  //**SMP assignment to sparse matrices***********************************************************
508  template< typename MT // Type of the target sparse matrix
509  , bool SO2 > // Storage order of the target sparse matrix
510  friend inline EnableIf_< UseSMPAssign<MT> >
512  {
514 
516 
523 
524  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
525  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
526 
527  const TmpType tmp( rhs );
528  smpAssign( ~lhs, tmp );
529  }
531  //**********************************************************************************************
532 
533  //**SMP addition assignment to dense matrices***************************************************
547  template< typename MT // Type of the target dense matrix
548  , bool SO2 > // Storage order of the target dense matrix
549  friend inline EnableIf_< UseSMPAssign<MT> >
551  {
553 
554  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
555  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
556 
557  smpAddAssign( ~lhs, rhs.lhs_ );
558  smpSubAssign( ~lhs, rhs.rhs_ );
559  }
561  //**********************************************************************************************
562 
563  //**SMP addition assignment to sparse matrices**************************************************
564  // No special implementation for the SMP addition assignment to sparse matrices.
565  //**********************************************************************************************
566 
567  //**SMP subtraction assignment to dense matrices************************************************
581  template< typename MT // Type of the target dense matrix
582  , bool SO2 > // Storage order of the target dense matrix
583  friend inline EnableIf_< UseSMPAssign<MT> >
585  {
587 
588  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
589  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
590 
591  smpSubAssign( ~lhs, rhs.lhs_ );
592  smpAddAssign( ~lhs, rhs.rhs_ );
593  }
595  //**********************************************************************************************
596 
597  //**SMP subtraction assignment to sparse matrices***********************************************
598  // No special implementation for the SMP subtraction assignment to sparse matrices.
599  //**********************************************************************************************
600 
601  //**SMP Schur product assignment to dense matrices**********************************************
616  template< typename MT // Type of the target dense matrix
617  , bool SO2 > // Storage order of the target dense matrix
618  friend inline EnableIf_< UseSMPAssign<MT> >
620  {
622 
626 
627  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
628  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
629 
630  const ResultType tmp( rhs );
631  smpSchurAssign( ~lhs, tmp );
632  }
634  //**********************************************************************************************
635 
636  //**SMP Schur product assignment to sparse matrices*********************************************
637  // No special implementation for the SMP Schur product assignment to sparse matrices.
638  //**********************************************************************************************
639 
640  //**SMP multiplication assignment to dense matrices*********************************************
641  // No special implementation for the SMP multiplication assignment to dense matrices.
642  //**********************************************************************************************
643 
644  //**SMP multiplication assignment to sparse matrices********************************************
645  // No special implementation for the SMP multiplication assignment to sparse matrices.
646  //**********************************************************************************************
647 
648  //**Compile time checks*************************************************************************
655  //**********************************************************************************************
656 };
657 //*************************************************************************************************
658 
659 
660 
661 
662 //=================================================================================================
663 //
664 // GLOBAL BINARY ARITHMETIC OPERATORS
665 //
666 //=================================================================================================
667 
668 //*************************************************************************************************
697 template< typename MT1 // Type of the left-hand side dense matrix
698  , typename MT2 // Type of the right-hand side sparse matrix
699  , bool SO > // Storage order
700 inline decltype(auto)
701  operator-( const DenseMatrix<MT1,SO>& lhs, const SparseMatrix<MT2,SO>& rhs )
702 {
704 
705  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
706  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
707  }
708 
710  return ReturnType( ~lhs, ~rhs );
711 }
712 //*************************************************************************************************
713 
714 
715 
716 
717 //=================================================================================================
718 //
719 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
720 //
721 //=================================================================================================
722 
723 //*************************************************************************************************
736 template< typename MT1 // Type of the dense matrix of the left-hand side expression
737  , typename MT2 // Type of the sparse matrix of the left-hand side expression
738  , bool SO1 // Storage order of the left-hand side expression
739  , typename MT3 // Type of the right-hand side dense matrix
740  , bool SO2 > // Storage order of the right-hand side dense matrix
741 inline decltype(auto)
743 {
745 
746  return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
747 }
749 //*************************************************************************************************
750 
751 
752 //*************************************************************************************************
765 template< typename MT1 // Type of the dense matrix of the left-hand side expression
766  , typename MT2 // Type of the sparse matrix of the left-hand side expression
767  , bool SO1 // Storage order of the left-hand side expression
768  , typename MT3 // Type of the right-hand side dense matrix
769  , bool SO2 > // Storage order of the right-hand side dense matrix
770 inline decltype(auto)
772 {
774 
775  return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
776 }
778 //*************************************************************************************************
779 
780 
781 
782 
783 //=================================================================================================
784 //
785 // ROWS SPECIALIZATIONS
786 //
787 //=================================================================================================
788 
789 //*************************************************************************************************
791 template< typename MT1, typename MT2, bool SO >
792 struct Rows< DMatSMatSubExpr<MT1,MT2,SO> >
793  : public Maximum< Rows<MT1>, Rows<MT2> >
794 {};
796 //*************************************************************************************************
797 
798 
799 
800 
801 //=================================================================================================
802 //
803 // COLUMNS SPECIALIZATIONS
804 //
805 //=================================================================================================
806 
807 //*************************************************************************************************
809 template< typename MT1, typename MT2, bool SO >
810 struct Columns< DMatSMatSubExpr<MT1,MT2,SO> >
811  : public Maximum< Columns<MT1>, Columns<MT2> >
812 {};
814 //*************************************************************************************************
815 
816 
817 
818 
819 //=================================================================================================
820 //
821 // ISSYMMETRIC SPECIALIZATIONS
822 //
823 //=================================================================================================
824 
825 //*************************************************************************************************
827 template< typename MT1, typename MT2, bool SO >
828 struct IsSymmetric< DMatSMatSubExpr<MT1,MT2,SO> >
829  : public BoolConstant< IsSymmetric<MT1>::value && IsSymmetric<MT2>::value >
830 {};
832 //*************************************************************************************************
833 
834 
835 
836 
837 //=================================================================================================
838 //
839 // ISHERMITIAN SPECIALIZATIONS
840 //
841 //=================================================================================================
842 
843 //*************************************************************************************************
845 template< typename MT1, typename MT2, bool SO >
846 struct IsHermitian< DMatSMatSubExpr<MT1,MT2,SO> >
847  : public BoolConstant< IsHermitian<MT1>::value && IsHermitian<MT2>::value >
848 {};
850 //*************************************************************************************************
851 
852 
853 
854 
855 //=================================================================================================
856 //
857 // ISLOWER SPECIALIZATIONS
858 //
859 //=================================================================================================
860 
861 //*************************************************************************************************
863 template< typename MT1, typename MT2, bool SO >
864 struct IsLower< DMatSMatSubExpr<MT1,MT2,SO> >
865  : public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
866 {};
868 //*************************************************************************************************
869 
870 
871 
872 
873 //=================================================================================================
874 //
875 // ISUNILOWER SPECIALIZATIONS
876 //
877 //=================================================================================================
878 
879 //*************************************************************************************************
881 template< typename MT1, typename MT2, bool SO >
882 struct IsUniLower< DMatSMatSubExpr<MT1,MT2,SO> >
883  : public BoolConstant< And< IsUniLower<MT1>, IsStrictlyLower<MT2> >::value >
884 {};
886 //*************************************************************************************************
887 
888 
889 
890 
891 //=================================================================================================
892 //
893 // ISSTRICTLYLOWER SPECIALIZATIONS
894 //
895 //=================================================================================================
896 
897 //*************************************************************************************************
899 template< typename MT1, typename MT2, bool SO >
900 struct IsStrictlyLower< DMatSMatSubExpr<MT1,MT2,SO> >
901  : public BoolConstant< And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >::value >
902 {};
904 //*************************************************************************************************
905 
906 
907 
908 
909 //=================================================================================================
910 //
911 // ISUPPER SPECIALIZATIONS
912 //
913 //=================================================================================================
914 
915 //*************************************************************************************************
917 template< typename MT1, typename MT2, bool SO >
918 struct IsUpper< DMatSMatSubExpr<MT1,MT2,SO> >
919  : public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
920 {};
922 //*************************************************************************************************
923 
924 
925 
926 
927 //=================================================================================================
928 //
929 // ISUNIUPPER SPECIALIZATIONS
930 //
931 //=================================================================================================
932 
933 //*************************************************************************************************
935 template< typename MT1, typename MT2, bool SO >
936 struct IsUniUpper< DMatSMatSubExpr<MT1,MT2,SO> >
937  : public BoolConstant< And< IsUniUpper<MT1>, IsStrictlyUpper<MT2> >::value >
938 {};
940 //*************************************************************************************************
941 
942 
943 
944 
945 //=================================================================================================
946 //
947 // ISSTRICTLYUPPER SPECIALIZATIONS
948 //
949 //=================================================================================================
950 
951 //*************************************************************************************************
953 template< typename MT1, typename MT2, bool SO >
954 struct IsStrictlyUpper< DMatSMatSubExpr<MT1,MT2,SO> >
955  : public BoolConstant< And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >::value >
956 {};
958 //*************************************************************************************************
959 
960 } // namespace blaze
961 
962 #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
RightOperand rhs_
Right-hand side sparse matrix of the subtraction expression.
Definition: DMatSMatSubExpr.h:283
Header file for auxiliary alias declarations.
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatSMatSubExpr.h:106
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.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for 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:786
Header file for basic type definitions.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSMatSubExpr.h:262
Compile time check whether the given type is an operational expression template.This type trait class...
Definition: IsOperation.h:71
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatSMatSubExpr.h:189
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_BE_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_< ResultType > ElementType
Resulting element type.
Definition: DMatSMatSubExpr.h:144
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatSMatSubExpr.h:230
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.
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSMatSubExpr.h:275
Header file for the Computation base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
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
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatSubExpr.h:153
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
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatSMatSubExpr.h:147
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
typename SubExprTrait< T1, T2 >::Type SubExprTrait_
Auxiliary alias declaration for the SubExprTrait class template.The SubExprTrait_ alias declaration p...
Definition: SubExprTrait.h:112
Constraint on the data type.
Constraint on the data type.
Header file for the Maximum class template.
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Header file for the IsTemporary type trait class.
Header file for the IsStrictlyUpper type trait.
LeftOperand lhs_
Left-hand side dense matrix of the subtraction expression.
Definition: DMatSMatSubExpr.h:282
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: DMatSMatSubExpr.h:250
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:67
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
ReturnType_< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: DMatSMatSubExpr.h:108
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatSMatSubExpr.h:150
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatSMatSubExpr.h:142
#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.
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.
SubTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatSMatSubExpr.h:141
Header file for the IsOperation type trait class.
Header file for the IsLower type trait.
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatSMatSubExpr.h:240
SubExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DMatSMatSubExpr.h:121
Header file for run time assertion macros.
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatSMatSubExpr.h:107
Expression object for dense matrix-sparse matrix subtractions.The DMatSMatSubExpr class represents th...
Definition: DMatSMatSubExpr.h:99
Utility type for generic codes.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatSMatSubExpr.h:204
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatSMatSubExpr.h:220
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
#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
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
DMatSMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatSMatSubExpr class.
Definition: DMatSMatSubExpr.h:173
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSMatSubExpr.h:143
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:250
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatSMatSubExpr.h:105
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
#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:108
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
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:95
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatSubExpr.h:156
Header file for the IsExpression type trait class.
Header file for the function trace functionality.