DMatSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
51 #include <blaze/math/Exception.h>
56 #include <blaze/math/Functions.h>
65 #include <blaze/math/shims/Reset.h>
108 #include <blaze/system/Thresholds.h>
109 #include <blaze/util/Assert.h>
111 #include <blaze/util/DisableIf.h>
112 #include <blaze/util/EnableIf.h>
115 #include <blaze/util/InvalidType.h>
116 #include <blaze/util/mpl/And.h>
117 #include <blaze/util/mpl/Bool.h>
118 #include <blaze/util/mpl/If.h>
119 #include <blaze/util/mpl/Or.h>
120 #include <blaze/util/Types.h>
122 
123 
124 namespace blaze {
125 
126 //=================================================================================================
127 //
128 // CLASS DMATSMATMULTEXPR
129 //
130 //=================================================================================================
131 
132 //*************************************************************************************************
139 template< typename MT1 // Type of the left-hand side dense matrix
140  , typename MT2 // Type of the right-hand side sparse matrix
141  , bool SF // Symmetry flag
142  , bool HF // Hermitian flag
143  , bool LF // Lower flag
144  , bool UF > // Upper flag
145 class DMatSMatMultExpr : public DenseMatrix< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, false >
146  , private MatMatMultExpr
147  , private Computation
148 {
149  private:
150  //**Type definitions****************************************************************************
157  //**********************************************************************************************
158 
159  //**********************************************************************************************
161  enum : bool { evaluateLeft = IsComputation<MT1>::value || RequiresEvaluation<MT1>::value };
162  //**********************************************************************************************
163 
164  //**********************************************************************************************
166  enum : bool { evaluateRight = IsComputation<MT2>::value || RequiresEvaluation<MT2>::value };
167  //**********************************************************************************************
168 
169  //**********************************************************************************************
171  enum : bool {
172  SYM = ( SF && !( HF || LF || UF ) ),
173  HERM = ( HF && !( LF || UF ) ),
174  LOW = ( LF || ( ( SF || HF ) && UF ) ),
175  UPP = ( UF || ( ( SF || HF ) && LF ) )
176  };
177  //**********************************************************************************************
178 
179  //**********************************************************************************************
181 
186  template< typename T1, typename T2, typename T3 >
187  struct CanExploitSymmetry {
188  enum : bool { value = ( IsSymmetric<T2>::value || IsSymmetric<T3>::value ) };
189  };
191  //**********************************************************************************************
192 
193  //**********************************************************************************************
195 
199  template< typename T1, typename T2, typename T3 >
200  struct IsEvaluationRequired {
201  enum : bool { value = ( evaluateLeft || evaluateRight ) &&
202  !CanExploitSymmetry<T1,T2,T3>::value };
203  };
205  //**********************************************************************************************
206 
207  //**********************************************************************************************
209 
212  template< typename T1, typename T2, typename T3 >
213  struct UseOptimizedKernel {
214  enum : bool { value = useOptimizedKernels &&
216  !IsResizable< ElementType_<T1> >::value };
217  };
219  //**********************************************************************************************
220 
221  //**********************************************************************************************
223 
226  template< typename T1, typename T2, typename T3 >
227  struct UseDefaultKernel {
228  enum : bool { value = !UseOptimizedKernel<T1,T2,T3>::value };
229  };
231  //**********************************************************************************************
232 
233  //**********************************************************************************************
235 
238  typedef IfTrue_< HERM
239  , DeclHerm
240  , IfTrue_< SYM
241  , DeclSym
242  , IfTrue_< LOW
243  , IfTrue_< UPP
244  , DeclDiag
245  , DeclLow >
246  , IfTrue_< UPP
247  , DeclUpp
248  , Noop > > > > ForwardFunctor;
250  //**********************************************************************************************
251 
252  public:
253  //**Type definitions****************************************************************************
256 
261  typedef const ElementType ReturnType;
262  typedef const ResultType CompositeType;
263 
265  typedef If_< IsExpression<MT1>, const MT1, const MT1& > LeftOperand;
266 
268  typedef If_< IsExpression<MT2>, const MT2, const MT2& > RightOperand;
269 
272 
275  //**********************************************************************************************
276 
277  //**Compilation flags***************************************************************************
279  enum : bool { simdEnabled = false };
280 
282  enum : bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
283  !evaluateRight && MT2::smpAssignable };
284  //**********************************************************************************************
285 
286  //**Constructor*********************************************************************************
292  explicit inline DMatSMatMultExpr( const MT1& lhs, const MT2& rhs ) noexcept
293  : lhs_( lhs ) // Left-hand side dense matrix of the multiplication expression
294  , rhs_( rhs ) // Right-hand side sparse matrix of the multiplication expression
295  {
296  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
297  }
298  //**********************************************************************************************
299 
300  //**Access operator*****************************************************************************
307  inline ReturnType operator()( size_t i, size_t j ) const {
308  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
309  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
310 
311  if( IsDiagonal<MT1>::value ) {
312  return lhs_(i,i) * rhs_(i,j);
313  }
314  else if( IsDiagonal<MT2>::value ) {
315  return lhs_(i,j) * rhs_(j,j);
316  }
318  const size_t begin( ( IsUpper<MT1>::value )
319  ?( ( IsLower<MT2>::value )
320  ?( max( ( IsStrictlyUpper<MT1>::value ? i+1UL : i )
321  , ( IsStrictlyLower<MT2>::value ? j+1UL : j ) ) )
322  :( IsStrictlyUpper<MT1>::value ? i+1UL : i ) )
323  :( ( IsLower<MT2>::value )
324  ?( IsStrictlyLower<MT2>::value ? j+1UL : j )
325  :( 0UL ) ) );
326  const size_t end( ( IsLower<MT1>::value )
327  ?( ( IsUpper<MT2>::value )
328  ?( min( ( IsStrictlyLower<MT1>::value ? i : i+1UL )
329  , ( IsStrictlyUpper<MT2>::value ? j : j+1UL ) ) )
330  :( IsStrictlyLower<MT1>::value ? i : i+1UL ) )
331  :( ( IsUpper<MT2>::value )
332  ?( IsStrictlyUpper<MT2>::value ? j : j+1UL )
333  :( lhs_.columns() ) ) );
334 
335  if( begin >= end ) return ElementType();
336 
337  const size_t n( end - begin );
338 
339  return subvector( row( lhs_, i ), begin, n ) * subvector( column( rhs_, j ), begin, n );
340  }
341  else {
342  return row( lhs_, i ) * column( rhs_, j );
343  }
344  }
345  //**********************************************************************************************
346 
347  //**At function*********************************************************************************
355  inline ReturnType at( size_t i, size_t j ) const {
356  if( i >= lhs_.rows() ) {
357  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
358  }
359  if( j >= rhs_.columns() ) {
360  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
361  }
362  return (*this)(i,j);
363  }
364  //**********************************************************************************************
365 
366  //**Rows function*******************************************************************************
371  inline size_t rows() const noexcept {
372  return lhs_.rows();
373  }
374  //**********************************************************************************************
375 
376  //**Columns function****************************************************************************
381  inline size_t columns() const noexcept {
382  return rhs_.columns();
383  }
384  //**********************************************************************************************
385 
386  //**Left operand access*************************************************************************
391  inline LeftOperand leftOperand() const noexcept {
392  return lhs_;
393  }
394  //**********************************************************************************************
395 
396  //**Right operand access************************************************************************
401  inline RightOperand rightOperand() const noexcept {
402  return rhs_;
403  }
404  //**********************************************************************************************
405 
406  //**********************************************************************************************
412  template< typename T >
413  inline bool canAlias( const T* alias ) const noexcept {
414  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
415  }
416  //**********************************************************************************************
417 
418  //**********************************************************************************************
424  template< typename T >
425  inline bool isAliased( const T* alias ) const noexcept {
426  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
427  }
428  //**********************************************************************************************
429 
430  //**********************************************************************************************
435  inline bool isAligned() const noexcept {
436  return lhs_.isAligned();
437  }
438  //**********************************************************************************************
439 
440  //**********************************************************************************************
445  inline bool canSMPAssign() const noexcept {
446  return ( rows() * columns() >= SMP_DMATSMATMULT_THRESHOLD ) && !IsDiagonal<MT1>::value;
447  }
448  //**********************************************************************************************
449 
450  private:
451  //**Member variables****************************************************************************
452  LeftOperand lhs_;
453  RightOperand rhs_;
454  //**********************************************************************************************
455 
456  //**Assignment to dense matrices****************************************************************
469  template< typename MT // Type of the target dense matrix
470  , bool SO > // Storage order of the target dense matrix
472  assign( DenseMatrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
473  {
475 
476  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
477  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
478 
479  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
480  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
481 
482  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
483  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
484  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
485  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
486  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
487  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
488 
489  DMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
490  }
492  //**********************************************************************************************
493 
494  //**Assignment to dense matrices (kernel selection)*********************************************
505  template< typename MT3 // Type of the left-hand side target matrix
506  , typename MT4 // Type of the left-hand side matrix operand
507  , typename MT5 > // Type of the right-hand side matrix operand
508  static inline void selectAssignKernel( MT3& C, const MT4& A, const MT5& B )
509  {
510  if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
511  selectSmallAssignKernel( C, A, B );
512  else
513  selectLargeAssignKernel( C, A, B );
514  }
516  //**********************************************************************************************
517 
518  //**Default assignment to dense matrices********************************************************
532  template< typename MT3 // Type of the left-hand side target matrix
533  , typename MT4 // Type of the left-hand side matrix operand
534  , typename MT5 > // Type of the right-hand side matrix operand
535  static inline void selectDefaultAssignKernel( MT3& C, const MT4& A, const MT5& B )
536  {
538 
539  reset( C );
540 
541  for( size_t k=0UL; k<B.rows(); ++k )
542  {
544  {
545  ConstIterator element( B.begin(k) );
546  const ConstIterator end( B.end(k) );
547 
548  for( ; element!=end; ++element ) {
549  C(k,element->index()) = A(k,k) * element->value();
550  }
551  }
552  else
553  {
554  const size_t iibegin( ( IsLower<MT4>::value )
555  ?( IsStrictlyLower<MT4>::value ? k+1UL : k )
556  :( 0UL ) );
557  const size_t iiend( ( IsUpper<MT4>::value )
558  ?( IsStrictlyUpper<MT4>::value ? k : k+1UL )
559  :( A.rows() ) );
560  BLAZE_INTERNAL_ASSERT( iibegin <= iiend, "Invalid loop indices detected" );
561 
562  for( size_t ii=iibegin; ii<iiend; ii+=8UL )
563  {
564  ConstIterator element( B.begin(k) );
565  const ConstIterator end( B.end(k) );
566  const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
567 
568  for( ; element!=end; ++element )
569  {
570  const size_t j1( element->index() );
571  const size_t ibegin( SYM || HERM || LOW ? max(j1,ii) : ii );
572  const size_t iend( UPP ? min(j1+1UL,itmp) : itmp );
573 
574  for( size_t i=ibegin; i<iend; ++i ) {
575  if( isDefault( C(i,element->index()) ) )
576  C(i,j1) = A(i,k) * element->value();
577  else
578  C(i,j1) += A(i,k) * element->value();
579  }
580  }
581  }
582  }
583  }
584 
585  if( SYM || HERM ) {
586  for( size_t i=0UL; i<A.rows(); ++i ) {
587  for( size_t j=i+1UL; j<B.columns(); ++j ) {
588  C(i,j) = HERM ? conj( C(j,i) ) : C(j,i);
589  }
590  }
591  }
592  }
594  //**********************************************************************************************
595 
596  //**Default assignment to dense matrices (small matrices)***************************************
609  template< typename MT3 // Type of the left-hand side target matrix
610  , typename MT4 // Type of the left-hand side matrix operand
611  , typename MT5 > // Type of the right-hand side matrix operand
613  selectSmallAssignKernel( MT3& C, const MT4& A, const MT5& B )
614  {
615  selectDefaultAssignKernel( C, A, B );
616  }
618  //**********************************************************************************************
619 
620  //**Optimized assignment to dense matrices (small matrices)*************************************
635  template< typename MT3 // Type of the left-hand side target matrix
636  , typename MT4 // Type of the left-hand side matrix operand
637  , typename MT5 > // Type of the right-hand side matrix operand
639  selectSmallAssignKernel( MT3& C, const MT4& A, const MT5& B )
640  {
642 
643  reset( C );
644 
645  for( size_t j=0UL; j<B.rows(); ++j )
646  {
647  const size_t iibegin( ( IsLower<MT4>::value )
648  ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
649  :( 0UL ) );
650  const size_t iiend( ( IsUpper<MT4>::value )
651  ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
652  :( A.rows() ) );
653  BLAZE_INTERNAL_ASSERT( iibegin <= iiend, "Invalid loop indices detected" );
654 
655  for( size_t ii=iibegin; ii<iiend; ii+=8UL )
656  {
657  ConstIterator element( B.begin(j) );
658  const ConstIterator end( B.end(j) );
659  const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
660 
661  for( ; element!=end; ++element )
662  {
663  const size_t j1( element->index() );
664  const size_t ibegin( SYM || HERM || LOW ? max(j1,ii) : ii );
665  const size_t iend( UPP ? min(j1+1UL,itmp) : itmp );
666 
667  for( size_t i=ibegin; i<iend; ++i ) {
668  C(i,j1) += A(i,j) * element->value();
669  }
670  }
671  }
672  }
673 
674  if( SYM || HERM ) {
675  for( size_t i=0UL; i<A.rows(); ++i ) {
676  for( size_t j=i+1UL; j<B.columns(); ++j ) {
677  C(i,j) = HERM ? conj( C(j,i) ) : C(j,i);
678  }
679  }
680  }
681  }
683  //**********************************************************************************************
684 
685  //**Default assignment to dense matrices (large matrices)***************************************
698  template< typename MT3 // Type of the left-hand side target matrix
699  , typename MT4 // Type of the left-hand side matrix operand
700  , typename MT5 > // Type of the right-hand side matrix operand
702  selectLargeAssignKernel( MT3& C, const MT4& A, const MT5& B )
703  {
704  selectDefaultAssignKernel( C, A, B );
705  }
707  //**********************************************************************************************
708 
709  //**Optimized assignment to dense matrices (large matrices)*************************************
724  template< typename MT3 // Type of the left-hand side target matrix
725  , typename MT4 // Type of the left-hand side matrix operand
726  , typename MT5 > // Type of the right-hand side matrix operand
728  selectLargeAssignKernel( MT3& C, const MT4& A, const MT5& B )
729  {
731 
732  const ForwardFunctor fwd;
733 
734  const OppositeType_<MT5> tmp( serial( B ) );
735  assign( C, fwd( A * tmp ) );
736  }
738  //**********************************************************************************************
739 
740  //**Assignment to sparse matrices***************************************************************
753  template< typename MT // Type of the target sparse matrix
754  , bool SO > // Storage order of the target sparse matrix
756  assign( SparseMatrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
757  {
759 
761 
768 
769  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
770  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
771 
772  const ForwardFunctor fwd;
773 
774  const TmpType tmp( serial( rhs ) );
775  assign( ~lhs, fwd( tmp ) );
776  }
778  //**********************************************************************************************
779 
780  //**Restructuring assignment********************************************************************
795  template< typename MT // Type of the target matrix
796  , bool SO > // Storage order of the target matrix
798  assign( Matrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
799  {
801 
803 
804  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
805  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
806 
807  const ForwardFunctor fwd;
808 
810  assign( ~lhs, fwd( trans( rhs.lhs_ ) * trans( rhs.rhs_ ) ) );
811  else if( IsSymmetric<MT1>::value )
812  assign( ~lhs, fwd( trans( rhs.lhs_ ) * rhs.rhs_ ) );
813  else
814  assign( ~lhs, fwd( rhs.lhs_ * trans( rhs.rhs_ ) ) );
815  }
817  //**********************************************************************************************
818 
819  //**Addition assignment to dense matrices*******************************************************
832  template< typename MT // Type of the target dense matrix
833  , bool SO > // Storage order of the target dense matrix
835  addAssign( DenseMatrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
836  {
838 
839  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
840  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
841 
842  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
843  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
844 
845  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
846  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
847  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
848  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
849  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
850  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
851 
852  DMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
853  }
855  //**********************************************************************************************
856 
857  //**Addition assignment to dense matrices (kernel selection)************************************
868  template< typename MT3 // Type of the left-hand side target matrix
869  , typename MT4 // Type of the left-hand side matrix operand
870  , typename MT5 > // Type of the right-hand side matrix operand
871  static inline void selectAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
872  {
873  if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
874  selectSmallAddAssignKernel( C, A, B );
875  else
876  selectLargeAddAssignKernel( C, A, B );
877  }
879  //**********************************************************************************************
880 
881  //**Optimized addition assignment to dense matrices (small matrices)****************************
895  template< typename MT3 // Type of the left-hand side target matrix
896  , typename MT4 // Type of the left-hand side matrix operand
897  , typename MT5 > // Type of the right-hand side matrix operand
898  static inline void selectSmallAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
899  {
901 
902  for( size_t j=0UL; j<B.rows(); ++j )
903  {
905  {
906  ConstIterator element( B.begin(j) );
907  const ConstIterator end( B.end(j) );
908 
909  for( ; element!=end; ++element ) {
910  C(j,element->index()) += A(j,j) * element->value();
911  }
912  }
913  else
914  {
915  const size_t iibegin( ( IsLower<MT4>::value )
916  ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
917  :( 0UL ) );
918  const size_t iiend( ( IsUpper<MT4>::value )
919  ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
920  :( A.rows() ) );
921  BLAZE_INTERNAL_ASSERT( iibegin <= iiend, "Invalid loop indices detected" );
922 
923  for( size_t ii=iibegin; ii<iiend; ii+=8UL )
924  {
925  ConstIterator element( B.begin(j) );
926  const ConstIterator end( B.end(j) );
927  const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
928 
929  for( ; element!=end; ++element )
930  {
931  const size_t j1( element->index() );
932  const size_t ibegin( LOW ? max(j1,ii) : ii );
933  const size_t iend( UPP ? min(j1+1UL,itmp) : itmp );
934 
935  for( size_t i=ibegin; i<iend; ++i ) {
936  C(i,j1) += A(i,j) * element->value();
937  }
938  }
939  }
940  }
941  }
942  }
944  //**********************************************************************************************
945 
946  //**Optimized addition assignment to dense matrices (large matrices)****************************
960  template< typename MT3 // Type of the left-hand side target matrix
961  , typename MT4 // Type of the left-hand side matrix operand
962  , typename MT5 > // Type of the right-hand side matrix operand
963  static inline void selectLargeAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
964  {
966 
967  const ForwardFunctor fwd;
968 
969  const OppositeType_<MT5> tmp( serial( B ) );
970  addAssign( C, fwd( A * tmp ) );
971  }
973  //**********************************************************************************************
974 
975  //**Restructuring addition assignment***********************************************************
990  template< typename MT // Type of the target matrix
991  , bool SO > // Storage order of the target matrix
993  addAssign( Matrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
994  {
996 
998 
999  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1000  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1001 
1002  const ForwardFunctor fwd;
1003 
1005  addAssign( ~lhs, fwd( trans( rhs.lhs_ ) * trans( rhs.rhs_ ) ) );
1006  else if( IsSymmetric<MT1>::value )
1007  addAssign( ~lhs, fwd( trans( rhs.lhs_ ) * rhs.rhs_ ) );
1008  else
1009  addAssign( ~lhs, fwd( rhs.lhs_ * trans( rhs.rhs_ ) ) );
1010  }
1012  //**********************************************************************************************
1013 
1014  //**Addition assignment to sparse matrices******************************************************
1015  // No special implementation for the addition assignment to sparse matrices.
1016  //**********************************************************************************************
1017 
1018  //**Subtraction assignment to dense matrices****************************************************
1031  template< typename MT // Type of the target dense matrix
1032  , bool SO > // Storage order of the target dense matrix
1034  subAssign( DenseMatrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1035  {
1037 
1038  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1039  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1040 
1041  LT A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense matrix operand
1042  RT B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
1043 
1044  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1045  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1046  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1047  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1048  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1049  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1050 
1051  DMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1052  }
1054  //**********************************************************************************************
1055 
1056  //**Subtraction assignment to dense matrices (kernel selection)*********************************
1067  template< typename MT3 // Type of the left-hand side target matrix
1068  , typename MT4 // Type of the left-hand side matrix operand
1069  , typename MT5 > // Type of the right-hand side matrix operand
1070  static inline void selectSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
1071  {
1072  if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
1073  selectSmallSubAssignKernel( C, A, B );
1074  else
1075  selectLargeSubAssignKernel( C, A, B );
1076  }
1078  //**********************************************************************************************
1079 
1080  //**Optimized subtraction assignment to dense matrices (small matrices)*************************
1094  template< typename MT3 // Type of the left-hand side target matrix
1095  , typename MT4 // Type of the left-hand side matrix operand
1096  , typename MT5 > // Type of the right-hand side matrix operand
1097  static inline void selectSmallSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
1098  {
1100 
1101  for( size_t j=0UL; j<B.rows(); ++j )
1102  {
1104  {
1105  ConstIterator element( B.begin(j) );
1106  const ConstIterator end( B.end(j) );
1107 
1108  for( ; element!=end; ++element ) {
1109  C(j,element->index()) -= A(j,j) * element->value();
1110  }
1111  }
1112  else
1113  {
1114  const size_t iibegin( ( IsLower<MT4>::value )
1115  ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
1116  :( 0UL ) );
1117  const size_t iiend( ( IsUpper<MT4>::value )
1118  ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
1119  :( A.rows() ) );
1120  BLAZE_INTERNAL_ASSERT( iibegin <= iiend, "Invalid loop indices detected" );
1121 
1122  for( size_t ii=iibegin; ii<iiend; ii+=8UL )
1123  {
1124  ConstIterator element( B.begin(j) );
1125  const ConstIterator end( B.end(j) );
1126  const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
1127 
1128  for( ; element!=end; ++element )
1129  {
1130  const size_t j1( element->index() );
1131  const size_t ibegin( LOW ? max(j1,ii) : ii );
1132  const size_t iend( UPP ? min(j1+1UL,itmp) : itmp );
1133 
1134  for( size_t i=ibegin; i<iend; ++i ) {
1135  C(i,j1) -= A(i,j) * element->value();
1136  }
1137  }
1138  }
1139  }
1140  }
1141  }
1143  //**********************************************************************************************
1144 
1145  //**Optimized subtraction assignment to dense matrices (large matrices)*************************
1159  template< typename MT3 // Type of the left-hand side target matrix
1160  , typename MT4 // Type of the left-hand side matrix operand
1161  , typename MT5 > // Type of the right-hand side matrix operand
1162  static inline void selectLargeSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
1163  {
1165 
1166  const ForwardFunctor fwd;
1167 
1168  const OppositeType_<MT5> tmp( serial( B ) );
1169  subAssign( C, fwd( A * tmp ) );
1170  }
1172  //**********************************************************************************************
1173 
1174  //**Restructuring subtraction assignment********************************************************
1189  template< typename MT // Type of the target matrix
1190  , bool SO > // Storage order of the target matrix
1192  subAssign( Matrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1193  {
1195 
1197 
1198  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1199  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1200 
1201  const ForwardFunctor fwd;
1202 
1204  subAssign( ~lhs, fwd( trans( rhs.lhs_ ) * trans( rhs.rhs_ ) ) );
1205  else if( IsSymmetric<MT1>::value )
1206  subAssign( ~lhs, fwd( trans( rhs.lhs_ ) * rhs.rhs_ ) );
1207  else
1208  subAssign( ~lhs, fwd( rhs.lhs_ * trans( rhs.rhs_ ) ) );
1209  }
1211  //**********************************************************************************************
1212 
1213  //**Subtraction assignment to sparse matrices***************************************************
1214  // No special implementation for the subtraction assignment to sparse matrices.
1215  //**********************************************************************************************
1216 
1217  //**Multiplication assignment to dense matrices*************************************************
1218  // No special implementation for the multiplication assignment to dense matrices.
1219  //**********************************************************************************************
1220 
1221  //**Multiplication assignment to sparse matrices************************************************
1222  // No special implementation for the multiplication assignment to sparse matrices.
1223  //**********************************************************************************************
1224 
1225  //**SMP assignment to dense matrices************************************************************
1240  template< typename MT // Type of the target dense matrix
1241  , bool SO > // Storage order of the target dense matrix
1243  smpAssign( DenseMatrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1244  {
1246 
1247  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1248  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1249 
1250  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1251  RT B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1252 
1253  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1254  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1255  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1256  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1257  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1258  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1259 
1260  smpAssign( ~lhs, A * B );
1261  }
1263  //**********************************************************************************************
1264 
1265  //**SMP assignment to sparse matrices***********************************************************
1280  template< typename MT // Type of the target sparse matrix
1281  , bool SO > // Storage order of the target sparse matrix
1283  smpAssign( SparseMatrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1284  {
1286 
1288 
1295 
1296  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1297  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1298 
1299  const ForwardFunctor fwd;
1300 
1301  const TmpType tmp( rhs );
1302  smpAssign( ~lhs, fwd( tmp ) );
1303  }
1305  //**********************************************************************************************
1306 
1307  //**Restructuring SMP assignment****************************************************************
1322  template< typename MT // Type of the target matrix
1323  , bool SO > // Storage order of the target matrix
1325  smpAssign( Matrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1326  {
1328 
1330 
1331  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1332  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1333 
1334  const ForwardFunctor fwd;
1335 
1337  smpAssign( ~lhs, fwd( trans( rhs.lhs_ ) * trans( rhs.rhs_ ) ) );
1338  else if( IsSymmetric<MT1>::value )
1339  smpAssign( ~lhs, fwd( trans( rhs.lhs_ ) * rhs.rhs_ ) );
1340  else
1341  smpAssign( ~lhs, fwd( rhs.lhs_ * trans( rhs.rhs_ ) ) );
1342  }
1344  //**********************************************************************************************
1345 
1346  //**SMP addition assignment to dense matrices***************************************************
1361  template< typename MT // Type of the target dense matrix
1362  , bool SO > // Storage order of the target sparse matrix
1365  {
1367 
1368  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1369  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1370 
1371  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1372  RT B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1373 
1374  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1375  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1376  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1377  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1378  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1379  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1380 
1381  smpAddAssign( ~lhs, A * B );
1382  }
1384  //**********************************************************************************************
1385 
1386  //**Restructuring SMP addition assignment*******************************************************
1401  template< typename MT // Type of the target matrix
1402  , bool SO > // Storage order of the target matrix
1404  smpAddAssign( Matrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1405  {
1407 
1409 
1410  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1411  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1412 
1413  const ForwardFunctor fwd;
1414 
1416  smpAddAssign( ~lhs, fwd( trans( rhs.lhs_ ) * trans( rhs.rhs_ ) ) );
1417  else if( IsSymmetric<MT1>::value )
1418  smpAddAssign( ~lhs, fwd( trans( rhs.lhs_ ) * rhs.rhs_ ) );
1419  else
1420  smpAddAssign( ~lhs, fwd( rhs.lhs_ * trans( rhs.rhs_ ) ) );
1421  }
1423  //**********************************************************************************************
1424 
1425  //**SMP addition assignment to sparse matrices**************************************************
1426  // No special implementation for the SMP addition assignment to sparse matrices.
1427  //**********************************************************************************************
1428 
1429  //**SMP subtraction assignment to dense matrices************************************************
1445  template< typename MT // Type of the target dense matrix
1446  , bool SO > // Storage order of the target sparse matrix
1449  {
1451 
1452  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1453  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1454 
1455  LT A( rhs.lhs_ ); // Evaluation of the left-hand side dense matrix operand
1456  RT B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1457 
1458  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1459  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1460  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1461  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1462  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1463  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1464 
1465  smpSubAssign( ~lhs, A * B );
1466  }
1468  //**********************************************************************************************
1469 
1470  //**Restructuring SMP subtraction assignment****************************************************
1485  template< typename MT // Type of the target matrix
1486  , bool SO > // Storage order of the target matrix
1488  smpSubAssign( Matrix<MT,SO>& lhs, const DMatSMatMultExpr& rhs )
1489  {
1491 
1493 
1494  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1495  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1496 
1497  const ForwardFunctor fwd;
1498 
1500  smpSubAssign( ~lhs, fwd( trans( rhs.lhs_ ) * trans( rhs.rhs_ ) ) );
1501  else if( IsSymmetric<MT1>::value )
1502  smpSubAssign( ~lhs, fwd( trans( rhs.lhs_ ) * rhs.rhs_ ) );
1503  else
1504  smpSubAssign( ~lhs, fwd( rhs.lhs_ * trans( rhs.rhs_ ) ) );
1505  }
1507  //**********************************************************************************************
1508 
1509  //**SMP subtraction assignment to sparse matrices***********************************************
1510  // No special implementation for the SMP subtraction assignment to sparse matrices.
1511  //**********************************************************************************************
1512 
1513  //**SMP multiplication assignment to dense matrices*********************************************
1514  // No special implementation for the SMP multiplication assignment to dense matrices.
1515  //**********************************************************************************************
1516 
1517  //**SMP multiplication assignment to sparse matrices********************************************
1518  // No special implementation for the SMP multiplication assignment to sparse matrices.
1519  //**********************************************************************************************
1520 
1521  //**Compile time checks*************************************************************************
1529  //**********************************************************************************************
1530 };
1531 //*************************************************************************************************
1532 
1533 
1534 
1535 
1536 //=================================================================================================
1537 //
1538 // GLOBAL BINARY ARITHMETIC OPERATORS
1539 //
1540 //=================================================================================================
1541 
1542 //*************************************************************************************************
1571 template< typename T1 // Type of the left-hand side dense matrix
1572  , typename T2 > // Type of the right-hand side sparse matrix
1575 {
1577 
1578  if( (~lhs).columns() != (~rhs).rows() ) {
1579  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1580  }
1581 
1583 }
1584 //*************************************************************************************************
1585 
1586 
1587 
1588 
1589 //=================================================================================================
1590 //
1591 // GLOBAL FUNCTIONS
1592 //
1593 //=================================================================================================
1594 
1595 //*************************************************************************************************
1619 template< typename MT1 // Type of the left-hand side dense matrix
1620  , typename MT2 // Type of the right-hand side sparse matrix
1621  , bool SF // Symmetry flag
1622  , bool HF // Hermitian flag
1623  , bool LF // Lower flag
1624  , bool UF > // Upper flag
1627 {
1629 
1630  if( !isSquare( dm ) ) {
1631  BLAZE_THROW_INVALID_ARGUMENT( "Invalid symmetric matrix specification" );
1632  }
1633 
1635 }
1637 //*************************************************************************************************
1638 
1639 
1640 //*************************************************************************************************
1664 template< typename MT1 // Type of the left-hand side dense matrix
1665  , typename MT2 // Type of the right-hand side sparse matrix
1666  , bool SF // Symmetry flag
1667  , bool HF // Hermitian flag
1668  , bool LF // Lower flag
1669  , bool UF > // Upper flag
1672 {
1674 
1675  if( !isSquare( dm ) ) {
1676  BLAZE_THROW_INVALID_ARGUMENT( "Invalid Hermitian matrix specification" );
1677  }
1678 
1680 }
1682 //*************************************************************************************************
1683 
1684 
1685 //*************************************************************************************************
1709 template< typename MT1 // Type of the left-hand side dense matrix
1710  , typename MT2 // Type of the right-hand side sparse matrix
1711  , bool SF // Symmetry flag
1712  , bool HF // Hermitian flag
1713  , bool LF // Lower flag
1714  , bool UF > // Upper flag
1717 {
1719 
1720  if( !isSquare( dm ) ) {
1721  BLAZE_THROW_INVALID_ARGUMENT( "Invalid lower matrix specification" );
1722  }
1723 
1725 }
1727 //*************************************************************************************************
1728 
1729 
1730 //*************************************************************************************************
1754 template< typename MT1 // Type of the left-hand side dense matrix
1755  , typename MT2 // Type of the right-hand side sparse matrix
1756  , bool SF // Symmetry flag
1757  , bool HF // Hermitian flag
1758  , bool LF // Lower flag
1759  , bool UF > // Upper flag
1762 {
1764 
1765  if( !isSquare( dm ) ) {
1766  BLAZE_THROW_INVALID_ARGUMENT( "Invalid upper matrix specification" );
1767  }
1768 
1770 }
1772 //*************************************************************************************************
1773 
1774 
1775 //*************************************************************************************************
1799 template< typename MT1 // Type of the left-hand side dense matrix
1800  , typename MT2 // Type of the right-hand side sparse matrix
1801  , bool SF // Symmetry flag
1802  , bool HF // Hermitian flag
1803  , bool LF // Lower flag
1804  , bool UF > // Upper flag
1807 {
1809 
1810  if( !isSquare( dm ) ) {
1811  BLAZE_THROW_INVALID_ARGUMENT( "Invalid diagonal matrix specification" );
1812  }
1813 
1815 }
1817 //*************************************************************************************************
1818 
1819 
1820 
1821 
1822 //=================================================================================================
1823 //
1824 // ROWS SPECIALIZATIONS
1825 //
1826 //=================================================================================================
1827 
1828 //*************************************************************************************************
1830 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1831 struct Rows< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> > : public Rows<MT1>
1832 {};
1834 //*************************************************************************************************
1835 
1836 
1837 
1838 
1839 //=================================================================================================
1840 //
1841 // COLUMNS SPECIALIZATIONS
1842 //
1843 //=================================================================================================
1844 
1845 //*************************************************************************************************
1847 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1848 struct Columns< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> > : public Columns<MT2>
1849 {};
1851 //*************************************************************************************************
1852 
1853 
1854 
1855 
1856 //=================================================================================================
1857 //
1858 // ISALIGNED SPECIALIZATIONS
1859 //
1860 //=================================================================================================
1861 
1862 //*************************************************************************************************
1864 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1865 struct IsAligned< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
1866  : public BoolConstant< IsAligned<MT1>::value >
1867 {};
1869 //*************************************************************************************************
1870 
1871 
1872 
1873 
1874 //=================================================================================================
1875 //
1876 // ISSYMMETRIC SPECIALIZATIONS
1877 //
1878 //=================================================================================================
1879 
1880 //*************************************************************************************************
1882 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1883 struct IsSymmetric< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
1884  : public BoolConstant< Or< Bool<SF>
1885  , And< Bool<HF>
1886  , IsBuiltin< ElementType_< DMatSMatMultExpr<MT1,MT2,false,true,false,false> > > >
1887  , And< Bool<LF>, Bool<UF> > >::value >
1888 {};
1890 //*************************************************************************************************
1891 
1892 
1893 
1894 
1895 //=================================================================================================
1896 //
1897 // ISHERMITIAN SPECIALIZATIONS
1898 //
1899 //=================================================================================================
1900 
1901 //*************************************************************************************************
1903 template< typename MT1, typename MT2, bool SF, bool LF, bool UF >
1904 struct IsHermitian< DMatSMatMultExpr<MT1,MT2,SF,true,LF,UF> >
1905  : public TrueType
1906 {};
1908 //*************************************************************************************************
1909 
1910 
1911 
1912 
1913 //=================================================================================================
1914 //
1915 // ISLOWER SPECIALIZATIONS
1916 //
1917 //=================================================================================================
1918 
1919 //*************************************************************************************************
1921 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1922 struct IsLower< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
1923  : public BoolConstant< Or< Bool<LF>
1924  , And< IsLower<MT1>, IsLower<MT2> >
1925  , And< Or< Bool<SF>, Bool<HF> >
1926  , IsUpper<MT1>, IsUpper<MT2> > >::value >
1927 {};
1929 //*************************************************************************************************
1930 
1931 
1932 
1933 
1934 //=================================================================================================
1935 //
1936 // ISUNILOWER SPECIALIZATIONS
1937 //
1938 //=================================================================================================
1939 
1940 //*************************************************************************************************
1942 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1943 struct IsUniLower< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
1944  : public BoolConstant< Or< And< IsUniLower<MT1>, IsUniLower<MT2> >
1945  , And< Or< Bool<SF>, Bool<HF> >
1946  , IsUniUpper<MT1>, IsUniUpper<MT2> > >::value >
1947 {};
1949 //*************************************************************************************************
1950 
1951 
1952 
1953 
1954 //=================================================================================================
1955 //
1956 // ISSTRICTLYLOWER SPECIALIZATIONS
1957 //
1958 //=================================================================================================
1959 
1960 //*************************************************************************************************
1962 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1963 struct IsStrictlyLower< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
1964  : public BoolConstant< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1965  , And< IsStrictlyLower<MT2>, IsLower<MT1> >
1966  , And< Or< Bool<SF>, Bool<HF> >
1967  , Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1968  , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > > > >::value >
1969 {};
1971 //*************************************************************************************************
1972 
1973 
1974 
1975 
1976 //=================================================================================================
1977 //
1978 // ISUPPER SPECIALIZATIONS
1979 //
1980 //=================================================================================================
1981 
1982 //*************************************************************************************************
1984 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
1985 struct IsUpper< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
1986  : public BoolConstant< Or< Bool<UF>
1987  , And< IsUpper<MT1>, IsUpper<MT2> >
1988  , And< Or< Bool<SF>, Bool<HF> >
1989  , IsLower<MT1>, IsLower<MT2> > >::value >
1990 {};
1992 //*************************************************************************************************
1993 
1994 
1995 
1996 
1997 //=================================================================================================
1998 //
1999 // ISUNIUPPER SPECIALIZATIONS
2000 //
2001 //=================================================================================================
2002 
2003 //*************************************************************************************************
2005 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2006 struct IsUniUpper< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2007  : public BoolConstant< Or< And< IsUniUpper<MT1>, IsUniUpper<MT2> >
2008  , And< Or< Bool<SF>, Bool<HF> >
2009  , IsUniLower<MT1>, IsUniLower<MT2> > >::value >
2010 {};
2012 //*************************************************************************************************
2013 
2014 
2015 
2016 
2017 //=================================================================================================
2018 //
2019 // ISSTRICTLYUPPER SPECIALIZATIONS
2020 //
2021 //=================================================================================================
2022 
2023 //*************************************************************************************************
2025 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2026 struct IsStrictlyUpper< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2027  : public BoolConstant< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2028  , And< IsStrictlyUpper<MT2>, IsUpper<MT1> >
2029  , And< Or< Bool<SF>, Bool<HF> >
2030  , Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2031  , And< IsStrictlyLower<MT2>, IsLower<MT1> > > > >::value >
2032 {};
2034 //*************************************************************************************************
2035 
2036 
2037 
2038 
2039 //=================================================================================================
2040 //
2041 // EXPRESSION TRAIT SPECIALIZATIONS
2042 //
2043 //=================================================================================================
2044 
2045 //*************************************************************************************************
2047 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF, typename VT >
2048 struct DMatDVecMultExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, VT >
2049 {
2050  public:
2051  //**********************************************************************************************
2056  , INVALID_TYPE >;
2057  //**********************************************************************************************
2058 };
2060 //*************************************************************************************************
2061 
2062 
2063 //*************************************************************************************************
2065 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF, typename VT >
2066 struct DMatSVecMultExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, VT >
2067 {
2068  public:
2069  //**********************************************************************************************
2074  , INVALID_TYPE >;
2075  //**********************************************************************************************
2076 };
2078 //*************************************************************************************************
2079 
2080 
2081 //*************************************************************************************************
2083 template< typename VT, typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2084 struct TDVecDMatMultExprTrait< VT, DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2085 {
2086  public:
2087  //**********************************************************************************************
2092  , INVALID_TYPE >;
2093  //**********************************************************************************************
2094 };
2096 //*************************************************************************************************
2097 
2098 
2099 //*************************************************************************************************
2101 template< typename VT, typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2102 struct TSVecDMatMultExprTrait< VT, DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2103 {
2104  public:
2105  //**********************************************************************************************
2110  , INVALID_TYPE >;
2111  //**********************************************************************************************
2112 };
2114 //*************************************************************************************************
2115 
2116 
2117 //*************************************************************************************************
2119 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2120 struct DMatDeclSymExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2121 {
2122  public:
2123  //**********************************************************************************************
2127  , INVALID_TYPE >;
2128  //**********************************************************************************************
2129 };
2131 //*************************************************************************************************
2132 
2133 
2134 //*************************************************************************************************
2136 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2137 struct DMatDeclHermExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2138 {
2139  public:
2140  //**********************************************************************************************
2144  , INVALID_TYPE >;
2145  //**********************************************************************************************
2146 };
2148 //*************************************************************************************************
2149 
2150 
2151 //*************************************************************************************************
2153 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2154 struct DMatDeclLowExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2155 {
2156  public:
2157  //**********************************************************************************************
2161  , INVALID_TYPE >;
2162  //**********************************************************************************************
2163 };
2165 //*************************************************************************************************
2166 
2167 
2168 //*************************************************************************************************
2170 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2171 struct DMatDeclUppExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2172 {
2173  public:
2174  //**********************************************************************************************
2178  , INVALID_TYPE >;
2179  //**********************************************************************************************
2180 };
2182 //*************************************************************************************************
2183 
2184 
2185 //*************************************************************************************************
2187 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2188 struct DMatDeclDiagExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2189 {
2190  public:
2191  //**********************************************************************************************
2195  , INVALID_TYPE >;
2196  //**********************************************************************************************
2197 };
2199 //*************************************************************************************************
2200 
2201 
2202 //*************************************************************************************************
2204 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF, bool AF >
2205 struct SubmatrixExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, AF >
2206 {
2207  public:
2208  //**********************************************************************************************
2211  //**********************************************************************************************
2212 };
2214 //*************************************************************************************************
2215 
2216 
2217 //*************************************************************************************************
2219 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2220 struct RowExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2221 {
2222  public:
2223  //**********************************************************************************************
2224  using Type = MultExprTrait_< RowExprTrait_<const MT1>, MT2 >;
2225  //**********************************************************************************************
2226 };
2228 //*************************************************************************************************
2229 
2230 
2231 //*************************************************************************************************
2233 template< typename MT1, typename MT2, bool SF, bool HF, bool LF, bool UF >
2234 struct ColumnExprTrait< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2235 {
2236  public:
2237  //**********************************************************************************************
2239  //**********************************************************************************************
2240 };
2242 //*************************************************************************************************
2243 
2244 } // namespace blaze
2245 
2246 #endif
typename SubmatrixExprTrait< MT, AF >::Type SubmatrixExprTrait_
Auxiliary alias declaration for the SubmatrixExprTrait type trait.The SubmatrixExprTrait_ alias decla...
Definition: SubmatrixExprTrait.h:134
#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
Evaluation of the expression type of a dense matrix declupp operation.Via this type trait it is possi...
Definition: DMatDeclUppExprTrait.h:75
Compile time check for row vector types.This type trait tests whether or not the given template argum...
Definition: IsRowVector.h:80
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1214
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSMatMultExpr.h:413
Header file for the SMatDVecMultExprTrait class template.
Header file for the Rows type trait.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatSMatMultExpr.h:371
DMatSMatMultExpr< MT1, MT2, SF, HF, LF, UF > This
Type of this DMatSMatMultExpr instance.
Definition: DMatSMatMultExpr.h:255
Header file for the IsUniUpper type trait.
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:87
Header file for basic type definitions.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatSMatMultExpr.h:435
typename TDVecSMatMultExprTrait< VT, MT >::Type TDVecSMatMultExprTrait_
Auxiliary alias declaration for the TDVecSMatMultExprTrait class template.The TDVecSMatMultExprTrait_...
Definition: TDVecSMatMultExprTrait.h:123
Header file for the DMatDeclDiagExprTrait class template.
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.
Header file for the IsDiagonal type trait.
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
Header file for the ColumnExprTrait class template.
Header file for the DeclUpp functor.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:194
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
IfTrue_< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: DMatSMatMultExpr.h:274
Header file for the IsRowVector type trait.
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1755
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSMatMultExpr.h:259
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
Header file for the TDVecSMatMultExprTrait 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:721
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
DisableIf_< IsSymmetric< MT >, const DMatDeclSymExpr< MT, SO > > declsym(const DenseMatrix< MT, SO > &dm)
Declares the given non-symmetric dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:841
Evaluation of the expression type of a dense matrix/dense vector multiplication.Via this type trait i...
Definition: DMatDVecMultExprTrait.h:78
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Constraints on the storage order of matrix types.
DMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatSMatMultExpr class.
Definition: DMatSMatMultExpr.h:292
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: DMatSMatMultExpr.h:401
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
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1802
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:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
CompositeType_< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:155
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
Flag for Hermitian matrices.
Definition: DMatSMatMultExpr.h:173
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatSMatMultExpr.h:307
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatSMatMultExpr.h:445
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Evaluation of the expression type of a dense matrix declsym operation.Via this type trait it is possi...
Definition: DMatDeclSymExprTrait.h:75
Constraint on the data type.
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
DisableIf_< IsHermitian< MT >, const DMatDeclHermExpr< MT, SO > > declherm(const DenseMatrix< MT, SO > &dm)
Declares the given non-Hermitian dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:841
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
SubvectorExprTrait_< VT, unaligned > subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:152
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatSMatMultExpr.h:381
Header file for the DisableIf class template.
Compile time check for dense vector types.This type trait tests whether or not the given template par...
Definition: IsDenseVector.h:78
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the DeclLow functor.
Header file for the If class template.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
#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
Flag for upper matrices.
Definition: DMatSMatMultExpr.h:175
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
Generic wrapper for the decllow() function.
Definition: DeclLow.h:58
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
Header file for the Or class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatSMatMultExpr.h:391
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:268
#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 DMatDeclLowExprTrait class template.
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
Evaluation of the expression type of a dense matrix/sparse vector multiplication.Via this type trait ...
Definition: DMatSVecMultExprTrait.h:80
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:78
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
Header file for the DMatDVecMultExprTrait class template.
Header file for the IsLower type trait.
ElementType_< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:153
Header file for the IsAligned type trait.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
Header file for the SMatSVecMultExprTrait class template.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:128
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:152
#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
Generic wrapper for the null function.
Definition: Noop.h:58
Header file for the IsTriangular type trait.
Header file for the DMatDeclUppExprTrait class template.
Header file for the DMatDeclSymExprTrait class template.
Compile time check for column vector types.This type trait tests whether or not the given template ar...
Definition: IsColumnVector.h:80
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.
DisableIf_< IsLower< MT >, const DMatDeclLowExpr< MT, SO > > decllow(const DenseMatrix< MT, SO > &dm)
Declares the given non-lower dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:842
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:260
Header file for the DeclDiag functor.
Evaluation of the expression type of a dense matrix declherm operation.Via this type trait it is poss...
Definition: DMatDeclHermExprTrait.h:75
Compile time check for dense matrix types.This type trait tests whether or not the given template par...
Definition: IsDenseMatrix.h:78
CompositeType_< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:156
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:128
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Flag for symmetric matrices.
Definition: DMatSMatMultExpr.h:172
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatMultExpr.h:109
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatSMatMultExpr.h:355
Header file for the conjugate shim.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Base class for all matrix/matrix multiplication expression templates.The MatMatMultExpr class serves ...
Definition: MatMatMultExpr.h:65
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
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.
Expression object for dense matrix-sparse matrix multiplications.The DMatSMatMultExpr class represent...
Definition: DMatSMatMultExpr.h:145
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
Header file for the reset shim.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Header file for the DMatDeclHermExprTrait class template.
Header file for the isDefault shim.
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Constraint on the data type.
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:151
Constraints on the storage order of matrix types.
Generic wrapper for the declherm() function.
Definition: DeclHerm.h:58
typename DMatSVecMultExprTrait< MT, VT >::Type DMatSVecMultExprTrait_
Auxiliary alias declaration for the DMatSVecMultExprTrait class template.The DMatSVecMultExprTrait_ a...
Definition: DMatSVecMultExprTrait.h:123
Header file for the Noop functor.
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DMatSMatMultExpr.h:257
typename DMatDVecMultExprTrait< MT, VT >::Type DMatDVecMultExprTrait_
Auxiliary alias declaration for the DMatDVecMultExprTrait class template.The DMatDVecMultExprTrait_ a...
Definition: DMatDVecMultExprTrait.h:119
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
Header file for the IsDenseVector type trait.
Generic wrapper for the declupp() function.
Definition: DeclUpp.h:58
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatSMatMultExpr.h:262
Evaluation of the expression type of a dense vector/dense matrix multiplication.Via this type trait i...
Definition: TDVecDMatMultExprTrait.h:78
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Evaluation of the expression type of a sparse vector/dense matrix multiplication.Via this type trait ...
Definition: TSVecDMatMultExprTrait.h:78
Header file for the IsRowMajorMatrix type trait.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatSMatMultExpr.h:258
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
Header file for the TDVecDMatMultExprTrait class template.
ElementType_< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:154
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:76
Evaluation of the expression type of a dense matrix decllow operation.Via this type trait it is possi...
Definition: DMatDeclLowExprTrait.h:75
Flag for lower matrices.
Definition: DMatSMatMultExpr.h:174
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:58
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:265
Evaluation of the expression type of a dense matrix decldiag operation.Via this type trait it is poss...
Definition: DMatDeclDiagExprTrait.h:75
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DMatSMatMultExpr.h:260
Header file for the TSVecDMatMultExprTrait class template.
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:78
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: DMatSMatMultExpr.h:453
Header file for the DeclHerm functor.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
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 DMatSVecMultExprTrait class template.
Header file for the IsColumnVector type trait.
Constraint on the data type.
IfTrue_< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatSMatMultExpr.h:271
Generic wrapper for the declsym() function.
Definition: DeclSym.h:58
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:677
Header file for the IsResizable type trait.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: DMatSMatMultExpr.h:261
const DMatDMatMultExpr< T1, T2, false, false, false, false > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7505
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
DisableIf_< IsDiagonal< MT >, const DMatDeclDiagExpr< MT, SO > > decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given non-diagonal dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:841
DisableIf_< IsUpper< MT >, const DMatDeclUppExpr< MT, SO > > declupp(const DenseMatrix< MT, SO > &dm)
Declares the given non-upper dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:842
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#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
Header file for the Bool class template.
Header file for the DeclSym functor.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSMatMultExpr.h:425
#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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatSMatMultExpr.h:452