TSMatSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
74 #include <blaze/math/views/Check.h>
78 #include <blaze/util/Assert.h>
79 #include <blaze/util/DisableIf.h>
80 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/mpl/And.h>
83 #include <blaze/util/mpl/If.h>
84 #include <blaze/util/mpl/Or.h>
85 #include <blaze/util/Types.h>
86 #include <blaze/util/Unused.h>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS TSMATSMATMULTEXPR
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
104 template< typename MT1 // Type of the left-hand side sparse matrix
105  , typename MT2 > // Type of the right-hand side sparse matrix
106 class TSMatSMatMultExpr
107  : public MatMatMultExpr< SparseMatrix< TSMatSMatMultExpr<MT1,MT2>, true > >
108  , private Computation
109 {
110  private:
111  //**Type definitions****************************************************************************
116  //**********************************************************************************************
117 
118  //**********************************************************************************************
120  enum : bool { evaluateLeft = RequiresEvaluation<MT1>::value };
121  //**********************************************************************************************
122 
123  //**********************************************************************************************
125  enum : bool { evaluateRight = RequiresEvaluation<MT2>::value };
126  //**********************************************************************************************
127 
128  //**********************************************************************************************
130 
137  template< typename T1, typename T2, typename T3 >
138  struct CanExploitSymmetry {
139  enum : bool { value = ( IsRowMajorMatrix<T1>::value && IsSymmetric<T2>::value ) ||
141  };
143  //**********************************************************************************************
144 
145  //**********************************************************************************************
147 
152  template< typename T1, typename T2, typename T3 >
153  struct IsEvaluationRequired {
154  enum : bool { value = ( evaluateLeft || evaluateRight ) &&
155  !CanExploitSymmetry<T1,T2,T2>::value };
156  };
158  //**********************************************************************************************
159 
160  public:
161  //**Type definitions****************************************************************************
167  using ReturnType = const ElementType;
168  using CompositeType = const ResultType;
169 
171  using LeftOperand = If_< IsExpression<MT1>, const MT1, const MT1& >;
172 
174  using RightOperand = If_< IsExpression<MT2>, const MT2, const MT2& >;
175  //**********************************************************************************************
176 
177  //**Compilation flags***************************************************************************
179  enum : bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
180  !evaluateRight && MT2::smpAssignable };
181  //**********************************************************************************************
182 
183  //**Constructor*********************************************************************************
189  explicit inline TSMatSMatMultExpr( const MT1& lhs, const MT2& rhs ) noexcept
190  : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
191  , rhs_( rhs ) // Right-hand side sparse matrix of the multiplication expression
192  {
193  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
194  }
195  //**********************************************************************************************
196 
197  //**Access operator*****************************************************************************
204  inline ReturnType operator()( size_t i, size_t j ) const {
205  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
206  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
207 
208  if( IsDiagonal<MT1>::value ) {
209  return lhs_(i,i) * rhs_(i,j);
210  }
211  else if( IsDiagonal<MT2>::value ) {
212  return lhs_(i,j) * rhs_(j,j);
213  }
215  const size_t begin( ( IsUpper<MT1>::value )
216  ?( ( IsLower<MT2>::value )
217  ?( max( ( IsStrictlyUpper<MT1>::value ? i+1UL : i )
218  , ( IsStrictlyLower<MT2>::value ? j+1UL : j ) ) )
219  :( IsStrictlyUpper<MT1>::value ? i+1UL : i ) )
220  :( ( IsLower<MT2>::value )
221  ?( IsStrictlyLower<MT2>::value ? j+1UL : j )
222  :( 0UL ) ) );
223  const size_t end( ( IsLower<MT1>::value )
224  ?( ( IsUpper<MT2>::value )
225  ?( min( ( IsStrictlyLower<MT1>::value ? i : i+1UL )
226  , ( IsStrictlyUpper<MT2>::value ? j : j+1UL ) ) )
227  :( IsStrictlyLower<MT1>::value ? i : i+1UL ) )
228  :( ( IsUpper<MT2>::value )
229  ?( IsStrictlyUpper<MT2>::value ? j : j+1UL )
230  :( lhs_.columns() ) ) );
231 
232  if( begin >= end ) return ElementType();
233 
234  const size_t n( end - begin );
235 
236  return subvector( row( lhs_, i, unchecked ), begin, n, unchecked ) *
237  subvector( column( rhs_, j, unchecked ), begin, n, unchecked );
238  }
239  else {
240  return row( lhs_, i, unchecked ) * column( rhs_, j, unchecked );
241  }
242  }
243  //**********************************************************************************************
244 
245  //**At function*********************************************************************************
253  inline ReturnType at( size_t i, size_t j ) const {
254  if( i >= lhs_.rows() ) {
255  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
256  }
257  if( j >= rhs_.columns() ) {
258  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
259  }
260  return (*this)(i,j);
261  }
262  //**********************************************************************************************
263 
264  //**Rows function*******************************************************************************
269  inline size_t rows() const noexcept {
270  return lhs_.rows();
271  }
272  //**********************************************************************************************
273 
274  //**Columns function****************************************************************************
279  inline size_t columns() const noexcept {
280  return rhs_.columns();
281  }
282  //**********************************************************************************************
283 
284  //**NonZeros function***************************************************************************
289  inline constexpr size_t nonZeros() const noexcept {
290  return 0UL;
291  }
292  //**********************************************************************************************
293 
294  //**NonZeros function***************************************************************************
300  inline size_t nonZeros( size_t i ) const noexcept {
301  UNUSED_PARAMETER( i );
302  return 0UL;
303  }
304  //**********************************************************************************************
305 
306  //**Left operand access*************************************************************************
311  inline LeftOperand leftOperand() const noexcept {
312  return lhs_;
313  }
314  //**********************************************************************************************
315 
316  //**Right operand access************************************************************************
321  inline RightOperand rightOperand() const noexcept {
322  return rhs_;
323  }
324  //**********************************************************************************************
325 
326  //**********************************************************************************************
332  template< typename T >
333  inline bool canAlias( const T* alias ) const noexcept {
334  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
335  }
336  //**********************************************************************************************
337 
338  //**********************************************************************************************
344  template< typename T >
345  inline bool isAliased( const T* alias ) const noexcept {
346  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
347  }
348  //**********************************************************************************************
349 
350  //**********************************************************************************************
355  inline bool canSMPAssign() const noexcept {
356  return ( rows() * columns() >= SMP_TSMATSMATMULT_THRESHOLD );
357  }
358  //**********************************************************************************************
359 
360  private:
361  //**Member variables****************************************************************************
364  //**********************************************************************************************
365 
366  //**Assignment to dense matrices****************************************************************
379  template< typename MT // Type of the target dense matrix
380  , bool SO > // Storage order of the target dense matrix
382  assign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
383  {
385 
386  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
387  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
388 
389  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
390  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
391 
392  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
393  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
394  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
395  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
396  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
397  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
398 
399  TSMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
400  }
402  //**********************************************************************************************
403 
404  //**Default assignment to dense matrices********************************************************
418  template< typename MT3 // Type of the left-hand side target matrix
419  , typename MT4 // Type of the left-hand side matrix operand
420  , typename MT5 > // Type of the right-hand side matrix operand
421  static inline void selectAssignKernel( MT3& C, const MT4& A, const MT5& B )
422  {
423  using LeftIterator = ConstIterator_<MT4>;
424  using RightIterator = ConstIterator_<MT5>;
425 
426  for( size_t j=0UL; j<A.columns(); ++j ) {
427  const LeftIterator lend( A.end(j) );
428  for( LeftIterator lelem=A.begin(j); lelem!=lend; ++lelem ) {
429  const RightIterator rend( B.end(j) );
430  for( RightIterator relem=B.begin(j); relem!=rend; ++relem )
431  {
432  if( IsResizable< ElementType_<MT3> >::value &&
433  isDefault( C(lelem->index(),relem->index()) ) ) {
434  C(lelem->index(),relem->index()) = lelem->value() * relem->value();
435  }
436  else {
437  C(lelem->index(),relem->index()) += lelem->value() * relem->value();
438  }
439  }
440  }
441  }
442  }
444  //**********************************************************************************************
445 
446  //**Assignment to row-major sparse matrices*****************************************************
459  template< typename MT > // Type of the target sparse matrix
461  assign( SparseMatrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
462  {
464 
466 
467  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
468  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
469 
471 
472  const OppositeType_<MT1> tmp( serial( rhs.lhs_ ) );
473  assign( ~lhs, tmp * rhs.rhs_ );
474  }
476  //**********************************************************************************************
477 
478  //**Assignment to column-major sparse matrices**************************************************
491  template< typename MT > // Type of the target sparse matrix
493  assign( SparseMatrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
494  {
496 
497  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
498  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
499 
501 
502  const OppositeType_<MT2> tmp( serial( rhs.rhs_ ) );
503  assign( ~lhs, rhs.lhs_ * tmp );
504  }
506  //**********************************************************************************************
507 
508  //**Restructuring assignment to row-major matrices**********************************************
523  template< typename MT > // Type of the target matrix
525  assign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
526  {
528 
530 
531  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
532  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
533 
534  assign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
535  }
537  //**********************************************************************************************
538 
539  //**Restructuring assignment to column-major matrices*******************************************
554  template< typename MT > // Type of the target matrix
556  assign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
557  {
559 
560  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
561  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
562 
563  assign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
564  }
566  //**********************************************************************************************
567 
568  //**Addition assignment to dense matrices*******************************************************
581  template< typename MT // Type of the target dense matrix
582  , bool SO > // Storage order of the target dense matarix
584  addAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
585  {
587 
588  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
589  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
590 
591  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
592  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
593 
594  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
595  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
596  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
597  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
598  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
599  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
600 
601  TSMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
602  }
604  //**********************************************************************************************
605 
606  //**Default addition assignment to dense matrices***********************************************
620  template< typename MT3 // Type of the left-hand side target matrix
621  , typename MT4 // Type of the left-hand side matrix operand
622  , typename MT5 > // Type of the right-hand side matrix operand
623  static inline void selectAddAssignKernel( MT3& C, const MT4& A, const MT5& B )
624  {
625  using LeftIterator = ConstIterator_<MT4>;
626  using RightIterator = ConstIterator_<MT5>;
627 
628  for( size_t j=0UL; j<A.columns(); ++j ) {
629  const LeftIterator lend( A.end(j) );
630  for( LeftIterator lelem=A.begin(j); lelem!=lend; ++lelem ) {
631  const RightIterator rend( B.end(j) );
632  for( RightIterator relem=B.begin(j); relem!=rend; ++relem ) {
633  C(lelem->index(),relem->index()) += lelem->value() * relem->value();
634  }
635  }
636  }
637  }
639  //**********************************************************************************************
640 
641  //**Restructuring addition assignment to row-major matrices*************************************
656  template< typename MT > // Type of the target matrix
658  addAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
659  {
661 
663 
664  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
665  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
666 
667  addAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
668  }
670  //**********************************************************************************************
671 
672  //**Restructuring addition assignment to column-major matrices**********************************
687  template< typename MT > // Type of the target matrix
689  addAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
690  {
692 
693  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
694  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
695 
696  addAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
697  }
699  //**********************************************************************************************
700 
701  //**Addition assignment to sparse matrices******************************************************
702  // No special implementation for the addition assignment to sparse matrices.
703  //**********************************************************************************************
704 
705  //**Subtraction assignment to dense matrices****************************************************
718  template< typename MT // Type of the target dense matrix
719  , bool SO > // Storage order of the target dense matrix
720  friend inline void subAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
721  {
723 
724  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
725  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
726 
727  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
728  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
729 
730  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
731  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
732  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
733  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
734  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
735  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
736 
737  TSMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
738  }
740  //**********************************************************************************************
741 
742  //**Default subtraction assignment to dense matrices********************************************
756  template< typename MT3 // Type of the left-hand side target matrix
757  , typename MT4 // Type of the left-hand side matrix operand
758  , typename MT5 > // Type of the right-hand side matrix operand
759  static inline void selectSubAssignKernel( MT3& C, const MT4& A, const MT5& B )
760  {
761  using LeftIterator = ConstIterator_<MT4>;
762  using RightIterator = ConstIterator_<MT5>;
763 
764  for( size_t j=0UL; j<A.columns(); ++j ) {
765  const LeftIterator lend( A.end(j) );
766  for( LeftIterator lelem=A.begin(j); lelem!=lend; ++lelem ) {
767  const RightIterator rend( B.end(j) );
768  for( RightIterator relem=B.begin(j); relem!=rend; ++relem ) {
769  C(lelem->index(),relem->index()) -= lelem->value() * relem->value();
770  }
771  }
772  }
773  }
775  //**********************************************************************************************
776 
777  //**Restructuring subtraction assignment to row-major matrices**********************************
792  template< typename MT > // Type of the target matrix
794  subAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
795  {
797 
799 
800  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
801  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
802 
803  subAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
804  }
806  //**********************************************************************************************
807 
808  //**Restructuring subtraction assignment to column-major matrices*******************************
823  template< typename MT > // Type of the target matrix
825  subAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
826  {
828 
829  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
830  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
831 
832  subAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
833  }
835  //**********************************************************************************************
836 
837  //**Subtraction assignment to sparse matrices***************************************************
838  // No special implementation for the subtraction assignment to sparse matrices.
839  //**********************************************************************************************
840 
841  //**Schur product assignment to dense matrices**************************************************
854  template< typename MT // Type of the target dense matrix
855  , bool SO > // Storage order of the target dense matrix
856  friend inline void schurAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
857  {
859 
863 
864  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
865  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
866 
867  const ResultType tmp( serial( rhs ) );
868  schurAssign( ~lhs, tmp );
869  }
871  //**********************************************************************************************
872 
873  //**Schur product assignment to sparse matrices*************************************************
874  // No special implementation for the Schur product assignment to sparse matrices.
875  //**********************************************************************************************
876 
877  //**Multiplication assignment to dense matrices*************************************************
878  // No special implementation for the multiplication assignment to dense matrices.
879  //**********************************************************************************************
880 
881  //**Multiplication assignment to sparse matrices************************************************
882  // No special implementation for the multiplication assignment to sparse matrices.
883  //**********************************************************************************************
884 
885  //**SMP assignment to matrices******************************************************************
901  template< typename MT // Type of the target matrix
902  , bool SO > // Storage order of the target matrix
904  smpAssign( Matrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
905  {
907 
908  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
909  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
910 
911  CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
912  CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
913 
914  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
915  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
916  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
917  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
918  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
919  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
920 
921  smpAssign( ~lhs, A * B );
922  }
924  //**********************************************************************************************
925 
926  //**Restructuring SMP assignment to row-major matrices******************************************
941  template< typename MT > // Type of the target matrix
943  smpAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
944  {
946 
948 
949  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
950  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
951 
952  smpAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
953  }
955  //**********************************************************************************************
956 
957  //**Restructuring SMP assignment to column-major matrices***************************************
972  template< typename MT > // Type of the target matrix
974  smpAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
975  {
977 
978  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
979  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
980 
981  smpAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
982  }
984  //**********************************************************************************************
985 
986  //**SMP addition assignment to dense matrices***************************************************
1002  template< typename MT // Type of the target dense matrix
1003  , bool SO > // Storage order of the target dense matarix
1006  {
1008 
1009  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1010  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1011 
1012  CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
1013  CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1014 
1015  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1016  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1017  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1018  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1019  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1020  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1021 
1022  smpAddAssign( ~lhs, A * B );
1023  }
1025  //**********************************************************************************************
1026 
1027  //**Restructuring SMP addition assignment to row-major matrices*********************************
1042  template< typename MT > // Type of the target matrix
1044  smpAddAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
1045  {
1047 
1049 
1050  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1051  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1052 
1053  smpAddAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1054  }
1056  //**********************************************************************************************
1057 
1058  //**Restructuring SMP addition assignment to column-major matrices******************************
1073  template< typename MT > // Type of the target matrix
1075  smpAddAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
1076  {
1078 
1079  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1080  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1081 
1082  smpAddAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1083  }
1085  //**********************************************************************************************
1086 
1087  //**SMP addition assignment to sparse matrices**************************************************
1088  // No special implementation for the SMP addition assignment to sparse matrices.
1089  //**********************************************************************************************
1090 
1091  //**SMP subtraction assignment to dense matrices************************************************
1107  template< typename MT // Type of the target dense matrix
1108  , bool SO > // Storage order of the target dense matrix
1111  {
1113 
1114  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1115  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1116 
1117  CT1 A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
1118  CT2 B( rhs.rhs_ ); // Evaluation of the right-hand side sparse matrix operand
1119 
1120  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
1121  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
1122  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
1123  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
1124  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
1125  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
1126 
1127  smpSubAssign( ~lhs, A * B );
1128  }
1130  //**********************************************************************************************
1131 
1132  //**Restructuring SMP subtraction assignment to row-major matrices******************************
1147  template< typename MT > // Type of the target matrix
1149  smpSubAssign( Matrix<MT,false>& lhs, const TSMatSMatMultExpr& rhs )
1150  {
1152 
1154 
1155  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1156  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1157 
1158  smpSubAssign( ~lhs, trans( rhs.lhs_ ) * rhs.rhs_ );
1159  }
1161  //**********************************************************************************************
1162 
1163  //**Restructuring SMP subtraction assignment to column-major matrices***************************
1178  template< typename MT > // Type of the target matrix
1180  smpSubAssign( Matrix<MT,true>& lhs, const TSMatSMatMultExpr& rhs )
1181  {
1183 
1184  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1185  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1186 
1187  smpSubAssign( ~lhs, rhs.lhs_ * trans( rhs.rhs_ ) );
1188  }
1190  //**********************************************************************************************
1191 
1192  //**SMP subtraction assignment to sparse matrices***********************************************
1193  // No special implementation for the SMP subtraction assignment to sparse matrices.
1194  //**********************************************************************************************
1195 
1196  //**SMP Schur product assignment to dense matrices**********************************************
1209  template< typename MT // Type of the target dense matrix
1210  , bool SO > // Storage order of the target dense matrix
1211  friend inline void smpSchurAssign( DenseMatrix<MT,SO>& lhs, const TSMatSMatMultExpr& rhs )
1212  {
1214 
1218 
1219  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1220  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1221 
1222  const ResultType tmp( rhs );
1223  smpSchurAssign( ~lhs, tmp );
1224  }
1226  //**********************************************************************************************
1227 
1228  //**SMP Schur product assignment to sparse matrices*********************************************
1229  // No special implementation for the SMP Schur product assignment to sparse matrices.
1230  //**********************************************************************************************
1231 
1232  //**SMP multiplication assignment to dense matrices*********************************************
1233  // No special implementation for the SMP multiplication assignment to dense matrices.
1234  //**********************************************************************************************
1235 
1236  //**SMP multiplication assignment to sparse matrices********************************************
1237  // No special implementation for the SMP multiplication assignment to sparse matrices.
1238  //**********************************************************************************************
1239 
1240  //**Compile time checks*************************************************************************
1248  //**********************************************************************************************
1249 };
1250 //*************************************************************************************************
1251 
1252 
1253 
1254 
1255 //=================================================================================================
1256 //
1257 // GLOBAL BINARY ARITHMETIC OPERATORS
1258 //
1259 //=================================================================================================
1260 
1261 //*************************************************************************************************
1291 template< typename MT1 // Type of the left-hand side sparse matrix
1292  , typename MT2 > // Type of the right-hand side sparse matrix
1293 inline decltype(auto)
1294  operator*( const SparseMatrix<MT1,true>& lhs, const SparseMatrix<MT2,false>& rhs )
1295 {
1297 
1298  if( (~lhs).columns() != (~rhs).rows() ) {
1299  BLAZE_THROW_INVALID_ARGUMENT( "Matrix sizes do not match" );
1300  }
1301 
1302  using ReturnType = const TSMatSMatMultExpr<MT1,MT2>;
1303  return ReturnType( ~lhs, ~rhs );
1304 }
1305 //*************************************************************************************************
1306 
1307 
1308 
1309 
1310 //=================================================================================================
1311 //
1312 // SIZE SPECIALIZATIONS
1313 //
1314 //=================================================================================================
1315 
1316 //*************************************************************************************************
1318 template< typename MT1, typename MT2 >
1319 struct Size< TSMatSMatMultExpr<MT1,MT2>, 0UL >
1320  : public Size<MT1,0UL>
1321 {};
1322 
1323 template< typename MT1, typename MT2 >
1324 struct Size< TSMatSMatMultExpr<MT1,MT2>, 1UL >
1325  : public Size<MT2,1UL>
1326 {};
1328 //*************************************************************************************************
1329 
1330 
1331 
1332 
1333 //=================================================================================================
1334 //
1335 // ISLOWER SPECIALIZATIONS
1336 //
1337 //=================================================================================================
1338 
1339 //*************************************************************************************************
1341 template< typename MT1, typename MT2 >
1342 struct IsLower< TSMatSMatMultExpr<MT1,MT2> >
1343  : public And< IsLower<MT1>, IsLower<MT2> >
1344 {};
1346 //*************************************************************************************************
1347 
1348 
1349 
1350 
1351 //=================================================================================================
1352 //
1353 // ISUNILOWER SPECIALIZATIONS
1354 //
1355 //=================================================================================================
1356 
1357 //*************************************************************************************************
1359 template< typename MT1, typename MT2 >
1360 struct IsUniLower< TSMatSMatMultExpr<MT1,MT2> >
1361  : public And< IsUniLower<MT1>, IsUniLower<MT2> >
1362 {};
1364 //*************************************************************************************************
1365 
1366 
1367 
1368 
1369 //=================================================================================================
1370 //
1371 // ISSTRICTLYLOWER SPECIALIZATIONS
1372 //
1373 //=================================================================================================
1374 
1375 //*************************************************************************************************
1377 template< typename MT1, typename MT2 >
1378 struct IsStrictlyLower< TSMatSMatMultExpr<MT1,MT2> >
1379  : public Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1380  , And< IsStrictlyLower<MT2>, IsLower<MT1> > >
1381 {};
1383 //*************************************************************************************************
1384 
1385 
1386 
1387 
1388 //=================================================================================================
1389 //
1390 // ISUPPER SPECIALIZATIONS
1391 //
1392 //=================================================================================================
1393 
1394 //*************************************************************************************************
1396 template< typename MT1, typename MT2 >
1397 struct IsUpper< TSMatSMatMultExpr<MT1,MT2> >
1398  : public And< IsUpper<MT1>, IsUpper<MT2> >
1399 {};
1401 //*************************************************************************************************
1402 
1403 
1404 
1405 
1406 //=================================================================================================
1407 //
1408 // ISUNIUPPER SPECIALIZATIONS
1409 //
1410 //=================================================================================================
1411 
1412 //*************************************************************************************************
1414 template< typename MT1, typename MT2 >
1415 struct IsUniUpper< TSMatSMatMultExpr<MT1,MT2> >
1416  : public And< IsUniUpper<MT1>, IsUniUpper<MT2> >
1417 {};
1419 //*************************************************************************************************
1420 
1421 
1422 
1423 
1424 //=================================================================================================
1425 //
1426 // ISSTRICTLYUPPER SPECIALIZATIONS
1427 //
1428 //=================================================================================================
1429 
1430 //*************************************************************************************************
1432 template< typename MT1, typename MT2 >
1433 struct IsStrictlyUpper< TSMatSMatMultExpr<MT1,MT2> >
1434  : public Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1435  , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >
1436 {};
1438 //*************************************************************************************************
1439 
1440 } // namespace blaze
1441 
1442 #endif
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:329
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
ResultType_< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:112
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:86
Header file for basic type definitions.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatSMatMultExpr.h:204
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the serial shim.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
Header file for the IsColumnMajorMatrix type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatSMatMultExpr.h:311
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:163
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatSMatMultExpr.h:168
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
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:87
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatSMatMultExpr.h:253
Constraints on the storage order of matrix types.
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:174
Header file for the RequiresEvaluation type trait.
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:171
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for the SparseMatrix base class.
Constraint on the data type.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: TSMatSMatMultExpr.h:321
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSMatSMatMultExpr.h:355
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:110
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TSMatSMatMultExpr.h:269
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
Header file for the Or class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for the IsLower type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TSMatSMatMultExpr.h:279
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:89
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSMatSMatMultExpr.h:345
Header file for the IsTriangular type trait.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:167
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:430
Constraint on the data type.
constexpr size_t nonZeros() const noexcept
Returns the number of non-zero elements in the sparse matrix.
Definition: TSMatSMatMultExpr.h:289
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
#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:107
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
TSMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TSMatSMatMultExpr class.
Definition: TSMatSMatMultExpr.h:189
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
CompositeType_< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:115
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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSMatSMatMultExpr.h:333
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
CompositeType_< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:114
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TSMatSMatMultExpr.h:166
Header file for the isDefault shim.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
Constraint on the data type.
Constraints on the storage order of matrix types.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Expression object for transpose sparse matrix-sparse matrix multiplications.The TSMatSMatMultExpr cla...
Definition: Forward.h:164
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
size_t nonZeros(size_t i) const noexcept
Returns the number of non-zero elements in the specified row.
Definition: TSMatSMatMultExpr.h:300
Header file for the IsRowMajorMatrix type trait.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatSMatMultExpr.h:164
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatSMatMultExpr.h:362
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSMatSMatMultExpr.h:165
Header file for the IsComputation type trait class.
Compile time logical &#39;or&#39; evaluation.The Or alias declaration performs at compile time a logical &#39;or&#39;...
Definition: Or.h:76
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Compile time logical &#39;and&#39; evaluation.The And alias declaration performs at compile time a logical &#39;a...
Definition: And.h:76
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: TSMatSMatMultExpr.h:113
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Constraint on the data type.
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TSMatSMatMultExpr.h:363
Header file for the IsResizable type trait.
Header file for the Size type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Header file for the IsExpression type trait class.
Header file for the function trace functionality.