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>
69 #include <blaze/util/Assert.h>
71 #include <blaze/util/EmptyType.h>
72 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/SelectType.h>
75 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS SMATTRANSEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename MT // Type of the sparse matrix
96  , bool SO > // Storage order
97 class SMatTransExpr : public SparseMatrix< SMatTransExpr<MT,SO>, SO >
98  , private MatTransExpr
99  , private SelectType< IsComputation<MT>::value, Computation, EmptyType >::Type
100 {
101  private:
102  //**Type definitions****************************************************************************
103  typedef typename MT::ResultType RT;
104  typedef typename MT::CompositeType CT;
105  //**********************************************************************************************
106 
107  //**Serial evaluation strategy******************************************************************
109 
115  enum { useAssign = RequiresEvaluation<MT>::value };
116 
118  template< typename MT2 >
120  struct UseAssign {
121  enum { value = useAssign };
122  };
124  //**********************************************************************************************
125 
126  //**Parallel evaluation strategy****************************************************************
128 
133  template< typename MT2 >
134  struct UseSMPAssign {
135  enum { value = MT2::smpAssignable && useAssign };
136  };
138  //**********************************************************************************************
139 
140  public:
141  //**Type definitions****************************************************************************
143  typedef typename MT::TransposeType ResultType;
144  typedef typename MT::OppositeType OppositeType;
145  typedef typename MT::ResultType TransposeType;
146  typedef typename MT::ElementType ElementType;
147  typedef typename MT::ReturnType ReturnType;
148 
151 
153  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
154  //**********************************************************************************************
155 
156  //**ConstIterator class definition**************************************************************
160  {
161  public:
162  //**Type definitions*************************************************************************
165 
166  typedef std::forward_iterator_tag IteratorCategory;
167  typedef typename std::iterator_traits<IteratorType>::value_type ValueType;
168  typedef typename std::iterator_traits<IteratorType>::pointer PointerType;
169  typedef typename std::iterator_traits<IteratorType>::reference ReferenceType;
170  typedef typename std::iterator_traits<IteratorType>::difference_type DifferenceType;
171 
172  // STL iterator requirements
173  typedef IteratorCategory iterator_category;
174  typedef ValueType value_type;
175  typedef PointerType pointer;
176  typedef ReferenceType reference;
177  typedef DifferenceType difference_type;
178  //*******************************************************************************************
179 
180  //**Constructor******************************************************************************
183  inline ConstIterator( IteratorType it )
184  : it_( it ) // Iterator over the elements of the sparse matrix expression
185  {}
186  //*******************************************************************************************
187 
188  //**Prefix increment operator****************************************************************
194  ++it_;
195  return *this;
196  }
197  //*******************************************************************************************
198 
199  //**Element access operator******************************************************************
204  inline const ValueType operator*() const {
205  return *it_;
206  }
207  //*******************************************************************************************
208 
209  //**Element access operator******************************************************************
214  inline const IteratorType operator->() const {
215  return it_;
216  }
217  //*******************************************************************************************
218 
219  //**Value function***************************************************************************
224  inline ReturnType value() const {
225  return it_->value();
226  }
227  //*******************************************************************************************
228 
229  //**Index function***************************************************************************
234  inline size_t index() const {
235  return it_->index();
236  }
237  //*******************************************************************************************
238 
239  //**Equality operator************************************************************************
245  inline bool operator==( const ConstIterator& rhs ) const {
246  return it_ == rhs.it_;
247  }
248  //*******************************************************************************************
249 
250  //**Inequality operator**********************************************************************
256  inline bool operator!=( const ConstIterator& rhs ) const {
257  return it_ != rhs.it_;
258  }
259  //*******************************************************************************************
260 
261  //**Subtraction operator*********************************************************************
267  inline DifferenceType operator-( const ConstIterator& rhs ) const {
268  return it_ - rhs.it_;
269  }
270  //*******************************************************************************************
271 
272  private:
273  //**Member variables*************************************************************************
274  IteratorType it_;
275  //*******************************************************************************************
276  };
277  //**********************************************************************************************
278 
279  //**Compilation flags***************************************************************************
281  enum { smpAssignable = MT::smpAssignable };
282  //**********************************************************************************************
283 
284  //**Constructor*********************************************************************************
289  explicit inline SMatTransExpr( const MT& sm )
290  : sm_( sm )
291  {}
292  //**********************************************************************************************
293 
294  //**Access operator*****************************************************************************
301  inline ReturnType operator()( size_t i, size_t j ) const {
302  BLAZE_INTERNAL_ASSERT( i < sm_.columns(), "Invalid row access index" );
303  BLAZE_INTERNAL_ASSERT( j < sm_.rows() , "Invalid column access index" );
304  return sm_(j,i);
305  }
306  //**********************************************************************************************
307 
308  //**Begin function******************************************************************************
314  inline ConstIterator begin( size_t i ) const {
315  return sm_.begin(i);
316  }
317  //**********************************************************************************************
318 
319  //**End function********************************************************************************
325  inline ConstIterator end( size_t i ) const {
326  return sm_.end(i);
327  }
328  //**********************************************************************************************
329 
330  //**Rows function*******************************************************************************
335  inline size_t rows() const {
336  return sm_.columns();
337  }
338  //**********************************************************************************************
339 
340  //**Columns function****************************************************************************
345  inline size_t columns() const {
346  return sm_.rows();
347  }
348  //**********************************************************************************************
349 
350  //**NonZeros function***************************************************************************
355  inline size_t nonZeros() const {
356  return sm_.nonZeros();
357  }
358  //**********************************************************************************************
359 
360  //**NonZeros function***************************************************************************
366  inline size_t nonZeros( size_t i ) const {
367  return sm_.nonZeros( i );
368  }
369  //**********************************************************************************************
370 
371  //**Find function*******************************************************************************
378  inline ConstIterator find( size_t i, size_t j ) const {
380  return sm_.find( j, i );
381  }
382  //**********************************************************************************************
383 
384  //**LowerBound function*************************************************************************
391  inline ConstIterator lowerBound( size_t i, size_t j ) const {
393  return sm_.lowerBound( j, i );
394  }
395  //**********************************************************************************************
396 
397  //**UpperBound function*************************************************************************
404  inline ConstIterator upperBound( size_t i, size_t j ) const {
406  return sm_.upperBound( j, i );
407  }
408  //**********************************************************************************************
409 
410  //**Operand access******************************************************************************
415  inline Operand operand() const {
416  return sm_;
417  }
418  //**********************************************************************************************
419 
420  //**********************************************************************************************
426  template< typename T >
427  inline bool canAlias( const T* alias ) const {
428  return sm_.canAlias( alias );
429  }
430  //**********************************************************************************************
431 
432  //**********************************************************************************************
438  template< typename T >
439  inline bool isAliased( const T* alias ) const {
440  return sm_.isAliased( alias );
441  }
442  //**********************************************************************************************
443 
444  //**********************************************************************************************
449  inline bool canSMPAssign() const {
450  return sm_.canSMPAssign();
451  }
452  //**********************************************************************************************
453 
454  private:
455  //**Member variables****************************************************************************
456  Operand sm_;
457  //**********************************************************************************************
458 
459  //**Assignment to dense matrices****************************************************************
473  template< typename MT2 // Type of the target dense matrix
474  , bool SO2 > // Storage order of the target dense matrix
475  friend inline typename EnableIf< UseAssign<MT2> >::Type
476  assign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
477  {
479 
480  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
481  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
482 
483  DMatTransposer<MT2,!SO2> tmp( ~lhs );
484  assign( tmp, rhs.sm_ );
485  }
487  //**********************************************************************************************
488 
489  //**Assignment to sparse matrices***************************************************************
503  template< typename MT2 // Type of the target sparse matrix
504  , bool SO2 > // Storage order of the target sparse matrix
505  friend inline typename EnableIf< UseAssign<MT2> >::Type
506  assign( SparseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
507  {
509 
510  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
511  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
512 
513  SMatTransposer<MT2,!SO2> tmp( ~lhs );
514  assign( tmp, rhs.sm_ );
515  }
517  //**********************************************************************************************
518 
519  //**Addition assignment to dense matrices*******************************************************
533  template< typename MT2 // Type of the target dense matrix
534  , bool SO2 > // Storage order of the target dense matrix
535  friend inline typename EnableIf< UseAssign<MT2> >::Type
536  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
537  {
539 
540  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
541  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
542 
543  DMatTransposer<MT2,!SO2> tmp( ~lhs );
544  addAssign( tmp, rhs.sm_ );
545  }
547  //**********************************************************************************************
548 
549  //**Addition assignment to sparse matrices******************************************************
550  // No special implementation for the addition assignment to sparse matrices.
551  //**********************************************************************************************
552 
553  //**Subtraction assignment to dense matrices****************************************************
567  template< typename MT2 // Type of the target dense matrix
568  , bool SO2 > // Storage order of the target dense matrix
569  friend inline typename EnableIf< UseAssign<MT2> >::Type
570  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
571  {
573 
574  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
575  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
576 
577  DMatTransposer<MT2,!SO2> tmp( ~lhs );
578  subAssign( tmp, rhs.sm_ );
579  }
581  //**********************************************************************************************
582 
583  //**Subtraction assignment to sparse matrices***************************************************
584  // No special implementation for the subtraction assignment to sparse matrices.
585  //**********************************************************************************************
586 
587  //**Multiplication assignment to dense matrices*************************************************
588  // No special implementation for the multiplication assignment to dense matrices.
589  //**********************************************************************************************
590 
591  //**Multiplication assignment to sparse matrices************************************************
592  // No special implementation for the multiplication assignment to sparse matrices.
593  //**********************************************************************************************
594 
595  //**SMP assignment to dense matrices************************************************************
609  template< typename MT2 // Type of the target dense matrix
610  , bool SO2 > // Storage order of the target dense matrix
611  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
612  smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
613  {
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
617  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
618 
619  DMatTransposer<MT2,!SO2> tmp( ~lhs );
620  smpAssign( tmp, rhs.sm_ );
621  }
623  //**********************************************************************************************
624 
625  //**SMP assignment to sparse matrices***********************************************************
639  template< typename MT2 // Type of the target sparse matrix
640  , bool SO2 > // Storage order of the target sparse matrix
641  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
642  smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
643  {
645 
646  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
647  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
648 
649  SMatTransposer<MT2,!SO2> tmp( ~lhs );
650  smpAssign( tmp, rhs.sm_ );
651  }
653  //**********************************************************************************************
654 
655  //**SMP addition assignment to dense matrices***************************************************
669  template< typename MT2 // Type of the target dense matrix
670  , bool SO2 > // Storage order of the target dense matrix
671  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
672  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
673  {
675 
676  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
677  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
678 
679  DMatTransposer<MT2,!SO2> tmp( ~lhs );
680  smpAddAssign( tmp, rhs.sm_ );
681  }
683  //**********************************************************************************************
684 
685  //**SMP addition assignment to sparse matrices**************************************************
686  // No special implementation for the SMP addition assignment to sparse matrices.
687  //**********************************************************************************************
688 
689  //**SMP subtraction assignment to dense matrices************************************************
704  template< typename MT2 // Type of the target dense matrix
705  , bool SO2 > // Storage order of the target dense matrix
706  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
707  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatTransExpr& rhs )
708  {
710 
711  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
712  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
713 
714  DMatTransposer<MT2,!SO2> tmp( ~lhs );
715  smpSubAssign( tmp, rhs.sm_ );
716  }
718  //**********************************************************************************************
719 
720  //**SMP subtraction assignment to sparse matrices***********************************************
721  // No special implementation for the SMP subtraction assignment to sparse matrices.
722  //**********************************************************************************************
723 
724  //**SMP multiplication assignment to dense matrices*********************************************
725  // No special implementation for the SMP multiplication assignment to dense matrices.
726  //**********************************************************************************************
727 
728  //**SMP multiplication assignment to sparse matrices********************************************
729  // No special implementation for the SMP multiplication assignment to sparse matrices.
730  //**********************************************************************************************
731 
732  //**Trans function******************************************************************************
748  friend inline Operand trans( const SMatTransExpr<MT,SO>& sm )
749  {
751 
752  return sm.sm_;
753  }
755  //**********************************************************************************************
756 
757  //**Compile time checks*************************************************************************
762  //**********************************************************************************************
763 };
764 //*************************************************************************************************
765 
766 
767 
768 
769 //=================================================================================================
770 //
771 // GLOBAL OPERATORS
772 //
773 //=================================================================================================
774 
775 //*************************************************************************************************
790 template< typename MT // Type of the sparse matrix
791  , bool SO > // Storage order
793 {
795 
796  return SMatTransExpr<MT,!SO>( ~sm );
797 }
798 //*************************************************************************************************
799 
800 
801 
802 
803 //=================================================================================================
804 //
805 // ROWS SPECIALIZATIONS
806 //
807 //=================================================================================================
808 
809 //*************************************************************************************************
811 template< typename MT, bool SO >
812 struct Rows< SMatTransExpr<MT,SO> > : public Columns<MT>
813 {};
815 //*************************************************************************************************
816 
817 
818 
819 
820 //=================================================================================================
821 //
822 // COLUMNS SPECIALIZATIONS
823 //
824 //=================================================================================================
825 
826 //*************************************************************************************************
828 template< typename MT, bool SO >
829 struct Columns< SMatTransExpr<MT,SO> > : public Rows<MT>
830 {};
832 //*************************************************************************************************
833 
834 
835 
836 
837 //=================================================================================================
838 //
839 // ISSYMMETRIC SPECIALIZATIONS
840 //
841 //=================================================================================================
842 
843 //*************************************************************************************************
845 template< typename MT, bool SO >
846 struct IsSymmetric< SMatTransExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
847 {};
849 //*************************************************************************************************
850 
851 
852 
853 
854 //=================================================================================================
855 //
856 // ISLOWER SPECIALIZATIONS
857 //
858 //=================================================================================================
859 
860 //*************************************************************************************************
862 template< typename MT, bool SO >
863 struct IsLower< SMatTransExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
864 {};
866 //*************************************************************************************************
867 
868 
869 
870 
871 //=================================================================================================
872 //
873 // ISUNILOWER SPECIALIZATIONS
874 //
875 //=================================================================================================
876 
877 //*************************************************************************************************
879 template< typename MT, bool SO >
880 struct IsUniLower< SMatTransExpr<MT,SO> > : public IsTrue< IsUniUpper<MT>::value >
881 {};
883 //*************************************************************************************************
884 
885 
886 
887 
888 //=================================================================================================
889 //
890 // ISSTRICTLYLOWER SPECIALIZATIONS
891 //
892 //=================================================================================================
893 
894 //*************************************************************************************************
896 template< typename MT, bool SO >
897 struct IsStrictlyLower< SMatTransExpr<MT,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
898 {};
900 //*************************************************************************************************
901 
902 
903 
904 
905 //=================================================================================================
906 //
907 // ISUPPER SPECIALIZATIONS
908 //
909 //=================================================================================================
910 
911 //*************************************************************************************************
913 template< typename MT, bool SO >
914 struct IsUpper< SMatTransExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
915 {};
917 //*************************************************************************************************
918 
919 
920 
921 
922 //=================================================================================================
923 //
924 // ISUNIUPPER SPECIALIZATIONS
925 //
926 //=================================================================================================
927 
928 //*************************************************************************************************
930 template< typename MT, bool SO >
931 struct IsUniUpper< SMatTransExpr<MT,SO> > : public IsTrue< IsUniLower<MT>::value >
932 {};
934 //*************************************************************************************************
935 
936 
937 
938 
939 //=================================================================================================
940 //
941 // ISSTRICTLYUPPER SPECIALIZATIONS
942 //
943 //=================================================================================================
944 
945 //*************************************************************************************************
947 template< typename MT, bool SO >
948 struct IsStrictlyUpper< SMatTransExpr<MT,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
949 {};
951 //*************************************************************************************************
952 
953 
954 
955 
956 //=================================================================================================
957 //
958 // EXPRESSION TRAIT SPECIALIZATIONS
959 //
960 //=================================================================================================
961 
962 //*************************************************************************************************
964 template< typename MT, bool SO, bool AF >
965 struct SubmatrixExprTrait< SMatTransExpr<MT,SO>, AF >
966 {
967  public:
968  //**********************************************************************************************
969  typedef typename TransExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
970  //**********************************************************************************************
971 };
973 //*************************************************************************************************
974 
975 
976 //*************************************************************************************************
978 template< typename MT, bool SO >
979 struct RowExprTrait< SMatTransExpr<MT,SO> >
980 {
981  public:
982  //**********************************************************************************************
983  typedef typename TransExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
984  //**********************************************************************************************
985 };
987 //*************************************************************************************************
988 
989 
990 //*************************************************************************************************
992 template< typename MT, bool SO >
993 struct ColumnExprTrait< SMatTransExpr<MT,SO> >
994 {
995  public:
996  //**********************************************************************************************
997  typedef typename TransExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
998  //**********************************************************************************************
999 };
1001 //*************************************************************************************************
1002 
1003 } // namespace blaze
1004 
1005 #endif
Operand operand() const
Returns the sparse matrix operand.
Definition: SMatTransExpr.h:415
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatTransExpr.h:224
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatTransExpr.h:355
Header file for the sparse matrix transposer.
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SMatTransExpr.h:183
Header file for basic type definitions.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransExpr.h:314
#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
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatTransExpr.h:427
Header file for the MatTransExpr base class.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatTransExpr.h:335
Iterator over the elements of the sparse matrix transposition expression.
Definition: SMatTransExpr.h:159
Header file for the ColumnExprTrait class template.
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: SMatTransExpr.h:145
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
const ValueType operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatTransExpr.h:204
Header file for the Computation base class.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransExpr.h:325
Header file for the RequiresEvaluation type trait.
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2503
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTransExpr.h:301
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.
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: SMatTransExpr.h:169
SMatTransExpr(const MT &sm)
Constructor for the SMatTransExpr class.
Definition: SMatTransExpr.h:289
Constraint on the data type.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SMatTransExpr.h:147
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
const IteratorType operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatTransExpr.h:214
Operand sm_
Sparse matrix of the transposition expression.
Definition: SMatTransExpr.h:456
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatTransExpr.h:166
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatTransExpr.h:245
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:391
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatTransExpr.h:274
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying pointers.
Definition: SMatTransExpr.h:167
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.
SMatTransExpr< MT, SO > This
Type of this SMatTransExpr instance.
Definition: SMatTransExpr.h:142
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:72
Header file for the IsLower type trait.
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: SMatTransExpr.h:170
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatTransExpr.h:449
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: SMatTransExpr.h:366
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraints on the storage order of matrix types.
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatTransExpr.h:404
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatTransExpr.h:439
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.
MT::ElementType ElementType
Resulting element type.
Definition: SMatTransExpr.h:146
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
IteratorCategory iterator_category
The iterator category.
Definition: SMatTransExpr.h:173
Header file for the dense matrix transposer.
Expression object for the transposition of a sparse matrix.The SMatTransposer class is a wrapper obje...
Definition: Forward.h:103
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:2506
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatTransExpr.h:193
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
DifferenceType difference_type
Difference between two iterators.
Definition: SMatTransExpr.h:177
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
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatTransExpr.h:104
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
SelectType< useAssign, const ResultType, const SMatTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatTransExpr.h:150
Header file for the TransExprTrait class template.
#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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatTransExpr.h:267
Header file for the RemoveReference type trait.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the sparse matrix expression.
Definition: SMatTransExpr.h:153
size_t index() const
Access to the current index of the sparse element.
Definition: SMatTransExpr.h:234
PointerType pointer
Pointer return type.
Definition: SMatTransExpr.h:175
ValueType value_type
Type of the underlying pointers.
Definition: SMatTransExpr.h:174
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:937
Header file for the IsComputation type trait class.
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatTransExpr.h:164
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: SMatTransExpr.h:143
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
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:2502
Header file for the IsTrue value trait.
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatTransExpr.h:378
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTransExpr.h:144
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatTransExpr.h:256
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: SMatTransExpr.h:168
Header file for the IsUpper type trait.
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatTransExpr.h:103
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
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatTransExpr.h:345
ReferenceType reference
Reference return type.
Definition: SMatTransExpr.h:176
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