All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SMatTDMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATTDMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
51 #include <blaze/math/shims/Reset.h>
79 #include <blaze/util/Assert.h>
80 #include <blaze/util/InvalidType.h>
82 #include <blaze/util/SelectType.h>
83 #include <blaze/util/Types.h>
85 
86 
87 namespace blaze {
88 
89 //=================================================================================================
90 //
91 // CLASS SMATTDMATMULTEXPR
92 //
93 //=================================================================================================
94 
95 //*************************************************************************************************
102 template< typename MT1 // Type of the left-hand side sparse matrix
103  , typename MT2 > // Type of the right-hand side dense matrix
104 class SMatTDMatMultExpr : public DenseMatrix< SMatTDMatMultExpr<MT1,MT2>, false >
105  , private MatMatMultExpr
106  , private Computation
107 {
108  private:
109  //**Type definitions****************************************************************************
110  typedef typename MT1::ResultType RT1;
111  typedef typename MT2::ResultType RT2;
112  typedef typename MT1::CompositeType CT1;
113  typedef typename MT2::CompositeType CT2;
114  //**********************************************************************************************
115 
116  public:
117  //**Type definitions****************************************************************************
123  typedef const ElementType ReturnType;
124  typedef const ResultType CompositeType;
125 
127  typedef typename SelectType< IsExpression<MT1>::value, const MT1, const MT1& >::Type LeftOperand;
128 
130  typedef typename SelectType< IsExpression<MT2>::value, const MT2, const MT2& >::Type RightOperand;
131 
133  typedef typename SelectType< IsComputation<MT1>::value, const RT1, CT1 >::Type LT;
134 
136  typedef typename SelectType< IsComputation<MT2>::value, const RT2, CT2 >::Type RT;
137  //**********************************************************************************************
138 
139  //**Compilation flags***************************************************************************
141  enum { vectorizable = 0 };
142  //**********************************************************************************************
143 
144  //**Constructor*********************************************************************************
150  explicit inline SMatTDMatMultExpr( const MT1& lhs, const MT2& rhs )
151  : lhs_( lhs ) // Left-hand side sparse matrix of the multiplication expression
152  , rhs_( rhs ) // Right-hand side dense matrix of the multiplication expression
153  {
154  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.rows(), "Invalid matrix sizes" );
155  }
156  //**********************************************************************************************
157 
158  //**Access operator*****************************************************************************
165  inline ReturnType operator()( size_t i, size_t j ) const {
166  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
167  BLAZE_INTERNAL_ASSERT( j < rhs_.columns(), "Invalid column access index" );
168 
170 
171  ElementType tmp = ElementType();
172 
173  // Early exit
174  if( lhs_.columns() == 0UL )
175  return tmp;
176 
177  // Fast computation in case the left-hand side sparse matrix directly provides iterators
179  {
180  // Evaluation of the left-hand side sparse matrix operand
181  CT1 A( lhs_ );
182 
183  const ConstIterator end( A.end(i) );
184  ConstIterator element( A.begin(i) );
185 
186  // Early exit in case row i is empty
187  if( element == end )
188  return tmp;
189 
190  // Calculating element (i,j)
191  tmp = element->value() * rhs_(element->index(),j);
192  ++element;
193  for( ; element!=end; ++element )
194  tmp += element->value() * rhs_(element->index(),j);
195  }
196 
197  // Default computation in case the left-hand side sparse matrix doesn't provide iterators
198  else {
199  tmp = lhs_(i,0UL) * rhs_(0UL,j);
200  for( size_t k=1UL; k<lhs_.columns(); ++k ) {
201  tmp += lhs_(i,k) * rhs_(k,j);
202  }
203  }
204 
205  return tmp;
206  }
207  //**********************************************************************************************
208 
209  //**Rows function*******************************************************************************
214  inline size_t rows() const {
215  return lhs_.rows();
216  }
217  //**********************************************************************************************
218 
219  //**Columns function****************************************************************************
224  inline size_t columns() const {
225  return rhs_.columns();
226  }
227  //**********************************************************************************************
228 
229  //**Left operand access*************************************************************************
234  inline LeftOperand leftOperand() const {
235  return lhs_;
236  }
237  //**********************************************************************************************
238 
239  //**Right operand access************************************************************************
244  inline RightOperand rightOperand() const {
245  return rhs_;
246  }
247  //**********************************************************************************************
248 
249  //**********************************************************************************************
255  template< typename T >
256  inline bool canAlias( const T* alias ) const {
257  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
258  }
259  //**********************************************************************************************
260 
261  //**********************************************************************************************
267  template< typename T >
268  inline bool isAliased( const T* alias ) const {
269  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
270  }
271  //**********************************************************************************************
272 
273  private:
274  //**Member variables****************************************************************************
277  //**********************************************************************************************
278 
279  //**Assignment to dense matrices****************************************************************
291  template< typename MT // Type of the target dense matrix
292  , bool SO > // Storage order of the target dense matrix
293  friend inline void assign( DenseMatrix<MT,SO>& lhs, const SMatTDMatMultExpr& rhs )
294  {
296 
297  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
298  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
299 
301 
302  LT A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
303  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
304 
305  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
306  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
307  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
308  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
309  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
310  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
311 
312  const size_t block( 256UL );
313 
314  BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == ( B.columns() & size_t(-4) ), "Invalid end calculation" );
315  const size_t jend( B.columns() & size_t(-4) );
316 
317  for( size_t ii=0UL; ii<A.rows(); ii+=block ) {
318  const size_t iend( ( ii+block > A.rows() )?( A.rows() ):( ii+block ) );
319  for( size_t j=0UL; j<jend; j+=4UL ) {
320  for( size_t i=ii; i<iend; ++i ) {
321  const ConstIterator end( A.end(i) );
322  ConstIterator element( A.begin(i) );
323  if( element!=end ) {
324  (~lhs)(i,j ) = element->value() * B(element->index(),j );
325  (~lhs)(i,j+1UL) = element->value() * B(element->index(),j+1UL);
326  (~lhs)(i,j+2UL) = element->value() * B(element->index(),j+2UL);
327  (~lhs)(i,j+3UL) = element->value() * B(element->index(),j+3UL);
328  ++element;
329  for( ; element!=end; ++element ) {
330  (~lhs)(i,j ) += element->value() * B(element->index(),j );
331  (~lhs)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
332  (~lhs)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
333  (~lhs)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
334  }
335  }
336  else {
337  reset( (~lhs)(i,j ) );
338  reset( (~lhs)(i,j+1UL) );
339  reset( (~lhs)(i,j+2UL) );
340  reset( (~lhs)(i,j+3UL) );
341  }
342  }
343  }
344  for( size_t j=jend; j<B.columns(); ++j ) {
345  for( size_t i=ii; i<iend; ++i ) {
346  const ConstIterator end( A.end(i) );
347  ConstIterator element( A.begin(i) );
348  if( element!=end ) {
349  (~lhs)(i,j) = element->value() * B(element->index(),j);
350  ++element;
351  for( ; element!=end; ++element ) {
352  (~lhs)(i,j) += element->value() * B(element->index(),j);
353  }
354  }
355  else {
356  reset( (~lhs)(i,j) );
357  }
358  }
359  }
360  }
361  }
363  //**********************************************************************************************
364 
365  //**Assignment to sparse matrices***************************************************************
377  template< typename MT // Type of the target sparse matrix
378  , bool SO > // Storage order of the target sparse matrix
379  friend inline void assign( SparseMatrix<MT,SO>& lhs, const SMatTDMatMultExpr& rhs )
380  {
382 
383  typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
384 
391 
392  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
393  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
394 
395  const TmpType tmp( rhs );
396  assign( ~lhs, tmp );
397  }
399  //**********************************************************************************************
400 
401  //**Addition assignment to dense matrices*******************************************************
414  template< typename MT // Type of the target dense matrix
415  , bool SO > // Storage order of the target dense matrix
416  friend inline void addAssign( DenseMatrix<MT,SO>& lhs, const SMatTDMatMultExpr& rhs )
417  {
419 
420  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
421  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
422 
424 
425  LT A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
426  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
427 
428  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
429  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
430  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
431  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
432  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
433  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
434 
435  const size_t block( 256UL );
436  BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == ( B.columns() & size_t(-4) ), "Invalid end calculation" );
437  const size_t jend( B.columns() & size_t(-4) );
438 
439  for( size_t ii=0UL; ii<A.rows(); ii+=block ) {
440  const size_t iend( ( ii+block > A.rows() )?( A.rows() ):( ii+block ) );
441  for( size_t j=0UL; j<jend; j+=4UL ) {
442  for( size_t i=ii; i<iend; ++i ) {
443  const ConstIterator end( A.end(i) );
444  ConstIterator element( A.begin(i) );
445  for( ; element!=end; ++element ) {
446  (~lhs)(i,j ) += element->value() * B(element->index(),j );
447  (~lhs)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
448  (~lhs)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
449  (~lhs)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
450  }
451  }
452  }
453  for( size_t j=jend; j<B.columns(); ++j ) {
454  for( size_t i=ii; i<iend; ++i ) {
455  const ConstIterator end( A.end(i) );
456  ConstIterator element( A.begin(i) );
457  for( ; element!=end; ++element ) {
458  (~lhs)(i,j) += element->value() * B(element->index(),j);
459  }
460  }
461  }
462  }
463  }
465  //**********************************************************************************************
466 
467  //**Addition assignment to sparse matrices******************************************************
468  // No special implementation for the addition assignment to sparse matrices.
469  //**********************************************************************************************
470 
471  //**Subtraction assignment to dense matrices****************************************************
484  template< typename MT // Type of the target dense matrix
485  , bool SO > // Storage order of the target dense matrix
486  friend inline void subAssign( DenseMatrix<MT,SO>& lhs, const SMatTDMatMultExpr& rhs )
487  {
489 
490  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
491  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
492 
494 
495  LT A( rhs.lhs_ ); // Evaluation of the left-hand side sparse matrix operand
496  RT B( rhs.rhs_ ); // Evaluation of the right-hand side dense matrix operand
497 
498  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
499  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
500  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
501  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
502  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
503  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
504 
505  const size_t block( 256UL );
506  BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == ( B.columns() & size_t(-4) ), "Invalid end calculation" );
507  const size_t jend( B.columns() & size_t(-4) );
508 
509  for( size_t ii=0UL; ii<A.rows(); ii+=block ) {
510  const size_t iend( ( ii+block > A.rows() )?( A.rows() ):( ii+block ) );
511  for( size_t j=0UL; j<jend; j+=4UL ) {
512  for( size_t i=ii; i<iend; ++i ) {
513  const ConstIterator end( A.end(i) );
514  ConstIterator element( A.begin(i) );
515  for( ; element!=end; ++element ) {
516  (~lhs)(i,j ) -= element->value() * B(element->index(),j );
517  (~lhs)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
518  (~lhs)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
519  (~lhs)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
520  }
521  }
522  }
523  for( size_t j=jend; j<B.columns(); ++j ) {
524  for( size_t i=ii; i<iend; ++i ) {
525  const ConstIterator end( A.end(i) );
526  ConstIterator element( A.begin(i) );
527  for( ; element!=end; ++element ) {
528  (~lhs)(i,j) -= element->value() * B(element->index(),j);
529  }
530  }
531  }
532  }
533  }
535  //**********************************************************************************************
536 
537  //**Subtraction assignment to sparse matrices***************************************************
538  // No special implementation for the subtraction assignment to sparse matrices.
539  //**********************************************************************************************
540 
541  //**Multiplication assignment to dense matrices*************************************************
542  // No special implementation for the multiplication assignment to dense matrices.
543  //**********************************************************************************************
544 
545  //**Multiplication assignment to sparse matrices************************************************
546  // No special implementation for the multiplication assignment to sparse matrices.
547  //**********************************************************************************************
548 
549  //**Compile time checks*************************************************************************
556  //**********************************************************************************************
557 };
558 //*************************************************************************************************
559 
560 
561 
562 
563 //=================================================================================================
564 //
565 // GLOBAL BINARY ARITHMETIC OPERATORS
566 //
567 //=================================================================================================
568 
569 //*************************************************************************************************
600 template< typename T1 // Type of the left-hand side sparse matrix
601  , typename T2 > // Type of the right-hand side dense matrix
602 inline const SMatTDMatMultExpr<T1,T2>
604 {
606 
607  if( (~lhs).columns() != (~rhs).rows() )
608  throw std::invalid_argument( "Matrix sizes do not match" );
609 
610  return SMatTDMatMultExpr<T1,T2>( ~lhs, ~rhs );
611 }
612 //*************************************************************************************************
613 
614 
615 
616 
617 //=================================================================================================
618 //
619 // EXPRESSION TRAIT SPECIALIZATIONS
620 //
621 //=================================================================================================
622 
623 //*************************************************************************************************
625 template< typename MT1, typename MT2, typename VT >
626 struct DMatDVecMultExprTrait< SMatTDMatMultExpr<MT1,MT2>, VT >
627 {
628  public:
629  //**********************************************************************************************
630  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
631  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
632  IsDenseVector<VT>::value && IsColumnVector<VT>::value
633  , typename SMatDVecMultExprTrait< MT1, typename TDMatDVecMultExprTrait<MT2,VT>::Type >::Type
634  , INVALID_TYPE >::Type Type;
635  //**********************************************************************************************
636 };
638 //*************************************************************************************************
639 
640 
641 //*************************************************************************************************
643 template< typename MT1, typename MT2, typename VT >
644 struct DMatSVecMultExprTrait< SMatTDMatMultExpr<MT1,MT2>, VT >
645 {
646  public:
647  //**********************************************************************************************
648  typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
649  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
650  IsSparseVector<VT>::value && IsColumnVector<VT>::value
651  , typename SMatDVecMultExprTrait< MT1, typename TDMatSVecMultExprTrait<MT2,VT>::Type >::Type
652  , INVALID_TYPE >::Type Type;
653  //**********************************************************************************************
654 };
656 //*************************************************************************************************
657 
658 
659 //*************************************************************************************************
661 template< typename VT, typename MT1, typename MT2 >
662 struct TDVecDMatMultExprTrait< VT, SMatTDMatMultExpr<MT1,MT2> >
663 {
664  public:
665  //**********************************************************************************************
666  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
667  IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
668  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
669  , typename TDVecTDMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
670  , INVALID_TYPE >::Type Type;
671  //**********************************************************************************************
672 };
674 //*************************************************************************************************
675 
676 
677 //*************************************************************************************************
679 template< typename VT, typename MT1, typename MT2 >
680 struct TSVecDMatMultExprTrait< VT, SMatTDMatMultExpr<MT1,MT2> >
681 {
682  public:
683  //**********************************************************************************************
684  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
685  IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
686  IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
687  , typename TSVecTDMatMultExprTrait< typename TSVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
688  , INVALID_TYPE >::Type Type;
689  //**********************************************************************************************
690 };
692 //*************************************************************************************************
693 
694 
695 //*************************************************************************************************
697 template< typename MT1, typename MT2 >
698 struct SubmatrixExprTrait< SMatTDMatMultExpr<MT1,MT2> >
699 {
700  public:
701  //**********************************************************************************************
702  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1>::Type
703  , typename SubmatrixExprTrait<const MT2>::Type >::Type Type;
704  //**********************************************************************************************
705 };
707 //*************************************************************************************************
708 
709 
710 //*************************************************************************************************
712 template< typename MT1, typename MT2 >
713 struct RowExprTrait< SMatTDMatMultExpr<MT1,MT2> >
714 {
715  public:
716  //**********************************************************************************************
717  typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
718  //**********************************************************************************************
719 };
721 //*************************************************************************************************
722 
723 
724 //*************************************************************************************************
726 template< typename MT1, typename MT2 >
727 struct ColumnExprTrait< SMatTDMatMultExpr<MT1,MT2> >
728 {
729  public:
730  //**********************************************************************************************
731  typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
732  //**********************************************************************************************
733 };
735 //*************************************************************************************************
736 
737 } // namespace blaze
738 
739 #endif
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatTDMatMultExpr.h:127
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatTDMatMultExpr.h:123
Header file for the SMatDVecMultExprTrait class template.
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
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:3703
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatTDMatMultExpr.h:112
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatTDMatMultExpr.h:256
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SMatTDMatMultExpr.h:119
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatTDMatMultExpr.h:124
Header file for the TDVecSMatMultExprTrait class template.
SelectType< IsComputation< MT1 >::value, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatTDMatMultExpr.h:133
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatTDMatMultExpr.h:275
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatTDMatMultExpr.h:110
SMatTDMatMultExpr< MT1, MT2 > This
Type of this SMatTDMatMultExpr instance.
Definition: SMatTDMatMultExpr.h:118
Header file for the RequiresEvaluation type trait.
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatTDMatMultExpr.h:111
Header file for the TSVecSMatMultExprTrait class template.
RightOperand rightOperand() const
Returns the right-hand side transpose dense matrix operand.
Definition: SMatTDMatMultExpr.h:244
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatTDMatMultExpr.h:224
SMatTDMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the SMatTDMatMultExpr class.
Definition: SMatTDMatMultExpr.h:150
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:104
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
SelectType< IsComputation< MT2 >::value, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatTDMatMultExpr.h:136
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 multiplication trait.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: StorageOrder.h:161
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
Header file for the TDMatSVecMultExprTrait class template.
Header file for the DenseMatrix base class.
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
Header file for the DMatDVecMultExprTrait class template.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatTDMatMultExpr.h:214
Expression object for sparse matrix-transpose dense matrix multiplications.The SMatTDMatMultExpr clas...
Definition: Forward.h:97
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
Constraints on the storage order of matrix types.
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatTDMatMultExpr.h:121
Header file for the IsSparseVector type trait.
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: StorageOrder.h:81
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: SMatTDMatMultExpr.h:130
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatTDMatMultExpr.h:234
Header file for the reset shim.
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: SMatTDMatMultExpr.h:113
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatTDMatMultExpr.h:122
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTDMatMultExpr.h:120
Header file for the RemoveReference type trait.
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:283
Header file for the IsDenseVector type trait.
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: SMatTDMatMultExpr.h:276
Header file for the TDVecDMatMultExprTrait class template.
Header file for the TDMatDVecMultExprTrait class template.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
size_t columns(const Matrix< MT, SO > &m)
Returns the current number of columns of the matrix.
Definition: Matrix.h:154
Header file for basic type definitions.
Header file for the TSVecDMatMultExprTrait class template.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTDMatMultExpr.h:165
Header file for the DMatSVecMultExprTrait class template.
Header file for the IsColumnVector type trait.
Size type of the Blaze library.
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:138
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TDVecTDMatMultExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatTDMatMultExpr.h:268
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.