TSMatSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
44 #include <vector>
90 #include <blaze/util/Assert.h>
91 #include <blaze/util/DisableIf.h>
92 #include <blaze/util/EnableIf.h>
93 #include <blaze/util/InvalidType.h>
95 #include <blaze/util/mpl/And.h>
96 #include <blaze/util/mpl/Or.h>
97 #include <blaze/util/SelectType.h>
98 #include <blaze/util/Types.h>
99 #include <blaze/util/Unused.h>
101 
102 
103 namespace blaze {
104 
105 //=================================================================================================
106 //
107 // CLASS TSMATSMATMULTEXPR
108 //
109 //=================================================================================================
110 
111 //*************************************************************************************************
118 template< typename MT1 // Type of the left-hand side sparse matrix
119  , typename MT2 > // Type of the right-hand side sparse matrix
120 class TSMatSMatMultExpr : public SparseMatrix< TSMatSMatMultExpr<MT1,MT2>, true >
121  , private MatMatMultExpr
122  , private Computation
123 {
124  private:
125  //**Type definitions****************************************************************************
126  typedef typename MT1::ResultType RT1;
127  typedef typename MT2::ResultType RT2;
128  typedef typename MT1::CompositeType CT1;
129  typedef typename MT2::CompositeType CT2;
130  //**********************************************************************************************
131 
132  //**********************************************************************************************
134  enum { evaluateLeft = RequiresEvaluation<MT1>::value };
135  //**********************************************************************************************
136 
137  //**********************************************************************************************
139  enum { evaluateRight = RequiresEvaluation<MT2>::value };
140  //**********************************************************************************************
141 
142  //**********************************************************************************************
144 
151  template< typename T1, typename T2, typename T3 >
152  struct CanExploitSymmetry {
153  enum { value = ( IsRowMajorMatrix<T1>::value && IsSymmetric<T2>::value ) ||
154  ( IsColumnMajorMatrix<T1>::value && IsSymmetric<T3>::value ) };
155  };
157  //**********************************************************************************************
158 
159  //**********************************************************************************************
161 
166  template< typename T1, typename T2, typename T3 >
167  struct IsEvaluationRequired {
168  enum { value = ( evaluateLeft || evaluateRight ) &&
169  !CanExploitSymmetry<T1,T2,T2>::value };
170  };
172  //**********************************************************************************************
173 
174  public:
175  //**Type definitions****************************************************************************
181  typedef const ElementType ReturnType;
182  typedef const ResultType CompositeType;
183 
185  typedef typename SelectType< IsExpression<MT1>::value, const MT1, const MT1& >::Type LeftOperand;
186 
188  typedef typename SelectType< IsExpression<MT2>::value, const MT2, const MT2& >::Type RightOperand;
189  //**********************************************************************************************
190 
191  //**Compilation flags***************************************************************************
193  enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
194  !evaluateRight && MT2::smpAssignable };
195  //**********************************************************************************************
196 
197  //**Constructor*********************************************************************************
203  explicit inline TSMatSMatMultExpr( const MT1& lhs, const MT2& rhs )
204  : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
205  , rhs_( rhs ) // Right-hand side sparse matrix of the multiplication expression
206  {
207  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
208  }
209  //**********************************************************************************************
210 
211  //**Access operator*****************************************************************************
218  inline ReturnType operator()( size_t i, size_t j ) const {
219  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
220  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
221 
222  ElementType tmp = ElementType();
223 
224  if( lhs_.columns() != 0UL )
225  {
226  const size_t kbegin( max( ( IsUpper<MT1>::value )?( i ):( 0UL ),
227  ( IsLower<MT2>::value )?( j ):( 0UL ) ) );
228  const size_t kend ( min( ( IsLower<MT1>::value )?( i+1UL ):( lhs_.columns() ),
229  ( IsUpper<MT2>::value )?( j+1UL ):( lhs_.columns() ) ) );
230 
231  tmp = lhs_(i,kbegin) * rhs_(kbegin,j);
232  for( size_t k=kbegin+1UL; k<kend; ++k ) {
233  tmp += lhs_(i,k) * rhs_(k,j);
234  }
235  }
236 
237  return tmp;
238  }
239  //**********************************************************************************************
240 
241  //**Rows function*******************************************************************************
246  inline size_t rows() const {
247  return lhs_.rows();
248  }
249  //**********************************************************************************************
250 
251  //**Columns function****************************************************************************
256  inline size_t columns() const {
257  return rhs_.columns();
258  }
259  //**********************************************************************************************
260 
261  //**NonZeros function***************************************************************************
266  inline size_t nonZeros() const {
267  return 0UL;
268  }
269  //**********************************************************************************************
270 
271  //**NonZeros function***************************************************************************
277  inline size_t nonZeros( size_t i ) const {
278  UNUSED_PARAMETER( i );
279  return 0UL;
280  }
281  //**********************************************************************************************
282 
283  //**Left operand access*************************************************************************
288  inline LeftOperand leftOperand() const {
289  return lhs_;
290  }
291  //**********************************************************************************************
292 
293  //**Right operand access************************************************************************
298  inline RightOperand rightOperand() const {
299  return rhs_;
300  }
301  //**********************************************************************************************
302 
303  //**********************************************************************************************
309  template< typename T >
310  inline bool canAlias( const T* alias ) const {
311  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
312  }
313  //**********************************************************************************************
314 
315  //**********************************************************************************************
321  template< typename T >
322  inline bool isAliased( const T* alias ) const {
323  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
324  }
325  //**********************************************************************************************
326 
327  //**********************************************************************************************
332  inline bool canSMPAssign() const {
333  return ( rows() > SMP_TSMATSMATMULT_THRESHOLD );
334  }
335  //**********************************************************************************************
336 
337  private:
338  //**Member variables****************************************************************************
339  LeftOperand lhs_;
340  RightOperand rhs_;
341  //**********************************************************************************************
342 
343  //**Assignment to dense matrices****************************************************************
356  template< typename MT // Type of the target dense matrix
357  , bool SO > // Storage order of the target dense matrix
358  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
359  assign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
360  {
362 
363  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
364  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
365 
366  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
367  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
368 
369  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
370  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
371  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
372  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
373  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
374  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
375 
376  TSMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
377  }
379  //**********************************************************************************************
380 
381  //**Default assignment to dense matrices********************************************************
395  template< typename MT3 // Type of the left-hand side target matrix
396  , typename MT4 // Type of the left-hand side matrix operand
397  , typename MT5 > // Type of the right-hand side matrix operand
398  static inline void selectAssignKernel( MT3& C, const MT4& A, const MT5& B )
399  {
400  typedef typename MT4::ConstIterator LeftIterator;
401  typedef typename MT5::ConstIterator RightIterator;
402 
403  for( size_t j=0UL; j<A.columns(); ++j ) {
404  const LeftIterator lend( A.end(j) );
405  for( LeftIterator lelem=A.begin(j); lelem!=lend; ++lelem ) {
406  const RightIterator rend( B.end(j) );
407  for( RightIterator relem=B.begin(j); relem!=rend; ++relem )
408  {
410  isDefault( C(lelem->index(),relem->index()) ) ) {
411  C(lelem->index(),relem->index()) = lelem->value() * relem->value();
412  }
413  else {
414  C(lelem->index(),relem->index()) += lelem->value() * relem->value();
415  }
416  }
417  }
418  }
419  }
421  //**********************************************************************************************
422 
423  //**Assignment to row-major sparse matrices*****************************************************
436  template< typename MT > // Type of the target sparse matrix
437  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
438  assign( SparseMatrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
439  {
441 
443 
444  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
445  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
446 
448 
449  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
450  assign( ~lhs, tmp * rhs.rhs_ );
451  }
453  //**********************************************************************************************
454 
455  //**Assignment to column-major sparse matrices**************************************************
468  template< typename MT > // Type of the target sparse matrix
469  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
470  assign( SparseMatrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
471  {
473 
474  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
475  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
476 
478 
479  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
480  assign( ~lhs, rhs.lhs_ * tmp );
481  }
483  //**********************************************************************************************
484 
485  //**Restructuring assignment to row-major matrices**********************************************
500  template< typename MT > // Type of the target matrix
501  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
502  assign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
503  {
505 
507 
508  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
509  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
510 
511  assign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
512  }
514  //**********************************************************************************************
515 
516  //**Restructuring assignment to column-major matrices*******************************************
531  template< typename MT > // Type of the target matrix
532  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
533  assign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
534  {
536 
537  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
538  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
539 
540  assign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
541  }
543  //**********************************************************************************************
544 
545  //**Addition assignment to dense matrices*******************************************************
558  template< typename MT // Type of the target dense matrix
559  , bool SO > // Storage order of the target dense matarix
560  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
561  addAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
562  {
564 
565  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
566  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
567 
568  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
569  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
570 
571  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
572  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
573  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
574  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
575  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
576  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
577 
578  TSMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
579  }
581  //**********************************************************************************************
582 
583  //**Default addition assignment to dense matrices***********************************************
597  template< typename MT3 // Type of the left-hand side target matrix
598  , typename MT4 // Type of the left-hand side matrix operand
599  , typename MT5 > // Type of the right-hand side matrix operand
600  static inline void selectAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
601  {
602  typedef typename MT4::ConstIterator LeftIterator;
603  typedef typename MT5::ConstIterator RightIterator;
604 
605  for( size_t j=0UL; j<A.columns(); ++j ) {
606  const LeftIterator lend( A.end(j) );
607  for( LeftIterator lelem=A.begin(j); lelem!=lend; ++lelem ) {
608  const RightIterator rend( B.end(j) );
609  for( RightIterator relem=B.begin(j); relem!=rend; ++relem ) {
610  C(lelem->index(),relem->index()) += lelem->value() * relem->value();
611  }
612  }
613  }
614  }
616  //**********************************************************************************************
617 
618  //**Restructuring addition assignment to row-major matrices*************************************
633  template< typename MT > // Type of the target matrix
634  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
635  addAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
636  {
638 
640 
641  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
642  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
643 
644  addAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
645  }
647  //**********************************************************************************************
648 
649  //**Restructuring addition assignment to column-major matrices**********************************
664  template< typename MT > // Type of the target matrix
665  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
666  addAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
667  {
669 
670  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
671  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
672 
673  addAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
674  }
676  //**********************************************************************************************
677 
678  //**Addition assignment to sparse matrices******************************************************
679  // No special implementation for the addition assignment to sparse matrices.
680  //**********************************************************************************************
681 
682  //**Subtraction assignment to dense matrices****************************************************
695  template< typename MT // Type of the target dense matrix
696  , bool SO > // Storage order of the target dense matrix
697  friend inline void subAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
698  {
700 
701  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
702  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
703 
704  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
705  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
706 
707  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
708  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
709  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
710  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
711  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
712  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
713 
714  TSMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
715  }
717  //**********************************************************************************************
718 
719  //**Default subtraction assignment to dense matrices********************************************
733  template< typename MT3 // Type of the left-hand side target matrix
734  , typename MT4 // Type of the left-hand side matrix operand
735  , typename MT5 > // Type of the right-hand side matrix operand
736  static inline void selectSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
737  {
738  typedef typename MT4::ConstIterator LeftIterator;
739  typedef typename MT5::ConstIterator RightIterator;
740 
741  for( size_t j=0UL; j<A.columns(); ++j ) {
742  const LeftIterator lend( A.end(j) );
743  for( LeftIterator lelem=A.begin(j); lelem!=lend; ++lelem ) {
744  const RightIterator rend( B.end(j) );
745  for( RightIterator relem=B.begin(j); relem!=rend; ++relem ) {
746  C(lelem->index(),relem->index()) -= lelem->value() * relem->value();
747  }
748  }
749  }
750  }
752  //**********************************************************************************************
753 
754  //**Restructuring subtraction assignment to row-major matrices**********************************
769  template< typename MT > // Type of the target matrix
770  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
771  subAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
772  {
774 
776 
777  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
778  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
779 
780  subAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
781  }
783  //**********************************************************************************************
784 
785  //**Restructuring subtraction assignment to column-major matrices*******************************
800  template< typename MT > // Type of the target matrix
801  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
802  subAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
803  {
805 
806  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
807  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
808 
809  subAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
810  }
812  //**********************************************************************************************
813 
814  //**Subtraction assignment to sparse matrices***************************************************
815  // No special implementation for the subtraction assignment to sparse matrices.
816  //**********************************************************************************************
817 
818  //**Multiplication assignment to dense matrices*************************************************
819  // No special implementation for the multiplication assignment to dense matrices.
820  //**********************************************************************************************
821 
822  //**Multiplication assignment to sparse matrices************************************************
823  // No special implementation for the multiplication assignment to sparse matrices.
824  //**********************************************************************************************
825 
826  //**SMP assignment to matrices******************************************************************
842  template< typename MT // Type of the target matrix
843  , bool SO > // Storage order of the target matrix
844  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
845  smpAssign( Matrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
846  {
848 
849  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
850  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
851 
852  CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
853  CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
854 
855  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
856  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
857  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
858  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
859  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
860  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
861 
862  smpAssign( ~lhs, A * B );
863  }
865  //**********************************************************************************************
866 
867  //**Restructuring SMP assignment to row-major matrices******************************************
882  template< typename MT > // Type of the target matrix
883  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
884  smpAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
885  {
887 
889 
890  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
891  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
892 
893  smpAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
894  }
896  //**********************************************************************************************
897 
898  //**Restructuring SMP assignment to column-major matrices***************************************
913  template< typename MT > // Type of the target matrix
914  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
915  smpAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
916  {
918 
919  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
920  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
921 
922  smpAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
923  }
925  //**********************************************************************************************
926 
927  //**SMP addition assignment to dense matrices***************************************************
943  template< typename MT // Type of the target dense matrix
944  , bool SO > // Storage order of the target dense matarix
945  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
946  smpAddAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
947  {
949 
950  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
951  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
952 
953  CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
954  CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
955 
956  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
957  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
958  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
959  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
960  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
961  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
962 
963  smpAddAssign( ~lhs, A * B );
964  }
966  //**********************************************************************************************
967 
968  //**Restructuring SMP addition assignment to row-major matrices*********************************
983  template< typename MT > // Type of the target matrix
984  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
985  smpAddAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
986  {
988 
990 
991  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
992  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
993 
994  smpAddAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
995  }
997  //**********************************************************************************************
998 
999  //**Restructuring SMP addition assignment to column-major matrices******************************
1014  template< typename MT > // Type of the target matrix
1015  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1016  smpAddAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
1017  {
1019 
1020  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1021  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1022 
1023  smpAddAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1024  }
1026  //**********************************************************************************************
1027 
1028  //**SMP addition assignment to sparse matrices**************************************************
1029  // No special implementation for the SMP addition assignment to sparse matrices.
1030  //**********************************************************************************************
1031 
1032  //**SMP subtraction assignment to dense matrices************************************************
1048  template< typename MT // Type of the target dense matrix
1049  , bool SO > // Storage order of the target dense matrix
1050  friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1051  smpSubAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
1052  {
1054 
1055  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1056  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1057 
1058  CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
1059  CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1060 
1061  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1062  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1063  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1064  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1065  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1066  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1067 
1068  smpSubAssign( ~lhs, A * B );
1069  }
1071  //**********************************************************************************************
1072 
1073  //**Restructuring SMP subtraction assignment to row-major matrices******************************
1088  template< typename MT > // Type of the target matrix
1089  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1090  smpSubAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
1091  {
1093 
1095 
1096  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1097  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1098 
1099  smpSubAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1100  }
1102  //**********************************************************************************************
1103 
1104  //**Restructuring SMP subtraction assignment to column-major matrices***************************
1119  template< typename MT > // Type of the target matrix
1120  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1121  smpSubAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
1122  {
1124 
1125  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1126  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1127 
1128  smpSubAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1129  }
1131  //**********************************************************************************************
1132 
1133  //**SMP subtraction assignment to sparse matrices***********************************************
1134  // No special implementation for the SMP subtraction assignment to sparse matrices.
1135  //**********************************************************************************************
1136 
1137  //**SMP multiplication assignment to dense matrices*********************************************
1138  // No special implementation for the SMP multiplication assignment to dense matrices.
1139  //**********************************************************************************************
1140 
1141  //**SMP multiplication assignment to sparse matrices********************************************
1142  // No special implementation for the SMP multiplication assignment to sparse matrices.
1143  //**********************************************************************************************
1144 
1145  //**Compile time checks*************************************************************************
1153  //**********************************************************************************************
1154 };
1155 //*************************************************************************************************
1156 
1157 
1158 
1159 
1160 //=================================================================================================
1161 //
1162 // GLOBAL BINARY ARITHMETIC OPERATORS
1163 //
1164 //=================================================================================================
1165 
1166 //*************************************************************************************************
1196 template< typename T1 // Type of the left-hand side sparse matrix
1197  , typename T2 > // Type of the right-hand side sparse matrix
1198 inline const TSMatSMatMultExpr<T1,T2>
1200 {
1202 
1203  if( (~lhs).columns() != (~rhs).rows() )
1204  throw std::invalid_argument( "Matrix sizes do not match" );
1205 
1206  return TSMatSMatMultExpr<T1,T2>( ~lhs, ~rhs );
1207 }
1208 //*************************************************************************************************
1209 
1210 
1211 
1212 
1213 //=================================================================================================
1214 //
1215 // ROWS SPECIALIZATIONS
1216 //
1217 //=================================================================================================
1218 
1219 //*************************************************************************************************
1221 template< typename MT1, typename MT2 >
1222 struct Rows< TSMatSMatMultExpr<MT1,MT2> >
1223  : public Rows<MT1>
1224 {};
1226 //*************************************************************************************************
1227 
1228 
1229 
1230 
1231 //=================================================================================================
1232 //
1233 // COLUMNS SPECIALIZATIONS
1234 //
1235 //=================================================================================================
1236 
1237 //*************************************************************************************************
1239 template< typename MT1, typename MT2 >
1240 struct Columns< TSMatSMatMultExpr<MT1,MT2> >
1241  : public Columns<MT2>
1242 {};
1244 //*************************************************************************************************
1245 
1246 
1247 
1248 
1249 //=================================================================================================
1250 //
1251 // ISLOWER SPECIALIZATIONS
1252 //
1253 //=================================================================================================
1254 
1255 //*************************************************************************************************
1257 template< typename MT1, typename MT2 >
1258 struct IsLower< TSMatSMatMultExpr<MT1,MT2> >
1259  : public IsTrue< And< IsLower<MT1>, IsLower<MT2> >::value >
1260 {};
1262 //*************************************************************************************************
1263 
1264 
1265 
1266 
1267 //=================================================================================================
1268 //
1269 // ISUNILOWER SPECIALIZATIONS
1270 //
1271 //=================================================================================================
1272 
1273 //*************************************************************************************************
1275 template< typename MT1, typename MT2 >
1276 struct IsUniLower< TSMatSMatMultExpr<MT1,MT2> >
1277  : public IsTrue< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1278 {};
1280 //*************************************************************************************************
1281 
1282 
1283 
1284 
1285 //=================================================================================================
1286 //
1287 // ISSTRICTLYLOWER SPECIALIZATIONS
1288 //
1289 //=================================================================================================
1290 
1291 //*************************************************************************************************
1293 template< typename MT1, typename MT2 >
1294 struct IsStrictlyLower< TSMatSMatMultExpr<MT1,MT2> >
1295  : public IsTrue< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1296  , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1297 {};
1299 //*************************************************************************************************
1300 
1301 
1302 
1303 
1304 //=================================================================================================
1305 //
1306 // ISUPPER SPECIALIZATIONS
1307 //
1308 //=================================================================================================
1309 
1310 //*************************************************************************************************
1312 template< typename MT1, typename MT2 >
1313 struct IsUpper< TSMatSMatMultExpr<MT1,MT2> >
1314  : public IsTrue< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1315 {};
1317 //*************************************************************************************************
1318 
1319 
1320 
1321 
1322 //=================================================================================================
1323 //
1324 // ISUNIUPPER SPECIALIZATIONS
1325 //
1326 //=================================================================================================
1327 
1328 //*************************************************************************************************
1330 template< typename MT1, typename MT2 >
1331 struct IsUniUpper< TSMatSMatMultExpr<MT1,MT2> >
1332  : public IsTrue< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1333 {};
1335 //*************************************************************************************************
1336 
1337 
1338 
1339 
1340 //=================================================================================================
1341 //
1342 // ISSTRICTLYUPPER SPECIALIZATIONS
1343 //
1344 //=================================================================================================
1345 
1346 //*************************************************************************************************
1348 template< typename MT1, typename MT2 >
1349 struct IsStrictlyUpper< TSMatSMatMultExpr<MT1,MT2> >
1350  : public IsTrue< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1351  , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
1352 {};
1354 //*************************************************************************************************
1355 
1356 
1357 
1358 
1359 //=================================================================================================
1360 //
1361 // EXPRESSION TRAIT SPECIALIZATIONS
1362 //
1363 //=================================================================================================
1364 
1365 //*************************************************************************************************
1367 template< typename MT1, typename MT2, typename VT >
1368 struct TSMatDVecMultExprTrait< TSMatSMatMultExpr<MT1,MT2>, VT >
1369 {
1370  public:
1371  //**********************************************************************************************
1372  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1373  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1374  IsDenseVector<VT>::value && IsColumnVector<VT>::value
1375  , typename TSMatDVecMultExprTrait< MT1, typename SMatDVecMultExprTrait<MT2,VT>::Type >::Type
1376  , INVALID_TYPE >::Type Type;
1377  //**********************************************************************************************
1378 };
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1385 template< typename MT1, typename MT2, typename VT >
1386 struct TSMatSVecMultExprTrait< TSMatSMatMultExpr<MT1,MT2>, VT >
1387 {
1388  public:
1389  //**********************************************************************************************
1390  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1391  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1392  IsSparseVector<VT>::value && IsColumnVector<VT>::value
1393  , typename TSMatDVecMultExprTrait< MT1, typename SMatDVecMultExprTrait<MT2,VT>::Type >::Type
1394  , INVALID_TYPE >::Type Type;
1395  //**********************************************************************************************
1396 };
1398 //*************************************************************************************************
1399 
1400 
1401 //*************************************************************************************************
1403 template< typename VT, typename MT1, typename MT2 >
1404 struct TDVecTSMatMultExprTrait< VT, TSMatSMatMultExpr<MT1,MT2> >
1405 {
1406  public:
1407  //**********************************************************************************************
1408  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1409  IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1410  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1411  , typename TDVecSMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1412  , INVALID_TYPE >::Type Type;
1413  //**********************************************************************************************
1414 };
1416 //*************************************************************************************************
1417 
1418 
1419 //*************************************************************************************************
1421 template< typename VT, typename MT1, typename MT2 >
1422 struct TSVecTSMatMultExprTrait< VT, TSMatSMatMultExpr<MT1,MT2> >
1423 {
1424  public:
1425  //**********************************************************************************************
1426  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1427  IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1428  IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1429  , typename TDVecSMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1430  , INVALID_TYPE >::Type Type;
1431  //**********************************************************************************************
1432 };
1434 //*************************************************************************************************
1435 
1436 
1437 //*************************************************************************************************
1439 template< typename MT1, typename MT2, bool AF >
1440 struct SubmatrixExprTrait< TSMatSMatMultExpr<MT1,MT2>, AF >
1441 {
1442  public:
1443  //**********************************************************************************************
1444  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1445  , typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1446  //**********************************************************************************************
1447 };
1449 //*************************************************************************************************
1450 
1451 
1452 //*************************************************************************************************
1454 template< typename MT1, typename MT2 >
1455 struct RowExprTrait< TSMatSMatMultExpr<MT1,MT2> >
1456 {
1457  public:
1458  //**********************************************************************************************
1459  typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1460  //**********************************************************************************************
1461 };
1463 //*************************************************************************************************
1464 
1465 
1466 //*************************************************************************************************
1468 template< typename MT1, typename MT2 >
1469 struct ColumnExprTrait< TSMatSMatMultExpr<MT1,MT2> >
1470 {
1471  public:
1472  //**********************************************************************************************
1473  typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
1474  //**********************************************************************************************
1475 };
1477 //*************************************************************************************************
1478 
1479 } // namespace blaze
1480 
1481 #endif
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1649
Header file for the SMatDVecMultExprTrait class template.
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper 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:8247
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:185
Header file for basic type definitions.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:179
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
Header file for the TSVecTSMatMultExprTrait class template.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the And class template.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
Header file for the TDVecSMatMultExprTrait class template.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSMatSMatMultExpr.h:310
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TSMatSMatMultExpr.h:332
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Header file for the RequiresEvaluation type trait.
Header file for the TSVecSMatMultExprTrait class template.
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2503
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
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:129
const size_t SMP_TSMATSMATMULT_THRESHOLD
SMP column-major sparse matrix/row-major sparse matrix multiplication threshold.This threshold specif...
Definition: Thresholds.h:1156
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: TSMatSMatMultExpr.h:277
Header file for the SparseMatrix base class.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:188
Constraint on the data type.
Header file for the MultExprTrait class template.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:181
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
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.
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
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TSMatSMatMultExpr.h:246
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
RightOperand rightOperand() const
Returns the right-hand side sparse matrix operand.
Definition: TSMatSMatMultExpr.h:298
Header file for the Or class template.
Header file for the TDVecTSMatMultExprTrait class template.
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1602
TSMatSMatMultExpr< MT1, MT2 > This
Type of this TSMatSMatMultExpr instance.
Definition: TSMatSMatMultExpr.h:176
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.
Header file for the IsLower type trait.
LeftOperand leftOperand() const
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatSMatMultExpr.h:288
TSMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TSMatSMatMultExpr class.
Definition: TSMatSMatMultExpr.h:203
Header file for the SMatSVecMultExprTrait class template.
Constraints on the storage order of matrix types.
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the complete DynamicVector implementation.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
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
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: TSMatSMatMultExpr.h:266
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
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
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:177
Header file for run time assertion macros.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TSMatSMatMultExpr.h:256
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:150
ResultType::ElementType ElementType
Resulting element type.
Definition: TSMatSMatMultExpr.h:180
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
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:128
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatSMatMultExpr.h:178
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatSMatMultExpr.h:182
Header file for the isDefault shim.
Constraint on the data type.
Expression object for transpose sparse matrix-sparse matrix multiplications.The TSMatSMatMultExpr cla...
Definition: Forward.h:140
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Header file for the IsDenseVector type trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSMatSMatMultExpr.h:322
Header file for the IsRowMajorMatrix type trait.
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatSMatMultExpr.h:339
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:937
Header file for the IsComputation type trait class.
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
#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:2502
Header file for the IsTrue value trait.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:126
Header file for the IsUpper type trait.
Header file for the IsColumnVector type trait.
Constraint on the data type.
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TSMatSMatMultExpr.h:340
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatSMatMultExpr.h:218
Header file for the IsResizable type trait.
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:127
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
#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 TSMatSVecMultExprTrait class template.
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