DMatTransExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
67 #include <blaze/system/Inline.h>
68 #include <blaze/util/Assert.h>
70 #include <blaze/util/EmptyType.h>
71 #include <blaze/util/EnableIf.h>
73 #include <blaze/util/SelectType.h>
74 #include <blaze/util/Types.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS DMATTRANSEXPR
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename MT // Type of the dense matrix
94  , bool SO > // Storage order
95 class DMatTransExpr : public DenseMatrix< DMatTransExpr<MT,SO>, SO >
96  , private MatTransExpr
97  , private SelectType< IsComputation<MT>::value, Computation, EmptyType >::Type
98 {
99  private:
100  //**Type definitions****************************************************************************
101  typedef typename MT::ResultType RT;
102  typedef typename MT::CompositeType CT;
103  //**********************************************************************************************
104 
105  //**Serial evaluation strategy******************************************************************
107 
113  enum { useAssign = RequiresEvaluation<MT>::value };
114 
116  template< typename MT2 >
118  struct UseAssign {
119  enum { value = useAssign };
120  };
122  //**********************************************************************************************
123 
124  //**Parallel evaluation strategy****************************************************************
126 
131  template< typename MT2 >
132  struct UseSMPAssign {
133  enum { value = MT2::smpAssignable && useAssign };
134  };
136  //**********************************************************************************************
137 
138  public:
139  //**Type definitions****************************************************************************
141  typedef typename MT::TransposeType ResultType;
143  typedef typename MT::ResultType TransposeType;
144  typedef typename MT::ElementType ElementType;
146  typedef typename MT::ReturnType ReturnType;
147 
150 
152  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
153  //**********************************************************************************************
154 
155  //**ConstIterator class definition**************************************************************
159  {
160  public:
161  //**Type definitions*************************************************************************
162  typedef std::random_access_iterator_tag IteratorCategory;
163  typedef ElementType ValueType;
164  typedef ElementType* PointerType;
165  typedef ElementType& ReferenceType;
167 
168  // STL iterator requirements
169  typedef IteratorCategory iterator_category;
170  typedef ValueType value_type;
171  typedef PointerType pointer;
172  typedef ReferenceType reference;
173  typedef DifferenceType difference_type;
174 
176  typedef typename MT::ConstIterator IteratorType;
177  //*******************************************************************************************
178 
179  //**Constructor******************************************************************************
184  explicit inline ConstIterator( IteratorType iterator )
185  : iterator_( iterator ) // Iterator to the current element
186  {}
187  //*******************************************************************************************
188 
189  //**Addition assignment operator*************************************************************
195  inline ConstIterator& operator+=( size_t inc ) {
196  iterator_ += inc;
197  return *this;
198  }
199  //*******************************************************************************************
200 
201  //**Subtraction assignment operator**********************************************************
207  inline ConstIterator& operator-=( size_t dec ) {
208  iterator_ -= dec;
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Prefix increment operator****************************************************************
219  ++iterator_;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Postfix increment operator***************************************************************
229  inline const ConstIterator operator++( int ) {
230  return ConstIterator( iterator_++ );
231  }
232  //*******************************************************************************************
233 
234  //**Prefix decrement operator****************************************************************
240  --iterator_;
241  return *this;
242  }
243  //*******************************************************************************************
244 
245  //**Postfix decrement operator***************************************************************
250  inline const ConstIterator operator--( int ) {
251  return ConstIterator( iterator_-- );
252  }
253  //*******************************************************************************************
254 
255  //**Element access operator******************************************************************
260  inline ReturnType operator*() const {
261  return *iterator_;
262  }
263  //*******************************************************************************************
264 
265  //**Load function****************************************************************************
270  inline IntrinsicType load() const {
271  return iterator_.load();
272  }
273  //*******************************************************************************************
274 
275  //**Equality operator************************************************************************
281  inline bool operator==( const ConstIterator& rhs ) const {
282  return iterator_ == rhs.iterator_;
283  }
284  //*******************************************************************************************
285 
286  //**Inequality operator**********************************************************************
292  inline bool operator!=( const ConstIterator& rhs ) const {
293  return iterator_ != rhs.iterator_;
294  }
295  //*******************************************************************************************
296 
297  //**Less-than operator***********************************************************************
303  inline bool operator<( const ConstIterator& rhs ) const {
304  return iterator_ < rhs.iterator_;
305  }
306  //*******************************************************************************************
307 
308  //**Greater-than operator********************************************************************
314  inline bool operator>( const ConstIterator& rhs ) const {
315  return iterator_ > rhs.iterator_;
316  }
317  //*******************************************************************************************
318 
319  //**Less-or-equal-than operator**************************************************************
325  inline bool operator<=( const ConstIterator& rhs ) const {
326  return iterator_ <= rhs.iterator_;
327  }
328  //*******************************************************************************************
329 
330  //**Greater-or-equal-than operator***********************************************************
336  inline bool operator>=( const ConstIterator& rhs ) const {
337  return iterator_ >= rhs.iterator_;
338  }
339  //*******************************************************************************************
340 
341  //**Subtraction operator*********************************************************************
347  inline DifferenceType operator-( const ConstIterator& rhs ) const {
348  return iterator_ - rhs.iterator_;
349  }
350  //*******************************************************************************************
351 
352  //**Addition operator************************************************************************
359  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
360  return ConstIterator( it.iterator_ + inc );
361  }
362  //*******************************************************************************************
363 
364  //**Addition operator************************************************************************
371  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
372  return ConstIterator( it.iterator_ + inc );
373  }
374  //*******************************************************************************************
375 
376  //**Subtraction operator*********************************************************************
383  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
384  return ConstIterator( it.iterator_ - dec );
385  }
386  //*******************************************************************************************
387 
388  private:
389  //**Member variables*************************************************************************
390  IteratorType iterator_;
391  //*******************************************************************************************
392  };
393  //**********************************************************************************************
394 
395  //**Compilation flags***************************************************************************
397  enum { vectorizable = MT::vectorizable };
398 
400  enum { smpAssignable = MT::smpAssignable };
401  //**********************************************************************************************
402 
403  //**Constructor*********************************************************************************
408  explicit inline DMatTransExpr( const MT& dm )
409  : dm_( dm ) // Dense matrix of the transposition expression
410  {}
411  //**********************************************************************************************
412 
413  //**Access operator*****************************************************************************
420  inline ReturnType operator()( size_t i, size_t j ) const {
421  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
422  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
423  return dm_(j,i);
424  }
425  //**********************************************************************************************
426 
427  //**Load function*******************************************************************************
434  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t i, size_t j ) const {
435  typedef IntrinsicTrait<ElementType> IT;
436  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
437  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
438  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
439  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
440  return dm_.load(j,i);
441  }
442  //**********************************************************************************************
443 
444  //**Low-level data access***********************************************************************
449  inline const ElementType* data() const {
450  return dm_.data();
451  }
452  //**********************************************************************************************
453 
454  //**Begin function******************************************************************************
460  inline ConstIterator begin( size_t i ) const {
461  return ConstIterator( dm_.begin(i) );
462  }
463  //**********************************************************************************************
464 
465  //**End function********************************************************************************
471  inline ConstIterator end( size_t i ) const {
472  return ConstIterator( dm_.end(i) );
473  }
474  //**********************************************************************************************
475 
476  //**Rows function*******************************************************************************
481  inline size_t rows() const {
482  return dm_.columns();
483  }
484  //**********************************************************************************************
485 
486  //**Columns function****************************************************************************
491  inline size_t columns() const {
492  return dm_.rows();
493  }
494  //**********************************************************************************************
495 
496  //**Spacing function****************************************************************************
501  inline size_t spacing() const {
502  return dm_.spacing();
503  }
504  //**********************************************************************************************
505 
506  //**NonZeros function***************************************************************************
511  inline size_t nonZeros() const {
512  return dm_.nonZeros();
513  }
514  //**********************************************************************************************
515 
516  //**NonZeros function***************************************************************************
522  inline size_t nonZeros( size_t i ) const {
523  return dm_.nonZeros( i );
524  }
525  //**********************************************************************************************
526 
527  //**Operand access******************************************************************************
532  inline Operand operand() const {
533  return dm_;
534  }
535  //**********************************************************************************************
536 
537  //**********************************************************************************************
543  template< typename T >
544  inline bool canAlias( const T* alias ) const {
545  return dm_.canAlias( alias );
546  }
547  //**********************************************************************************************
548 
549  //**********************************************************************************************
555  template< typename T >
556  inline bool isAliased( const T* alias ) const {
557  return dm_.isAliased( alias );
558  }
559  //**********************************************************************************************
560 
561  //**********************************************************************************************
566  inline bool isAligned() const {
567  return dm_.isAligned();
568  }
569  //**********************************************************************************************
570 
571  //**********************************************************************************************
576  inline bool canSMPAssign() const {
577  return dm_.canSMPAssign();
578  }
579  //**********************************************************************************************
580 
581  private:
582  //**Member variables****************************************************************************
583  Operand dm_;
584  //**********************************************************************************************
585 
586  //**Assignment to dense matrices****************************************************************
600  template< typename MT2 // Type of the target dense matrix
601  , bool SO2 > // Storage order of the target dense matrix
602  friend inline typename EnableIf< UseAssign<MT2> >::Type
603  assign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
604  {
606 
607  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
608  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
609 
610  DMatTransposer<MT2,!SO2> tmp( ~lhs );
611  assign( tmp, rhs.dm_ );
612  }
614  //**********************************************************************************************
615 
616  //**Assignment to sparse matrices***************************************************************
630  template< typename MT2 // Type of the target sparse matrix
631  , bool SO2 > // Storage order of the target sparse matrix
632  friend inline typename EnableIf< UseAssign<MT2> >::Type
633  assign( SparseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
634  {
636 
638 
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  const TmpType tmp( serial( rhs ) );
650  assign( ~lhs, tmp );
651  }
653  //**********************************************************************************************
654 
655  //**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< UseAssign<MT2> >::Type
672  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& 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  addAssign( tmp, rhs.dm_ );
681  }
683  //**********************************************************************************************
684 
685  //**Addition assignment to sparse matrices******************************************************
686  // No special implementation for the addition assignment to sparse matrices.
687  //**********************************************************************************************
688 
689  //**Subtraction assignment to dense matrices****************************************************
703  template< typename MT2 // Type of the target dense matrix
704  , bool SO2 > // Storage order of the target dense matrix
705  friend inline typename EnableIf< UseAssign<MT2> >::Type
706  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
707  {
709 
710  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
711  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
712 
713  DMatTransposer<MT2,!SO2> tmp( ~lhs );
714  subAssign( tmp, rhs.dm_ );
715  }
717  //**********************************************************************************************
718 
719  //**Subtraction assignment to sparse matrices***************************************************
720  // No special implementation for the subtraction assignment to sparse matrices.
721  //**********************************************************************************************
722 
723  //**Multiplication assignment to dense matrices*************************************************
724  // No special implementation for the multiplication assignment to dense matrices.
725  //**********************************************************************************************
726 
727  //**Multiplication assignment to sparse matrices************************************************
728  // No special implementation for the multiplication assignment to sparse matrices.
729  //**********************************************************************************************
730 
731  //**SMP assignment to dense matrices************************************************************
745  template< typename MT2 // Type of the target dense matrix
746  , bool SO2 > // Storage order of the target dense matrix
747  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
748  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
749  {
751 
752  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
753  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
754 
755  DMatTransposer<MT2,!SO2> tmp( ~lhs );
756  smpAssign( tmp, rhs.dm_ );
757  }
759  //**********************************************************************************************
760 
761  //**SMP assignment to sparse matrices***********************************************************
775  template< typename MT2 // Type of the target sparse matrix
776  , bool SO2 > // Storage order of the target sparse matrix
777  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
778  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
779  {
781 
782  typedef typename SelectType< SO == SO2, ResultType, OppositeType >::Type TmpType;
783 
790 
791  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
792  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
793 
794  const TmpType tmp( rhs );
795  smpAssign( ~lhs, tmp );
796  }
798  //**********************************************************************************************
799 
800  //**SMP addition assignment to dense matrices***************************************************
814  template< typename MT2 // Type of the target dense matrix
815  , bool SO2 > // Storage order of the target dense matrix
816  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
817  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
818  {
820 
821  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
822  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
823 
824  DMatTransposer<MT2,!SO2> tmp( ~lhs );
825  smpAddAssign( tmp, rhs.dm_ );
826  }
828  //**********************************************************************************************
829 
830  //**SMP addition assignment to sparse matrices**************************************************
831  // No special implementation for the SMP addition assignment to sparse matrices.
832  //**********************************************************************************************
833 
834  //**SMP subtraction assignment to dense matrices************************************************
848  template< typename MT2 // Type of the target dense matrix
849  , bool SO2 > // Storage order of the target dense matrix
850  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
851  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
852  {
854 
855  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
856  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
857 
858  DMatTransposer<MT2,!SO2> tmp( ~lhs );
859  smpSubAssign( tmp, rhs.dm_ );
860  }
862  //**********************************************************************************************
863 
864  //**SMP subtraction assignment to sparse matrices***********************************************
865  // No special implementation for the SMP subtraction assignment to sparse matrices.
866  //**********************************************************************************************
867 
868  //**SMP multiplication assignment to dense matrices*********************************************
869  // No special implementation for the SMP multiplication assignment to dense matrices.
870  //**********************************************************************************************
871 
872  //**SMP multiplication assignment to sparse matrices********************************************
873  // No special implementation for the SMP multiplication assignment to sparse matrices.
874  //**********************************************************************************************
875 
876  //**Trans function******************************************************************************
892  friend inline Operand trans( const DMatTransExpr<MT,SO>& dm )
893  {
895 
896  return dm.dm_;
897  }
899  //**********************************************************************************************
900 
901  //**Compile time checks*************************************************************************
906  //**********************************************************************************************
907 };
908 //*************************************************************************************************
909 
910 
911 
912 
913 //=================================================================================================
914 //
915 // GLOBAL OPERATORS
916 //
917 //=================================================================================================
918 
919 //*************************************************************************************************
935 template< typename MT // Type of the dense matrix
936  , bool SO > // Storage order
938 {
940 
941  return DMatTransExpr<MT,!SO>( ~dm );
942 }
943 //*************************************************************************************************
944 
945 
946 
947 
948 //=================================================================================================
949 //
950 // ROWS SPECIALIZATIONS
951 //
952 //=================================================================================================
953 
954 //*************************************************************************************************
956 template< typename MT, bool SO >
957 struct Rows< DMatTransExpr<MT,SO> > : public Columns<MT>
958 {};
960 //*************************************************************************************************
961 
962 
963 
964 
965 //=================================================================================================
966 //
967 // COLUMNS SPECIALIZATIONS
968 //
969 //=================================================================================================
970 
971 //*************************************************************************************************
973 template< typename MT, bool SO >
974 struct Columns< DMatTransExpr<MT,SO> > : public Rows<MT>
975 {};
977 //*************************************************************************************************
978 
979 
980 
981 
982 //=================================================================================================
983 //
984 // ISSYMMETRIC SPECIALIZATIONS
985 //
986 //=================================================================================================
987 
988 //*************************************************************************************************
990 template< typename MT, bool SO >
991 struct IsSymmetric< DMatTransExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
992 {};
994 //*************************************************************************************************
995 
996 
997 
998 
999 //=================================================================================================
1000 //
1001 // ISLOWER SPECIALIZATIONS
1002 //
1003 //=================================================================================================
1004 
1005 //*************************************************************************************************
1007 template< typename MT, bool SO >
1008 struct IsLower< DMatTransExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
1009 {};
1011 //*************************************************************************************************
1012 
1013 
1014 
1015 
1016 //=================================================================================================
1017 //
1018 // ISUNILOWER SPECIALIZATIONS
1019 //
1020 //=================================================================================================
1021 
1022 //*************************************************************************************************
1024 template< typename MT, bool SO >
1025 struct IsUniLower< DMatTransExpr<MT,SO> > : public IsTrue< IsUniUpper<MT>::value >
1026 {};
1028 //*************************************************************************************************
1029 
1030 
1031 
1032 
1033 //=================================================================================================
1034 //
1035 // ISSTRICTLYLOWER SPECIALIZATIONS
1036 //
1037 //=================================================================================================
1038 
1039 //*************************************************************************************************
1041 template< typename MT, bool SO >
1042 struct IsStrictlyLower< DMatTransExpr<MT,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
1043 {};
1045 //*************************************************************************************************
1046 
1047 
1048 
1049 
1050 //=================================================================================================
1051 //
1052 // ISUPPER SPECIALIZATIONS
1053 //
1054 //=================================================================================================
1055 
1056 //*************************************************************************************************
1058 template< typename MT, bool SO >
1059 struct IsUpper< DMatTransExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
1060 {};
1062 //*************************************************************************************************
1063 
1064 
1065 
1066 
1067 //=================================================================================================
1068 //
1069 // ISUNIUPPER SPECIALIZATIONS
1070 //
1071 //=================================================================================================
1072 
1073 //*************************************************************************************************
1075 template< typename MT, bool SO >
1076 struct IsUniUpper< DMatTransExpr<MT,SO> > : public IsTrue< IsUniLower<MT>::value >
1077 {};
1079 //*************************************************************************************************
1080 
1081 
1082 
1083 
1084 //=================================================================================================
1085 //
1086 // ISSTRICTLYUPPER SPECIALIZATIONS
1087 //
1088 //=================================================================================================
1089 
1090 //*************************************************************************************************
1092 template< typename MT, bool SO >
1093 struct IsStrictlyUpper< DMatTransExpr<MT,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
1094 {};
1096 //*************************************************************************************************
1097 
1098 
1099 
1100 
1101 //=================================================================================================
1102 //
1103 // EXPRESSION TRAIT SPECIALIZATIONS
1104 //
1105 //=================================================================================================
1106 
1107 //*************************************************************************************************
1109 template< typename MT, bool SO, bool AF >
1110 struct SubmatrixExprTrait< DMatTransExpr<MT,SO>, AF >
1111 {
1112  public:
1113  //**********************************************************************************************
1114  typedef typename TransExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1115  //**********************************************************************************************
1116 };
1118 //*************************************************************************************************
1119 
1120 
1121 //*************************************************************************************************
1123 template< typename MT, bool SO >
1124 struct RowExprTrait< DMatTransExpr<MT,SO> >
1125 {
1126  public:
1127  //**********************************************************************************************
1128  typedef typename TransExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1129  //**********************************************************************************************
1130 };
1132 //*************************************************************************************************
1133 
1134 
1135 //*************************************************************************************************
1137 template< typename MT, bool SO >
1138 struct ColumnExprTrait< DMatTransExpr<MT,SO> >
1139 {
1140  public:
1141  //**********************************************************************************************
1142  typedef typename TransExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1143  //**********************************************************************************************
1144 };
1146 //*************************************************************************************************
1147 
1148 } // namespace blaze
1149 
1150 #endif
Pointer difference type of the Blaze library.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatTransExpr.h:207
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatTransExpr.h:218
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DMatTransExpr.h:169
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
DMatTransExpr(const MT &dm)
Constructor for the DMatTransExpr class.
Definition: DMatTransExpr.h:408
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatTransExpr.h:195
SelectType< useAssign, const ResultType, const DMatTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatTransExpr.h:149
Expression object for dense matrix transpositions.The DMatTransExpr class represents the compile time...
Definition: DMatTransExpr.h:95
#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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
Header file for the MatTransExpr base class.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Header file for the ColumnExprTrait class template.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatTransExpr.h:371
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransExpr.h:142
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatTransExpr.h:176
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
Header file for the Computation base class.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTransExpr.h:566
Header file for the RequiresEvaluation type trait.
Operand dm_
Dense matrix of the transposition expression.
Definition: DMatTransExpr.h:583
Operand operand() const
Returns the dense matrix operand.
Definition: DMatTransExpr.h:532
Header file for the IsUniLower type trait.
ReferenceType reference
Reference return type.
Definition: DMatTransExpr.h:172
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransExpr.h:460
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
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: DMatTransExpr.h:141
Constraint on the data type.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatTransExpr.h:250
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatTransExpr.h:434
Constraint on the data type.
MT::ElementType ElementType
Resulting element type.
Definition: DMatTransExpr.h:144
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatTransExpr.h:270
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:359
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatTransExpr.h:556
ValueType value_type
Type of the underlying elements.
Definition: DMatTransExpr.h:170
ConstIterator(IteratorType iterator)
Constructor for the ConstIterator class.
Definition: DMatTransExpr.h:184
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
PointerType pointer
Pointer return type.
Definition: DMatTransExpr.h:171
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatTransExpr.h:166
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:292
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DMatTransExpr.h:152
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
Header file for the DenseMatrix base class.
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.
IteratorType iterator_
Iterator to the current element.
Definition: DMatTransExpr.h:390
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:72
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatTransExpr.h:145
Header file for the IsLower type trait.
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatTransExpr.h:101
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransExpr.h:143
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatTransExpr.h:239
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
const ElementType * data() const
Low-level data access to the matrix elements.
Definition: DMatTransExpr.h:449
DifferenceType difference_type
Difference between two iterators.
Definition: DMatTransExpr.h:173
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:336
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the serial shim.
ElementType * PointerType
Pointer return type.
Definition: DMatTransExpr.h:164
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatTransExpr.h:347
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:383
Header file for the dense matrix transposer.
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
size_t spacing() const
Returns the spacing between the beginning of two rows/columns.
Definition: DMatTransExpr.h:501
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
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
ElementType ValueType
Type of the underlying elements.
Definition: DMatTransExpr.h:163
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatTransExpr.h:481
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
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatTransExpr.h:491
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:281
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the TransExprTrait class template.
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:65
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransExpr.h:420
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransExpr.h:471
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatTransExpr.h:229
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:283
ElementType & ReferenceType
Reference return type.
Definition: DMatTransExpr.h:165
Iterator over the elements of the dense matrix.
Definition: DMatTransExpr.h:158
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatTransExpr.h:260
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.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatTransExpr.h:162
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
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:325
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatTransExpr.h:102
#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:2502
Header file for the IsTrue value trait.
size_t nonZeros() const
Returns the number of non-zero elements in the dense matrix.
Definition: DMatTransExpr.h:511
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatTransExpr.h:576
Header file for the IsUpper type trait.
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DMatTransExpr.h:146
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: DMatTransExpr.h:522
Header file for the empty type.
DMatTransExpr< MT, SO > This
Type of this DMatTransExpr instance.
Definition: DMatTransExpr.h:140
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:314
System settings for the inline keywords.
#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
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatTransExpr.h:544
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:303
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