SMatTSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATTSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
86 #include <blaze/util/Assert.h>
87 #include <blaze/util/DisableIf.h>
88 #include <blaze/util/EnableIf.h>
89 #include <blaze/util/InvalidType.h>
91 #include <blaze/util/mpl/And.h>
92 #include <blaze/util/mpl/Or.h>
93 #include <blaze/util/SelectType.h>
94 #include <blaze/util/Types.h>
96 #include <blaze/util/Unused.h>
98 
99 
100 namespace blaze {
101 
102 //=================================================================================================
103 //
104 // CLASS SMATTSMATMULTEXPR
105 //
106 //=================================================================================================
107 
108 //*************************************************************************************************
115 template< typename MT1 // Type of the left-hand side sparse matrix
116  , typename MT2 > // Type of the right-hand side sparse matrix
117 class SMatTSMatMultExpr : public SparseMatrix< SMatTSMatMultExpr<MT1,MT2>, false >
118  , private MatMatMultExpr
119  , private Computation
120 {
121  private:
122  //**Type definitions****************************************************************************
123  typedef typename MT1::ResultType RT1;
124  typedef typename MT2::ResultType RT2;
125  typedef typename MT1::CompositeType CT1;
126  typedef typename MT2::CompositeType CT2;
127  //**********************************************************************************************
128 
129  //**********************************************************************************************
131 
138  template< typename T1, typename T2, typename T3 >
139  struct CanExploitSymmetry {
140  enum { value = ( IsRowMajorMatrix<T1>::value && IsSymmetric<T3>::value ) ||
142  };
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
153  typedef const ElementType ReturnType;
154  typedef const ResultType CompositeType;
155 
157  typedef typename SelectType< IsExpression<MT1>::value, const MT1, const MT1& >::Type LeftOperand;
158 
160  typedef typename SelectType< IsExpression<MT2>::value, const MT2, const MT2& >::Type RightOperand;
161  //**********************************************************************************************
162 
163  //**Compilation flags***************************************************************************
165  enum { smpAssignable = 0 };
166  //**********************************************************************************************
167 
168  //**Constructor*********************************************************************************
174  explicit inline SMatTSMatMultExpr( const MT1& lhs, const MT2& rhs )
175  : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
176  , rhs_( rhs ) // Right-hand side sparse matrix of the multiplication expression
177  {
178  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
179  }
180  //**********************************************************************************************
181 
182  //**Access operator*****************************************************************************
189  inline ReturnType operator()( size_t i, size_t j ) const {
190  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
191  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
192 
193  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
194  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
195 
196  ElementType tmp = ElementType();
197 
198  // Early exit
199  if( lhs_.columns() == 0UL )
200  return tmp;
201 
202  // Fast computation in case both the left-hand side and the right-hand side
203  // sparse matrices directly provide iterators
205  {
206  // Evaluation of the left-hand side sparse matrix operand
207  CT1 A( lhs_ );
208 
209  const LeftIterator lend( A.end(i) );
210  LeftIterator lelem( A.begin(i) );
211 
212  // Evaluation of the right-hand side sparse matrix operand
213  CT2 B( rhs_ );
214 
215  const RightIterator rend( B.end(j) );
216  RightIterator relem( B.begin(j) );
217 
218  // Early exit in case row i or column j are empty
219  if( lelem == lend || relem == rend )
220  return tmp;
221 
222  // Calculating element (i,j)
223  while( true ) {
224  if( lelem->index() < relem->index() ) {
225  ++lelem;
226  if( lelem == lend ) break;
227  }
228  else if( relem->index() < lelem->index() ) {
229  ++relem;
230  if( relem == rend ) break;
231  }
232  else {
233  tmp = lelem->value() * relem->value();
234  ++lelem;
235  ++relem;
236  break;
237  }
238  }
239 
240  if( lelem != lend && relem != rend )
241  {
242  while( true ) {
243  if( lelem->index() < relem->index() ) {
244  ++lelem;
245  if( lelem == lend ) break;
246  }
247  else if( relem->index() < lelem->index() ) {
248  ++relem;
249  if( relem == rend ) break;
250  }
251  else {
252  tmp += lelem->value() * relem->value();
253  ++lelem;
254  if( lelem == lend ) break;
255  ++relem;
256  if( relem == rend ) break;
257  }
258  }
259  }
260  }
261 
262  // Optimized computation in case the left-hand side sparse matrix directly provides iterators
264  {
265  // Evaluation of the left-hand side sparse matrix operand
266  CT1 A( lhs_ );
267 
268  const LeftIterator end( ( IsUpper<MT2>::value )?( A.upperBound(i,j) ):( A.end(i) ) );
269  LeftIterator element( ( IsLower<MT2>::value )?( A.lowerBound(i,j) ):( A.begin(i) ) );
270 
271  // Early exit in case row i is empty
272  if( element == end )
273  return tmp;
274 
275  // Calculating element (i,j)
276  tmp = element->value() * rhs_(element->index(),j);
277  ++element;
278  for( ; element!=end; ++element ) {
279  tmp += element->value() * rhs_(element->index(),j);
280  }
281  }
282 
283  // Optimized computation in case the right-hand side sparse matrix directly provides iterators
285  {
286  // Evaluation of the right-hand side sparse matrix operand
287  CT2 B( rhs_ );
288 
289  const RightIterator end( ( IsLower<MT1>::value )?( B.upperBound(i,j) ):( B.end(j) ) );
290  RightIterator element( ( IsUpper<MT1>::value )?( B.lowerBound(i,j) ):( B.begin(j) ) );
291 
292  // Early exit in case row i is empty
293  if( element == end )
294  return tmp;
295 
296  // Calculating element (i,j)
297  tmp = lhs_(i,element->index()) * element->value();
298  ++element;
299  for( ; element!=end; ++element ) {
300  tmp += lhs_(i,element->index()) * element->value();
301  }
302  }
303 
304  // Default computation in case both sparse matrices don't provide iterators
305  else {
306  const size_t kbegin( max( ( IsUpper<MT1>::value )?( i ):( 0UL ),
307  ( IsLower<MT2>::value )?( j ):( 0UL ) ) );
308  const size_t kend ( min( ( IsLower<MT1>::value )?( i+1UL ):( lhs_.columns() ),
309  ( IsUpper<MT2>::value )?( j+1UL ):( lhs_.columns() ) ) );
310 
311  tmp = lhs_(i,kbegin) * rhs_(kbegin,j);
312  for( size_t k=kbegin+1UL; k<kend; ++k ) {
313  tmp += lhs_(i,k) * rhs_(k,j);
314  }
315  }
316 
317  return tmp;
318  }
319  //**********************************************************************************************
320 
321  //**Rows function*******************************************************************************
326  inline size_t rows() const {
327  return lhs_.rows();
328  }
329  //**********************************************************************************************
330 
331  //**Columns function****************************************************************************
336  inline size_t columns() const {
337  return rhs_.columns();
338  }
339  //**********************************************************************************************
340 
341  //**NonZeros function***************************************************************************
346  inline size_t nonZeros() const {
347  return 0UL;
348  }
349  //**********************************************************************************************
350 
351  //**NonZeros function***************************************************************************
357  inline size_t nonZeros( size_t i ) const {
358  UNUSED_PARAMETER( i );
359  return 0UL;
360  }
361  //**********************************************************************************************
362 
363  //**Left operand access*************************************************************************
368  inline LeftOperand leftOperand() const {
369  return lhs_;
370  }
371  //**********************************************************************************************
372 
373  //**Right operand access************************************************************************
378  inline RightOperand rightOperand() const {
379  return rhs_;
380  }
381  //**********************************************************************************************
382 
383  //**********************************************************************************************
389  template< typename T >
390  inline bool canAlias( const T* alias ) const {
391  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
392  }
393  //**********************************************************************************************
394 
395  //**********************************************************************************************
401  template< typename T >
402  inline bool isAliased( const T* alias ) const {
403  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
404  }
405  //**********************************************************************************************
406 
407  //**********************************************************************************************
412  inline bool canSMPAssign() const {
413  return ( rows() > SMP_SMATTSMATMULT_THRESHOLD );
414  }
415  //**********************************************************************************************
416 
417  private:
418  //**Member variables****************************************************************************
419  LeftOperand lhs_;
420  RightOperand rhs_;
421  //**********************************************************************************************
422 
423  //**Assignment to row-major matrices************************************************************
436  template< typename MT > // Type of the target matrix
437  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
438  assign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
439  {
441 
442  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
443  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
444 
446 
447  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
448  assign( ~lhs, rhs.lhs_ * tmp );
449  }
451  //**********************************************************************************************
452 
453  //**Restructuring assignment to row-major matrices**********************************************
468  template< typename MT > // Type of the target matrix
469  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
470  assign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& 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 
477  assign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
478  }
480  //**********************************************************************************************
481 
482  //**Assignment to column-major matrices*********************************************************
495  template< typename MT > // Type of the target matrix
496  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
497  assign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
498  {
500 
502 
503  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
504  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
505 
507 
508  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
509  assign( ~lhs, tmp * rhs.rhs_ );
510  }
512  //**********************************************************************************************
513 
514  //**Restructuring assignment to column-major matrices*******************************************
529  template< typename MT > // Type of the target matrix
530  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
531  assign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
532  {
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, trans( rhs.lhs_ ) * rhs.rhs_ );
541  }
543  //**********************************************************************************************
544 
545  //**Addition assignment to row-major dense matrices*********************************************
558  template< typename MT > // Type of the target dense matrix
559  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
560  addAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
561  {
563 
564  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
565  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
566 
568 
569  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
570  addAssign( ~lhs, rhs.lhs_ * tmp );
571  }
573  //**********************************************************************************************
574 
575  //**Restructuring addition assignment to row-major matrices*************************************
590  template< typename MT > // Type of the target matrix
591  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
592  addAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
593  {
595 
596  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
597  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
598 
599  addAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
600  }
602  //**********************************************************************************************
603 
604  //**Addition assignment to column-major dense matrices******************************************
617  template< typename MT > // Type of the target dense matrix
618  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
619  addAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
620  {
622 
624 
625  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
626  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
627 
629 
630  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
631  addAssign( ~lhs, tmp * rhs.rhs_ );
632  }
634  //**********************************************************************************************
635 
636  //**Restructuring addition assignment to column-major matrices**********************************
651  template< typename MT > // Type of the target matrix
652  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
653  addAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
654  {
656 
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
660  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
661 
662  addAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
663  }
665  //**********************************************************************************************
666 
667  //**Addition assignment to sparse matrices******************************************************
668  // No special implementation for the addition assignment to sparse matrices.
669  //**********************************************************************************************
670 
671  //**Subtraction assignment to row-major dense matrices******************************************
684  template< typename MT > // Type of the target dense matrix
685  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
686  subAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
687  {
689 
690  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
691  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
692 
694 
695  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
696  subAssign( ~lhs, rhs.lhs_ * tmp );
697  }
699  //**********************************************************************************************
700 
701  //**Restructuring subtraction assignment to row-major matrices**********************************
716  template< typename MT > // Type of the target matrix
717  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
718  subAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
719  {
721 
722  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
723  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
724 
725  subAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
726  }
728  //**********************************************************************************************
729 
730  //**Subtraction assignment to column-major dense matrices***************************************
743  template< typename MT > // Type of the target dense matrix
744  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
745  subAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
746  {
748 
750 
751  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
752  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
753 
755 
756  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
757  subAssign( ~lhs, tmp * rhs.rhs_ );
758  }
760  //**********************************************************************************************
761 
762  //**Restructuring subtraction assignment to column-major matrices*******************************
777  template< typename MT > // Type of the target matrix
778  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
779  subAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
780  {
782 
784 
785  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
786  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
787 
788  subAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
789  }
791  //**********************************************************************************************
792 
793  //**Subtraction assignment to sparse matrices***************************************************
794  // No special implementation for the subtraction assignment to sparse matrices.
795  //**********************************************************************************************
796 
797  //**Multiplication assignment to dense matrices*************************************************
798  // No special implementation for the multiplication assignment to dense matrices.
799  //**********************************************************************************************
800 
801  //**Multiplication assignment to sparse matrices************************************************
802  // No special implementation for the multiplication assignment to sparse matrices.
803  //**********************************************************************************************
804 
805  //**SMP assignment to row-major matrices********************************************************
820  template< typename MT > // Type of the target matrix
821  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
822  smpAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
823  {
825 
826  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
827  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
828 
830 
831  const typename MT2::OppositeType tmp( rhs.rhs_ );
832  smpAssign( ~lhs, rhs.lhs_ * tmp );
833  }
835  //**********************************************************************************************
836 
837  //**Restructuring SMP assignment to row-major matrices******************************************
852  template< typename MT > // Type of the target matrix
853  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
854  smpAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
855  {
857 
858  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
859  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
860 
861  smpAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
862  }
864  //**********************************************************************************************
865 
866  //**SMP assignment to column-major matrices*****************************************************
881  template< typename MT > // Type of the target matrix
882  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
883  smpAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
884  {
886 
888 
889  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
890  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
891 
893 
894  const typename MT1::OppositeType tmp( rhs.lhs_ );
895  smpAssign( ~lhs, tmp * rhs.rhs_ );
896  }
898  //**********************************************************************************************
899 
900  //**Restructuring SMP assignment to column-major matrices***************************************
915  template< typename MT > // Type of the target matrix
916  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
917  smpAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
918  {
920 
922 
923  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
924  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
925 
926  smpAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
927  }
929  //**********************************************************************************************
930 
931  //**SMP addition assignment to row-major dense matrices*****************************************
946  template< typename MT > // Type of the target dense matrix
947  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
948  smpAddAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
949  {
951 
952  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
953  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
954 
956 
957  const typename MT2::OppositeType tmp( rhs.rhs_ );
958  smpAddAssign( ~lhs, rhs.lhs_ * tmp );
959  }
961  //**********************************************************************************************
962 
963  //**SMP addition assignment to column-major dense matrices**************************************
978  template< typename MT > // Type of the target dense matrix
979  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
980  smpAddAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
981  {
983 
985 
986  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
987  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
988 
990 
991  const typename MT1::OppositeType tmp( rhs.lhs_ );
992  smpAddAssign( ~lhs, tmp * rhs.rhs_ );
993  }
995  //**********************************************************************************************
996 
997  //**Restructuring SMP addition assignment to row-major matrices*********************************
1012  template< typename MT > // Type of the target matrix
1013  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1014  smpAddAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
1015  {
1017 
1018  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1019  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1020 
1021  smpAddAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1022  }
1024  //**********************************************************************************************
1025 
1026  //**Restructuring SMP addition assignment to column-major matrices******************************
1041  template< typename MT > // Type of the target matrix
1042  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1043  smpAddAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1044  {
1046 
1048 
1049  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1050  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1051 
1052  smpAddAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1053  }
1055  //**********************************************************************************************
1056 
1057  //**SMP addition assignment to sparse matrices**************************************************
1058  // No special implementation for the SMP addition assignment to sparse matrices.
1059  //**********************************************************************************************
1060 
1061  //**SMP subtraction assignment to row-major dense matrices**************************************
1076  template< typename MT > // Type of the target dense matrix
1077  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1078  smpSubAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
1079  {
1081 
1082  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1083  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1084 
1086 
1087  const typename MT2::OppositeType tmp( rhs.rhs_ );
1088  smpSubAssign( ~lhs, rhs.lhs_ * tmp );
1089  }
1091  //**********************************************************************************************
1092 
1093  //**SMP subtraction assignment to column-major dense matrices***********************************
1108  template< typename MT > // Type of the target dense matrix
1109  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1110  smpSubAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1111  {
1113 
1115 
1116  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1117  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1118 
1120 
1121  const typename MT1::OppositeType tmp( rhs.lhs_ );
1122  smpSubAssign( ~lhs, tmp * rhs.rhs_ );
1123  }
1125  //**********************************************************************************************
1126 
1127  //**Restructuring SMP subtraction assignment to row-major matrices******************************
1142  template< typename MT > // Type of the target matrix
1143  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1144  smpSubAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
1145  {
1147 
1148  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1149  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1150 
1151  smpSubAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1152  }
1154  //**********************************************************************************************
1155 
1156  //**Restructuring SMP subtraction assignment to column-major matrices***************************
1171  template< typename MT > // Type of the target matrix
1172  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1173  smpSubAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1174  {
1176 
1178 
1179  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1180  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1181 
1182  smpSubAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1183  }
1185  //**********************************************************************************************
1186 
1187  //**SMP subtraction assignment to sparse matrices***********************************************
1188  // No special implementation for the SMP subtraction assignment to sparse matrices.
1189  //**********************************************************************************************
1190 
1191  //**SMP multiplication assignment to dense matrices*********************************************
1192  // No special implementation for the SMP multiplication assignment to dense matrices.
1193  //**********************************************************************************************
1194 
1195  //**SMP multiplication assignment to sparse matrices********************************************
1196  // No special implementation for the SMP multiplication assignment to sparse matrices.
1197  //**********************************************************************************************
1198 
1199  //**Compile time checks*************************************************************************
1207  //**********************************************************************************************
1208 };
1209 //*************************************************************************************************
1210 
1211 
1212 
1213 
1214 //=================================================================================================
1215 //
1216 // GLOBAL BINARY ARITHMETIC OPERATORS
1217 //
1218 //=================================================================================================
1219 
1220 //*************************************************************************************************
1250 template< typename T1 // Type of the left-hand side sparse matrix
1251  , typename T2 > // Type of the right-hand side sparse matrix
1252 inline const SMatTSMatMultExpr<T1,T2>
1254 {
1256 
1257  if( (~lhs).columns() != (~rhs).rows() )
1258  throw std::invalid_argument( "Matrix sizes do not match" );
1259 
1260  return SMatTSMatMultExpr<T1,T2>( ~lhs, ~rhs );
1261 }
1262 //*************************************************************************************************
1263 
1264 
1265 
1266 
1267 //=================================================================================================
1268 //
1269 // ROWS SPECIALIZATIONS
1270 //
1271 //=================================================================================================
1272 
1273 //*************************************************************************************************
1275 template< typename MT1, typename MT2 >
1276 struct Rows< SMatTSMatMultExpr<MT1,MT2> >
1277  : public Rows<MT1>
1278 {};
1280 //*************************************************************************************************
1281 
1282 
1283 
1284 
1285 //=================================================================================================
1286 //
1287 // COLUMNS SPECIALIZATIONS
1288 //
1289 //=================================================================================================
1290 
1291 //*************************************************************************************************
1293 template< typename MT1, typename MT2 >
1294 struct Columns< SMatTSMatMultExpr<MT1,MT2> >
1295  : public Columns<MT2>
1296 {};
1298 //*************************************************************************************************
1299 
1300 
1301 
1302 
1303 //=================================================================================================
1304 //
1305 // ISLOWER SPECIALIZATIONS
1306 //
1307 //=================================================================================================
1308 
1309 //*************************************************************************************************
1311 template< typename MT1, typename MT2 >
1312 struct IsLower< SMatTSMatMultExpr<MT1,MT2> >
1313  : public IsTrue< And< IsLower<MT1>, IsLower<MT2> >::value >
1314 {};
1316 //*************************************************************************************************
1317 
1318 
1319 
1320 
1321 //=================================================================================================
1322 //
1323 // ISUNILOWER SPECIALIZATIONS
1324 //
1325 //=================================================================================================
1326 
1327 //*************************************************************************************************
1329 template< typename MT1, typename MT2 >
1330 struct IsUniLower< SMatTSMatMultExpr<MT1,MT2> >
1331  : public IsTrue< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1332 {};
1334 //*************************************************************************************************
1335 
1336 
1337 
1338 
1339 //=================================================================================================
1340 //
1341 // ISSTRICTLYLOWER SPECIALIZATIONS
1342 //
1343 //=================================================================================================
1344 
1345 //*************************************************************************************************
1347 template< typename MT1, typename MT2 >
1348 struct IsStrictlyLower< SMatTSMatMultExpr<MT1,MT2> >
1349  : public IsTrue< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1350  , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1351 {};
1353 //*************************************************************************************************
1354 
1355 
1356 
1357 
1358 //=================================================================================================
1359 //
1360 // ISUPPER SPECIALIZATIONS
1361 //
1362 //=================================================================================================
1363 
1364 //*************************************************************************************************
1366 template< typename MT1, typename MT2 >
1367 struct IsUpper< SMatTSMatMultExpr<MT1,MT2> >
1368  : public IsTrue< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1369 {};
1371 //*************************************************************************************************
1372 
1373 
1374 
1375 
1376 //=================================================================================================
1377 //
1378 // ISUNIUPPER SPECIALIZATIONS
1379 //
1380 //=================================================================================================
1381 
1382 //*************************************************************************************************
1384 template< typename MT1, typename MT2 >
1385 struct IsUniUpper< SMatTSMatMultExpr<MT1,MT2> >
1386  : public IsTrue< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1387 {};
1389 //*************************************************************************************************
1390 
1391 
1392 
1393 
1394 //=================================================================================================
1395 //
1396 // ISSTRICTLYUPPER SPECIALIZATIONS
1397 //
1398 //=================================================================================================
1399 
1400 //*************************************************************************************************
1402 template< typename MT1, typename MT2 >
1403 struct IsStrictlyUpper< SMatTSMatMultExpr<MT1,MT2> >
1404  : public IsTrue< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1405  , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
1406 {};
1408 //*************************************************************************************************
1409 
1410 
1411 
1412 
1413 //=================================================================================================
1414 //
1415 // EXPRESSION TRAIT SPECIALIZATIONS
1416 //
1417 //=================================================================================================
1418 
1419 //*************************************************************************************************
1421 template< typename MT1, typename MT2, typename VT >
1422 struct SMatDVecMultExprTrait< SMatTSMatMultExpr<MT1,MT2>, VT >
1423 {
1424  public:
1425  //**********************************************************************************************
1426  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1427  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1428  IsDenseVector<VT>::value && IsColumnVector<VT>::value
1429  , typename SMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1430  , INVALID_TYPE >::Type Type;
1431  //**********************************************************************************************
1432 };
1434 //*************************************************************************************************
1435 
1436 
1437 //*************************************************************************************************
1439 template< typename MT1, typename MT2, typename VT >
1440 struct SMatSVecMultExprTrait< SMatTSMatMultExpr<MT1,MT2>, VT >
1441 {
1442  public:
1443  //**********************************************************************************************
1444  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1445  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1446  IsSparseVector<VT>::value && IsColumnVector<VT>::value
1447  , typename SMatSVecMultExprTrait< MT1, typename TSMatSVecMultExprTrait<MT2,VT>::Type >::Type
1448  , INVALID_TYPE >::Type Type;
1449  //**********************************************************************************************
1450 };
1452 //*************************************************************************************************
1453 
1454 
1455 //*************************************************************************************************
1457 template< typename VT, typename MT1, typename MT2 >
1458 struct TDVecSMatMultExprTrait< VT, SMatTSMatMultExpr<MT1,MT2> >
1459 {
1460  public:
1461  //**********************************************************************************************
1462  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1463  IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1464  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1465  , typename TDVecTSMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1466  , INVALID_TYPE >::Type Type;
1467  //**********************************************************************************************
1468 };
1470 //*************************************************************************************************
1471 
1472 
1473 //*************************************************************************************************
1475 template< typename VT, typename MT1, typename MT2 >
1476 struct TSVecSMatMultExprTrait< VT, SMatTSMatMultExpr<MT1,MT2> >
1477 {
1478  public:
1479  //**********************************************************************************************
1480  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1481  IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1482  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1483  , typename TDVecTSMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1484  , INVALID_TYPE >::Type Type;
1485  //**********************************************************************************************
1486 };
1488 //*************************************************************************************************
1489 
1490 
1491 //*************************************************************************************************
1493 template< typename MT1, typename MT2, bool AF >
1494 struct SubmatrixExprTrait< SMatTSMatMultExpr<MT1,MT2>, AF >
1495 {
1496  public:
1497  //**********************************************************************************************
1498  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1499  , typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1500  //**********************************************************************************************
1501 };
1503 //*************************************************************************************************
1504 
1505 
1506 //*************************************************************************************************
1508 template< typename MT1, typename MT2 >
1509 struct RowExprTrait< SMatTSMatMultExpr<MT1,MT2> >
1510 {
1511  public:
1512  //**********************************************************************************************
1513  typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1514  //**********************************************************************************************
1515 };
1517 //*************************************************************************************************
1518 
1519 
1520 //*************************************************************************************************
1522 template< typename MT1, typename MT2 >
1523 struct ColumnExprTrait< SMatTSMatMultExpr<MT1,MT2> >
1524 {
1525  public:
1526  //**********************************************************************************************
1527  typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
1528  //**********************************************************************************************
1529 };
1531 //*************************************************************************************************
1532 
1533 } // namespace blaze
1534 
1535 #endif
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SMatTSMatMultExpr.h:149
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
Header file for basic type definitions.
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
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:157
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatTSMatMultExpr.h:346
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
Header file for the TSVecTSMatMultExprTrait class template.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:160
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
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
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.
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
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.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatTSMatMultExpr.h:336
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2503
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatTSMatMultExpr.h:412
Header file for the SparseMatrix base class.
SMatTSMatMultExpr< MT1, MT2 > This
Type of this SMatTSMatMultExpr instance.
Definition: SMatTSMatMultExpr.h:148
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatTSMatMultExpr.h:153
Constraint on the data type.
Expression object for sparse matrix-transpose sparse matrix multiplications.The SMatTSMatMultExpr cla...
Definition: Forward.h:105
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
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.
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:125
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:104
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatTSMatMultExpr.h:151
#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
Header file for the Or class template.
Header file for the TDVecTSMatMultExprTrait class template.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:123
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1602
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.
Header file for the SMatSVecMultExprTrait class template.
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatTSMatMultExpr.h:402
RightOperand rightOperand() const
Returns the right-hand side transpose sparse matrix operand.
Definition: SMatTSMatMultExpr.h:378
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
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatTSMatMultExpr.h:152
const size_t SMP_SMATTSMATMULT_THRESHOLD
SMP row-major sparse matrix/column-major sparse matrix multiplication threshold.This threshold specif...
Definition: Thresholds.h:1133
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: SMatTSMatMultExpr.h:154
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
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
SMatTSMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the SMatTSMatMultExpr class.
Definition: SMatTSMatMultExpr.h:174
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:104
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
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
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:87
Constraint on the data type.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTSMatMultExpr.h:189
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTSMatMultExpr.h:150
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatTSMatMultExpr.h:419
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
Header file for the IsDenseVector type trait.
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:126
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatTSMatMultExpr.h:326
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: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.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatTSMatMultExpr.h:390
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: SMatTSMatMultExpr.h:420
Header file for the IsUpper type trait.
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:124
Header file for the IsColumnVector type trait.
Constraint on the data type.
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatTSMatMultExpr.h:368
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
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatTSMatMultExpr.h:357
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