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>
51 #include <blaze/math/Exception.h>
71 #include <blaze/util/Assert.h>
72 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/mpl/And.h>
75 #include <blaze/util/mpl/If.h>
76 #include <blaze/util/mpl/Maximum.h>
77 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DMATTSMATSUBEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename MT1 // Type of the left-hand side dense matrix
96  , typename MT2 > // Type of the right-hand side sparse matrix
98  : public MatMatSubExpr< DenseMatrix< DMatTSMatSubExpr<MT1,MT2>, false > >
99  , private Computation
100 {
101  private:
102  //**Type definitions****************************************************************************
107  //**********************************************************************************************
108 
109  //**Return type evaluation**********************************************************************
111 
116  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
117 
120  //**********************************************************************************************
121 
122  //**Parallel evaluation strategy****************************************************************
124 
129  template< typename MT >
130  struct UseSMPAssign {
131  enum : bool { value = ( !MT1::smpAssignable || !MT2::smpAssignable ) };
132  };
134  //**********************************************************************************************
135 
136  public:
137  //**Type definitions****************************************************************************
143 
146 
148  using CompositeType = const ResultType;
149 
151  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
152 
154  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
155  //**********************************************************************************************
156 
157  //**Compilation flags***************************************************************************
159  enum : bool { simdEnabled = false };
160 
162  enum : bool { smpAssignable = false };
163  //**********************************************************************************************
164 
165  //**Constructor*********************************************************************************
171  explicit inline DMatTSMatSubExpr( const MT1& lhs, const MT2& rhs ) noexcept
172  : lhs_( lhs ) // Left-hand side dense matrix of the subtraction expression
173  , rhs_( rhs ) // Right-hand side sparse matrix of the subtraction expression
174  {
175  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
176  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
177  }
178  //**********************************************************************************************
179 
180  //**Access operator*****************************************************************************
187  inline ReturnType operator()( size_t i, size_t j ) const {
188  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
189  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
190  return lhs_(i,j) - rhs_(i,j);
191  }
192  //**********************************************************************************************
193 
194  //**At function*********************************************************************************
202  inline ReturnType at( size_t i, size_t j ) const {
203  if( i >= lhs_.rows() ) {
204  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
205  }
206  if( j >= lhs_.columns() ) {
207  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
208  }
209  return (*this)(i,j);
210  }
211  //**********************************************************************************************
212 
213  //**Rows function*******************************************************************************
218  inline size_t rows() const noexcept {
219  return lhs_.rows();
220  }
221  //**********************************************************************************************
222 
223  //**Columns function****************************************************************************
228  inline size_t columns() const noexcept {
229  return lhs_.columns();
230  }
231  //**********************************************************************************************
232 
233  //**Left operand access*************************************************************************
238  inline LeftOperand leftOperand() const noexcept {
239  return lhs_;
240  }
241  //**********************************************************************************************
242 
243  //**Right operand access************************************************************************
248  inline RightOperand rightOperand() const noexcept {
249  return rhs_;
250  }
251  //**********************************************************************************************
252 
253  //**********************************************************************************************
259  template< typename T >
260  inline bool canAlias( const T* alias ) const noexcept {
261  return ( IsExpression<MT1>::value && lhs_.canAlias( alias ) ) ||
262  ( rhs_.canAlias( alias ) );
263  }
264  //**********************************************************************************************
265 
266  //**********************************************************************************************
272  template< typename T >
273  inline bool isAliased( const T* alias ) const noexcept {
274  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
275  }
276  //**********************************************************************************************
277 
278  private:
279  //**Member variables****************************************************************************
282  //**********************************************************************************************
283 
284  //**Assignment to dense matrices****************************************************************
296  template< typename MT // Type of the target dense matrix
297  , bool SO2 > // Storage order of the target dense matrix
298  friend inline void assign( DenseMatrix<MT,SO2>& lhs, const DMatTSMatSubExpr& rhs )
299  {
301 
302  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
303  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
304 
305  if( !IsOperation<MT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
306  subAssign( ~lhs, rhs.rhs_ );
307  }
308  else {
309  assign ( ~lhs, rhs.lhs_ );
310  subAssign( ~lhs, rhs.rhs_ );
311  }
312  }
314  //**********************************************************************************************
315 
316  //**Assignment to sparse matrices***************************************************************
328  template< typename MT // Type of the target sparse matrix
329  , bool SO2 > // Storage order of the target sparse matrix
330  friend inline void assign( SparseMatrix<MT,SO2>& lhs, const DMatTSMatSubExpr& rhs )
331  {
333 
335 
342 
343  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
344  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
345 
346  const TmpType tmp( serial( rhs ) );
347  assign( ~lhs, tmp );
348  }
350  //**********************************************************************************************
351 
352  //**Addition assignment to dense matrices*******************************************************
365  template< typename MT // Type of the target dense matrix
366  , bool SO2 > // Storage order of the target dense matrix
367  friend inline void addAssign( DenseMatrix<MT,SO2>& lhs, const DMatTSMatSubExpr& rhs )
368  {
370 
371  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
372  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
373 
374  addAssign( ~lhs, rhs.lhs_ );
375  subAssign( ~lhs, rhs.rhs_ );
376  }
378  //**********************************************************************************************
379 
380  //**Addition assignment to sparse matrices******************************************************
381  // No special implementation for the addition assignment to sparse matrices.
382  //**********************************************************************************************
383 
384  //**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 DMatTSMatSubExpr& 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**************************************************
429  template< typename MT // Type of the target dense matrix
430  , bool SO2 > // Storage order of the target dense matrix
431  friend inline void schurAssign( DenseMatrix<MT,SO2>& lhs, const DMatTSMatSubExpr& rhs )
432  {
434 
438 
439  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
440  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
441 
442  const ResultType tmp( serial( rhs ) );
443  schurAssign( ~lhs, tmp );
444  }
446  //**********************************************************************************************
447 
448  //**Schur product assignment to sparse matrices*************************************************
449  // No special implementation for the Schur product assignment to sparse matrices.
450  //**********************************************************************************************
451 
452  //**Multiplication assignment to dense matrices*************************************************
453  // No special implementation for the multiplication assignment to dense matrices.
454  //**********************************************************************************************
455 
456  //**Multiplication assignment to sparse matrices************************************************
457  // No special implementation for the multiplication assignment to sparse matrices.
458  //**********************************************************************************************
459 
460  //**SMP assignment to dense matrices************************************************************
474  template< typename MT // Type of the target dense matrix
475  , bool SO2 > // Storage order of the target dense matrix
476  friend inline EnableIf_< UseSMPAssign<MT> >
478  {
480 
481  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
482  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
483 
484  if( !IsOperation<MT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
485  smpSubAssign( ~lhs, rhs.rhs_ );
486  }
487  else {
488  smpAssign ( ~lhs, rhs.lhs_ );
489  smpSubAssign( ~lhs, rhs.rhs_ );
490  }
491  }
493  //**********************************************************************************************
494 
495  //**SMP assignment to sparse matrices***********************************************************
509  template< typename MT // Type of the target sparse matrix
510  , bool SO2 > // Storage order of the target sparse matrix
511  friend inline EnableIf_< UseSMPAssign<MT> >
513  {
515 
517 
524 
525  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
526  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
527 
528  const TmpType tmp( rhs );
529  smpAssign( ~lhs, tmp );
530  }
532  //**********************************************************************************************
533 
534  //**SMP addition assignment to dense matrices***************************************************
549  template< typename MT // Type of the target dense matrix
550  , bool SO2 > // Storage order of the target dense matrix
551  friend inline EnableIf_< UseSMPAssign<MT> >
553  {
555 
556  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
557  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
558 
559  smpAddAssign( ~lhs, rhs.lhs_ );
560  smpSubAssign( ~lhs, rhs.rhs_ );
561  }
563  //**********************************************************************************************
564 
565  //**SMP addition assignment to sparse matrices**************************************************
566  // No special implementation for the SMP addition assignment to sparse matrices.
567  //**********************************************************************************************
568 
569  //**SMP subtraction assignment to dense matrices************************************************
584  template< typename MT // Type of the target dense matrix
585  , bool SO2 > // Storage order of the target dense matrix
586  friend inline EnableIf_< UseSMPAssign<MT> >
588  {
590 
591  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
592  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
593 
594  smpSubAssign( ~lhs, rhs.lhs_ );
595  smpAddAssign( ~lhs, rhs.rhs_ );
596  }
598  //**********************************************************************************************
599 
600  //**SMP subtraction assignment to sparse matrices***********************************************
601  // No special implementation for the SMP subtraction assignment to sparse matrices.
602  //**********************************************************************************************
603 
604  //**SMP Schur product assignment to dense matrices**********************************************
619  template< typename MT // Type of the target dense matrix
620  , bool SO2 > // Storage order of the target dense matrix
621  friend inline EnableIf_< UseSMPAssign<MT> >
623  {
625 
629 
630  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
631  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
632 
633  const ResultType tmp( rhs );
634  smpSchurAssign( ~lhs, tmp );
635  }
637  //**********************************************************************************************
638 
639  //**SMP Schur product assignment to sparse matrices*********************************************
640  // No special implementation for the SMP Schur product assignment to sparse matrices.
641  //**********************************************************************************************
642 
643  //**SMP multiplication assignment to dense matrices*********************************************
644  // No special implementation for the SMP multiplication assignment to dense matrices.
645  //**********************************************************************************************
646 
647  //**SMP multiplication assignment to sparse matrices********************************************
648  // No special implementation for the SMP multiplication assignment to sparse matrices.
649  //**********************************************************************************************
650 
651  //**Compile time checks*************************************************************************
659  //**********************************************************************************************
660 };
661 //*************************************************************************************************
662 
663 
664 
665 
666 //=================================================================================================
667 //
668 // GLOBAL BINARY ARITHMETIC OPERATORS
669 //
670 //=================================================================================================
671 
672 //*************************************************************************************************
702 template< typename MT1 // Type of the left-hand side dense matrix
703  , typename MT2 > // Type of the right-hand side sparse matrix
704 inline decltype(auto)
705  operator-( const DenseMatrix<MT1,false>& lhs, const SparseMatrix<MT2,true>& rhs )
706 {
708 
709  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() ) {
710  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
711  }
712 
714  return ReturnType( ~lhs, ~rhs );
715 }
716 //*************************************************************************************************
717 
718 
719 
720 
721 //=================================================================================================
722 //
723 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
724 //
725 //=================================================================================================
726 
727 //*************************************************************************************************
740 template< typename MT1 // Type of the dense matrix of the left-hand side expression
741  , typename MT2 // Type of the sparse matrix of the left-hand side expression
742  , typename MT3 // Type of the right-hand side dense matrix
743  , bool SO > // Storage order of the right-hand side dense matrix
744 inline decltype(auto)
746 {
748 
749  return ( lhs.leftOperand() + (~rhs) ) - lhs.rightOperand();
750 }
752 //*************************************************************************************************
753 
754 
755 //*************************************************************************************************
768 template< typename MT1 // Type of the dense matrix of the left-hand side expression
769  , typename MT2 // Type of the sparse matrix of the left-hand side expression
770  , typename MT3 // Type of the right-hand side dense matrix
771  , bool SO > // Storage order of the right-hand side dense matrix
772 inline decltype(auto)
774 {
776 
777  return ( lhs.leftOperand() - (~rhs) ) - lhs.rightOperand();
778 }
780 //*************************************************************************************************
781 
782 
783 
784 
785 //=================================================================================================
786 //
787 // SIZE SPECIALIZATIONS
788 //
789 //=================================================================================================
790 
791 //*************************************************************************************************
793 template< typename MT1, typename MT2 >
794 struct Size< DMatTSMatSubExpr<MT1,MT2>, 0UL >
795  : public Maximum< Size<MT1,0UL>, Size<MT2,0UL> >
796 {};
797 
798 template< typename MT1, typename MT2 >
799 struct Size< DMatTSMatSubExpr<MT1,MT2>, 1UL >
800  : public Maximum< Size<MT1,1UL>, Size<MT2,1UL> >
801 {};
803 //*************************************************************************************************
804 
805 
806 
807 
808 //=================================================================================================
809 //
810 // ISSYMMETRIC SPECIALIZATIONS
811 //
812 //=================================================================================================
813 
814 //*************************************************************************************************
816 template< typename MT1, typename MT2 >
817 struct IsSymmetric< DMatTSMatSubExpr<MT1,MT2> >
818  : public And< IsSymmetric<MT1>, IsSymmetric<MT2> >
819 {};
821 //*************************************************************************************************
822 
823 
824 
825 
826 //=================================================================================================
827 //
828 // ISHERMITIAN SPECIALIZATIONS
829 //
830 //=================================================================================================
831 
832 //*************************************************************************************************
834 template< typename MT1, typename MT2 >
835 struct IsHermitian< DMatTSMatSubExpr<MT1,MT2> >
836  : public And< IsHermitian<MT1>, IsHermitian<MT2> >
837 {};
839 //*************************************************************************************************
840 
841 
842 
843 
844 //=================================================================================================
845 //
846 // ISLOWER SPECIALIZATIONS
847 //
848 //=================================================================================================
849 
850 //*************************************************************************************************
852 template< typename MT1, typename MT2 >
853 struct IsLower< DMatTSMatSubExpr<MT1,MT2> >
854  : public And< IsLower<MT1>, IsLower<MT2> >
855 {};
857 //*************************************************************************************************
858 
859 
860 
861 
862 //=================================================================================================
863 //
864 // ISUNILOWER SPECIALIZATIONS
865 //
866 //=================================================================================================
867 
868 //*************************************************************************************************
870 template< typename MT1, typename MT2 >
871 struct IsUniLower< DMatTSMatSubExpr<MT1,MT2> >
872  : public And< IsUniLower<MT1>, IsStrictlyLower<MT2> >
873 {};
875 //*************************************************************************************************
876 
877 
878 
879 
880 //=================================================================================================
881 //
882 // ISSTRICTLYLOWER SPECIALIZATIONS
883 //
884 //=================================================================================================
885 
886 //*************************************************************************************************
888 template< typename MT1, typename MT2 >
889 struct IsStrictlyLower< DMatTSMatSubExpr<MT1,MT2> >
890  : public And< IsStrictlyLower<MT1>, IsStrictlyLower<MT2> >
891 {};
893 //*************************************************************************************************
894 
895 
896 
897 
898 //=================================================================================================
899 //
900 // ISUPPER SPECIALIZATIONS
901 //
902 //=================================================================================================
903 
904 //*************************************************************************************************
906 template< typename MT1, typename MT2 >
907 struct IsUpper< DMatTSMatSubExpr<MT1,MT2> >
908  : public And< IsUpper<MT1>, IsUpper<MT2> >
909 {};
911 //*************************************************************************************************
912 
913 
914 
915 
916 //=================================================================================================
917 //
918 // ISUNIUPPER SPECIALIZATIONS
919 //
920 //=================================================================================================
921 
922 //*************************************************************************************************
924 template< typename MT1, typename MT2 >
925 struct IsUniUpper< DMatTSMatSubExpr<MT1,MT2> >
926  : public And< IsUniUpper<MT1>, IsStrictlyUpper<MT2> >
927 {};
929 //*************************************************************************************************
930 
931 
932 
933 
934 //=================================================================================================
935 //
936 // ISSTRICTLYUPPER SPECIALIZATIONS
937 //
938 //=================================================================================================
939 
940 //*************************************************************************************************
942 template< typename MT1, typename MT2 >
943 struct IsStrictlyUpper< DMatTSMatSubExpr<MT1,MT2> >
944  : public And< IsStrictlyUpper<MT1>, IsStrictlyUpper<MT2> >
945 {};
947 //*************************************************************************************************
948 
949 } // namespace blaze
950 
951 #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.
SubTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatTSMatSubExpr.h:139
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTSMatSubExpr.h:140
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatTSMatSubExpr.h:154
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
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
LeftOperand lhs_
Left-hand side dense matrix of the subtraction expression.
Definition: DMatTSMatSubExpr.h:280
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:949
Header file for basic type definitions.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatTSMatSubExpr.h:145
Compile time check whether the given type is an operational expression template.This type trait class...
Definition: IsOperation.h:70
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
SubExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DMatTSMatSubExpr.h:119
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
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTSMatSubExpr.h:141
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:701
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatTSMatSubExpr.h:142
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:87
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatTSMatSubExpr.h:103
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:87
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:733
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose sparse matrix operand.
Definition: DMatTSMatSubExpr.h:248
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: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:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTSMatSubExpr.h:273
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.
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:58
Header file for the If class template.
Expression object for dense matrix-transpose sparse matrix subtractions.The DMatTSMatSubExpr class re...
Definition: DMatTSMatSubExpr.h:97
#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:102
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatTSMatSubExpr.h:104
#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.
DMatTSMatSubExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatTSMatSubExpr class.
Definition: DMatTSMatSubExpr.h:171
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.
Header file for the IsOperation type trait class.
Header file for the IsLower type trait.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTSMatSubExpr.h:202
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.
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatTSMatSubExpr.h:148
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
ReturnType_< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition: DMatTSMatSubExpr.h:106
#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.
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
Constraints on the storage order of matrix types.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatTSMatSubExpr.h:151
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTSMatSubExpr.h:218
RightOperand rhs_
Right-hand side sparse matrix of the subtraction expression.
Definition: DMatTSMatSubExpr.h:281
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:3080
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTSMatSubExpr.h:228
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:291
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatTSMatSubExpr.h:238
Compile time logical &#39;and&#39; evaluation.The And alias declaration performs at compile time a logical &#39;a...
Definition: And.h:76
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTSMatSubExpr.h:187
#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:107
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.
ReturnType_< MT1 > RN1
Return type of the left-hand side dense matrix expression.
Definition: DMatTSMatSubExpr.h:105
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTSMatSubExpr.h:260
Header file for the IsHermitian type trait.
Header file for the SubExprTrait class template.
Header file for the Size type trait.
#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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.