All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSMatTSMatAddExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATTSMATADDEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATTSMATADDEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
62 #include <blaze/util/Assert.h>
64 #include <blaze/util/SelectType.h>
65 #include <blaze/util/Types.h>
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // CLASS TSMATTSMATADDEXPR
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
84 template< typename MT1 // Type of the left-hand side sparse matrix
85  , typename MT2 > // Type of the right-hand side sparse matrix
86 class TSMatTSMatAddExpr : public SparseMatrix< TSMatTSMatAddExpr<MT1,MT2>, true >
87  , private MatMatAddExpr
88  , private Computation
89 {
90  private:
91  //**Type definitions****************************************************************************
92  typedef typename MT1::ResultType RT1;
93  typedef typename MT2::ResultType RT2;
94  typedef typename MT1::ReturnType RN1;
95  typedef typename MT2::ReturnType RN2;
96  typedef typename MT1::CompositeType CT1;
97  typedef typename MT2::CompositeType CT2;
98  //**********************************************************************************************
99 
100  //**Return type evaluation**********************************************************************
102 
107  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
108 
111  //**********************************************************************************************
112 
113  //**Parallel evaluation strategy****************************************************************
115 
120  template< typename MT >
121  struct UseSMPAssign {
122  enum { value = MT::smpAssignable };
123  };
125  //**********************************************************************************************
126 
127  public:
128  //**Type definitions****************************************************************************
134 
137 
139  typedef const ResultType CompositeType;
140 
142  typedef typename SelectType< IsExpression<MT1>::value, const MT1, const MT1& >::Type LeftOperand;
143 
145  typedef typename SelectType< IsExpression<MT2>::value, const MT2, const MT2& >::Type RightOperand;
146  //**********************************************************************************************
147 
148  //**Compilation flags***************************************************************************
150  enum { smpAssignable = 0 };
151  //**********************************************************************************************
152 
153  //**Constructor*********************************************************************************
159  explicit inline TSMatTSMatAddExpr( const MT1& lhs, const MT2& rhs )
160  : lhs_( lhs ) // Left-hand side sparse matrix of the addition expression
161  , rhs_( rhs ) // Right-hand side sparse matrix of the addition expression
162  {
163  BLAZE_INTERNAL_ASSERT( lhs.rows() == rhs.rows() , "Invalid number of rows" );
164  BLAZE_INTERNAL_ASSERT( lhs.columns() == rhs.columns(), "Invalid number of columns" );
165  }
166  //**********************************************************************************************
167 
168  //**Access operator*****************************************************************************
175  inline ReturnType operator()( size_t i, size_t j ) const {
176  BLAZE_INTERNAL_ASSERT( i < lhs_.rows() , "Invalid row access index" );
177  BLAZE_INTERNAL_ASSERT( j < lhs_.columns(), "Invalid column access index" );
178  return lhs_(i,j) + rhs_(i,j);
179  }
180  //**********************************************************************************************
181 
182  //**Rows function*******************************************************************************
187  inline size_t rows() const {
188  return lhs_.rows();
189  }
190  //**********************************************************************************************
191 
192  //**Columns function****************************************************************************
197  inline size_t columns() const {
198  return lhs_.columns();
199  }
200  //**********************************************************************************************
201 
202  //**NonZeros function***************************************************************************
207  inline size_t nonZeros() const {
208  return lhs_.nonZeros() + rhs_.nonZeros();
209  }
210  //**********************************************************************************************
211 
212  //**NonZeros function***************************************************************************
218  inline size_t nonZeros( size_t i ) const {
219  return lhs_.nonZeros(i) + rhs_.nonZeros(i);
220  }
221  //**********************************************************************************************
222 
223  //**Left operand access*************************************************************************
228  inline LeftOperand leftOperand() const {
229  return lhs_;
230  }
231  //**********************************************************************************************
232 
233  //**Right operand access************************************************************************
238  inline RightOperand rightOperand() const {
239  return rhs_;
240  }
241  //**********************************************************************************************
242 
243  //**********************************************************************************************
249  template< typename T >
250  inline bool canAlias( const T* alias ) const {
251  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
252  }
253  //**********************************************************************************************
254 
255  //**********************************************************************************************
261  template< typename T >
262  inline bool isAliased( const T* alias ) const {
263  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
264  }
265  //**********************************************************************************************
266 
267  private:
268  //**Member variables****************************************************************************
271  //**********************************************************************************************
272 
273  //**Assignment to dense matrices****************************************************************
286  template< typename MT // Type of the target dense matrix
287  , bool SO > // Storage order of the target dense matrix
288  friend inline void assign( DenseMatrix<MT,SO>& lhs, const TSMatTSMatAddExpr& rhs )
289  {
291 
292  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
293  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
294 
295  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
296 
297  assign( ~lhs, rhs.lhs_ );
298 
300  addAssign( ~lhs, rhs.rhs_ );
301  }
302  else
303  {
304  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
305 
306  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
307  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
308  BLAZE_INTERNAL_ASSERT( B.rows() == (~lhs).rows() , "Invalid number of rows" );
309  BLAZE_INTERNAL_ASSERT( B.columns() == (~lhs).columns() , "Invalid number of columns" );
310 
311  for( size_t j=0UL; j<(~lhs).columns(); ++j ) {
312  const RightIterator end( B.end(j) );
313  for( RightIterator element=B.begin(j); element!=end; ++element ) {
314  if( isDefault( (~lhs)(element->index(),j) ) )
315  (~lhs)(element->index(),j) = element->value();
316  else
317  (~lhs)(element->index(),j) += element->value();
318  }
319  }
320  }
321  }
323  //**********************************************************************************************
324 
325  //**Assignment to row-major sparse matrices*****************************************************
338  template< typename MT > // Type of the target sparse matrix
339  friend inline void assign( SparseMatrix<MT,false>& lhs, const TSMatTSMatAddExpr& rhs )
340  {
342 
343  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
344  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
345 
346  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
347  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
348 
349  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
350  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
351 
352  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
353  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
354  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
355  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
356  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
357  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).columns() , "Invalid number of columns" );
358 
359  const size_t m( rhs.rows() );
360  const size_t n( rhs.columns() );
361 
362  // Counting the number of elements per column
363  std::vector<size_t> nonzeros( m, 0UL );
364  for( size_t j=0UL; j<n; ++j )
365  {
366  const LeftIterator lend( A.end(j) );
367  const RightIterator rend( B.end(j) );
368 
369  LeftIterator l( A.begin(j) );
370  RightIterator r( B.begin(j) );
371 
372  while( l != lend && r != rend )
373  {
374  if( l->index() < r->index() ) {
375  ++nonzeros[l->index()];
376  ++l;
377  }
378  else if( l->index() > r->index() ) {
379  ++nonzeros[r->index()];
380  ++r;
381  }
382  else {
383  ++nonzeros[l->index()];
384  ++l;
385  ++r;
386  }
387  }
388 
389  while( l != lend ) {
390  ++nonzeros[l->index()];
391  ++l;
392  }
393 
394  while( r != rend ) {
395  ++nonzeros[r->index()];
396  ++r;
397  }
398  }
399 
400  // Resizing the left-hand side sparse matrix
401  for( size_t i=0UL; i<m; ++i ) {
402  (~lhs).reserve( i, nonzeros[i] );
403  }
404 
405  // Performing the matrix addition
406  for( size_t j=0UL; j<n; ++j )
407  {
408  const LeftIterator lend( A.end(j) );
409  const RightIterator rend( B.end(j) );
410 
411  LeftIterator l( A.begin(j) );
412  RightIterator r( B.begin(j) );
413 
414  while( l != lend && r != rend )
415  {
416  if( l->index() < r->index() ) {
417  (~lhs).append( l->index(), j, l->value() );
418  ++l;
419  }
420  else if( l->index() > r->index() ) {
421  (~lhs).append( r->index(), j, r->value() );
422  ++r;
423  }
424  else {
425  (~lhs).append( l->index(), j, l->value()+r->value() );
426  ++l;
427  ++r;
428  }
429  }
430 
431  while( l != lend ) {
432  (~lhs).append( l->index(), j, l->value() );
433  ++l;
434  }
435 
436  while( r != rend ) {
437  (~lhs).append( r->index(), j, r->value() );
438  ++r;
439  }
440  }
441  }
443  //**********************************************************************************************
444 
445  //**Assignment to column-major sparse matrices**************************************************
458  template< typename MT > // Type of the target sparse matrix
459  friend inline void assign( SparseMatrix<MT,true>& lhs, const TSMatTSMatAddExpr& 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 
466  typedef typename RemoveReference<CT1>::Type::ConstIterator LeftIterator;
467  typedef typename RemoveReference<CT2>::Type::ConstIterator RightIterator;
468 
469  CT1 A( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse matrix operand
470  CT2 B( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse matrix operand
471 
472  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.lhs_.rows() , "Invalid number of rows" );
473  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.lhs_.columns(), "Invalid number of columns" );
474  BLAZE_INTERNAL_ASSERT( B.rows() == rhs.rhs_.rows() , "Invalid number of rows" );
475  BLAZE_INTERNAL_ASSERT( B.columns() == rhs.rhs_.columns(), "Invalid number of columns" );
476  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).rows() , "Invalid number of rows" );
477  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).columns() , "Invalid number of columns" );
478 
479  // Final memory allocation (based on the evaluated operands)
480  (~lhs).reserve( A.nonZeros() + B.nonZeros() );
481 
482  // Performing the matrix addition
483  for( size_t j=0UL; j<(~lhs).columns(); ++j )
484  {
485  const LeftIterator lend( A.end(j) );
486  const RightIterator rend( B.end(j) );
487 
488  LeftIterator l( A.begin(j) );
489  RightIterator r( B.begin(j) );
490 
491  while( l != lend && r != rend )
492  {
493  if( l->index() < r->index() ) {
494  (~lhs).append( l->index(), j, l->value() );
495  ++l;
496  }
497  else if( l->index() > r->index() ) {
498  (~lhs).append( r->index(), j, r->value() );
499  ++r;
500  }
501  else {
502  (~lhs).append( l->index(), j, l->value()+r->value() );
503  ++l;
504  ++r;
505  }
506  }
507 
508  while( l != lend ) {
509  (~lhs).append( l->index(), j, l->value() );
510  ++l;
511  }
512 
513  while( r != rend ) {
514  (~lhs).append( r->index(), j, r->value() );
515  ++r;
516  }
517 
518  (~lhs).finalize( j );
519  }
520  }
522  //**********************************************************************************************
523 
524  //**Addition assignment to dense matrices*******************************************************
537  template< typename MT // Type of the target dense matrix
538  , bool SO > // Storage order of the target dense matrix
539  friend inline void addAssign( DenseMatrix<MT,SO>& lhs, const TSMatTSMatAddExpr& rhs )
540  {
542 
543  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
544  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
545 
546  addAssign( ~lhs, rhs.lhs_ );
547  addAssign( ~lhs, rhs.rhs_ );
548  }
550  //**********************************************************************************************
551 
552  //**Addition assignment to sparse matrices******************************************************
553  // No special implementation for the addition assignment to sparse matrices.
554  //**********************************************************************************************
555 
556  //**Subtraction assignment to dense matrices****************************************************
569  template< typename MT // Type of the target dense matrix
570  , bool SO > // Storage order of the target dense matrix
571  friend inline void subAssign( DenseMatrix<MT,SO>& lhs, const TSMatTSMatAddExpr& rhs )
572  {
574 
575  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
576  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
577 
578  subAssign( ~lhs, rhs.lhs_ );
579  subAssign( ~lhs, rhs.rhs_ );
580  }
582  //**********************************************************************************************
583 
584  //**Subtraction assignment to sparse matrices***************************************************
585  // No special implementation for the subtraction assignment to sparse matrices.
586  //**********************************************************************************************
587 
588  //**Multiplication assignment to dense matrices*************************************************
589  // No special implementation for the multiplication assignment to dense matrices.
590  //**********************************************************************************************
591 
592  //**Multiplication assignment to sparse matrices************************************************
593  // No special implementation for the multiplication assignment to sparse matrices.
594  //**********************************************************************************************
595 
596  //**SMP assignment to dense matrices************************************************************
597  // No special implementation for the SMP assignment to dense matrices.
598  //**********************************************************************************************
599 
600  //**SMP assignment to sparse matrices***********************************************************
601  // No special implementation for the SMP assignment to sparse matrices.
602  //**********************************************************************************************
603 
604  //**SMP addition assignment to dense matrices***************************************************
619  template< typename MT // Type of the target dense matrix
620  , bool SO > // Storage order of the target dense matrix
621  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
622  smpAddAssign( DenseMatrix<MT,SO>& lhs, const TSMatTSMatAddExpr& rhs )
623  {
625 
626  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
627  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
628 
629  smpAddAssign( ~lhs, rhs.lhs_ );
630  smpAddAssign( ~lhs, rhs.rhs_ );
631  }
633  //**********************************************************************************************
634 
635  //**SMP addition assignment to sparse matrices**************************************************
636  // No special implementation for the SMP addition assignment to sparse matrices.
637  //**********************************************************************************************
638 
639  //**SMP subtraction assignment to dense matrices************************************************
654  template< typename MT // Type of the target dense matrix
655  , bool SO > // Storage order of the target dense matrix
656  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
657  smpSubAssign( DenseMatrix<MT,SO>& lhs, const TSMatTSMatAddExpr& rhs )
658  {
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
662  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
663 
664  smpSubAssign( ~lhs, rhs.lhs_ );
665  smpSubAssign( ~lhs, rhs.rhs_ );
666  }
668  //**********************************************************************************************
669 
670  //**SMP subtraction assignment to sparse matrices***********************************************
671  // No special implementation for the SMP subtraction assignment to sparse matrices.
672  //**********************************************************************************************
673 
674  //**SMP multiplication assignment to dense matrices*********************************************
675  // No special implementation for the SMP multiplication assignment to dense matrices.
676  //**********************************************************************************************
677 
678  //**SMP multiplication assignment to sparse matrices********************************************
679  // No special implementation for the SMP multiplication assignment to sparse matrices.
680  //**********************************************************************************************
681 
682  //**Compile time checks*************************************************************************
689  //**********************************************************************************************
690 };
691 //*************************************************************************************************
692 
693 
694 
695 
696 //=================================================================================================
697 //
698 // GLOBAL BINARY ARITHMETIC OPERATORS
699 //
700 //=================================================================================================
701 
702 //*************************************************************************************************
728 template< typename T1 // Type of the left-hand side sparse matrix
729  , typename T2 > // Type of the right-hand side sparse matrix
730 inline const TSMatTSMatAddExpr<T1,T2>
732 {
734 
735  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() )
736  throw std::invalid_argument( "Matrix sizes do not match" );
737 
738  return TSMatTSMatAddExpr<T1,T2>( ~lhs, ~rhs );
739 }
740 //*************************************************************************************************
741 
742 
743 
744 
745 //=================================================================================================
746 //
747 // EXPRESSION TRAIT SPECIALIZATIONS
748 //
749 //=================================================================================================
750 
751 //*************************************************************************************************
753 template< typename MT1, typename MT2, bool AF >
754 struct SubmatrixExprTrait< TSMatTSMatAddExpr<MT1,MT2>, AF >
755 {
756  public:
757  //**********************************************************************************************
758  typedef typename AddExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
759  , typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
760  //**********************************************************************************************
761 };
763 //*************************************************************************************************
764 
765 
766 //*************************************************************************************************
768 template< typename MT1, typename MT2 >
769 struct RowExprTrait< TSMatTSMatAddExpr<MT1,MT2> >
770 {
771  public:
772  //**********************************************************************************************
773  typedef typename AddExprTrait< typename RowExprTrait<const MT1>::Type
774  , typename RowExprTrait<const MT2>::Type >::Type Type;
775  //**********************************************************************************************
776 };
778 //*************************************************************************************************
779 
780 
781 //*************************************************************************************************
783 template< typename MT1, typename MT2 >
784 struct ColumnExprTrait< TSMatTSMatAddExpr<MT1,MT2> >
785 {
786  public:
787  //**********************************************************************************************
788  typedef typename AddExprTrait< typename ColumnExprTrait<const MT1>::Type
789  , typename ColumnExprTrait<const MT2>::Type >::Type Type;
790  //**********************************************************************************************
791 };
793 //*************************************************************************************************
794 
795 } // namespace blaze
796 
797 #endif
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatTSMatAddExpr.h:131
Evaluation of the return type of an addition expression.Via this type trait it is possible to evaluat...
Definition: AddExprTrait.h:103
AddTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TSMatTSMatAddExpr.h:130
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSMatTSMatAddExpr.h:132
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatTSMatAddExpr.h:175
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:96
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:145
ResultType::ElementType ElementType
Resulting element type.
Definition: TSMatTSMatAddExpr.h:133
LeftOperand lhs_
Left-hand side sparse matrix of the addition expression.
Definition: TSMatTSMatAddExpr.h:269
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4642
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
MT2::ReturnType RN2
Return type of the right-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:95
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: TSMatTSMatAddExpr.h:136
Header file for the ColumnExprTrait class template.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
Header file for the AddExprTrait 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:690
Header file for the Computation base class.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSMatTSMatAddExpr.h:250
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:142
Header file for the RequiresEvaluation type trait.
AddExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: TSMatTSMatAddExpr.h:110
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:93
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: TSMatTSMatAddExpr.h:207
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: TSMatTSMatAddExpr.h:218
Header file for the SparseMatrix base class.
Constraint on the data type.
void smpAddAssign(DenseMatrix< 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:122
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TSMatTSMatAddExpr.h:187
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 IsTemporary type trait class.
#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
Expression object for transpose sparse matrix-transpose sparse matrix additions.The TSMatTSMatAddExpr...
Definition: Forward.h:144
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
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:271
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSMatTSMatAddExpr.h:262
Constraints on the storage order of matrix types.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:92
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatTSMatAddExpr.h:139
Header file for the serial shim.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TSMatTSMatAddExpr.h:197
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:97
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
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.
Base template for the AddTrait class.
Definition: AddTrait.h:141
Header file for the addition trait.
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:301
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:331
Header file for the isDefault shim.
Header file for the MatMatAddExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatTSMatAddExpr.h:228
Header file for the RemoveReference type trait.
Header file for the IsComputation type trait class.
TSMatTSMatAddExpr< MT1, MT2 > This
Type of this TSMatTSMatAddExpr instance.
Definition: TSMatTSMatAddExpr.h:129
RightOperand rhs_
Right-hand side sparse matrix of the addition expression.
Definition: TSMatTSMatAddExpr.h:270
#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:2403
size_t columns(const Matrix< MT, SO > &m)
Returns the current number of columns of the matrix.
Definition: Matrix.h:170
Header file for basic type definitions.
Header file for the IsResizable type trait.
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:154
#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
TSMatTSMatAddExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TSMatTSMatAddExpr class.
Definition: TSMatTSMatAddExpr.h:159
RightOperand rightOperand() const
Returns the right-hand side transpose sparse matrix operand.
Definition: TSMatTSMatAddExpr.h:238
#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
MT1::ReturnType RN1
Return type of the left-hand side sparse matrix expression.
Definition: TSMatTSMatAddExpr.h:94
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.