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 
43 #include <iterator>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
78 #include <blaze/util/EmptyType.h>
79 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/Exception.h>
81 #include <blaze/util/InvalidType.h>
83 #include <blaze/util/SelectType.h>
84 #include <blaze/util/Types.h>
86 
87 
88 namespace blaze {
89 
90 //=================================================================================================
91 //
92 // CLASS DMATTRANSEXPR
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
103 template< typename MT // Type of the dense matrix
104  , bool SO > // Storage order
105 class DMatTransExpr : public DenseMatrix< DMatTransExpr<MT,SO>, SO >
106  , private MatTransExpr
107  , private SelectType< IsComputation<MT>::value, Computation, EmptyType >::Type
108 {
109  private:
110  //**Type definitions****************************************************************************
111  typedef typename MT::ResultType RT;
112  typedef typename MT::CompositeType CT;
113  //**********************************************************************************************
114 
115  //**Serial evaluation strategy******************************************************************
117 
123  enum { useAssign = RequiresEvaluation<MT>::value };
124 
126  template< typename MT2 >
128  struct UseAssign {
129  enum { value = useAssign };
130  };
132  //**********************************************************************************************
133 
134  //**Parallel evaluation strategy****************************************************************
136 
141  template< typename MT2 >
142  struct UseSMPAssign {
143  enum { value = MT2::smpAssignable && useAssign };
144  };
146  //**********************************************************************************************
147 
148  public:
149  //**Type definitions****************************************************************************
151  typedef typename MT::TransposeType ResultType;
153  typedef typename MT::ResultType TransposeType;
154  typedef typename MT::ElementType ElementType;
156  typedef typename MT::ReturnType ReturnType;
157 
160 
162  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
163  //**********************************************************************************************
164 
165  //**ConstIterator class definition**************************************************************
169  {
170  public:
171  //**Type definitions*************************************************************************
172  typedef std::random_access_iterator_tag IteratorCategory;
173  typedef ElementType ValueType;
174  typedef ElementType* PointerType;
175  typedef ElementType& ReferenceType;
177 
178  // STL iterator requirements
179  typedef IteratorCategory iterator_category;
180  typedef ValueType value_type;
181  typedef PointerType pointer;
182  typedef ReferenceType reference;
183  typedef DifferenceType difference_type;
184 
186  typedef typename MT::ConstIterator IteratorType;
187  //*******************************************************************************************
188 
189  //**Constructor******************************************************************************
194  explicit inline ConstIterator( IteratorType iterator )
195  : iterator_( iterator ) // Iterator to the current element
196  {}
197  //*******************************************************************************************
198 
199  //**Addition assignment operator*************************************************************
205  inline ConstIterator& operator+=( size_t inc ) {
206  iterator_ += inc;
207  return *this;
208  }
209  //*******************************************************************************************
210 
211  //**Subtraction assignment operator**********************************************************
217  inline ConstIterator& operator-=( size_t dec ) {
218  iterator_ -= dec;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Prefix increment operator****************************************************************
229  ++iterator_;
230  return *this;
231  }
232  //*******************************************************************************************
233 
234  //**Postfix increment operator***************************************************************
239  inline const ConstIterator operator++( int ) {
240  return ConstIterator( iterator_++ );
241  }
242  //*******************************************************************************************
243 
244  //**Prefix decrement operator****************************************************************
250  --iterator_;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Postfix decrement operator***************************************************************
260  inline const ConstIterator operator--( int ) {
261  return ConstIterator( iterator_-- );
262  }
263  //*******************************************************************************************
264 
265  //**Element access operator******************************************************************
270  inline ReturnType operator*() const {
271  return *iterator_;
272  }
273  //*******************************************************************************************
274 
275  //**Load function****************************************************************************
280  inline IntrinsicType load() const {
281  return iterator_.load();
282  }
283  //*******************************************************************************************
284 
285  //**Equality operator************************************************************************
291  inline bool operator==( const ConstIterator& rhs ) const {
292  return iterator_ == rhs.iterator_;
293  }
294  //*******************************************************************************************
295 
296  //**Inequality operator**********************************************************************
302  inline bool operator!=( const ConstIterator& rhs ) const {
303  return iterator_ != rhs.iterator_;
304  }
305  //*******************************************************************************************
306 
307  //**Less-than operator***********************************************************************
313  inline bool operator<( const ConstIterator& rhs ) const {
314  return iterator_ < rhs.iterator_;
315  }
316  //*******************************************************************************************
317 
318  //**Greater-than operator********************************************************************
324  inline bool operator>( const ConstIterator& rhs ) const {
325  return iterator_ > rhs.iterator_;
326  }
327  //*******************************************************************************************
328 
329  //**Less-or-equal-than operator**************************************************************
335  inline bool operator<=( const ConstIterator& rhs ) const {
336  return iterator_ <= rhs.iterator_;
337  }
338  //*******************************************************************************************
339 
340  //**Greater-or-equal-than operator***********************************************************
346  inline bool operator>=( const ConstIterator& rhs ) const {
347  return iterator_ >= rhs.iterator_;
348  }
349  //*******************************************************************************************
350 
351  //**Subtraction operator*********************************************************************
357  inline DifferenceType operator-( const ConstIterator& rhs ) const {
358  return iterator_ - rhs.iterator_;
359  }
360  //*******************************************************************************************
361 
362  //**Addition operator************************************************************************
369  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
370  return ConstIterator( it.iterator_ + inc );
371  }
372  //*******************************************************************************************
373 
374  //**Addition operator************************************************************************
381  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
382  return ConstIterator( it.iterator_ + inc );
383  }
384  //*******************************************************************************************
385 
386  //**Subtraction operator*********************************************************************
393  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
394  return ConstIterator( it.iterator_ - dec );
395  }
396  //*******************************************************************************************
397 
398  private:
399  //**Member variables*************************************************************************
400  IteratorType iterator_;
401  //*******************************************************************************************
402  };
403  //**********************************************************************************************
404 
405  //**Compilation flags***************************************************************************
407  enum { vectorizable = MT::vectorizable };
408 
410  enum { smpAssignable = MT::smpAssignable };
411  //**********************************************************************************************
412 
413  //**Constructor*********************************************************************************
418  explicit inline DMatTransExpr( const MT& dm )
419  : dm_( dm ) // Dense matrix of the transposition expression
420  {}
421  //**********************************************************************************************
422 
423  //**Access operator*****************************************************************************
430  inline ReturnType operator()( size_t i, size_t j ) const {
431  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
432  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
433  return dm_(j,i);
434  }
435  //**********************************************************************************************
436 
437  //**At function*********************************************************************************
445  inline ReturnType at( size_t i, size_t j ) const {
446  if( i >= dm_.columns() ) {
447  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
448  }
449  if( j >= dm_.rows() ) {
450  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
451  }
452  return (*this)(i,j);
453  }
454  //**********************************************************************************************
455 
456  //**Load function*******************************************************************************
463  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t i, size_t j ) const {
464  typedef IntrinsicTrait<ElementType> IT;
465  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
466  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
467  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
468  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
469  return dm_.load(j,i);
470  }
471  //**********************************************************************************************
472 
473  //**Low-level data access***********************************************************************
478  inline const ElementType* data() const {
479  return dm_.data();
480  }
481  //**********************************************************************************************
482 
483  //**Begin function******************************************************************************
489  inline ConstIterator begin( size_t i ) const {
490  return ConstIterator( dm_.begin(i) );
491  }
492  //**********************************************************************************************
493 
494  //**End function********************************************************************************
500  inline ConstIterator end( size_t i ) const {
501  return ConstIterator( dm_.end(i) );
502  }
503  //**********************************************************************************************
504 
505  //**Rows function*******************************************************************************
510  inline size_t rows() const {
511  return dm_.columns();
512  }
513  //**********************************************************************************************
514 
515  //**Columns function****************************************************************************
520  inline size_t columns() const {
521  return dm_.rows();
522  }
523  //**********************************************************************************************
524 
525  //**Spacing function****************************************************************************
530  inline size_t spacing() const {
531  return dm_.spacing();
532  }
533  //**********************************************************************************************
534 
535  //**NonZeros function***************************************************************************
540  inline size_t nonZeros() const {
541  return dm_.nonZeros();
542  }
543  //**********************************************************************************************
544 
545  //**NonZeros function***************************************************************************
551  inline size_t nonZeros( size_t i ) const {
552  return dm_.nonZeros( i );
553  }
554  //**********************************************************************************************
555 
556  //**Operand access******************************************************************************
561  inline Operand operand() const {
562  return dm_;
563  }
564  //**********************************************************************************************
565 
566  //**********************************************************************************************
572  template< typename T >
573  inline bool canAlias( const T* alias ) const {
574  return dm_.isAliased( alias );
575  }
576  //**********************************************************************************************
577 
578  //**********************************************************************************************
584  template< typename T >
585  inline bool isAliased( const T* alias ) const {
586  return dm_.isAliased( alias );
587  }
588  //**********************************************************************************************
589 
590  //**********************************************************************************************
595  inline bool isAligned() const {
596  return dm_.isAligned();
597  }
598  //**********************************************************************************************
599 
600  //**********************************************************************************************
605  inline bool canSMPAssign() const {
606  return dm_.canSMPAssign();
607  }
608  //**********************************************************************************************
609 
610  private:
611  //**Member variables****************************************************************************
612  Operand dm_;
613  //**********************************************************************************************
614 
615  //**Assignment to dense matrices****************************************************************
629  template< typename MT2 // Type of the target dense matrix
630  , bool SO2 > // Storage order of the target dense matrix
631  friend inline typename EnableIf< UseAssign<MT2> >::Type
632  assign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
633  {
635 
636  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
637  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
638 
639  DMatTransposer<MT2,!SO2> tmp( ~lhs );
640  assign( tmp, rhs.dm_ );
641  }
643  //**********************************************************************************************
644 
645  //**Assignment to sparse matrices***************************************************************
659  template< typename MT2 // Type of the target sparse matrix
660  , bool SO2 > // Storage order of the target sparse matrix
661  friend inline typename EnableIf< UseAssign<MT2> >::Type
662  assign( SparseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
663  {
665 
667 
674 
675  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
676  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
677 
678  const TmpType tmp( serial( rhs ) );
679  assign( ~lhs, tmp );
680  }
682  //**********************************************************************************************
683 
684  //**Addition assignment to dense matrices*******************************************************
698  template< typename MT2 // Type of the target dense matrix
699  , bool SO2 > // Storage order of the target dense matrix
700  friend inline typename EnableIf< UseAssign<MT2> >::Type
701  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
702  {
704 
705  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
706  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
707 
708  DMatTransposer<MT2,!SO2> tmp( ~lhs );
709  addAssign( tmp, rhs.dm_ );
710  }
712  //**********************************************************************************************
713 
714  //**Addition assignment to sparse matrices******************************************************
715  // No special implementation for the addition assignment to sparse matrices.
716  //**********************************************************************************************
717 
718  //**Subtraction assignment to dense matrices****************************************************
732  template< typename MT2 // Type of the target dense matrix
733  , bool SO2 > // Storage order of the target dense matrix
734  friend inline typename EnableIf< UseAssign<MT2> >::Type
735  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
736  {
738 
739  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
740  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
741 
742  DMatTransposer<MT2,!SO2> tmp( ~lhs );
743  subAssign( tmp, rhs.dm_ );
744  }
746  //**********************************************************************************************
747 
748  //**Subtraction assignment to sparse matrices***************************************************
749  // No special implementation for the subtraction assignment to sparse matrices.
750  //**********************************************************************************************
751 
752  //**Multiplication assignment to dense matrices*************************************************
753  // No special implementation for the multiplication assignment to dense matrices.
754  //**********************************************************************************************
755 
756  //**Multiplication assignment to sparse matrices************************************************
757  // No special implementation for the multiplication assignment to sparse matrices.
758  //**********************************************************************************************
759 
760  //**SMP assignment to dense matrices************************************************************
774  template< typename MT2 // Type of the target dense matrix
775  , bool SO2 > // Storage order of the target dense matrix
776  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
777  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
778  {
780 
781  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
782  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
783 
784  DMatTransposer<MT2,!SO2> tmp( ~lhs );
785  smpAssign( tmp, rhs.dm_ );
786  }
788  //**********************************************************************************************
789 
790  //**SMP assignment to sparse matrices***********************************************************
804  template< typename MT2 // Type of the target sparse matrix
805  , bool SO2 > // Storage order of the target sparse matrix
806  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
807  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
808  {
810 
811  typedef typename SelectType< SO == SO2, ResultType, OppositeType >::Type TmpType;
812 
819 
820  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
821  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
822 
823  const TmpType tmp( rhs );
824  smpAssign( ~lhs, tmp );
825  }
827  //**********************************************************************************************
828 
829  //**SMP addition assignment to dense matrices***************************************************
843  template< typename MT2 // Type of the target dense matrix
844  , bool SO2 > // Storage order of the target dense matrix
845  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
846  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
847  {
849 
850  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
851  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
852 
853  DMatTransposer<MT2,!SO2> tmp( ~lhs );
854  smpAddAssign( tmp, rhs.dm_ );
855  }
857  //**********************************************************************************************
858 
859  //**SMP addition assignment to sparse matrices**************************************************
860  // No special implementation for the SMP addition assignment to sparse matrices.
861  //**********************************************************************************************
862 
863  //**SMP subtraction assignment to dense matrices************************************************
877  template< typename MT2 // Type of the target dense matrix
878  , bool SO2 > // Storage order of the target dense matrix
879  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
880  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatTransExpr& rhs )
881  {
883 
884  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
885  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
886 
887  DMatTransposer<MT2,!SO2> tmp( ~lhs );
888  smpSubAssign( tmp, rhs.dm_ );
889  }
891  //**********************************************************************************************
892 
893  //**SMP subtraction assignment to sparse matrices***********************************************
894  // No special implementation for the SMP subtraction assignment to sparse matrices.
895  //**********************************************************************************************
896 
897  //**SMP multiplication assignment to dense matrices*********************************************
898  // No special implementation for the SMP multiplication assignment to dense matrices.
899  //**********************************************************************************************
900 
901  //**SMP multiplication assignment to sparse matrices********************************************
902  // No special implementation for the SMP multiplication assignment to sparse matrices.
903  //**********************************************************************************************
904 
905  //**Compile time checks*************************************************************************
910  //**********************************************************************************************
911 };
912 //*************************************************************************************************
913 
914 
915 
916 
917 //=================================================================================================
918 //
919 // GLOBAL OPERATORS
920 //
921 //=================================================================================================
922 
923 //*************************************************************************************************
942 template< typename MT // Type of the dense matrix
943  , bool SO > // Storage order
945 {
947 
948  return DMatTransExpr<MT,!SO>( ~dm );
949 }
950 //*************************************************************************************************
951 
952 
953 
954 
955 //=================================================================================================
956 //
957 // GLOBAL RESTRUCTURING FUNCTIONS
958 //
959 //=================================================================================================
960 
961 //*************************************************************************************************
981 template< typename MT // Type of the dense matrix
982  , bool SO > // Storage order
983 inline typename DMatTransExpr<MT,SO>::Operand trans( const DMatTransExpr<MT,SO>& dm )
984 {
986 
987  return dm.operand();
988 }
990 //*************************************************************************************************
991 
992 
993 
994 
995 //=================================================================================================
996 //
997 // ROWS SPECIALIZATIONS
998 //
999 //=================================================================================================
1000 
1001 //*************************************************************************************************
1003 template< typename MT, bool SO >
1004 struct Rows< DMatTransExpr<MT,SO> > : public Columns<MT>
1005 {};
1007 //*************************************************************************************************
1008 
1009 
1010 
1011 
1012 //=================================================================================================
1013 //
1014 // COLUMNS SPECIALIZATIONS
1015 //
1016 //=================================================================================================
1017 
1018 //*************************************************************************************************
1020 template< typename MT, bool SO >
1021 struct Columns< DMatTransExpr<MT,SO> > : public Rows<MT>
1022 {};
1024 //*************************************************************************************************
1025 
1026 
1027 
1028 
1029 //=================================================================================================
1030 //
1031 // ISALIGNED SPECIALIZATIONS
1032 //
1033 //=================================================================================================
1034 
1035 //*************************************************************************************************
1037 template< typename MT, bool SO >
1038 struct IsAligned< DMatTransExpr<MT,SO> > : public IsTrue< IsAligned<MT>::value >
1039 {};
1041 //*************************************************************************************************
1042 
1043 
1044 
1045 
1046 //=================================================================================================
1047 //
1048 // ISPADDED SPECIALIZATIONS
1049 //
1050 //=================================================================================================
1051 
1052 //*************************************************************************************************
1054 template< typename MT, bool SO >
1055 struct IsPadded< DMatTransExpr<MT,SO> > : public IsTrue< IsPadded<MT>::value >
1056 {};
1058 //*************************************************************************************************
1059 
1060 
1061 
1062 
1063 //=================================================================================================
1064 //
1065 // ISSYMMETRIC SPECIALIZATIONS
1066 //
1067 //=================================================================================================
1068 
1069 //*************************************************************************************************
1071 template< typename MT, bool SO >
1072 struct IsSymmetric< DMatTransExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
1073 {};
1075 //*************************************************************************************************
1076 
1077 
1078 
1079 
1080 //=================================================================================================
1081 //
1082 // ISHERMITIAN SPECIALIZATIONS
1083 //
1084 //=================================================================================================
1085 
1086 //*************************************************************************************************
1088 template< typename MT, bool SO >
1089 struct IsHermitian< DMatTransExpr<MT,SO> > : public IsTrue< IsHermitian<MT>::value >
1090 {};
1092 //*************************************************************************************************
1093 
1094 
1095 
1096 
1097 //=================================================================================================
1098 //
1099 // ISLOWER SPECIALIZATIONS
1100 //
1101 //=================================================================================================
1102 
1103 //*************************************************************************************************
1105 template< typename MT, bool SO >
1106 struct IsLower< DMatTransExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
1107 {};
1109 //*************************************************************************************************
1110 
1111 
1112 
1113 
1114 //=================================================================================================
1115 //
1116 // ISUNILOWER SPECIALIZATIONS
1117 //
1118 //=================================================================================================
1119 
1120 //*************************************************************************************************
1122 template< typename MT, bool SO >
1123 struct IsUniLower< DMatTransExpr<MT,SO> > : public IsTrue< IsUniUpper<MT>::value >
1124 {};
1126 //*************************************************************************************************
1127 
1128 
1129 
1130 
1131 //=================================================================================================
1132 //
1133 // ISSTRICTLYLOWER SPECIALIZATIONS
1134 //
1135 //=================================================================================================
1136 
1137 //*************************************************************************************************
1139 template< typename MT, bool SO >
1140 struct IsStrictlyLower< DMatTransExpr<MT,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
1141 {};
1143 //*************************************************************************************************
1144 
1145 
1146 
1147 
1148 //=================================================================================================
1149 //
1150 // ISUPPER SPECIALIZATIONS
1151 //
1152 //=================================================================================================
1153 
1154 //*************************************************************************************************
1156 template< typename MT, bool SO >
1157 struct IsUpper< DMatTransExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
1158 {};
1160 //*************************************************************************************************
1161 
1162 
1163 
1164 
1165 //=================================================================================================
1166 //
1167 // ISUNIUPPER SPECIALIZATIONS
1168 //
1169 //=================================================================================================
1170 
1171 //*************************************************************************************************
1173 template< typename MT, bool SO >
1174 struct IsUniUpper< DMatTransExpr<MT,SO> > : public IsTrue< IsUniLower<MT>::value >
1175 {};
1177 //*************************************************************************************************
1178 
1179 
1180 
1181 
1182 //=================================================================================================
1183 //
1184 // ISSTRICTLYUPPER SPECIALIZATIONS
1185 //
1186 //=================================================================================================
1187 
1188 //*************************************************************************************************
1190 template< typename MT, bool SO >
1191 struct IsStrictlyUpper< DMatTransExpr<MT,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
1192 {};
1194 //*************************************************************************************************
1195 
1196 
1197 
1198 
1199 //=================================================================================================
1200 //
1201 // EXPRESSION TRAIT SPECIALIZATIONS
1202 //
1203 //=================================================================================================
1204 
1205 //*************************************************************************************************
1207 template< typename MT >
1208 struct DMatTransExprTrait< DMatTransExpr<MT,false> >
1209 {
1210  public:
1211  //**********************************************************************************************
1212  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1213  , typename DMatTransExpr<MT,false>::Operand
1214  , INVALID_TYPE >::Type Type;
1215  //**********************************************************************************************
1216 };
1218 //*************************************************************************************************
1219 
1220 
1221 //*************************************************************************************************
1223 template< typename MT >
1224 struct TDMatTransExprTrait< DMatTransExpr<MT,true> >
1225 {
1226  public:
1227  //**********************************************************************************************
1228  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1229  , typename DMatTransExpr<MT,true>::Operand
1230  , INVALID_TYPE >::Type Type;
1231  //**********************************************************************************************
1232 };
1234 //*************************************************************************************************
1235 
1236 
1237 //*************************************************************************************************
1239 template< typename MT, bool SO, bool AF >
1240 struct SubmatrixExprTrait< DMatTransExpr<MT,SO>, AF >
1241 {
1242  public:
1243  //**********************************************************************************************
1244  typedef typename TransExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1245  //**********************************************************************************************
1246 };
1248 //*************************************************************************************************
1249 
1250 
1251 //*************************************************************************************************
1253 template< typename MT, bool SO >
1254 struct RowExprTrait< DMatTransExpr<MT,SO> >
1255 {
1256  public:
1257  //**********************************************************************************************
1258  typedef typename TransExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1259  //**********************************************************************************************
1260 };
1262 //*************************************************************************************************
1263 
1264 
1265 //*************************************************************************************************
1267 template< typename MT, bool SO >
1268 struct ColumnExprTrait< DMatTransExpr<MT,SO> >
1269 {
1270  public:
1271  //**********************************************************************************************
1272  typedef typename TransExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1273  //**********************************************************************************************
1274 };
1276 //*************************************************************************************************
1277 
1278 } // namespace blaze
1279 
1280 #endif
Pointer difference type of the Blaze library.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatTransExpr.h:217
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatTransExpr.h:228
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DMatTransExpr.h:179
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:252
DMatTransExpr(const MT &dm)
Constructor for the DMatTransExpr class.
Definition: DMatTransExpr.h:418
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatTransExpr.h:205
SelectType< useAssign, const ResultType, const DMatTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatTransExpr.h:159
Expression object for dense matrix transpositions.The DMatTransExpr class represents the compile time...
Definition: DMatTransExpr.h:105
#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:81
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
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:381
Header file for the IsColumnMajorMatrix type trait.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransExpr.h:152
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatTransExpr.h:186
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:595
Header file for the RequiresEvaluation type trait.
Operand dm_
Dense matrix of the transposition expression.
Definition: DMatTransExpr.h:612
Operand operand() const
Returns the dense matrix operand.
Definition: DMatTransExpr.h:561
Header file for the IsUniLower type trait.
ReferenceType reference
Reference return type.
Definition: DMatTransExpr.h:182
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransExpr.h:489
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:117
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: DMatTransExpr.h:151
Constraint on the data type.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatTransExpr.h:260
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransExpr.h:445
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatTransExpr.h:463
Constraint on the data type.
MT::ElementType ElementType
Resulting element type.
Definition: DMatTransExpr.h:154
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:280
Header file for the DMatTransExprTrait class template.
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:369
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatTransExpr.h:585
ValueType value_type
Type of the underlying elements.
Definition: DMatTransExpr.h:180
ConstIterator(IteratorType iterator)
Constructor for the ConstIterator class.
Definition: DMatTransExpr.h:194
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:181
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:176
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:302
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DMatTransExpr.h:162
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
IteratorType iterator_
Iterator to the current element.
Definition: DMatTransExpr.h:400
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:79
Header file for the TDMatTransExprTrait class template.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatTransExpr.h:155
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatTransExpr.h:111
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransExpr.h:153
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatTransExpr.h:249
#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:478
DifferenceType difference_type
Difference between two iterators.
Definition: DMatTransExpr.h:183
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
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:346
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
Header file for the serial shim.
ElementType * PointerType
Pointer return type.
Definition: DMatTransExpr.h:174
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatTransExpr.h:357
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:393
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:530
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
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:173
Utility type for generic codes.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatTransExpr.h:510
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatTransExpr.h:520
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:291
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:430
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransExpr.h:500
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatTransExpr.h:239
#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:122
ElementType & ReferenceType
Reference return type.
Definition: DMatTransExpr.h:175
Iterator over the elements of the dense matrix.
Definition: DMatTransExpr.h:168
Header file for the IsRowMajorMatrix type trait.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatTransExpr.h:270
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
Header file for the IsComputation type trait class.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatTransExpr.h:172
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:335
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatTransExpr.h:112
#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:2583
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:540
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatTransExpr.h:605
Header file for the IsUpper type trait.
Header file for exception macros.
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DMatTransExpr.h:156
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: DMatTransExpr.h:551
Header file for the empty type.
DMatTransExpr< MT, SO > This
Type of this DMatTransExpr instance.
Definition: DMatTransExpr.h:150
Header file for the IsHermitian type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:324
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:573
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:313
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.