All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSMatDMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATDMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
53 #include <blaze/math/shims/Reset.h>
88 #include <blaze/util/Assert.h>
89 #include <blaze/util/DisableIf.h>
90 #include <blaze/util/EnableIf.h>
91 #include <blaze/util/InvalidType.h>
93 #include <blaze/util/SelectType.h>
94 #include <blaze/util/Types.h>
97 
98 
99 namespace blaze {
100 
101 //=================================================================================================
102 //
103 // CLASS SMATDMATMULTEXPR
104 //
105 //=================================================================================================
106 
107 //*************************************************************************************************
114 template< typename MT1 // Type of the left-hand side dense matrix
115  , typename MT2 > // Type of the right-hand side sparse matrix
116 class TSMatDMatMultExpr : public DenseMatrix< TSMatDMatMultExpr<MT1,MT2>, true >
117  , private MatMatMultExpr
118  , private Computation
119 {
120  private:
121  //**Type definitions****************************************************************************
122  typedef typename MT1::ResultType RT1;
123  typedef typename MT2::ResultType RT2;
124  typedef typename RT1::ElementType ET1;
125  typedef typename RT2::ElementType ET2;
126  typedef typename MT1::CompositeType CT1;
127  typedef typename MT2::CompositeType CT2;
128  //**********************************************************************************************
129 
130  //**********************************************************************************************
133  //**********************************************************************************************
134 
135  //**********************************************************************************************
137  enum { evaluateRight = IsComputation<MT2>::value || RequiresEvaluation<MT2>::value };
138  //**********************************************************************************************
139 
140  //**********************************************************************************************
142 
148  template< typename T1, typename T2, typename T3 >
149  struct CanExploitSymmetry {
150  enum { value = IsRowMajorMatrix<T1>::value && IsSymmetric<T2>::value };
151  };
153  //**********************************************************************************************
154 
155  //**********************************************************************************************
157 
161  template< typename T1, typename T2, typename T3 >
162  struct IsEvaluationRequired {
163  enum { value = ( evaluateLeft || evaluateRight ) &&
164  !CanExploitSymmetry<T1,T2,T3>::value };
165  };
167  //**********************************************************************************************
168 
169  //**********************************************************************************************
171 
175  template< typename T1, typename T2, typename T3 >
176  struct UseOptimizedKernel {
177  enum { value = !IsResizable<typename T1::ElementType>::value };
178  };
180  //**********************************************************************************************
181 
182  //**********************************************************************************************
184 
187  template< typename T1, typename T2, typename T3 >
188  struct UseDefaultKernel {
189  enum { value = !UseOptimizedKernel<T1,T2,T3>::value };
190  };
192  //**********************************************************************************************
193 
194  public:
195  //**Type definitions****************************************************************************
201  typedef const ElementType ReturnType;
202  typedef const ResultType CompositeType;
203 
205  typedef typename SelectType< IsExpression<MT1>::value, const MT1, const MT1& >::Type LeftOperand;
206 
208  typedef typename SelectType< IsExpression<MT2>::value, const MT2, const MT2& >::Type RightOperand;
209 
212 
215  //**********************************************************************************************
216 
217  //**Compilation flags***************************************************************************
219  enum { vectorizable = 0 };
220 
222  enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
223  !evaluateRight && MT2::smpAssignable };
224  //**********************************************************************************************
225 
226  //**Constructor*********************************************************************************
232  explicit inline TSMatDMatMultExpr( const MT1& lhs, const MT2& rhs )
233  : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
234  , rhs_( rhs ) // Right-hand side dense matrix of the multiplication expression
235  {
236  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
237  }
238  //**********************************************************************************************
239 
240  //**Access operator*****************************************************************************
247  inline ReturnType operator()( size_t i, size_t j ) const {
248  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
249  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
250 
251  ElementType tmp;
252 
253  if( lhs_.columns() != 0UL ) {
254  tmp = lhs_(i,0UL) * rhs_(0UL,j);
255  for( size_t k=1UL; k<lhs_.columns(); ++k ) {
256  tmp += lhs_(i,k) * rhs_(k,j);
257  }
258  }
259  else {
260  reset( tmp );
261  }
262 
263  return tmp;
264  }
265  //**********************************************************************************************
266 
267  //**Rows function*******************************************************************************
272  inline size_t rows() const {
273  return lhs_.rows();
274  }
275  //**********************************************************************************************
276 
277  //**Columns function****************************************************************************
282  inline size_t columns() const {
283  return rhs_.columns();
284  }
285  //**********************************************************************************************
286 
287  //**Left operand access*************************************************************************
292  inline LeftOperand leftOperand() const {
293  return lhs_;
294  }
295  //**********************************************************************************************
296 
297  //**Right operand access************************************************************************
302  inline RightOperand rightOperand() const {
303  return rhs_;
304  }
305  //**********************************************************************************************
306 
307  //**********************************************************************************************
313  template< typename T >
314  inline bool canAlias( const T* alias ) const {
315  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
316  }
317  //**********************************************************************************************
318 
319  //**********************************************************************************************
325  template< typename T >
326  inline bool isAliased( const T* alias ) const {
327  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
328  }
329  //**********************************************************************************************
330 
331  //**********************************************************************************************
336  inline bool isAligned() const {
337  return rhs_.isAligned();
338  }
339  //**********************************************************************************************
340 
341  //**********************************************************************************************
346  inline bool canSMPAssign() const {
347  return ( columns() > SMP_TSMATDMATMULT_THRESHOLD );
348  }
349  //**********************************************************************************************
350 
351  private:
352  //**Member variables****************************************************************************
355  //**********************************************************************************************
356 
357  //**Assignment to dense matrices****************************************************************
370  template< typename MT // Type of the target dense matrix
371  , bool SO > // Storage order of the target dense matrix
372  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
373  assign( DenseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
374  {
376 
377  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
378  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
379 
380  LT A( serial( rhs.lhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
381  RT B( serial( rhs.rhs_ ) ); // Evaluation of the left-hand side dense matrix operand
382 
383  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
384  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
385  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
386  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
387  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
388  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
389 
390  TSMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
391  }
393  //**********************************************************************************************
394 
395  //**Default assignment to dense matrices********************************************************
410  template< typename MT3 // Type of the left-hand side target matrix
411  , typename MT4 // Type of the left-hand side matrix operand
412  , typename MT5 > // Type of the right-hand side matrix operand
413  static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
414  selectAssignKernel( MT3& C, const MT4& A, const MT5& B )
415  {
416  typedef typename MT4::ConstIterator ConstIterator;
417 
418  reset( C );
419 
420  const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
421 
422  for( size_t jj=0UL; jj<B.columns(); jj+=block ) {
423  const size_t jend( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
424  for( size_t i=0UL; i<A.columns(); ++i ) {
425  const ConstIterator end( A.end(i) );
426  ConstIterator element( A.begin(i) );
427  for( ; element!=end; ++element ) {
428  for( size_t j=jj; j<jend; ++j ) {
429  if( isDefault( C(element->index(),j) ) )
430  C(element->index(),j) = element->value() * B(i,j);
431  else
432  C(element->index(),j) += element->value() * B(i,j);
433  }
434  }
435  }
436  }
437  }
439  //**********************************************************************************************
440 
441  //**Optimized assignment to dense matrices******************************************************
456  template< typename MT3 // Type of the left-hand side target matrix
457  , typename MT4 // Type of the left-hand side matrix operand
458  , typename MT5 > // Type of the right-hand side matrix operand
459  static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
460  selectAssignKernel( MT3& C, const MT4& A, const MT5& B )
461  {
462  typedef typename MT4::ConstIterator ConstIterator;
463 
464  const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
465 
466  for( size_t jj=0UL; jj<B.columns(); jj+=block ) {
467  const size_t jend( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
468  for( size_t i=0UL; i<A.rows(); ++i ) {
469  for( size_t j=jj; j<jend; ++j ) {
470  reset( C(i,j) );
471  }
472  }
473  for( size_t i=0UL; i<A.columns(); ++i )
474  {
475  const ConstIterator end( A.end(i) );
476  ConstIterator element( A.begin(i) );
477 
478  const size_t nonzeros( A.nonZeros(i) );
479 
480  const size_t kend( nonzeros & size_t(-4) );
481  BLAZE_INTERNAL_ASSERT( ( nonzeros - ( nonzeros % 4UL ) ) == kend, "Invalid end calculation" );
482 
483  for( size_t k=0UL; k<kend; k+=4UL ) {
484  const size_t i1( element->index() );
485  const ET1 v1( element->value() );
486  ++element;
487  const size_t i2( element->index() );
488  const ET1 v2( element->value() );
489  ++element;
490  const size_t i3( element->index() );
491  const ET1 v3( element->value() );
492  ++element;
493  const size_t i4( element->index() );
494  const ET1 v4( element->value() );
495  ++element;
496 
497  for( size_t j=jj; j<jend; ++j ) {
498  C(i1,j) += v1 * B(i,j);
499  C(i2,j) += v2 * B(i,j);
500  C(i3,j) += v3 * B(i,j);
501  C(i4,j) += v4 * B(i,j);
502  }
503  }
504 
505  for( ; element!=end; ++element ) {
506  for( size_t j=jj; j<jend; ++j ) {
507  C(element->index(),j) += element->value() * B(i,j);
508  }
509  }
510  }
511  }
512  }
514  //**********************************************************************************************
515 
516  //**Assignment to sparse matrices***************************************************************
529  template< typename MT // Type of the target sparse matrix
530  , bool SO > // Storage order of the target sparse matrix
531  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
532  assign( SparseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
533  {
535 
536  typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
537 
544 
545  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
546  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
547 
548  const TmpType tmp( serial( rhs ) );
549  assign( ~lhs, tmp );
550  }
552  //**********************************************************************************************
553 
554  //**Restructuring assignment to row-major matrices**********************************************
569  template< typename MT > // Type of the target matrix
570  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
571  assign( Matrix<MT,false>& lhs, const TSMatDMatMultExpr& rhs )
572  {
574 
576 
577  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
578  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
579 
580  assign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
581  }
583  //**********************************************************************************************
584 
585  //**Addition assignment to dense matrices*******************************************************
598  template< typename MT // Type of the target dense matrix
599  , bool SO > // Storage order of the target dense matrix
600  friend inline void addAssign( DenseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
601  {
603 
604  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
605  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
606 
607  LT A( serial( rhs.lhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
608  RT B( serial( rhs.rhs_ ) ); // Evaluation of the left-hand side dense matrix operand
609 
610  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
611  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
612  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
613  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
614  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
615  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
616 
617  TSMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
618  }
620  //**********************************************************************************************
621 
622  //**Optimized addition assignment to dense matrices*********************************************
636  template< typename MT3 // Type of the left-hand side target matrix
637  , typename MT4 // Type of the left-hand side matrix operand
638  , typename MT5 > // Type of the right-hand side matrix operand
639  static inline void selectAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
640  {
641  typedef typename MT4::ConstIterator ConstIterator;
642 
643  const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
644 
645  for( size_t jj=0UL; jj<B.columns(); jj+=block ) {
646  const size_t jend( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
647  for( size_t i=0UL; i<A.columns(); ++i )
648  {
649  const ConstIterator end( A.end(i) );
650  ConstIterator element( A.begin(i) );
651 
652  const size_t nonzeros( A.nonZeros(i) );
653 
654  const size_t kend( nonzeros & size_t(-4) );
655  BLAZE_INTERNAL_ASSERT( ( nonzeros - ( nonzeros % 4UL ) ) == kend, "Invalid end calculation" );
656 
657  for( size_t k=0UL; k<kend; k+=4UL ) {
658  const size_t i1( element->index() );
659  const ET1 v1( element->value() );
660  ++element;
661  const size_t i2( element->index() );
662  const ET1 v2( element->value() );
663  ++element;
664  const size_t i3( element->index() );
665  const ET1 v3( element->value() );
666  ++element;
667  const size_t i4( element->index() );
668  const ET1 v4( element->value() );
669  ++element;
670 
671  for( size_t j=jj; j<jend; ++j ) {
672  C(i1,j) += v1 * B(i,j);
673  C(i2,j) += v2 * B(i,j);
674  C(i3,j) += v3 * B(i,j);
675  C(i4,j) += v4 * B(i,j);
676  }
677  }
678 
679  for( ; element!=end; ++element ) {
680  for( size_t j=jj; j<jend; ++j ) {
681  C(element->index(),j) += element->value() * B(i,j);
682  }
683  }
684  }
685  }
686  }
688  //**********************************************************************************************
689 
690  //**Restructuring addition assignment to row-major matrices*************************************
705  template< typename MT > // Type of the target matrix
706  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
707  addAssign( Matrix<MT,false>& lhs, const TSMatDMatMultExpr& rhs )
708  {
710 
712 
713  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
714  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
715 
716  addAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
717  }
719  //**********************************************************************************************
720 
721  //**Addition assignment to sparse matrices******************************************************
722  // No special implementation for the addition assignment to sparse matrices.
723  //**********************************************************************************************
724 
725  //**Subtraction assignment to dense matrices****************************************************
738  template< typename MT // Type of the target dense matrix
739  , bool SO > // Storage order of the target dense matrix
740  friend inline void subAssign( DenseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
741  {
743 
744  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
745  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
746 
747  LT A( serial( rhs.lhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
748  RT B( serial( rhs.rhs_ ) ); // Evaluation of the left-hand side dense matrix operand
749 
750  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
751  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
752  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
753  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
754  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
755  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
756 
757  TSMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
758  }
760  //**********************************************************************************************
761 
762  //**Optimized subtraction assignment to dense matrices******************************************
776  template< typename MT3 // Type of the left-hand side target matrix
777  , typename MT4 // Type of the left-hand side matrix operand
778  , typename MT5 > // Type of the right-hand side matrix operand
779  static inline void selectSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
780  {
781  typedef typename MT4::ConstIterator ConstIterator;
782 
783  const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
784 
785  for( size_t jj=0UL; jj<B.columns(); jj+=block ) {
786  const size_t jend( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
787  for( size_t i=0UL; i<A.columns(); ++i )
788  {
789  const ConstIterator end( A.end(i) );
790  ConstIterator element( A.begin(i) );
791 
792  const size_t nonzeros( A.nonZeros(i) );
793 
794  const size_t kend( nonzeros & size_t(-4) );
795  BLAZE_INTERNAL_ASSERT( ( nonzeros - ( nonzeros % 4UL ) ) == kend, "Invalid end calculation" );
796 
797  for( size_t k=0UL; k<kend; k+=4UL ) {
798  const size_t i1( element->index() );
799  const ET1 v1( element->value() );
800  ++element;
801  const size_t i2( element->index() );
802  const ET1 v2( element->value() );
803  ++element;
804  const size_t i3( element->index() );
805  const ET1 v3( element->value() );
806  ++element;
807  const size_t i4( element->index() );
808  const ET1 v4( element->value() );
809  ++element;
810 
811  for( size_t j=jj; j<jend; ++j ) {
812  C(i1,j) -= v1 * B(i,j);
813  C(i2,j) -= v2 * B(i,j);
814  C(i3,j) -= v3 * B(i,j);
815  C(i4,j) -= v4 * B(i,j);
816  }
817  }
818 
819  for( ; element!=end; ++element ) {
820  for( size_t j=jj; j<jend; ++j ) {
821  C(element->index(),j) -= element->value() * B(i,j);
822  }
823  }
824  }
825  }
826  }
828  //**********************************************************************************************
829 
830  //**Restructuring subtraction assignment to row-major matrices**********************************
845  template< typename MT > // Type of the target matrix
846  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
847  subAssign( Matrix<MT,false>& lhs, const TSMatDMatMultExpr& rhs )
848  {
850 
852 
853  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
854  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
855 
856  subAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
857  }
859  //**********************************************************************************************
860 
861  //**Subtraction assignment to sparse matrices***************************************************
862  // No special implementation for the subtraction assignment to sparse matrices.
863  //**********************************************************************************************
864 
865  //**Multiplication assignment to dense matrices*************************************************
866  // No special implementation for the multiplication assignment to dense matrices.
867  //**********************************************************************************************
868 
869  //**Multiplication assignment to sparse matrices************************************************
870  // No special implementation for the multiplication assignment to sparse matrices.
871  //**********************************************************************************************
872 
873  //**SMP assignment to dense matrices************************************************************
889  template< typename MT // Type of the target dense matrix
890  , bool SO > // Storage order of the target dense matrix
891  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
892  smpAssign( DenseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
893  {
895 
896  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
897  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
898 
899  LT A( rhs.lhs_ ); // Evaluation of the right-hand side sparse matrix operand
900  RT B( rhs.rhs_ ); // Evaluation of the left-hand side dense matrix operand
901 
902  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
903  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
904  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
905  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
906  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
907  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
908 
909  smpAssign( ~lhs, A * B );
910  }
912  //**********************************************************************************************
913 
914  //**SMP assignment to sparse matrices***********************************************************
930  template< typename MT // Type of the target sparse matrix
931  , bool SO > // Storage order of the target sparse matrix
932  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
933  smpAssign( SparseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
934  {
936 
937  typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
938 
945 
946  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
947  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
948 
949  const TmpType tmp( rhs );
950  smpAssign( ~lhs, tmp );
951  }
953  //**********************************************************************************************
954 
955  //**Restructuring SMP assignment to row-major matrices******************************************
970  template< typename MT > // Type of the target matrix
971  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
972  smpAssign( Matrix<MT,false>& lhs, const TSMatDMatMultExpr& rhs )
973  {
975 
976  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
977  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
978 
979  smpAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
980  }
982  //**********************************************************************************************
983 
984  //**SMP addition assignment to dense matrices***************************************************
1000  template< typename MT // Type of the target dense matrix
1001  , bool SO > // Storage order of the target dense matrix
1002  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1003  smpAddAssign( DenseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
1004  {
1006 
1007  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1008  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1009 
1010  LT A( rhs.lhs_ ); // Evaluation of the right-hand side sparse matrix operand
1011  RT B( rhs.rhs_ ); // Evaluation of the left-hand side dense matrix operand
1012 
1013  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1014  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1015  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1016  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1017  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1018  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1019 
1020  smpAddAssign( ~lhs, A * B );
1021  }
1023  //**********************************************************************************************
1024 
1025  //**Restructuring SMP addition assignment to row-major matrices*********************************
1040  template< typename MT > // Type of the target matrix
1041  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1042  smpAddAssign( Matrix<MT,false>& lhs, const TSMatDMatMultExpr& rhs )
1043  {
1045 
1046  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1047  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1048 
1049  smpAddAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1050  }
1052  //**********************************************************************************************
1053 
1054  //**SMP addition assignment to sparse matrices**************************************************
1055  // No special implementation for the SMP addition assignment to sparse matrices.
1056  //**********************************************************************************************
1057 
1058  //**SMP subtraction assignment to dense matrices************************************************
1074  template< typename MT // Type of the target dense matrix
1075  , bool SO > // Storage order of the target dense matrix
1076  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1077  smpSubAssign( DenseMatrix<MT,SO>& lhs, const TSMatDMatMultExpr& rhs )
1078  {
1080 
1081  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1082  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1083 
1084  LT A( rhs.lhs_ ); // Evaluation of the right-hand side sparse matrix operand
1085  RT B( rhs.rhs_ ); // Evaluation of the left-hand side dense matrix operand
1086 
1087  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1088  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1089  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1090  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1091  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1092  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1093 
1094  smpSubAssign( ~lhs, A * B );
1095  }
1097  //**********************************************************************************************
1098 
1099  //**Restructuring SMP subtraction assignment to row-major matrices******************************
1114  template< typename MT > // Type of the target matrix
1115  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1116  smpSubAssign( Matrix<MT,false>& lhs, const TSMatDMatMultExpr& rhs )
1117  {
1119 
1120  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1121  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1122 
1123  smpSubAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1124  }
1126  //**********************************************************************************************
1127 
1128  //**SMP subtraction assignment to sparse matrices***********************************************
1129  // No special implementation for the SMP subtraction assignment to sparse matrices.
1130  //**********************************************************************************************
1131 
1132  //**SMP multiplication assignment to dense matrices*********************************************
1133  // No special implementation for the SMP multiplication assignment to dense matrices.
1134  //**********************************************************************************************
1135 
1136  //**SMP multiplication assignment to sparse matrices********************************************
1137  // No special implementation for the SMP multiplication assignment to sparse matrices.
1138  //**********************************************************************************************
1139 
1140  //**Compile time checks*************************************************************************
1148  //**********************************************************************************************
1149 };
1150 //*************************************************************************************************
1151 
1152 
1153 
1154 
1155 //=================================================================================================
1156 //
1157 // GLOBAL BINARY ARITHMETIC OPERATORS
1158 //
1159 //=================================================================================================
1160 
1161 //*************************************************************************************************
1192 template< typename T1 // Type of the left-hand side sparse matrix
1193  , typename T2 > // Type of the right-hand side dense matrix
1194 inline const TSMatDMatMultExpr<T1,T2>
1196 {
1198 
1199  if( (~lhs).columns() != (~rhs).rows() )
1200  throw std::invalid_argument( "Matrix sizes do not match" );
1201 
1202  return TSMatDMatMultExpr<T1,T2>( ~lhs, ~rhs );
1203 }
1204 //*************************************************************************************************
1205 
1206 
1207 
1208 
1209 //=================================================================================================
1210 //
1211 // ROWS SPECIALIZATIONS
1212 //
1213 //=================================================================================================
1214 
1215 //*************************************************************************************************
1217 template< typename MT1, typename MT2 >
1218 struct Rows< TSMatDMatMultExpr<MT1,MT2> >
1219  : public Rows<MT1>
1220 {};
1222 //*************************************************************************************************
1223 
1224 
1225 
1226 
1227 //=================================================================================================
1228 //
1229 // COLUMNS SPECIALIZATIONS
1230 //
1231 //=================================================================================================
1232 
1233 //*************************************************************************************************
1235 template< typename MT1, typename MT2 >
1236 struct Columns< TSMatDMatMultExpr<MT1,MT2> >
1237  : public Columns<MT2>
1238 {};
1240 //*************************************************************************************************
1241 
1242 
1243 
1244 
1245 //=================================================================================================
1246 //
1247 // ISLOWER SPECIALIZATIONS
1248 //
1249 //=================================================================================================
1250 
1251 //*************************************************************************************************
1253 template< typename MT1, typename MT2 >
1254 struct IsLower< TSMatDMatMultExpr<MT1,MT2> >
1255  : public IsTrue< IsLower<MT1>::value && IsLower<MT2>::value >
1256 {};
1258 //*************************************************************************************************
1259 
1260 
1261 
1262 
1263 //=================================================================================================
1264 //
1265 // ISUPPER SPECIALIZATIONS
1266 //
1267 //=================================================================================================
1268 
1269 //*************************************************************************************************
1271 template< typename MT1, typename MT2 >
1272 struct IsUpper< TSMatDMatMultExpr<MT1,MT2> >
1273  : public IsTrue< IsUpper<MT1>::value && IsUpper<MT2>::value >
1274 {};
1276 //*************************************************************************************************
1277 
1278 
1279 
1280 
1281 //=================================================================================================
1282 //
1283 // EXPRESSION TRAIT SPECIALIZATIONS
1284 //
1285 //=================================================================================================
1286 
1287 //*************************************************************************************************
1289 template< typename MT1, typename MT2, typename VT >
1290 struct TDMatDVecMultExprTrait< TSMatDMatMultExpr<MT1,MT2>, VT >
1291 {
1292  public:
1293  //**********************************************************************************************
1294  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1295  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1296  IsDenseVector<VT>::value && IsColumnVector<VT>::value
1297  , typename TSMatDVecMultExprTrait< MT1, typename DMatDVecMultExprTrait<MT2,VT>::Type >::Type
1298  , INVALID_TYPE >::Type Type;
1299  //**********************************************************************************************
1300 };
1302 //*************************************************************************************************
1303 
1304 
1305 //*************************************************************************************************
1307 template< typename MT1, typename MT2, typename VT >
1308 struct TDMatSVecMultExprTrait< TSMatDMatMultExpr<MT1,MT2>, VT >
1309 {
1310  public:
1311  //**********************************************************************************************
1312  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1313  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1314  IsSparseVector<VT>::value && IsColumnVector<VT>::value
1315  , typename TSMatDVecMultExprTrait< MT1, typename DMatSVecMultExprTrait<MT2,VT>::Type >::Type
1316  , INVALID_TYPE >::Type Type;
1317  //**********************************************************************************************
1318 };
1320 //*************************************************************************************************
1321 
1322 
1323 //*************************************************************************************************
1325 template< typename VT, typename MT1, typename MT2 >
1326 struct TDVecTDMatMultExprTrait< VT, TSMatDMatMultExpr<MT1,MT2> >
1327 {
1328  public:
1329  //**********************************************************************************************
1330  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1331  IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1332  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1333  , typename TDVecDMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1334  , INVALID_TYPE >::Type Type;
1335  //**********************************************************************************************
1336 };
1338 //*************************************************************************************************
1339 
1340 
1341 //*************************************************************************************************
1343 template< typename VT, typename MT1, typename MT2 >
1344 struct TSVecTDMatMultExprTrait< VT, TSMatDMatMultExpr<MT1,MT2> >
1345 {
1346  public:
1347  //**********************************************************************************************
1348  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1349  IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1350  IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1351  , typename TDVecDMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1352  , INVALID_TYPE >::Type Type;
1353  //**********************************************************************************************
1354 };
1356 //*************************************************************************************************
1357 
1358 
1359 //*************************************************************************************************
1361 template< typename MT1, typename MT2, bool AF >
1362 struct SubmatrixExprTrait< TSMatDMatMultExpr<MT1,MT2>, AF >
1363 {
1364  public:
1365  //**********************************************************************************************
1366  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1367  , typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1368  //**********************************************************************************************
1369 };
1371 //*************************************************************************************************
1372 
1373 
1374 //*************************************************************************************************
1376 template< typename MT1, typename MT2 >
1377 struct RowExprTrait< TSMatDMatMultExpr<MT1,MT2> >
1378 {
1379  public:
1380  //**********************************************************************************************
1381  typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1382  //**********************************************************************************************
1383 };
1385 //*************************************************************************************************
1386 
1387 
1388 //*************************************************************************************************
1390 template< typename MT1, typename MT2 >
1391 struct ColumnExprTrait< TSMatDMatMultExpr<MT1,MT2> >
1392 {
1393  public:
1394  //**********************************************************************************************
1395  typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
1396  //**********************************************************************************************
1397 };
1399 //*************************************************************************************************
1400 
1401 } // namespace blaze
1402 
1403 #endif
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatDMatMultExpr.h:198
Header file for the Rows type trait.
const DMatDMatMultExpr< T1, T2 > 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:4838
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:197
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:258
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
#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:79
Header file for the ColumnExprTrait class template.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TSMatDMatMultExpr.h:282
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSMatDMatMultExpr.h:314
TSMatDMatMultExpr< MT1, MT2 > This
Type of this TSMatDMatMultExpr instance.
Definition: TSMatDMatMultExpr.h:196
Header file for the IsColumnMajorMatrix type trait.
Header file for the TSVecTSMatMultExprTrait class template.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSMatDMatMultExpr.h:336
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
LeftOperand leftOperand() const
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatDMatMultExpr.h:292
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:199
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:126
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatDMatMultExpr.h:353
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSMatDMatMultExpr.h:326
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatDMatMultExpr.h:211
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TSMatDMatMultExpr.h:346
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:125
Header file for the multiplication trait.
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: TSMatDMatMultExpr.h:354
Header file for the IsSymmetric type trait.
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:127
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:104
#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: StorageOrder.h:161
RightOperand rightOperand() const
Returns the right-hand side dense matrix operand.
Definition: TSMatDMatMultExpr.h:302
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Header file for the TDMatSVecMultExprTrait class template.
Header file for the TDVecTSMatMultExprTrait class template.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:122
Header file for the DenseMatrix base class.
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Columns type trait.
Header file for the TSMatDVecMultExprTrait class template.
TSMatDMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TSMatDMatMultExpr class.
Definition: TSMatDMatMultExpr.h:232
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatDMatMultExpr.h:247
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSMatDMatMultExpr.h:214
const size_t SMP_TSMATDMATMULT_THRESHOLD
SMP column-major sparse matrix/row-major dense matrix multiplication threshold.This threshold specifi...
Definition: Thresholds.h:1064
Header file for the DMatDVecMultExprTrait class template.
Header file for the IsLower type trait.
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:123
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:208
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:205
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
Header file for the serial shim.
#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:165
RT1::ElementType ET1
Element type of the left-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:124
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatDMatMultExpr.h:202
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:116
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: StorageOrder.h:81
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:201
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:142
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the reset shim.
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
#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:283
Header file for the IsDenseVector type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TSMatDMatMultExpr.h:272
Header file for the IsRowMajorMatrix type trait.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:932
Header file for the IsComputation type trait class.
Expression object for transpose sparse matrix-dense matrix multiplications.The TSMatDMatMultExpr clas...
Definition: Forward.h:137
Header file for the TDVecDMatMultExprTrait class template.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Header file for the TDMatDVecMultExprTrait class template.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for the IsTrue value trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: TSMatDMatMultExpr.h:200
Header file for basic type definitions.
Header file for the TSVecDMatMultExprTrait class template.
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.
Header file for the IsResizable type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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 TDVecTDMatMultExprTrait class template.
#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:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849