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 
52 #include <blaze/math/Functions.h>
87 #include <blaze/util/Assert.h>
88 #include <blaze/util/DisableIf.h>
89 #include <blaze/util/EnableIf.h>
90 #include <blaze/util/Exception.h>
91 #include <blaze/util/InvalidType.h>
93 #include <blaze/util/mpl/And.h>
94 #include <blaze/util/mpl/Or.h>
95 #include <blaze/util/SelectType.h>
96 #include <blaze/util/Types.h>
98 #include <blaze/util/Unused.h>
100 
101 
102 namespace blaze {
103 
104 //=================================================================================================
105 //
106 // CLASS SMATTSMATMULTEXPR
107 //
108 //=================================================================================================
109 
110 //*************************************************************************************************
117 template< typename MT1 // Type of the left-hand side sparse matrix
118  , typename MT2 > // Type of the right-hand side sparse matrix
119 class SMatTSMatMultExpr : public SparseMatrix< SMatTSMatMultExpr<MT1,MT2>, false >
120  , private MatMatMultExpr
121  , private Computation
122 {
123  private:
124  //**Type definitions****************************************************************************
125  typedef typename MT1::ResultType RT1;
126  typedef typename MT2::ResultType RT2;
127  typedef typename MT1::CompositeType CT1;
128  typedef typename MT2::CompositeType CT2;
129  //**********************************************************************************************
130 
131  //**********************************************************************************************
133 
140  template< typename T1, typename T2, typename T3 >
141  struct CanExploitSymmetry {
142  enum { value = ( IsRowMajorMatrix<T1>::value && IsSymmetric<T3>::value ) ||
144  };
146  //**********************************************************************************************
147 
148  public:
149  //**Type definitions****************************************************************************
155  typedef const ElementType ReturnType;
156  typedef const ResultType CompositeType;
157 
159  typedef typename SelectType< IsExpression<MT1>::value, const MT1, const MT1& >::Type LeftOperand;
160 
162  typedef typename SelectType< IsExpression<MT2>::value, const MT2, const MT2& >::Type RightOperand;
163  //**********************************************************************************************
164 
165  //**Compilation flags***************************************************************************
167  enum { smpAssignable = 0 };
168  //**********************************************************************************************
169 
170  //**Constructor*********************************************************************************
176  explicit inline SMatTSMatMultExpr( const MT1& lhs, const MT2& rhs )
177  : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
178  , rhs_( rhs ) // Right-hand side sparse matrix of the multiplication expression
179  {
180  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
181  }
182  //**********************************************************************************************
183 
184  //**Access operator*****************************************************************************
191  inline ReturnType operator()( size_t i, size_t j ) const {
192  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
193  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
194 
195  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
196  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
197 
198  ElementType tmp = ElementType();
199 
200  // Early exit
201  if( lhs_.columns() == 0UL )
202  return tmp;
203 
204  // Fast computation in case both the left-hand side and the right-hand side
205  // sparse matrices directly provide iterators
207  {
208  // Evaluation of the left-hand side sparse matrix operand
209  CT1 A( lhs_ );
210 
211  const LeftIterator lend( A.end(i) );
212  LeftIterator lelem( A.begin(i) );
213 
214  // Evaluation of the right-hand side sparse matrix operand
215  CT2 B( rhs_ );
216 
217  const RightIterator rend( B.end(j) );
218  RightIterator relem( B.begin(j) );
219 
220  // Early exit in case row i or column j are empty
221  if( lelem == lend || relem == rend )
222  return tmp;
223 
224  // Calculating element (i,j)
225  while( true ) {
226  if( lelem->index() < relem->index() ) {
227  ++lelem;
228  if( lelem == lend ) break;
229  }
230  else if( relem->index() < lelem->index() ) {
231  ++relem;
232  if( relem == rend ) break;
233  }
234  else {
235  tmp = lelem->value() * relem->value();
236  ++lelem;
237  ++relem;
238  break;
239  }
240  }
241 
242  if( lelem != lend && relem != rend )
243  {
244  while( true ) {
245  if( lelem->index() < relem->index() ) {
246  ++lelem;
247  if( lelem == lend ) break;
248  }
249  else if( relem->index() < lelem->index() ) {
250  ++relem;
251  if( relem == rend ) break;
252  }
253  else {
254  tmp += lelem->value() * relem->value();
255  ++lelem;
256  if( lelem == lend ) break;
257  ++relem;
258  if( relem == rend ) break;
259  }
260  }
261  }
262  }
263 
264  // Optimized computation in case the left-hand side sparse matrix directly provides iterators
266  {
267  // Evaluation of the left-hand side sparse matrix operand
268  CT1 A( lhs_ );
269 
270  const LeftIterator end( ( IsUpper<MT2>::value )?( A.upperBound(i,j) ):( A.end(i) ) );
271  LeftIterator element( ( IsLower<MT2>::value )?( A.lowerBound(i,j) ):( A.begin(i) ) );
272 
273  // Early exit in case row i is empty
274  if( element == end )
275  return tmp;
276 
277  // Calculating element (i,j)
278  tmp = element->value() * rhs_(element->index(),j);
279  ++element;
280  for( ; element!=end; ++element ) {
281  tmp += element->value() * rhs_(element->index(),j);
282  }
283  }
284 
285  // Optimized computation in case the right-hand side sparse matrix directly provides iterators
287  {
288  // Evaluation of the right-hand side sparse matrix operand
289  CT2 B( rhs_ );
290 
291  const RightIterator end( ( IsLower<MT1>::value )?( B.upperBound(i,j) ):( B.end(j) ) );
292  RightIterator element( ( IsUpper<MT1>::value )?( B.lowerBound(i,j) ):( B.begin(j) ) );
293 
294  // Early exit in case row i is empty
295  if( element == end )
296  return tmp;
297 
298  // Calculating element (i,j)
299  tmp = lhs_(i,element->index()) * element->value();
300  ++element;
301  for( ; element!=end; ++element ) {
302  tmp += lhs_(i,element->index()) * element->value();
303  }
304  }
305 
306  // Default computation in case both sparse matrices don't provide iterators
307  else {
308  const size_t kbegin( max( ( IsUpper<MT1>::value )?( i ):( 0UL ),
309  ( IsLower<MT2>::value )?( j ):( 0UL ) ) );
310  const size_t kend ( min( ( IsLower<MT1>::value )?( i+1UL ):( lhs_.columns() ),
311  ( IsUpper<MT2>::value )?( j+1UL ):( lhs_.columns() ) ) );
312 
313  tmp = lhs_(i,kbegin) * rhs_(kbegin,j);
314  for( size_t k=kbegin+1UL; k<kend; ++k ) {
315  tmp += lhs_(i,k) * rhs_(k,j);
316  }
317  }
318 
319  return tmp;
320  }
321  //**********************************************************************************************
322 
323  //**At function*********************************************************************************
331  inline ReturnType at( size_t i, size_t j ) const {
332  if( i >= lhs_.rows() ) {
333  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
334  }
335  if( j >= rhs_.columns() ) {
336  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
337  }
338  return (*this)(i,j);
339  }
340  //**********************************************************************************************
341 
342  //**Rows function*******************************************************************************
347  inline size_t rows() const {
348  return lhs_.rows();
349  }
350  //**********************************************************************************************
351 
352  //**Columns function****************************************************************************
357  inline size_t columns() const {
358  return rhs_.columns();
359  }
360  //**********************************************************************************************
361 
362  //**NonZeros function***************************************************************************
367  inline size_t nonZeros() const {
368  return 0UL;
369  }
370  //**********************************************************************************************
371 
372  //**NonZeros function***************************************************************************
378  inline size_t nonZeros( size_t i ) const {
379  UNUSED_PARAMETER( i );
380  return 0UL;
381  }
382  //**********************************************************************************************
383 
384  //**Left operand access*************************************************************************
389  inline LeftOperand leftOperand() const {
390  return lhs_;
391  }
392  //**********************************************************************************************
393 
394  //**Right operand access************************************************************************
399  inline RightOperand rightOperand() const {
400  return rhs_;
401  }
402  //**********************************************************************************************
403 
404  //**********************************************************************************************
410  template< typename T >
411  inline bool canAlias( const T* alias ) const {
412  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
413  }
414  //**********************************************************************************************
415 
416  //**********************************************************************************************
422  template< typename T >
423  inline bool isAliased( const T* alias ) const {
424  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
425  }
426  //**********************************************************************************************
427 
428  //**********************************************************************************************
433  inline bool canSMPAssign() const {
434  return ( rows() > SMP_SMATTSMATMULT_THRESHOLD );
435  }
436  //**********************************************************************************************
437 
438  private:
439  //**Member variables****************************************************************************
440  LeftOperand lhs_;
441  RightOperand rhs_;
442  //**********************************************************************************************
443 
444  //**Assignment to row-major matrices************************************************************
457  template< typename MT > // Type of the target matrix
458  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
459  assign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
460  {
462 
463  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
464  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
465 
467 
468  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
469  assign( ~lhs, rhs.lhs_ * tmp );
470  }
472  //**********************************************************************************************
473 
474  //**Restructuring assignment to row-major matrices**********************************************
489  template< typename MT > // Type of the target matrix
490  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
491  assign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
492  {
494 
495  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
496  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
497 
498  assign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
499  }
501  //**********************************************************************************************
502 
503  //**Assignment to column-major matrices*********************************************************
516  template< typename MT > // Type of the target matrix
517  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
518  assign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
519  {
521 
523 
524  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
525  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
526 
528 
529  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
530  assign( ~lhs, tmp * rhs.rhs_ );
531  }
533  //**********************************************************************************************
534 
535  //**Restructuring assignment to column-major matrices*******************************************
550  template< typename MT > // Type of the target matrix
551  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
552  assign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
553  {
555 
557 
558  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
559  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
560 
561  assign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
562  }
564  //**********************************************************************************************
565 
566  //**Addition assignment to row-major dense matrices*********************************************
579  template< typename MT > // Type of the target dense matrix
580  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
581  addAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
582  {
584 
585  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
586  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
587 
589 
590  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
591  addAssign( ~lhs, rhs.lhs_ * tmp );
592  }
594  //**********************************************************************************************
595 
596  //**Restructuring addition assignment to row-major matrices*************************************
611  template< typename MT > // Type of the target matrix
612  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
613  addAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
614  {
616 
617  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
618  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
619 
620  addAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
621  }
623  //**********************************************************************************************
624 
625  //**Addition assignment to column-major dense matrices******************************************
638  template< typename MT > // Type of the target dense matrix
639  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
640  addAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
641  {
643 
645 
646  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
647  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
648 
650 
651  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
652  addAssign( ~lhs, tmp * rhs.rhs_ );
653  }
655  //**********************************************************************************************
656 
657  //**Restructuring addition assignment to column-major matrices**********************************
672  template< typename MT > // Type of the target matrix
673  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
674  addAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
675  {
677 
679 
680  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
681  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
682 
683  addAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
684  }
686  //**********************************************************************************************
687 
688  //**Addition assignment to sparse matrices******************************************************
689  // No special implementation for the addition assignment to sparse matrices.
690  //**********************************************************************************************
691 
692  //**Subtraction assignment to row-major dense matrices******************************************
705  template< typename MT > // Type of the target dense matrix
706  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
707  subAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
708  {
710 
711  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
712  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
713 
715 
716  const typename MT2::OppositeType tmp( serial( rhs.rhs_ ) );
717  subAssign( ~lhs, rhs.lhs_ * tmp );
718  }
720  //**********************************************************************************************
721 
722  //**Restructuring subtraction assignment to row-major matrices**********************************
737  template< typename MT > // Type of the target matrix
738  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
739  subAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
740  {
742 
743  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
744  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
745 
746  subAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
747  }
749  //**********************************************************************************************
750 
751  //**Subtraction assignment to column-major dense matrices***************************************
764  template< typename MT > // Type of the target dense matrix
765  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
766  subAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
767  {
769 
771 
772  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
773  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
774 
776 
777  const typename MT1::OppositeType tmp( serial( rhs.lhs_ ) );
778  subAssign( ~lhs, tmp * rhs.rhs_ );
779  }
781  //**********************************************************************************************
782 
783  //**Restructuring subtraction assignment to column-major matrices*******************************
798  template< typename MT > // Type of the target matrix
799  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
800  subAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
801  {
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, trans( rhs.lhs_ ) * 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 row-major matrices********************************************************
841  template< typename MT > // Type of the target matrix
842  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
843  smpAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
844  {
846 
847  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
848  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
849 
851 
852  const typename MT2::OppositeType tmp( rhs.rhs_ );
853  smpAssign( ~lhs, rhs.lhs_ * tmp );
854  }
856  //**********************************************************************************************
857 
858  //**Restructuring SMP assignment to row-major matrices******************************************
873  template< typename MT > // Type of the target matrix
874  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
875  smpAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
876  {
878 
879  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
880  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
881 
882  smpAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
883  }
885  //**********************************************************************************************
886 
887  //**SMP assignment to column-major matrices*****************************************************
902  template< typename MT > // Type of the target matrix
903  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
904  smpAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
905  {
907 
909 
910  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
911  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
912 
914 
915  const typename MT1::OppositeType tmp( rhs.lhs_ );
916  smpAssign( ~lhs, tmp * rhs.rhs_ );
917  }
919  //**********************************************************************************************
920 
921  //**Restructuring SMP assignment to column-major matrices***************************************
936  template< typename MT > // Type of the target matrix
937  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
938  smpAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
939  {
941 
943 
944  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
945  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
946 
947  smpAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
948  }
950  //**********************************************************************************************
951 
952  //**SMP addition assignment to row-major dense matrices*****************************************
967  template< typename MT > // Type of the target dense matrix
968  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
969  smpAddAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
970  {
972 
973  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
974  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
975 
977 
978  const typename MT2::OppositeType tmp( rhs.rhs_ );
979  smpAddAssign( ~lhs, rhs.lhs_ * tmp );
980  }
982  //**********************************************************************************************
983 
984  //**SMP addition assignment to column-major dense matrices**************************************
999  template< typename MT > // Type of the target dense matrix
1000  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1001  smpAddAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1002  {
1004 
1006 
1007  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1008  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1009 
1011 
1012  const typename MT1::OppositeType tmp( rhs.lhs_ );
1013  smpAddAssign( ~lhs, tmp * rhs.rhs_ );
1014  }
1016  //**********************************************************************************************
1017 
1018  //**Restructuring SMP addition assignment to row-major matrices*********************************
1033  template< typename MT > // Type of the target matrix
1034  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1035  smpAddAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
1036  {
1038 
1039  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1040  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1041 
1042  smpAddAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1043  }
1045  //**********************************************************************************************
1046 
1047  //**Restructuring SMP addition assignment to column-major matrices******************************
1062  template< typename MT > // Type of the target matrix
1063  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1064  smpAddAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1065  {
1067 
1069 
1070  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1071  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1072 
1073  smpAddAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1074  }
1076  //**********************************************************************************************
1077 
1078  //**SMP addition assignment to sparse matrices**************************************************
1079  // No special implementation for the SMP addition assignment to sparse matrices.
1080  //**********************************************************************************************
1081 
1082  //**SMP subtraction assignment to row-major dense matrices**************************************
1097  template< typename MT > // Type of the target dense matrix
1098  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1099  smpSubAssign( DenseMatrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
1100  {
1102 
1103  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1104  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1105 
1107 
1108  const typename MT2::OppositeType tmp( rhs.rhs_ );
1109  smpSubAssign( ~lhs, rhs.lhs_ * tmp );
1110  }
1112  //**********************************************************************************************
1113 
1114  //**SMP subtraction assignment to column-major dense matrices***********************************
1129  template< typename MT > // Type of the target dense matrix
1130  friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1131  smpSubAssign( DenseMatrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1132  {
1134 
1136 
1137  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1138  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1139 
1141 
1142  const typename MT1::OppositeType tmp( rhs.lhs_ );
1143  smpSubAssign( ~lhs, tmp * rhs.rhs_ );
1144  }
1146  //**********************************************************************************************
1147 
1148  //**Restructuring SMP subtraction assignment to row-major matrices******************************
1163  template< typename MT > // Type of the target matrix
1164  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1165  smpSubAssign( Matrix<MT,false>& lhs, const SMatTSMatMultExpr& rhs )
1166  {
1168 
1169  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1170  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1171 
1172  smpSubAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1173  }
1175  //**********************************************************************************************
1176 
1177  //**Restructuring SMP subtraction assignment to column-major matrices***************************
1192  template< typename MT > // Type of the target matrix
1193  friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1194  smpSubAssign( Matrix<MT,true>& lhs, const SMatTSMatMultExpr& rhs )
1195  {
1197 
1199 
1200  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1201  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1202 
1203  smpSubAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1204  }
1206  //**********************************************************************************************
1207 
1208  //**SMP subtraction assignment to sparse matrices***********************************************
1209  // No special implementation for the SMP subtraction assignment to sparse matrices.
1210  //**********************************************************************************************
1211 
1212  //**SMP multiplication assignment to dense matrices*********************************************
1213  // No special implementation for the SMP multiplication assignment to dense matrices.
1214  //**********************************************************************************************
1215 
1216  //**SMP multiplication assignment to sparse matrices********************************************
1217  // No special implementation for the SMP multiplication assignment to sparse matrices.
1218  //**********************************************************************************************
1219 
1220  //**Compile time checks*************************************************************************
1228  //**********************************************************************************************
1229 };
1230 //*************************************************************************************************
1231 
1232 
1233 
1234 
1235 //=================================================================================================
1236 //
1237 // GLOBAL BINARY ARITHMETIC OPERATORS
1238 //
1239 //=================================================================================================
1240 
1241 //*************************************************************************************************
1271 template< typename T1 // Type of the left-hand side sparse matrix
1272  , typename T2 > // Type of the right-hand side sparse matrix
1273 inline const SMatTSMatMultExpr<T1,T2>
1275 {
1277 
1278  if( (~lhs).columns() != (~rhs).rows() ) {
1279  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1280  }
1281 
1282  return SMatTSMatMultExpr<T1,T2>( ~lhs, ~rhs );
1283 }
1284 //*************************************************************************************************
1285 
1286 
1287 
1288 
1289 //=================================================================================================
1290 //
1291 // ROWS SPECIALIZATIONS
1292 //
1293 //=================================================================================================
1294 
1295 //*************************************************************************************************
1297 template< typename MT1, typename MT2 >
1298 struct Rows< SMatTSMatMultExpr<MT1,MT2> > : public Rows<MT1>
1299 {};
1301 //*************************************************************************************************
1302 
1303 
1304 
1305 
1306 //=================================================================================================
1307 //
1308 // COLUMNS SPECIALIZATIONS
1309 //
1310 //=================================================================================================
1311 
1312 //*************************************************************************************************
1314 template< typename MT1, typename MT2 >
1315 struct Columns< SMatTSMatMultExpr<MT1,MT2> > : public Columns<MT2>
1316 {};
1318 //*************************************************************************************************
1319 
1320 
1321 
1322 
1323 //=================================================================================================
1324 //
1325 // ISLOWER SPECIALIZATIONS
1326 //
1327 //=================================================================================================
1328 
1329 //*************************************************************************************************
1331 template< typename MT1, typename MT2 >
1332 struct IsLower< SMatTSMatMultExpr<MT1,MT2> >
1333  : public IsTrue< And< IsLower<MT1>, IsLower<MT2> >::value >
1334 {};
1336 //*************************************************************************************************
1337 
1338 
1339 
1340 
1341 //=================================================================================================
1342 //
1343 // ISUNILOWER SPECIALIZATIONS
1344 //
1345 //=================================================================================================
1346 
1347 //*************************************************************************************************
1349 template< typename MT1, typename MT2 >
1350 struct IsUniLower< SMatTSMatMultExpr<MT1,MT2> >
1351  : public IsTrue< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1352 {};
1354 //*************************************************************************************************
1355 
1356 
1357 
1358 
1359 //=================================================================================================
1360 //
1361 // ISSTRICTLYLOWER SPECIALIZATIONS
1362 //
1363 //=================================================================================================
1364 
1365 //*************************************************************************************************
1367 template< typename MT1, typename MT2 >
1368 struct IsStrictlyLower< SMatTSMatMultExpr<MT1,MT2> >
1369  : public IsTrue< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1370  , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1371 {};
1373 //*************************************************************************************************
1374 
1375 
1376 
1377 
1378 //=================================================================================================
1379 //
1380 // ISUPPER SPECIALIZATIONS
1381 //
1382 //=================================================================================================
1383 
1384 //*************************************************************************************************
1386 template< typename MT1, typename MT2 >
1387 struct IsUpper< SMatTSMatMultExpr<MT1,MT2> >
1388  : public IsTrue< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1389 {};
1391 //*************************************************************************************************
1392 
1393 
1394 
1395 
1396 //=================================================================================================
1397 //
1398 // ISUNIUPPER SPECIALIZATIONS
1399 //
1400 //=================================================================================================
1401 
1402 //*************************************************************************************************
1404 template< typename MT1, typename MT2 >
1405 struct IsUniUpper< SMatTSMatMultExpr<MT1,MT2> >
1406  : public IsTrue< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1407 {};
1409 //*************************************************************************************************
1410 
1411 
1412 
1413 
1414 //=================================================================================================
1415 //
1416 // ISSTRICTLYUPPER SPECIALIZATIONS
1417 //
1418 //=================================================================================================
1419 
1420 //*************************************************************************************************
1422 template< typename MT1, typename MT2 >
1423 struct IsStrictlyUpper< SMatTSMatMultExpr<MT1,MT2> >
1424  : public IsTrue< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1425  , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
1426 {};
1428 //*************************************************************************************************
1429 
1430 
1431 
1432 
1433 //=================================================================================================
1434 //
1435 // EXPRESSION TRAIT SPECIALIZATIONS
1436 //
1437 //=================================================================================================
1438 
1439 //*************************************************************************************************
1441 template< typename MT1, typename MT2, typename VT >
1442 struct SMatDVecMultExprTrait< SMatTSMatMultExpr<MT1,MT2>, VT >
1443 {
1444  public:
1445  //**********************************************************************************************
1446  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1447  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1448  IsDenseVector<VT>::value && IsColumnVector<VT>::value
1449  , typename SMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1450  , INVALID_TYPE >::Type Type;
1451  //**********************************************************************************************
1452 };
1454 //*************************************************************************************************
1455 
1456 
1457 //*************************************************************************************************
1459 template< typename MT1, typename MT2, typename VT >
1460 struct SMatSVecMultExprTrait< SMatTSMatMultExpr<MT1,MT2>, VT >
1461 {
1462  public:
1463  //**********************************************************************************************
1464  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1465  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1466  IsSparseVector<VT>::value && IsColumnVector<VT>::value
1467  , typename SMatSVecMultExprTrait< MT1, typename TSMatSVecMultExprTrait<MT2,VT>::Type >::Type
1468  , INVALID_TYPE >::Type Type;
1469  //**********************************************************************************************
1470 };
1472 //*************************************************************************************************
1473 
1474 
1475 //*************************************************************************************************
1477 template< typename VT, typename MT1, typename MT2 >
1478 struct TDVecSMatMultExprTrait< VT, SMatTSMatMultExpr<MT1,MT2> >
1479 {
1480  public:
1481  //**********************************************************************************************
1482  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1483  IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1484  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1485  , typename TDVecTSMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1486  , INVALID_TYPE >::Type Type;
1487  //**********************************************************************************************
1488 };
1490 //*************************************************************************************************
1491 
1492 
1493 //*************************************************************************************************
1495 template< typename VT, typename MT1, typename MT2 >
1496 struct TSVecSMatMultExprTrait< VT, SMatTSMatMultExpr<MT1,MT2> >
1497 {
1498  public:
1499  //**********************************************************************************************
1500  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1501  IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1502  IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1503  , typename TDVecTSMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1504  , INVALID_TYPE >::Type Type;
1505  //**********************************************************************************************
1506 };
1508 //*************************************************************************************************
1509 
1510 
1511 //*************************************************************************************************
1513 template< typename MT1, typename MT2, bool AF >
1514 struct SubmatrixExprTrait< SMatTSMatMultExpr<MT1,MT2>, AF >
1515 {
1516  public:
1517  //**********************************************************************************************
1518  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1519  , typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1520  //**********************************************************************************************
1521 };
1523 //*************************************************************************************************
1524 
1525 
1526 //*************************************************************************************************
1528 template< typename MT1, typename MT2 >
1529 struct RowExprTrait< SMatTSMatMultExpr<MT1,MT2> >
1530 {
1531  public:
1532  //**********************************************************************************************
1533  typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1534  //**********************************************************************************************
1535 };
1537 //*************************************************************************************************
1538 
1539 
1540 //*************************************************************************************************
1542 template< typename MT1, typename MT2 >
1543 struct ColumnExprTrait< SMatTSMatMultExpr<MT1,MT2> >
1544 {
1545  public:
1546  //**********************************************************************************************
1547  typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
1548  //**********************************************************************************************
1549 };
1551 //*************************************************************************************************
1552 
1553 } // namespace blaze
1554 
1555 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SMatTSMatMultExpr.h:151
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
Header file for mathematical functions.
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:7820
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:250
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:159
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatTSMatMultExpr.h:367
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:162
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
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:721
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
Constraints on the storage order of matrix types.
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:357
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatTSMatMultExpr.h:433
Header file for the SparseMatrix base class.
SMatTSMatMultExpr< MT1, MT2 > This
Type of this SMatTSMatMultExpr instance.
Definition: SMatTSMatMultExpr.h:150
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatTSMatMultExpr.h:155
Constraint on the data type.
Expression object for sparse matrix-transpose sparse matrix multiplications.The SMatTSMatMultExpr cla...
Definition: Forward.h:115
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:127
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:110
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatTSMatMultExpr.h:153
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:79
Header file for the Or class template.
Header file for the TDVecTSMatMultExprTrait class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:125
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
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.
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:423
RightOperand rightOperand() const
Returns the right-hand side transpose sparse matrix operand.
Definition: SMatTSMatMultExpr.h:399
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatTSMatMultExpr.h:331
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:154
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:156
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: RowMajorMatrix.h:79
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:176
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:110
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:138
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:94
Constraint on the data type.
Constraints on the storage order of matrix types.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTSMatMultExpr.h:191
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTSMatMultExpr.h:152
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatTSMatMultExpr.h:440
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:128
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatTSMatMultExpr.h:347
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:944
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:2583
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:324
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatTSMatMultExpr.h:411
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: SMatTSMatMultExpr.h:441
Header file for the IsUpper type trait.
Header file for exception macros.
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: SMatTSMatMultExpr.h:126
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:389
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:378
Header file for the IsExpression type trait class.
Header file for the TSMatSVecMultExprTrait class template.
Header file for the FunctionTrace class.