All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SMatTransExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATTRANSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/EmptyType.h>
68 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/SelectType.h>
71 #include <blaze/util/Types.h>
74 
75 
76 namespace blaze {
77 
78 //=================================================================================================
79 //
80 // CLASS SMATTRANSEXPR
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
91 template< typename MT // Type of the sparse matrix
92  , bool SO > // Storage order
93 class SMatTransExpr : public SparseMatrix< SMatTransExpr<MT,SO>, SO >
94  , private MatTransExpr
95  , private SelectType< IsComputation<MT>::value, Computation, EmptyType >::Type
96 {
97  private:
98  //**Type definitions****************************************************************************
99  typedef typename MT::ResultType RT;
100  typedef typename MT::CompositeType CT;
101  //**********************************************************************************************
102 
103  //**Serial evaluation strategy******************************************************************
105 
111  enum { useAssign = RequiresEvaluation<MT>::value };
112 
114  template< typename MT2 >
116  struct UseAssign {
117  enum { value = useAssign };
118  };
120  //**********************************************************************************************
121 
122  //**Parallel evaluation strategy****************************************************************
124 
129  template< typename MT2 >
130  struct UseSMPAssign {
131  enum { value = MT2::smpAssignable && useAssign };
132  };
134  //**********************************************************************************************
135 
136  public:
137  //**Type definitions****************************************************************************
139  typedef typename MT::TransposeType ResultType;
140  typedef typename MT::OppositeType OppositeType;
141  typedef typename MT::ResultType TransposeType;
142  typedef typename MT::ElementType ElementType;
143  typedef typename MT::ReturnType ReturnType;
144 
147 
149  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
150  //**********************************************************************************************
151 
152  //**ConstIterator class definition**************************************************************
156  {
157  public:
158  //**Type definitions*************************************************************************
161 
162  typedef std::forward_iterator_tag IteratorCategory;
163  typedef typename std::iterator_traits<IteratorType>::value_type ValueType;
164  typedef typename std::iterator_traits<IteratorType>::pointer PointerType;
165  typedef typename std::iterator_traits<IteratorType>::reference ReferenceType;
166  typedef typename std::iterator_traits<IteratorType>::difference_type DifferenceType;
167 
168  // STL iterator requirements
174  //*******************************************************************************************
175 
176  //**Constructor******************************************************************************
180  : it_( it ) // Iterator over the elements of the sparse matrix expression
181  {}
182  //*******************************************************************************************
183 
184  //**Prefix increment operator****************************************************************
190  ++it_;
191  return *this;
192  }
193  //*******************************************************************************************
194 
195  //**Element access operator******************************************************************
200  inline const ValueType operator*() const {
201  return *it_;
202  }
203  //*******************************************************************************************
204 
205  //**Element access operator******************************************************************
210  inline const IteratorType operator->() const {
211  return it_;
212  }
213  //*******************************************************************************************
214 
215  //**Value function***************************************************************************
220  inline ReturnType value() const {
221  return it_->value();
222  }
223  //*******************************************************************************************
224 
225  //**Index function***************************************************************************
230  inline size_t index() const {
231  return it_->index();
232  }
233  //*******************************************************************************************
234 
235  //**Equality operator************************************************************************
241  inline bool operator==( const ConstIterator& rhs ) const {
242  return it_ == rhs.it_;
243  }
244  //*******************************************************************************************
245 
246  //**Inequality operator**********************************************************************
252  inline bool operator!=( const ConstIterator& rhs ) const {
253  return it_ != rhs.it_;
254  }
255  //*******************************************************************************************
256 
257  //**Subtraction operator*********************************************************************
263  inline DifferenceType operator-( const ConstIterator& rhs ) const {
264  return it_ - rhs.it_;
265  }
266  //*******************************************************************************************
267 
268  private:
269  //**Member variables*************************************************************************
271  //*******************************************************************************************
272  };
273  //**********************************************************************************************
274 
275  //**Compilation flags***************************************************************************
277  enum { smpAssignable = MT::smpAssignable };
278  //**********************************************************************************************
279 
280  //**Constructor*********************************************************************************
285  explicit inline SMatTransExpr( const MT& sm )
286  : sm_( sm )
287  {}
288  //**********************************************************************************************
289 
290  //**Access operator*****************************************************************************
297  inline ReturnType operator()( size_t i, size_t j ) const {
298  BLAZE_INTERNAL_ASSERT( i < sm_.columns(), "Invalid row access index" );
299  BLAZE_INTERNAL_ASSERT( j < sm_.rows() , "Invalid column access index" );
300  return sm_(j,i);
301  }
302  //**********************************************************************************************
303 
304  //**Begin function******************************************************************************
310  inline ConstIterator begin( size_t i ) const {
311  return sm_.begin(i);
312  }
313  //**********************************************************************************************
314 
315  //**End function********************************************************************************
321  inline ConstIterator end( size_t i ) const {
322  return sm_.end(i);
323  }
324  //**********************************************************************************************
325 
326  //**Rows function*******************************************************************************
331  inline size_t rows() const {
332  return sm_.columns();
333  }
334  //**********************************************************************************************
335 
336  //**Columns function****************************************************************************
341  inline size_t columns() const {
342  return sm_.rows();
343  }
344  //**********************************************************************************************
345 
346  //**NonZeros function***************************************************************************
351  inline size_t nonZeros() const {
352  return sm_.nonZeros();
353  }
354  //**********************************************************************************************
355 
356  //**NonZeros function***************************************************************************
362  inline size_t nonZeros( size_t i ) const {
363  return sm_.nonZeros( i );
364  }
365  //**********************************************************************************************
366 
367  //**Find function*******************************************************************************
374  inline ConstIterator find( size_t i, size_t j ) const {
376  return sm_.find( j, i );
377  }
378  //**********************************************************************************************
379 
380  //**LowerBound function*************************************************************************
387  inline ConstIterator lowerBound( size_t i, size_t j ) const {
389  return sm_.lowerBound( j, i );
390  }
391  //**********************************************************************************************
392 
393  //**UpperBound function*************************************************************************
400  inline ConstIterator upperBound( size_t i, size_t j ) const {
402  return sm_.upperBound( j, i );
403  }
404  //**********************************************************************************************
405 
406  //**Operand access******************************************************************************
411  inline Operand operand() const {
412  return sm_;
413  }
414  //**********************************************************************************************
415 
416  //**********************************************************************************************
422  template< typename T >
423  inline bool canAlias( const T* alias ) const {
424  return sm_.canAlias( alias );
425  }
426  //**********************************************************************************************
427 
428  //**********************************************************************************************
434  template< typename T >
435  inline bool isAliased( const T* alias ) const {
436  return sm_.isAliased( alias );
437  }
438  //**********************************************************************************************
439 
440  //**********************************************************************************************
445  inline bool canSMPAssign() const {
446  return sm_.canSMPAssign();
447  }
448  //**********************************************************************************************
449 
450  private:
451  //**Member variables****************************************************************************
453  //**********************************************************************************************
454 
455  //**Assignment to dense matrices****************************************************************
469  template< typename MT2 // Type of the target dense matrix
470  , bool SO2 > // Storage order of the target dense matrix
471  friend inline typename EnableIf< UseAssign<MT2> >::Type
472  assign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
473  {
475 
476  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
477  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
478 
479  DMatTransposer<MT2,!SO2> tmp( ~lhs );
480  assign( tmp, rhs.sm_ );
481  }
483  //**********************************************************************************************
484 
485  //**Assignment to sparse matrices***************************************************************
499  template< typename MT2 // Type of the target sparse matrix
500  , bool SO2 > // Storage order of the target sparse matrix
501  friend inline typename EnableIf< UseAssign<MT2> >::Type
502  assign( SparseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
503  {
505 
506  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
507  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
508 
509  SMatTransposer<MT2,!SO2> tmp( ~lhs );
510  assign( tmp, rhs.sm_ );
511  }
513  //**********************************************************************************************
514 
515  //**Addition assignment to dense matrices*******************************************************
529  template< typename MT2 // Type of the target dense matrix
530  , bool SO2 > // Storage order of the target dense matrix
531  friend inline typename EnableIf< UseAssign<MT2> >::Type
532  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
533  {
535 
536  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
537  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
538 
539  DMatTransposer<MT2,!SO2> tmp( ~lhs );
540  addAssign( tmp, rhs.sm_ );
541  }
543  //**********************************************************************************************
544 
545  //**Addition assignment to sparse matrices******************************************************
546  // No special implementation for the addition assignment to sparse matrices.
547  //**********************************************************************************************
548 
549  //**Subtraction assignment to dense matrices****************************************************
563  template< typename MT2 // Type of the target dense matrix
564  , bool SO2 > // Storage order of the target dense matrix
565  friend inline typename EnableIf< UseAssign<MT2> >::Type
566  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
567  {
569 
570  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
571  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
572 
573  DMatTransposer<MT2,!SO2> tmp( ~lhs );
574  subAssign( tmp, rhs.sm_ );
575  }
577  //**********************************************************************************************
578 
579  //**Subtraction assignment to sparse matrices***************************************************
580  // No special implementation for the subtraction assignment to sparse matrices.
581  //**********************************************************************************************
582 
583  //**Multiplication assignment to dense matrices*************************************************
584  // No special implementation for the multiplication assignment to dense matrices.
585  //**********************************************************************************************
586 
587  //**Multiplication assignment to sparse matrices************************************************
588  // No special implementation for the multiplication assignment to sparse matrices.
589  //**********************************************************************************************
590 
591  //**SMP assignment to dense matrices************************************************************
605  template< typename MT2 // Type of the target dense matrix
606  , bool SO2 > // Storage order of the target dense matrix
607  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
608  smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
609  {
611 
612  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
613  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
614 
615  DMatTransposer<MT2,!SO2> tmp( ~lhs );
616  smpAssign( tmp, rhs.sm_ );
617  }
619  //**********************************************************************************************
620 
621  //**SMP assignment to sparse matrices***********************************************************
635  template< typename MT2 // Type of the target sparse matrix
636  , bool SO2 > // Storage order of the target sparse matrix
637  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
638  smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
639  {
641 
642  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
643  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
644 
645  SMatTransposer<MT2,!SO2> tmp( ~lhs );
646  smpAssign( tmp, rhs.sm_ );
647  }
649  //**********************************************************************************************
650 
651  //**SMP addition assignment to dense matrices***************************************************
665  template< typename MT2 // Type of the target dense matrix
666  , bool SO2 > // Storage order of the target dense matrix
667  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
668  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
669  {
671 
672  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
673  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
674 
675  DMatTransposer<MT2,!SO2> tmp( ~lhs );
676  smpAddAssign( tmp, rhs.sm_ );
677  }
679  //**********************************************************************************************
680 
681  //**SMP addition assignment to sparse matrices**************************************************
682  // No special implementation for the SMP addition assignment to sparse matrices.
683  //**********************************************************************************************
684 
685  //**SMP subtraction assignment to dense matrices************************************************
700  template< typename MT2 // Type of the target dense matrix
701  , bool SO2 > // Storage order of the target dense matrix
702  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
703  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
704  {
706 
707  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
708  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
709 
710  DMatTransposer<MT2,!SO2> tmp( ~lhs );
711  smpSubAssign( tmp, rhs.sm_ );
712  }
714  //**********************************************************************************************
715 
716  //**SMP subtraction assignment to sparse matrices***********************************************
717  // No special implementation for the SMP subtraction assignment to sparse matrices.
718  //**********************************************************************************************
719 
720  //**SMP multiplication assignment to dense matrices*********************************************
721  // No special implementation for the SMP multiplication assignment to dense matrices.
722  //**********************************************************************************************
723 
724  //**SMP multiplication assignment to sparse matrices********************************************
725  // No special implementation for the SMP multiplication assignment to sparse matrices.
726  //**********************************************************************************************
727 
728  //**Trans function******************************************************************************
744  friend inline Operand trans( const SMatTransExpr<MT,SO>& sm )
745  {
747 
748  return sm.sm_;
749  }
751  //**********************************************************************************************
752 
753  //**Compile time checks*************************************************************************
758  //**********************************************************************************************
759 };
760 //*************************************************************************************************
761 
762 
763 
764 
765 //=================================================================================================
766 //
767 // GLOBAL OPERATORS
768 //
769 //=================================================================================================
770 
771 //*************************************************************************************************
786 template< typename MT // Type of the sparse matrix
787  , bool SO > // Storage order
789 {
791 
792  return SMatTransExpr<MT,!SO>( ~sm );
793 }
794 //*************************************************************************************************
795 
796 
797 
798 
799 //=================================================================================================
800 //
801 // ROWS SPECIALIZATIONS
802 //
803 //=================================================================================================
804 
805 //*************************************************************************************************
807 template< typename MT, bool SO >
808 struct Rows< SMatTransExpr<MT,SO> > : public Columns<MT>
809 {};
811 //*************************************************************************************************
812 
813 
814 
815 
816 //=================================================================================================
817 //
818 // COLUMNS SPECIALIZATIONS
819 //
820 //=================================================================================================
821 
822 //*************************************************************************************************
824 template< typename MT, bool SO >
825 struct Columns< SMatTransExpr<MT,SO> > : public Rows<MT>
826 {};
828 //*************************************************************************************************
829 
830 
831 
832 
833 //=================================================================================================
834 //
835 // ISSYMMETRIC SPECIALIZATIONS
836 //
837 //=================================================================================================
838 
839 //*************************************************************************************************
841 template< typename MT, bool SO >
842 struct IsSymmetric< SMatTransExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
843 {};
845 //*************************************************************************************************
846 
847 
848 
849 
850 //=================================================================================================
851 //
852 // ISLOWER SPECIALIZATIONS
853 //
854 //=================================================================================================
855 
856 //*************************************************************************************************
858 template< typename MT, bool SO >
859 struct IsLower< SMatTransExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
860 {};
862 //*************************************************************************************************
863 
864 
865 
866 
867 //=================================================================================================
868 //
869 // ISUPPER SPECIALIZATIONS
870 //
871 //=================================================================================================
872 
873 //*************************************************************************************************
875 template< typename MT, bool SO >
876 struct IsUpper< SMatTransExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
877 {};
879 //*************************************************************************************************
880 
881 
882 
883 
884 //=================================================================================================
885 //
886 // EXPRESSION TRAIT SPECIALIZATIONS
887 //
888 //=================================================================================================
889 
890 //*************************************************************************************************
892 template< typename MT, bool SO, bool AF >
893 struct SubmatrixExprTrait< SMatTransExpr<MT,SO>, AF >
894 {
895  public:
896  //**********************************************************************************************
897  typedef typename TransExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
898  //**********************************************************************************************
899 };
901 //*************************************************************************************************
902 
903 
904 //*************************************************************************************************
906 template< typename MT, bool SO >
907 struct RowExprTrait< SMatTransExpr<MT,SO> >
908 {
909  public:
910  //**********************************************************************************************
911  typedef typename TransExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
912  //**********************************************************************************************
913 };
915 //*************************************************************************************************
916 
917 
918 //*************************************************************************************************
920 template< typename MT, bool SO >
921 struct ColumnExprTrait< SMatTransExpr<MT,SO> >
922 {
923  public:
924  //**********************************************************************************************
925  typedef typename TransExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
926  //**********************************************************************************************
927 };
929 //*************************************************************************************************
930 
931 } // namespace blaze
932 
933 #endif
Header file for the sparse matrix transposer.
Header file for the Rows type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatTransExpr.h:252
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatTransExpr.h:160
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTransExpr.h:140
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransExpr.h:310
PointerType pointer
Pointer return type.
Definition: SMatTransExpr.h:171
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:242
Header file for the MatTransExpr base class.
Iterator over the elements of the sparse matrix transposition expression.
Definition: SMatTransExpr.h:155
Header file for the ColumnExprTrait class template.
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatTransExpr.h:100
Operand sm_
Sparse matrix of the transposition expression.
Definition: SMatTransExpr.h:452
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatTransExpr.h:263
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatTransExpr.h:400
Header file for the Computation base class.
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatTransExpr.h:99
Header file for the RequiresEvaluation type trait.
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying pointers.
Definition: SMatTransExpr.h:163
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2474
ReferenceType reference
Reference return type.
Definition: SMatTransExpr.h:172
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:107
Constraint on the data type.
Header file for the SparseMatrix base class.
Constraint on the data type.
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: SMatTransExpr.h:166
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: SMatTransExpr.h:141
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatTransExpr.h:374
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SMatTransExpr.h:143
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: SMatTransExpr.h:139
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: SMatTransExpr.h:165
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatTransExpr.h:423
Header file for the IsSymmetric type trait.
SMatTransExpr(const MT &sm)
Constructor for the SMatTransExpr class.
Definition: SMatTransExpr.h:285
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatTransExpr.h:270
MT::ElementType ElementType
Resulting element type.
Definition: SMatTransExpr.h:142
IteratorCategory iterator_category
The iterator category.
Definition: SMatTransExpr.h:169
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Columns type trait.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatTransExpr.h:341
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:71
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SMatTransExpr.h:179
Header file for the IsLower type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2475
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Constraint on the data type.
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 EnableIf class template.
Header file for the dense matrix transposer.
const IteratorType operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatTransExpr.h:210
Expression object for the transposition of a sparse matrix.The SMatTransposer class is a wrapper obje...
Definition: Forward.h:103
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTransExpr.h:297
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the sparse matrix expression.
Definition: SMatTransExpr.h:149
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatTransExpr.h:445
SelectType< useAssign, const ResultType, const SMatTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatTransExpr.h:146
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
SMatTransExpr< MT, SO > This
Type of this SMatTransExpr instance.
Definition: SMatTransExpr.h:138
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: SMatTransExpr.h:164
Header file for the TransExprTrait class template.
Operand operand() const
Returns the sparse matrix operand.
Definition: SMatTransExpr.h:411
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatTransExpr.h:351
#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:118
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatTransExpr.h:331
Header file for the RemoveReference type trait.
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatTransExpr.h:162
DifferenceType difference_type
Difference between two iterators.
Definition: SMatTransExpr.h:173
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatTransExpr.h:220
size_t index() const
Access to the current index of the sparse element.
Definition: SMatTransExpr.h:230
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatTransExpr.h:387
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatTransExpr.h:241
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:932
Header file for the IsComputation type trait class.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: SMatTransExpr.h:362
#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
Expression object for sparse matrix transpositions.The SMatTransExpr class represents the compile tim...
Definition: Forward.h:102
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for the IsTrue value trait.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransExpr.h:321
Header file for basic type definitions.
const ValueType operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatTransExpr.h:200
ValueType value_type
Type of the underlying pointers.
Definition: SMatTransExpr.h:170
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatTransExpr.h:189
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatTransExpr.h:435
Header file for the IsUpper type trait.
Header file for the empty type.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849