DMatConjExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATCONJEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATCONJEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
50 #include <blaze/math/Intrinsics.h>
79 #include <blaze/system/Inline.h>
80 #include <blaze/util/Assert.h>
82 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/Exception.h>
84 #include <blaze/util/InvalidType.h>
86 #include <blaze/util/SelectType.h>
87 #include <blaze/util/Types.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // CLASS DMATCONJEXPR
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
106 template< typename MT // Type of the dense matrix
107  , bool SO > // Storage order
108 class DMatConjExpr : public DenseMatrix< DMatConjExpr<MT,SO>, SO >
109  , private MatConjExpr
110  , private Computation
111 {
112  private:
113  //**Type definitions****************************************************************************
114  typedef typename MT::ReturnType RN;
115  typedef typename MT::ElementType ET;
116  //**********************************************************************************************
117 
118  //**Return type evaluation**********************************************************************
120 
125  enum { returnExpr = !IsTemporary<RN>::value };
126 
129  //**********************************************************************************************
130 
131  //**Serial evaluation strategy******************************************************************
133 
139  enum { useAssign = RequiresEvaluation<MT>::value };
140 
142  template< typename MT2 >
144  struct UseAssign {
145  enum { value = useAssign };
146  };
148  //**********************************************************************************************
149 
150  //**Parallel evaluation strategy****************************************************************
152 
158  template< typename MT2 >
159  struct UseSMPAssign {
160  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
161  };
163  //**********************************************************************************************
164 
165  public:
166  //**Type definitions****************************************************************************
168  typedef typename MT::ResultType ResultType;
169  typedef typename MT::OppositeType OppositeType;
170  typedef typename MT::TransposeType TransposeType;
171  typedef typename MT::ElementType ElementType;
173 
176 
179 
181  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
182  //**********************************************************************************************
183 
184  //**ConstIterator class definition**************************************************************
188  {
189  public:
190  //**Type definitions*************************************************************************
191  typedef std::random_access_iterator_tag IteratorCategory;
192  typedef ElementType ValueType;
193  typedef ElementType* PointerType;
194  typedef ElementType& ReferenceType;
196 
197  // STL iterator requirements
198  typedef IteratorCategory iterator_category;
199  typedef ValueType value_type;
200  typedef PointerType pointer;
201  typedef ReferenceType reference;
202  typedef DifferenceType difference_type;
203 
205  typedef typename MT::ConstIterator IteratorType;
206  //*******************************************************************************************
207 
208  //**Constructor******************************************************************************
213  explicit inline ConstIterator( IteratorType it )
214  : it_( it ) // Iterator to the current matrix element
215  {}
216  //*******************************************************************************************
217 
218  //**Addition assignment operator*************************************************************
224  inline ConstIterator& operator+=( size_t inc ) {
225  it_ += inc;
226  return *this;
227  }
228  //*******************************************************************************************
229 
230  //**Subtraction assignment operator**********************************************************
236  inline ConstIterator& operator-=( size_t dec ) {
237  it_ -= dec;
238  return *this;
239  }
240  //*******************************************************************************************
241 
242  //**Prefix increment operator****************************************************************
248  ++it_;
249  return *this;
250  }
251  //*******************************************************************************************
252 
253  //**Postfix increment operator***************************************************************
258  inline const ConstIterator operator++( int ) {
259  return ConstIterator( it_++ );
260  }
261  //*******************************************************************************************
262 
263  //**Prefix decrement operator****************************************************************
269  --it_;
270  return *this;
271  }
272  //*******************************************************************************************
273 
274  //**Postfix decrement operator***************************************************************
279  inline const ConstIterator operator--( int ) {
280  return ConstIterator( it_-- );
281  }
282  //*******************************************************************************************
283 
284  //**Element access operator******************************************************************
289  inline ReturnType operator*() const {
290  return conj( *it_ );
291  }
292  //*******************************************************************************************
293 
294  //**Load function****************************************************************************
299  inline IntrinsicType load() const {
300  return conj( it_.load() );
301  }
302  //*******************************************************************************************
303 
304  //**Equality operator************************************************************************
310  inline bool operator==( const ConstIterator& rhs ) const {
311  return it_ == rhs.it_;
312  }
313  //*******************************************************************************************
314 
315  //**Inequality operator**********************************************************************
321  inline bool operator!=( const ConstIterator& rhs ) const {
322  return it_ != rhs.it_;
323  }
324  //*******************************************************************************************
325 
326  //**Less-than operator***********************************************************************
332  inline bool operator<( const ConstIterator& rhs ) const {
333  return it_ < rhs.it_;
334  }
335  //*******************************************************************************************
336 
337  //**Greater-than operator********************************************************************
343  inline bool operator>( const ConstIterator& rhs ) const {
344  return it_ > rhs.it_;
345  }
346  //*******************************************************************************************
347 
348  //**Less-or-equal-than operator**************************************************************
354  inline bool operator<=( const ConstIterator& rhs ) const {
355  return it_ <= rhs.it_;
356  }
357  //*******************************************************************************************
358 
359  //**Greater-or-equal-than operator***********************************************************
365  inline bool operator>=( const ConstIterator& rhs ) const {
366  return it_ >= rhs.it_;
367  }
368  //*******************************************************************************************
369 
370  //**Subtraction operator*********************************************************************
376  inline DifferenceType operator-( const ConstIterator& rhs ) const {
377  return it_ - rhs.it_;
378  }
379  //*******************************************************************************************
380 
381  //**Addition operator************************************************************************
388  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
389  return ConstIterator( it.it_ + inc );
390  }
391  //*******************************************************************************************
392 
393  //**Addition operator************************************************************************
400  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
401  return ConstIterator( it.it_ + inc );
402  }
403  //*******************************************************************************************
404 
405  //**Subtraction operator*********************************************************************
412  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
413  return ConstIterator( it.it_ - dec );
414  }
415  //*******************************************************************************************
416 
417  private:
418  //**Member variables*************************************************************************
419  IteratorType it_;
420  //*******************************************************************************************
421  };
422  //**********************************************************************************************
423 
424  //**Compilation flags***************************************************************************
426  enum { vectorizable = MT::vectorizable &&
428 
430  enum { smpAssignable = MT::smpAssignable };
431  //**********************************************************************************************
432 
433  //**Constructor*********************************************************************************
438  explicit inline DMatConjExpr( const MT& dm )
439  : dm_( dm ) // Dense matrix of the complex conjugate expression
440  {}
441  //**********************************************************************************************
442 
443  //**Access operator*****************************************************************************
450  inline ReturnType operator()( size_t i, size_t j ) const {
451  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
452  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
453  return conj( dm_(i,j) );
454  }
455  //**********************************************************************************************
456 
457  //**At function*********************************************************************************
465  inline ReturnType at( size_t i, size_t j ) const {
466  if( i >= dm_.rows() ) {
467  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
468  }
469  if( j >= dm_.columns() ) {
470  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
471  }
472  return (*this)(i,j);
473  }
474  //**********************************************************************************************
475 
476  //**Load function*******************************************************************************
483  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t i, size_t j ) const {
484  typedef IntrinsicTrait<ElementType> IT;
485  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
486  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
487  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
488  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
489  return conj( dm_.load(i,j) );
490  }
491  //**********************************************************************************************
492 
493  //**Begin function******************************************************************************
499  inline ConstIterator begin( size_t i ) const {
500  return ConstIterator( dm_.begin(i) );
501  }
502  //**********************************************************************************************
503 
504  //**End function********************************************************************************
510  inline ConstIterator end( size_t i ) const {
511  return ConstIterator( dm_.end(i) );
512  }
513  //**********************************************************************************************
514 
515  //**Rows function*******************************************************************************
520  inline size_t rows() const {
521  return dm_.rows();
522  }
523  //**********************************************************************************************
524 
525  //**Columns function****************************************************************************
530  inline size_t columns() const {
531  return dm_.columns();
532  }
533  //**********************************************************************************************
534 
535  //**Operand access******************************************************************************
540  inline Operand operand() const {
541  return dm_;
542  }
543  //**********************************************************************************************
544 
545  //**********************************************************************************************
551  template< typename T >
552  inline bool canAlias( const T* alias ) const {
553  return IsComputation<MT>::value && dm_.canAlias( alias );
554  }
555  //**********************************************************************************************
556 
557  //**********************************************************************************************
563  template< typename T >
564  inline bool isAliased( const T* alias ) const {
565  return dm_.isAliased( alias );
566  }
567  //**********************************************************************************************
568 
569  //**********************************************************************************************
574  inline bool isAligned() const {
575  return dm_.isAligned();
576  }
577  //**********************************************************************************************
578 
579  //**********************************************************************************************
584  inline bool canSMPAssign() const {
585  return dm_.canSMPAssign();
586  }
587  //**********************************************************************************************
588 
589  private:
590  //**Member variables****************************************************************************
591  Operand dm_;
592  //**********************************************************************************************
593 
594  //**Assignment to dense matrices****************************************************************
608  template< typename MT2 // Type of the target dense matrix
609  , bool SO2 > // Storage order or the target dense matrix
610  friend inline typename EnableIf< UseAssign<MT2> >::Type
611  assign( DenseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
612  {
614 
615  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
616  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
617 
618  assign( ~lhs, rhs.dm_ );
619  assign( ~lhs, conj( ~lhs ) );
620  }
622  //**********************************************************************************************
623 
624  //**Assignment to sparse matrices***************************************************************
638  template< typename MT2 // Type of the target sparse matrix
639  , bool SO2 > // Storage order or the target sparse matrix
640  friend inline typename EnableIf< UseAssign<MT2> >::Type
641  assign( SparseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
642  {
644 
646 
653 
654  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
655  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
656 
657  const TmpType tmp( serial( rhs ) );
658  assign( ~lhs, tmp );
659  }
661  //**********************************************************************************************
662 
663  //**Addition assignment to dense matrices*******************************************************
677  template< typename MT2 // Type of the target dense matrix
678  , bool SO2 > // Storage order of the target dense matrix
679  friend inline typename EnableIf< UseAssign<MT2> >::Type
680  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
681  {
683 
687 
688  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
689  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
690 
691  const ResultType tmp( serial( rhs ) );
692  addAssign( ~lhs, tmp );
693  }
695  //**********************************************************************************************
696 
697  //**Addition assignment to sparse matrices******************************************************
698  // No special implementation for the addition assignment to sparse matrices.
699  //**********************************************************************************************
700 
701  //**Subtraction assignment to dense matrices****************************************************
715  template< typename MT2 // Type of the target dense matrix
716  , bool SO2 > // Storage order of the target dense matrix
717  friend inline typename EnableIf< UseAssign<MT2> >::Type
718  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
719  {
721 
725 
726  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
727  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
728 
729  const ResultType tmp( serial( rhs ) );
730  subAssign( ~lhs, tmp );
731  }
733  //**********************************************************************************************
734 
735  //**Subtraction assignment to sparse matrices***************************************************
736  // No special implementation for the subtraction assignment to sparse matrices.
737  //**********************************************************************************************
738 
739  //**Multiplication assignment to dense matrices*************************************************
740  // No special implementation for the multiplication assignment to dense matrices.
741  //**********************************************************************************************
742 
743  //**Multiplication assignment to sparse matrices************************************************
744  // No special implementation for the multiplication assignment to sparse matrices.
745  //**********************************************************************************************
746 
747  //**SMP assignment to dense matrices************************************************************
761  template< typename MT2 // Type of the target dense matrix
762  , bool SO2 > // Storage order or the target dense matrix
763  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
764  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
765  {
767 
768  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
769  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
770 
771  smpAssign( ~lhs, rhs.dm_ );
772  smpAssign( ~lhs, conj( ~lhs ) );
773  }
775  //**********************************************************************************************
776 
777  //**SMP assignment to sparse matrices***********************************************************
791  template< typename MT2 // Type of the target sparse matrix
792  , bool SO2 > // Storage order or the target sparse matrix
793  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
794  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
795  {
797 
798  typedef typename SelectType< SO == SO2, ResultType, OppositeType >::Type TmpType;
799 
806 
807  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
808  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
809 
810  const TmpType tmp( rhs );
811  smpAssign( ~lhs, tmp );
812  }
814  //**********************************************************************************************
815 
816  //**SMP addition assignment to dense matrices***************************************************
830  template< typename MT2 // Type of the target dense matrix
831  , bool SO2 > // Storage order of the target dense matrix
832  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
833  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
834  {
836 
840 
841  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
842  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
843 
844  const ResultType tmp( rhs );
845  smpAddAssign( ~lhs, tmp );
846  }
848  //**********************************************************************************************
849 
850  //**SMP addition assignment to sparse matrices**************************************************
851  // No special implementation for the SMP addition assignment to sparse matrices.
852  //**********************************************************************************************
853 
854  //**SMP subtraction assignment to dense matrices************************************************
868  template< typename MT2 // Type of the target dense matrix
869  , bool SO2 > // Storage order of the target dense matrix
870  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
871  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatConjExpr& rhs )
872  {
874 
878 
879  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
880  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
881 
882  const ResultType tmp( rhs );
883  smpSubAssign( ~lhs, tmp );
884  }
886  //**********************************************************************************************
887 
888  //**SMP subtraction assignment to sparse matrices***********************************************
889  // No special implementation for the SMP subtraction assignment to sparse matrices.
890  //**********************************************************************************************
891 
892  //**SMP multiplication assignment to dense matrices*********************************************
893  // No special implementation for the SMP multiplication assignment to dense matrices.
894  //**********************************************************************************************
895 
896  //**SMP multiplication assignment to sparse matrices********************************************
897  // No special implementation for the SMP multiplication assignment to sparse matrices.
898  //**********************************************************************************************
899 
900  //**Compile time checks*************************************************************************
905  //**********************************************************************************************
906 };
907 //*************************************************************************************************
908 
909 
910 
911 
912 //=================================================================================================
913 //
914 // GLOBAL FUNCTIONS
915 //
916 //=================================================================================================
917 
918 //*************************************************************************************************
935 template< typename MT // Type of the dense matrix
936  , bool SO > // Storage order
937 inline const DMatConjExpr<MT,SO> conj( const DenseMatrix<MT,SO>& dm )
938 {
940 
941  return DMatConjExpr<MT,SO>( ~dm );
942 }
943 //*************************************************************************************************
944 
945 
946 //*************************************************************************************************
972 template< typename MT // Type of the dense matrix
973  , bool SO > // Storage order
974 inline const typename CTransExprTrait<MT>::Type ctrans( const DenseMatrix<MT,SO>& dm )
975 {
977 
978  return trans( conj( ~dm ) );
979 }
980 //*************************************************************************************************
981 
982 
983 
984 
985 //=================================================================================================
986 //
987 // GLOBAL RESTRUCTURING FUNCTIONS
988 //
989 //=================================================================================================
990 
991 //*************************************************************************************************
1009 template< typename MT // Type of the dense matrix
1010  , bool SO > // Storage order
1011 inline typename DMatConjExpr<MT,SO>::Operand conj( const DMatConjExpr<MT,SO>& dm )
1012 {
1014 
1015  return dm.operand();
1016 }
1018 //*************************************************************************************************
1019 
1020 
1021 //*************************************************************************************************
1039 template< typename MT // Type of the dense matrix
1040  , bool SO > // Storage order
1041 inline const DMatTransExpr<MT,!SO> conj( const DMatTransExpr<DMatConjExpr<MT,SO>,!SO>& dm )
1042 {
1044 
1045  return DMatTransExpr<MT,!SO>( dm.operand().operand() );
1046 }
1048 //*************************************************************************************************
1049 
1050 
1051 
1052 
1053 //=================================================================================================
1054 //
1055 // ROWS SPECIALIZATIONS
1056 //
1057 //=================================================================================================
1058 
1059 //*************************************************************************************************
1061 template< typename MT, bool SO >
1062 struct Rows< DMatConjExpr<MT,SO> > : public Rows<MT>
1063 {};
1065 //*************************************************************************************************
1066 
1067 
1068 
1069 
1070 //=================================================================================================
1071 //
1072 // COLUMNS SPECIALIZATIONS
1073 //
1074 //=================================================================================================
1075 
1076 //*************************************************************************************************
1078 template< typename MT, bool SO >
1079 struct Columns< DMatConjExpr<MT,SO> > : public Columns<MT>
1080 {};
1082 //*************************************************************************************************
1083 
1084 
1085 
1086 
1087 //=================================================================================================
1088 //
1089 // ISALIGNED SPECIALIZATIONS
1090 //
1091 //=================================================================================================
1092 
1093 //*************************************************************************************************
1095 template< typename MT, bool SO >
1096 struct IsAligned< DMatConjExpr<MT,SO> > : public IsTrue< IsAligned<MT>::value >
1097 {};
1099 //*************************************************************************************************
1100 
1101 
1102 
1103 
1104 //=================================================================================================
1105 //
1106 // ISPADDED SPECIALIZATIONS
1107 //
1108 //=================================================================================================
1109 
1110 //*************************************************************************************************
1112 template< typename MT, bool SO >
1113 struct IsPadded< DMatConjExpr<MT,SO> > : public IsTrue< IsPadded<MT>::value >
1114 {};
1116 //*************************************************************************************************
1117 
1118 
1119 
1120 
1121 //=================================================================================================
1122 //
1123 // ISSYMMETRIC SPECIALIZATIONS
1124 //
1125 //=================================================================================================
1126 
1127 //*************************************************************************************************
1129 template< typename MT, bool SO >
1130 struct IsSymmetric< DMatConjExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
1131 {};
1133 //*************************************************************************************************
1134 
1135 
1136 
1137 
1138 //=================================================================================================
1139 //
1140 // ISHERMITIAN SPECIALIZATIONS
1141 //
1142 //=================================================================================================
1143 
1144 //*************************************************************************************************
1146 template< typename MT, bool SO >
1147 struct IsHermitian< DMatConjExpr<MT,SO> > : public IsTrue< IsHermitian<MT>::value >
1148 {};
1150 //*************************************************************************************************
1151 
1152 
1153 
1154 
1155 //=================================================================================================
1156 //
1157 // ISLOWER SPECIALIZATIONS
1158 //
1159 //=================================================================================================
1160 
1161 //*************************************************************************************************
1163 template< typename MT, bool SO >
1164 struct IsLower< DMatConjExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
1165 {};
1167 //*************************************************************************************************
1168 
1169 
1170 
1171 
1172 //=================================================================================================
1173 //
1174 // ISUNILOWER SPECIALIZATIONS
1175 //
1176 //=================================================================================================
1177 
1178 //*************************************************************************************************
1180 template< typename MT, bool SO >
1181 struct IsUniLower< DMatConjExpr<MT,SO> > : public IsTrue< IsUniLower<MT>::value >
1182 {};
1184 //*************************************************************************************************
1185 
1186 
1187 
1188 
1189 //=================================================================================================
1190 //
1191 // ISSTRICTLYLOWER SPECIALIZATIONS
1192 //
1193 //=================================================================================================
1194 
1195 //*************************************************************************************************
1197 template< typename MT, bool SO >
1198 struct IsStrictlyLower< DMatConjExpr<MT,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
1199 {};
1201 //*************************************************************************************************
1202 
1203 
1204 
1205 
1206 //=================================================================================================
1207 //
1208 // ISUPPER SPECIALIZATIONS
1209 //
1210 //=================================================================================================
1211 
1212 //*************************************************************************************************
1214 template< typename MT, bool SO >
1215 struct IsUpper< DMatConjExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
1216 {};
1218 //*************************************************************************************************
1219 
1220 
1221 
1222 
1223 //=================================================================================================
1224 //
1225 // ISUNIUPPER SPECIALIZATIONS
1226 //
1227 //=================================================================================================
1228 
1229 //*************************************************************************************************
1231 template< typename MT, bool SO >
1232 struct IsUniUpper< DMatConjExpr<MT,SO> > : public IsTrue< IsUniUpper<MT>::value >
1233 {};
1235 //*************************************************************************************************
1236 
1237 
1238 
1239 
1240 //=================================================================================================
1241 //
1242 // ISSTRICTLYUPPER SPECIALIZATIONS
1243 //
1244 //=================================================================================================
1245 
1246 //*************************************************************************************************
1248 template< typename MT, bool SO >
1249 struct IsStrictlyUpper< DMatConjExpr<MT,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
1250 {};
1252 //*************************************************************************************************
1253 
1254 
1255 
1256 
1257 //=================================================================================================
1258 //
1259 // EXPRESSION TRAIT SPECIALIZATIONS
1260 //
1261 //=================================================================================================
1262 
1263 //*************************************************************************************************
1265 template< typename MT >
1266 struct DMatConjExprTrait< DMatConjExpr<MT,false> >
1267 {
1268  public:
1269  //**********************************************************************************************
1270  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1271  , typename DMatConjExpr<MT,false>::Operand
1272  , INVALID_TYPE >::Type Type;
1273  //**********************************************************************************************
1274 };
1276 //*************************************************************************************************
1277 
1278 
1279 //*************************************************************************************************
1281 template< typename MT >
1282 struct TDMatConjExprTrait< DMatConjExpr<MT,true> >
1283 {
1284  public:
1285  //**********************************************************************************************
1286  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1287  , typename DMatConjExpr<MT,true>::Operand
1288  , INVALID_TYPE >::Type Type;
1289  //**********************************************************************************************
1290 };
1292 //*************************************************************************************************
1293 
1294 
1295 //*************************************************************************************************
1297 template< typename MT >
1298 struct DMatConjExprTrait< DMatTransExpr< DMatConjExpr<MT,true>, false > >
1299 {
1300  public:
1301  //**********************************************************************************************
1302  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1303  , DMatTransExpr<MT,false>
1304  , INVALID_TYPE >::Type Type;
1305  //**********************************************************************************************
1306 };
1308 //*************************************************************************************************
1309 
1310 
1311 //*************************************************************************************************
1313 template< typename MT >
1314 struct TDMatConjExprTrait< DMatTransExpr< DMatConjExpr<MT,false>, true > >
1315 {
1316  public:
1317  //**********************************************************************************************
1318  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1319  , DMatTransExpr<MT,true>
1320  , INVALID_TYPE >::Type Type;
1321  //**********************************************************************************************
1322 };
1324 //*************************************************************************************************
1325 
1326 
1327 //*************************************************************************************************
1329 template< typename MT, bool SO, bool AF >
1330 struct SubmatrixExprTrait< DMatConjExpr<MT,SO>, AF >
1331 {
1332  public:
1333  //**********************************************************************************************
1334  typedef typename ConjExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1335  //**********************************************************************************************
1336 };
1338 //*************************************************************************************************
1339 
1340 
1341 //*************************************************************************************************
1343 template< typename MT, bool SO >
1344 struct RowExprTrait< DMatConjExpr<MT,SO> >
1345 {
1346  public:
1347  //**********************************************************************************************
1348  typedef typename ConjExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1349  //**********************************************************************************************
1350 };
1352 //*************************************************************************************************
1353 
1354 
1355 //*************************************************************************************************
1357 template< typename MT, bool SO >
1358 struct ColumnExprTrait< DMatConjExpr<MT,SO> >
1359 {
1360  public:
1361  //**********************************************************************************************
1362  typedef typename ConjExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1363  //**********************************************************************************************
1364 };
1366 //*************************************************************************************************
1367 
1368 } // namespace blaze
1369 
1370 #endif
Pointer difference type of the Blaze library.
ValueType value_type
Type of the underlying elements.
Definition: DMatConjExpr.h:199
ElementType & ReferenceType
Reference return type.
Definition: DMatConjExpr.h:194
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatConjExpr.h:412
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatConjExpr.h:530
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatConjExpr.h:584
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DMatConjExpr.h:213
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatConjExpr.h:224
#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
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatConjExpr.h:310
#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
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: DMatConjExpr.h:168
Header file for the ColumnExprTrait class template.
IteratorType it_
Iterator to the current matrix element.
Definition: DMatConjExpr.h:419
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatConjExpr.h:332
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatConjExpr.h:376
Header file for the IsColumnMajorMatrix type trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatConjExpr.h:192
MT::ElementType ET
Element type of the dense matrix expression.
Definition: DMatConjExpr.h:115
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the MatConjExpr base class.
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
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatConjExpr.h:343
Header file for the Computation base class.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DMatConjExpr.h:175
Header file for the RequiresEvaluation type trait.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DMatConjExpr.h:181
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatConjExpr.h:510
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatConjExpr.h:365
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatConjExpr.h:195
Constraint on the data type.
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Constraint on the data type.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatConjExpr.h:499
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatConjExpr.h:388
ElementType * PointerType
Pointer return type.
Definition: DMatConjExpr.h:193
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
IntrinsicTrait< ET >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatConjExpr.h:172
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatConjExpr.h:354
Header file for the IsTemporary type trait class.
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
ConjExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatConjExpr.h:128
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatConjExpr.h:483
#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
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatConjExpr.h:321
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
Expression object for the dense matrix conj() function.The DMatConjExpr class represents the compile ...
Definition: DMatConjExpr.h:108
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatConjExpr.h:450
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatConjExpr.h:552
#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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraints on the storage order of matrix types.
DMatConjExpr(const MT &dm)
Constructor for the DMatConjExpr class.
Definition: DMatConjExpr.h:438
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatConjExpr.h:170
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
Header file for the serial shim.
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatConjExpr.h:299
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatConjExpr.h:114
Header file for the conjugate shim.
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
Evaluation of the return type of a complex conjugate expression.Via this type trait it is possible to...
Definition: ConjExprTrait.h:87
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
Utility type for generic codes.
Header file for the TDMatConjExprTrait class template.
MT::ElementType ElementType
Resulting element type.
Definition: DMatConjExpr.h:171
Header file for the DMatConjExprTrait class template.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
PointerType pointer
Pointer return type.
Definition: DMatConjExpr.h:200
DifferenceType difference_type
Difference between two iterators.
Definition: DMatConjExpr.h:202
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatConjExpr.h:205
Evaluation of the return type of a conjugate transpose expression.Via this type trait it is possible ...
Definition: CTransExprTrait.h:87
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatConjExpr.h:191
#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
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
ReferenceType reference
Reference return type.
Definition: DMatConjExpr.h:201
IteratorCategory iterator_category
The iterator category.
Definition: DMatConjExpr.h:198
Header file for the IsRowMajorMatrix type trait.
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.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatConjExpr.h:258
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
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
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatConjExpr.h:268
#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.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatConjExpr.h:564
Operand operand() const
Returns the dense matrix operand.
Definition: DMatConjExpr.h:540
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatConjExpr.h:465
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatConjExpr.h:169
Header file for the IsUpper type trait.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatConjExpr.h:279
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatConjExpr.h:574
Header file for exception macros.
SelectType< useAssign, const ResultType, const DMatConjExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatConjExpr.h:178
Header file for the CTransExprTrait class template.
Operand dm_
Dense matrix of the complex conjugate expression.
Definition: DMatConjExpr.h:591
Base class for all matrix complex conjugate expression templates.The MatConjExpr class serves as a ta...
Definition: MatConjExpr.h:65
Header file for the IsHermitian type trait.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatConjExpr.h:289
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatConjExpr.h:520
Header file for the ConjExprTrait class template.
DMatConjExpr< MT, SO > This
Type of this DMatConjExpr instance.
Definition: DMatConjExpr.h:167
System settings for the inline keywords.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatConjExpr.h:400
#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
Iterator over the elements of the dense matrix.
Definition: DMatConjExpr.h:187
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatConjExpr.h:247
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatConjExpr.h:236