SMatConjExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATCONJEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATCONJEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
44 #include <iterator>
79 #include <blaze/util/Assert.h>
81 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/Exception.h>
83 #include <blaze/util/InvalidType.h>
85 #include <blaze/util/SelectType.h>
86 #include <blaze/util/Types.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // CLASS SMATCONJEXPR
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
106 template< typename MT // Type of the sparse matrix
107  , bool SO > // Storage order
108 class SMatConjExpr : public SparseMatrix< SMatConjExpr<MT,SO>, SO >
109  , private MatConjExpr
110  , private Computation
111 {
112  private:
113  //**Type definitions****************************************************************************
114  typedef typename MT::ResultType RT;
115  typedef typename MT::ReturnType RN;
116  typedef typename MT::CompositeType CT;
117  //**********************************************************************************************
118 
119  //**Return type evaluation**********************************************************************
121 
126  enum { returnExpr = !IsTemporary<RN>::value };
127 
130  //**********************************************************************************************
131 
132  //**Serial evaluation strategy******************************************************************
134 
140  enum { useAssign = RequiresEvaluation<MT>::value };
141 
143  template< typename MT2 >
145  struct UseAssign {
146  enum { value = useAssign };
147  };
149  //**********************************************************************************************
150 
151  //**Parallel evaluation strategy****************************************************************
153 
159  template< typename MT2 >
160  struct UseSMPAssign {
161  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
162  };
164  //**********************************************************************************************
165 
166  public:
167  //**Type definitions****************************************************************************
169  typedef typename MT::ResultType ResultType;
170  typedef typename MT::OppositeType OppositeType;
171  typedef typename MT::TransposeType TransposeType;
172  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*************************************************************************
193 
196 
197  typedef std::forward_iterator_tag IteratorCategory;
198  typedef Element ValueType;
199  typedef ValueType* PointerType;
200  typedef ValueType& ReferenceType;
202 
203  // STL iterator requirements
204  typedef IteratorCategory iterator_category;
205  typedef ValueType value_type;
206  typedef PointerType pointer;
207  typedef ReferenceType reference;
208  typedef DifferenceType difference_type;
209  //*******************************************************************************************
210 
211  //**Constructor******************************************************************************
214  inline ConstIterator( IteratorType it )
215  : it_( it ) // Iterator over the elements of the sparse matrix expression
216  {}
217  //*******************************************************************************************
218 
219  //**Prefix increment operator****************************************************************
225  ++it_;
226  return *this;
227  }
228  //*******************************************************************************************
229 
230  //**Element access operator******************************************************************
235  inline const Element operator*() const {
236  return Element( conj( it_->value() ), it_->index() );
237  }
238  //*******************************************************************************************
239 
240  //**Element access operator******************************************************************
245  inline const ConstIterator* operator->() const {
246  return this;
247  }
248  //*******************************************************************************************
249 
250  //**Value function***************************************************************************
255  inline ReturnType value() const {
256  return conj( it_->value() );
257  }
258  //*******************************************************************************************
259 
260  //**Index function***************************************************************************
265  inline size_t index() const {
266  return it_->index();
267  }
268  //*******************************************************************************************
269 
270  //**Equality operator************************************************************************
276  inline bool operator==( const ConstIterator& rhs ) const {
277  return it_ == rhs.it_;
278  }
279  //*******************************************************************************************
280 
281  //**Inequality operator**********************************************************************
287  inline bool operator!=( const ConstIterator& rhs ) const {
288  return it_ != rhs.it_;
289  }
290  //*******************************************************************************************
291 
292  //**Subtraction operator*********************************************************************
298  inline DifferenceType operator-( const ConstIterator& rhs ) const {
299  return it_ - rhs.it_;
300  }
301  //*******************************************************************************************
302 
303  private:
304  //**Member variables*************************************************************************
305  IteratorType it_;
306  //*******************************************************************************************
307  };
308  //**********************************************************************************************
309 
310  //**Compilation flags***************************************************************************
312  enum { smpAssignable = MT::smpAssignable };
313  //**********************************************************************************************
314 
315  //**Constructor*********************************************************************************
320  explicit inline SMatConjExpr( const MT& sm )
321  : sm_( sm ) // Sparse matrix of the complex conjugate expression
322  {}
323  //**********************************************************************************************
324 
325  //**Access operator*****************************************************************************
332  inline ReturnType operator()( size_t i, size_t j ) const {
333  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
334  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
335  return conj( sm_(i,j) );
336  }
337  //**********************************************************************************************
338 
339  //**At function*********************************************************************************
347  inline ReturnType at( size_t i, size_t j ) const {
348  if( i >= sm_.rows() ) {
349  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
350  }
351  if( j >= sm_.columns() ) {
352  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
353  }
354  return (*this)(i,j);
355  }
356  //**********************************************************************************************
357 
358  //**Begin function******************************************************************************
364  inline ConstIterator begin( size_t i ) const {
365  return ConstIterator( sm_.begin(i) );
366  }
367  //**********************************************************************************************
368 
369  //**End function********************************************************************************
375  inline ConstIterator end( size_t i ) const {
376  return ConstIterator( sm_.end(i) );
377  }
378  //**********************************************************************************************
379 
380  //**Rows function*******************************************************************************
385  inline size_t rows() const {
386  return sm_.rows();
387  }
388  //**********************************************************************************************
389 
390  //**Columns function****************************************************************************
395  inline size_t columns() const {
396  return sm_.columns();
397  }
398  //**********************************************************************************************
399 
400  //**NonZeros function***************************************************************************
405  inline size_t nonZeros() const {
406  return sm_.nonZeros();
407  }
408  //**********************************************************************************************
409 
410  //**NonZeros function***************************************************************************
416  inline size_t nonZeros( size_t i ) const {
417  return sm_.nonZeros(i);
418  }
419  //**********************************************************************************************
420 
421  //**Find function*******************************************************************************
428  inline ConstIterator find( size_t i, size_t j ) const {
430  return ConstIterator( sm_.find( i, j ) );
431  }
432  //**********************************************************************************************
433 
434  //**LowerBound function*************************************************************************
441  inline ConstIterator lowerBound( size_t i, size_t j ) const {
443  return ConstIterator( sm_.lowerBound( i, j ) );
444  }
445  //**********************************************************************************************
446 
447  //**UpperBound function*************************************************************************
454  inline ConstIterator upperBound( size_t i, size_t j ) const {
456  return ConstIterator( sm_.upperBound( i, j ) );
457  }
458  //**********************************************************************************************
459 
460  //**Operand access******************************************************************************
465  inline Operand operand() const {
466  return sm_;
467  }
468  //**********************************************************************************************
469 
470  //**********************************************************************************************
476  template< typename T >
477  inline bool canAlias( const T* alias ) const {
478  return sm_.canAlias( alias );
479  }
480  //**********************************************************************************************
481 
482  //**********************************************************************************************
488  template< typename T >
489  inline bool isAliased( const T* alias ) const {
490  return sm_.isAliased( alias );
491  }
492  //**********************************************************************************************
493 
494  //**********************************************************************************************
499  inline bool canSMPAssign() const {
500  return sm_.canSMPAssign();
501  }
502  //**********************************************************************************************
503 
504  private:
505  //**Member variables****************************************************************************
506  Operand sm_;
507  //**********************************************************************************************
508 
509  //**Assignment to dense matrices****************************************************************
523  template< typename MT2 // Type of the target dense matrix
524  , bool SO2 > // Storage order of the target dense matrix
525  friend inline typename EnableIf< UseAssign<MT2> >::Type
526  assign( DenseMatrix<MT2,SO2>& lhs, const SMatConjExpr& rhs )
527  {
529 
530  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
531  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
532 
533  assign( ~lhs, rhs.sm_ );
534  assign( ~lhs, conj( ~lhs ) );
535  }
537  //**********************************************************************************************
538 
539  //**Assignment to row-major sparse matrices*****************************************************
553  template< typename MT2 > // Type of the target sparse matrix
554  friend inline typename EnableIf< UseAssign<MT2> >::Type
555  assign( SparseMatrix<MT2,false>& lhs, const SMatConjExpr& rhs )
556  {
558 
559  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
560  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
561 
562  typedef typename MT2::Iterator Iterator;
563 
564  assign( ~lhs, rhs.sm_ );
565 
566  const size_t m( rhs.rows() );
567 
568  for( size_t i=0UL; i<m; ++i ) {
569  const Iterator end( (~lhs).end(i) );
570  for( Iterator element=(~lhs).begin(i); element!=end; ++element ) {
571  conjugate( element->value() );
572  }
573  }
574  }
576  //**********************************************************************************************
577 
578  //**Assignment to column-major sparse matrices**************************************************
592  template< typename MT2 > // Type of the target sparse matrix
593  friend inline typename EnableIf< UseAssign<MT2> >::Type
594  assign( SparseMatrix<MT2,true>& lhs, const SMatConjExpr& rhs )
595  {
597 
598  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
599  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
600 
601  typedef typename MT2::Iterator Iterator;
602 
603  assign( ~lhs, rhs.sm_ );
604 
605  const size_t n( rhs.columns() );
606 
607  for( size_t j=0UL; j<n; ++j ) {
608  const Iterator end( (~lhs).end(j) );
609  for( Iterator element=(~lhs).begin(j); element!=end; ++element ) {
610  conjugate( element->value() );
611  }
612  }
613  }
615  //**********************************************************************************************
616 
617  //**Addition assignment to dense matrices*******************************************************
631  template< typename MT2 // Type of the target dense matrix
632  , bool SO2 > // Storage order of the target dense matrix
633  friend inline typename EnableIf< UseAssign<MT2> >::Type
634  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatConjExpr& rhs )
635  {
637 
640 
641  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
642  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
643 
644  const ResultType tmp( serial( rhs ) );
645  addAssign( ~lhs, tmp );
646  }
648  //**********************************************************************************************
649 
650  //**Addition assignment to sparse matrices******************************************************
651  // No special implementation for the addition assignment to sparse matrices.
652  //**********************************************************************************************
653 
654  //**Subtraction assignment to dense matrices****************************************************
668  template< typename MT2 // Type of the target dense matrix
669  , bool SO2 > // Storage order of the target sparse matrix
670  friend inline typename EnableIf< UseAssign<MT2> >::Type
671  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatConjExpr& rhs )
672  {
674 
677 
678  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
679  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
680 
681  const ResultType tmp( serial( rhs ) );
682  subAssign( ~lhs, tmp );
683  }
685  //**********************************************************************************************
686 
687  //**Subtraction assignment to sparse matrices***************************************************
688  // No special implementation for the subtraction assignment to sparse matrices.
689  //**********************************************************************************************
690 
691  //**Multiplication assignment to dense matrices*************************************************
692  // No special implementation for the multiplication assignment to dense matrices.
693  //**********************************************************************************************
694 
695  //**Multiplication assignment to sparse matrices************************************************
696  // No special implementation for the multiplication assignment to sparse matrices.
697  //**********************************************************************************************
698 
699  //**SMP assignment to dense matrices************************************************************
713  template< typename MT2 // Type of the target dense matrix
714  , bool SO2 > // Storage order of the target dense matrix
715  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
716  smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatConjExpr& rhs )
717  {
719 
720  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
721  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
722 
723  smpAssign( ~lhs, rhs.sm_ );
724  smpAssign( ~lhs, conj( ~lhs ) );
725  }
727  //**********************************************************************************************
728 
729  //**SMP assignment to sparse matrices***********************************************************
730  // No special implementation for the SMP assignment to sparse matrices.
731  //**********************************************************************************************
732 
733  //**SMP addition assignment to dense matrices***************************************************
747  template< typename MT2 // Type of the target dense matrix
748  , bool SO2 > // Storage order of the target dense matrix
749  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
750  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatConjExpr& rhs )
751  {
753 
756 
757  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
758  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
759 
760  const ResultType tmp( rhs );
761  smpAddAssign( ~lhs, tmp );
762  }
764  //**********************************************************************************************
765 
766  //**SMP addition assignment to sparse matrices**************************************************
767  // No special implementation for the SMP addition assignment to sparse matrices.
768  //**********************************************************************************************
769 
770  //**SMP subtraction assignment to dense matrices************************************************
784  template< typename MT2 // Type of the target dense matrix
785  , bool SO2 > // Storage order of the target sparse matrix
786  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
787  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatConjExpr& rhs )
788  {
790 
793 
794  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
795  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
796 
797  const ResultType tmp( rhs );
798  smpSubAssign( ~lhs, tmp );
799  }
801  //**********************************************************************************************
802 
803  //**SMP subtraction assignment to sparse matrices***********************************************
804  // No special implementation for the SMP subtraction assignment to sparse matrices.
805  //**********************************************************************************************
806 
807  //**SMP multiplication assignment to dense matrices*********************************************
808  // No special implementation for the SMP multiplication assignment to dense matrices.
809  //**********************************************************************************************
810 
811  //**SMP multiplication assignment to sparse matrices********************************************
812  // No special implementation for the SMP multiplication assignment to sparse matrices.
813  //**********************************************************************************************
814 
815  //**Compile time checks*************************************************************************
820  //**********************************************************************************************
821 };
822 //*************************************************************************************************
823 
824 
825 
826 
827 //=================================================================================================
828 //
829 // GLOBAL FUNCTIONS
830 //
831 //=================================================================================================
832 
833 //*************************************************************************************************
850 template< typename MT // Type of the sparse matrix
851  , bool SO > // Storage order
853 {
855 
856  return SMatConjExpr<MT,SO>( ~sm );
857 }
858 //*************************************************************************************************
859 
860 
861 //*************************************************************************************************
887 template< typename MT // Type of the sparse matrix
888  , bool SO > // Storage order
889 inline const typename CTransExprTrait<MT>::Type ctrans( const SparseMatrix<MT,SO>& sm )
890 {
892 
893  return trans( conj( ~sm ) );
894 }
895 //*************************************************************************************************
896 
897 
898 
899 
900 //=================================================================================================
901 //
902 // GLOBAL RESTRUCTURING FUNCTIONS
903 //
904 //=================================================================================================
905 
906 //*************************************************************************************************
924 template< typename MT // Type of the sparse matrix
925  , bool TF > // Transpose flag
926 inline typename SMatConjExpr<MT,TF>::Operand conj( const SMatConjExpr<MT,TF>& sm )
927 {
929 
930  return sm.operand();
931 }
933 //*************************************************************************************************
934 
935 
936 //*************************************************************************************************
954 template< typename MT // Type of the sparse matrix
955  , bool SO > // Storage order
956 inline const SMatTransExpr<MT,!SO> conj( const SMatTransExpr<SMatConjExpr<MT,SO>,!SO>& sm )
957 {
959 
960  return SMatTransExpr<MT,!SO>( sm.operand().operand() );
961 }
963 //*************************************************************************************************
964 
965 
966 
967 
968 //=================================================================================================
969 //
970 // ROWS SPECIALIZATIONS
971 //
972 //=================================================================================================
973 
974 //*************************************************************************************************
976 template< typename MT, bool SO >
977 struct Rows< SMatConjExpr<MT,SO> > : public Rows<MT>
978 {};
980 //*************************************************************************************************
981 
982 
983 
984 
985 //=================================================================================================
986 //
987 // COLUMNS SPECIALIZATIONS
988 //
989 //=================================================================================================
990 
991 //*************************************************************************************************
993 template< typename MT, bool SO >
994 struct Columns< SMatConjExpr<MT,SO> > : public Columns<MT>
995 {};
997 //*************************************************************************************************
998 
999 
1000 
1001 
1002 //=================================================================================================
1003 //
1004 // ISSYMMETRIC SPECIALIZATIONS
1005 //
1006 //=================================================================================================
1007 
1008 //*************************************************************************************************
1010 template< typename MT, bool SO >
1011 struct IsSymmetric< SMatConjExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
1012 {};
1014 //*************************************************************************************************
1015 
1016 
1017 
1018 
1019 //=================================================================================================
1020 //
1021 // ISHERMITIAN SPECIALIZATIONS
1022 //
1023 //=================================================================================================
1024 
1025 //*************************************************************************************************
1027 template< typename MT, bool SO >
1028 struct IsHermitian< SMatConjExpr<MT,SO> > : public IsTrue< IsHermitian<MT>::value >
1029 {};
1031 //*************************************************************************************************
1032 
1033 
1034 
1035 
1036 //=================================================================================================
1037 //
1038 // ISLOWER SPECIALIZATIONS
1039 //
1040 //=================================================================================================
1041 
1042 //*************************************************************************************************
1044 template< typename MT, bool SO >
1045 struct IsLower< SMatConjExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
1046 {};
1048 //*************************************************************************************************
1049 
1050 
1051 
1052 
1053 //=================================================================================================
1054 //
1055 // ISUNILOWER SPECIALIZATIONS
1056 //
1057 //=================================================================================================
1058 
1059 //*************************************************************************************************
1061 template< typename MT, bool SO >
1062 struct IsUniLower< SMatConjExpr<MT,SO> > : public IsTrue< IsUniLower<MT>::value >
1063 {};
1065 //*************************************************************************************************
1066 
1067 
1068 
1069 
1070 //=================================================================================================
1071 //
1072 // ISSTRICTLYLOWER SPECIALIZATIONS
1073 //
1074 //=================================================================================================
1075 
1076 //*************************************************************************************************
1078 template< typename MT, bool SO >
1079 struct IsStrictlyLower< SMatConjExpr<MT,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
1080 {};
1082 //*************************************************************************************************
1083 
1084 
1085 
1086 
1087 //=================================================================================================
1088 //
1089 // ISUPPER SPECIALIZATIONS
1090 //
1091 //=================================================================================================
1092 
1093 //*************************************************************************************************
1095 template< typename MT, bool SO >
1096 struct IsUpper< SMatConjExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
1097 {};
1099 //*************************************************************************************************
1100 
1101 
1102 
1103 
1104 //=================================================================================================
1105 //
1106 // ISUNIUPPER SPECIALIZATIONS
1107 //
1108 //=================================================================================================
1109 
1110 //*************************************************************************************************
1112 template< typename MT, bool SO >
1113 struct IsUniUpper< SMatConjExpr<MT,SO> > : public IsTrue< IsUniUpper<MT>::value >
1114 {};
1116 //*************************************************************************************************
1117 
1118 
1119 
1120 
1121 //=================================================================================================
1122 //
1123 // ISSTRICTLYUPPER SPECIALIZATIONS
1124 //
1125 //=================================================================================================
1126 
1127 //*************************************************************************************************
1129 template< typename MT, bool SO >
1130 struct IsStrictlyUpper< SMatConjExpr<MT,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
1131 {};
1133 //*************************************************************************************************
1134 
1135 
1136 
1137 
1138 //=================================================================================================
1139 //
1140 // EXPRESSION TRAIT SPECIALIZATIONS
1141 //
1142 //=================================================================================================
1143 
1144 //*************************************************************************************************
1146 template< typename MT >
1147 struct SMatConjExprTrait< SMatConjExpr<MT,false> >
1148 {
1149  public:
1150  //**********************************************************************************************
1151  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1152  , typename SMatConjExpr<MT,false>::Operand
1153  , INVALID_TYPE >::Type Type;
1154  //**********************************************************************************************
1155 };
1157 //*************************************************************************************************
1158 
1159 
1160 //*************************************************************************************************
1162 template< typename MT >
1163 struct TSMatConjExprTrait< SMatConjExpr<MT,true> >
1164 {
1165  public:
1166  //**********************************************************************************************
1167  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1168  , typename SMatConjExpr<MT,true>::Operand
1169  , INVALID_TYPE >::Type Type;
1170  //**********************************************************************************************
1171 };
1173 //*************************************************************************************************
1174 
1175 
1176 //*************************************************************************************************
1178 template< typename MT >
1179 struct SMatConjExprTrait< SMatTransExpr< SMatConjExpr<MT,true>, false > >
1180 {
1181  public:
1182  //**********************************************************************************************
1183  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1184  , SMatTransExpr<MT,false>
1185  , INVALID_TYPE >::Type Type;
1186  //**********************************************************************************************
1187 };
1189 //*************************************************************************************************
1190 
1191 
1192 //*************************************************************************************************
1194 template< typename MT >
1195 struct TSMatConjExprTrait< SMatTransExpr< SMatConjExpr<MT,false>, true > >
1196 {
1197  public:
1198  //**********************************************************************************************
1199  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1200  , SMatTransExpr<MT,true>
1201  , INVALID_TYPE >::Type Type;
1202  //**********************************************************************************************
1203 };
1205 //*************************************************************************************************
1206 
1207 
1208 //*************************************************************************************************
1210 template< typename MT, bool SO, bool AF >
1211 struct SubmatrixExprTrait< SMatConjExpr<MT,SO>, AF >
1212 {
1213  public:
1214  //**********************************************************************************************
1215  typedef typename ConjExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1216  //**********************************************************************************************
1217 };
1219 //*************************************************************************************************
1220 
1221 
1222 //*************************************************************************************************
1224 template< typename MT, bool SO >
1225 struct RowExprTrait< SMatConjExpr<MT,SO> >
1226 {
1227  public:
1228  //**********************************************************************************************
1229  typedef typename ConjExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1230  //**********************************************************************************************
1231 };
1233 //*************************************************************************************************
1234 
1235 
1236 //*************************************************************************************************
1238 template< typename MT, bool SO >
1239 struct ColumnExprTrait< SMatConjExpr<MT,SO> >
1240 {
1241  public:
1242  //**********************************************************************************************
1243  typedef typename ConjExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1244  //**********************************************************************************************
1245 };
1247 //*************************************************************************************************
1248 
1249 } // namespace blaze
1250 
1251 #endif
Expression object for the sparse matrix conj() function.The SMatConjExpr class represents the compile...
Definition: Forward.h:96
Pointer difference type of the Blaze library.
ValueType value_type
Type of the underlying pointers.
Definition: SMatConjExpr.h:205
ValueType * PointerType
Pointer return type.
Definition: SMatConjExpr.h:199
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.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatConjExpr.h:235
#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
Header file for the ColumnExprTrait class template.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatConjExpr.h:192
Header file for the IsColumnMajorMatrix type trait.
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatConjExpr.h:171
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: SMatConjExpr.h:169
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
Header file for the Computation base class.
Header file for the TSMatConjExprTrait class template.
Header file for the RequiresEvaluation type trait.
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatConjExpr.h:245
Header file for the SMatConjExprTrait class template.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatConjExpr.h:332
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
SelectType< useAssign, const ResultType, const SMatConjExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatConjExpr.h:178
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
Constraint on the data type.
ConjExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatConjExpr.h:129
Header file for the SparseMatrix base class.
PointerType pointer
Pointer return type.
Definition: SMatConjExpr.h:206
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
ValueType & ReferenceType
Reference return type.
Definition: SMatConjExpr.h:200
Constraint on the data type.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatConjExpr.h:305
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatConjExpr.h:499
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
Header file for the ValueIndexPair class.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
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
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatConjExpr.h:364
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatConjExpr.h:201
#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
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatConjExpr.h:347
Header file for the Columns type trait.
Operand operand() const
Returns the sparse matrix operand.
Definition: SMatConjExpr.h:465
BLAZE_ALWAYS_INLINE void conjugate(T &a)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
Header file for the IsLower type trait.
Element ValueType
Type of the underlying pointers.
Definition: SMatConjExpr.h:198
#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
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatConjExpr.h:428
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraints on the storage order of matrix types.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatConjExpr.h:375
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatConjExpr.h:405
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Operand sm_
Sparse matrix of the complex conjugate expression.
Definition: SMatConjExpr.h:506
Constraint on the data type.
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Iterator over the elements of the sparse matrix complex conjugate expression.
Definition: SMatConjExpr.h:187
IteratorCategory iterator_category
The iterator category.
Definition: SMatConjExpr.h:204
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatConjExpr.h:114
Header file for the serial shim.
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatConjExpr.h:170
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatConjExpr.h:298
Header file for the conjugate shim.
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatConjExpr.h:454
SMatConjExpr< MT, SO > This
Type of this SMatConjExpr instance.
Definition: SMatConjExpr.h:168
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 IsSparseVector type trait.
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
DifferenceType difference_type
Difference between two iterators.
Definition: SMatConjExpr.h:208
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatConjExpr.h:255
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.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatConjExpr.h:276
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatConjExpr.h:385
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatConjExpr.h:287
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatConjExpr.h:116
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatConjExpr.h:175
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatConjExpr.h:477
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatConjExpr.h:195
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatConjExpr.h:489
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Evaluation of the return type of a conjugate transpose expression.Via this type trait it is possible ...
Definition: CTransExprTrait.h:87
Header file for the RemoveReference type trait.
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatConjExpr.h:197
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatConjExpr.h:224
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
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.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatConjExpr.h:265
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SMatConjExpr.h:214
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatConjExpr.h:115
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the CTransExprTrait class template.
Header file for the IsHermitian type trait.
SMatConjExpr(const MT &sm)
Constructor for the SMatConjExpr class.
Definition: SMatConjExpr.h:320
Header file for the ConjExprTrait class template.
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatConjExpr.h:441
#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
ReferenceType reference
Reference return type.
Definition: SMatConjExpr.h:207
MT::ElementType ElementType
Resulting element type.
Definition: SMatConjExpr.h:172
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatConjExpr.h:395
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the sparse matrix expression.
Definition: SMatConjExpr.h:181
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatConjExpr.h:416
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.