SMatDeclHermExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLHERMEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDECLHERMEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
75 #include <blaze/util/Assert.h>
76 #include <blaze/util/DisableIf.h>
77 #include <blaze/util/EmptyType.h>
78 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/InvalidType.h>
82 #include <blaze/util/mpl/And.h>
83 #include <blaze/util/mpl/If.h>
84 #include <blaze/util/TrueType.h>
85 #include <blaze/util/Types.h>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS SMATDECLHERMEXPR
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
104 template< typename MT // Type of the sparse matrix
105  , bool SO > // Storage order
106 class SMatDeclHermExpr : public SparseMatrix< SMatDeclHermExpr<MT,SO>, SO >
107  , private DeclHermExpr
108  , private If< IsComputation<MT>, Computation, EmptyType >::Type
109 {
110  private:
111  //**Serial evaluation strategy******************************************************************
113 
119  enum : bool { useAssign = RequiresEvaluation<MT>::value };
120 
122  template< typename MT2 >
124  struct UseAssign {
125  enum : bool { value = useAssign };
126  };
128  //**********************************************************************************************
129 
130  //**Parallel evaluation strategy****************************************************************
132 
137  template< typename MT2 >
138  struct UseSMPAssign {
139  enum : bool { value = MT2::smpAssignable && useAssign };
140  };
142  //**********************************************************************************************
143 
144  //**********************************************************************************************
146 
150  template< typename MT2 >
151  struct GetConstIterator {
153  struct Success { using Type = typename MT2::ConstIterator; };
154  struct Failure { using Type = INVALID_TYPE; };
155  using Type = typename If_< HasConstIterator<MT2>, Success, Failure >::Type;
156  };
158  //**********************************************************************************************
159 
160  public:
161  //**Type definitions****************************************************************************
168 
171 
173  typedef typename GetConstIterator<MT>::Type ConstIterator;
174 
176  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
177  //**********************************************************************************************
178 
179  //**Compilation flags***************************************************************************
181  enum : bool { smpAssignable = MT::smpAssignable };
182  //**********************************************************************************************
183 
184  //**Constructor*********************************************************************************
189  explicit inline SMatDeclHermExpr( const MT& sm ) noexcept
190  : sm_( sm ) // Sparse matrix of the declherm expression
191  {}
192  //**********************************************************************************************
193 
194  //**Access operator*****************************************************************************
201  inline ReturnType operator()( size_t i, size_t j ) const {
202  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
203  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
204  return sm_(i,j);
205  }
206  //**********************************************************************************************
207 
208  //**At function*********************************************************************************
216  inline ReturnType at( size_t i, size_t j ) const {
217  if( i >= sm_.rows() ) {
218  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
219  }
220  if( j >= sm_.columns() ) {
221  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
222  }
223  return (*this)(i,j);
224  }
225  //**********************************************************************************************
226 
227  //**Begin function******************************************************************************
233  inline ConstIterator begin( size_t i ) const {
234  return ConstIterator( sm_.begin(i) );
235  }
236  //**********************************************************************************************
237 
238  //**End function********************************************************************************
244  inline ConstIterator end( size_t i ) const {
245  return ConstIterator( sm_.end(i) );
246  }
247  //**********************************************************************************************
248 
249  //**Rows function*******************************************************************************
254  inline size_t rows() const noexcept {
255  return sm_.rows();
256  }
257  //**********************************************************************************************
258 
259  //**Columns function****************************************************************************
264  inline size_t columns() const noexcept {
265  return sm_.columns();
266  }
267  //**********************************************************************************************
268 
269  //**NonZeros function***************************************************************************
274  inline size_t nonZeros() const {
275  return sm_.nonZeros();
276  }
277  //**********************************************************************************************
278 
279  //**NonZeros function***************************************************************************
285  inline size_t nonZeros( size_t i ) const {
286  return sm_.nonZeros(i);
287  }
288  //**********************************************************************************************
289 
290  //**Operand access******************************************************************************
295  inline Operand operand() const noexcept {
296  return sm_;
297  }
298  //**********************************************************************************************
299 
300  //**********************************************************************************************
306  template< typename T >
307  inline bool canAlias( const T* alias ) const noexcept {
308  return sm_.canAlias( alias );
309  }
310  //**********************************************************************************************
311 
312  //**********************************************************************************************
318  template< typename T >
319  inline bool isAliased( const T* alias ) const noexcept {
320  return sm_.isAliased( alias );
321  }
322  //**********************************************************************************************
323 
324  //**********************************************************************************************
329  inline bool canSMPAssign() const noexcept {
330  return sm_.canSMPAssign();
331  }
332  //**********************************************************************************************
333 
334  private:
335  //**Member variables****************************************************************************
336  Operand sm_;
337  //**********************************************************************************************
338 
339  //**Assignment to dense matrices****************************************************************
351  template< typename MT2 // Type of the target dense matrix
352  , bool SO2 > // Storage order of the target dense matrix
353  friend inline EnableIf_< UseAssign<MT2> >
354  assign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
355  {
357 
358  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
359  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
360 
361  assign( ~lhs, rhs.sm_ );
362  }
364  //**********************************************************************************************
365 
366  //**Assignment to sparse matrices***************************************************************
378  template< typename MT2 // Type of the target sparse matrix
379  , bool SO2 > // Storage order of the target sparse matrix
380  friend inline EnableIf_< UseAssign<MT2> >
381  assign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
382  {
384 
385  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
386  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
387 
388  assign( ~lhs, rhs.sm_ );
389  }
391  //**********************************************************************************************
392 
393  //**Addition assignment to dense matrices*******************************************************
405  template< typename MT2 // Type of the target dense matrix
406  , bool SO2 > // Storage order of the target dense matrix
407  friend inline EnableIf_< UseAssign<MT2> >
408  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
409  {
411 
412  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
413  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
414 
415  addAssign( ~lhs, rhs.sm_ );
416  }
418  //**********************************************************************************************
419 
420  //**Addition assignment to sparse matrices******************************************************
432  template< typename MT2 // Type of the target sparse matrix
433  , bool SO2 > // Storage order of the target sparse matrix
434  friend inline EnableIf_< UseAssign<MT2> >
435  addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
436  {
438 
439  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
440  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
441 
442  addAssign( ~lhs, rhs.sm_ );
443  }
445  //**********************************************************************************************
446 
447  //**Subtraction assignment to dense matrices****************************************************
459  template< typename MT2 // Type of the target dense matrix
460  , bool SO2 > // Storage order of the target dense matrix
461  friend inline EnableIf_< UseAssign<MT2> >
462  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
463  {
465 
466  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
467  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
468 
469  subAssign( ~lhs, rhs.sm_ );
470  }
472  //**********************************************************************************************
473 
474  //**Subtraction assignment to sparse matrices***************************************************
486  template< typename MT2 // Type of the target sparse matrix
487  , bool SO2 > // Storage order of the target sparse matrix
488  friend inline EnableIf_< UseAssign<MT2> >
489  subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
490  {
492 
493  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
494  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
495 
496  subAssign( ~lhs, rhs.sm_ );
497  }
499  //**********************************************************************************************
500 
501  //**Multiplication assignment to dense matrices*************************************************
513  template< typename MT2 // Type of the target dense matrix
514  , bool SO2 > // Storage order of the target dense matrix
515  friend inline EnableIf_< UseAssign<MT2> >
516  multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
517  {
519 
520  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
521  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
522 
523  multAssign( ~lhs, rhs.sm_ );
524  }
526  //**********************************************************************************************
527 
528  //**Multiplication assignment to sparse matrices************************************************
540  template< typename MT2 // Type of the target sparse matrix
541  , bool SO2 > // Storage order of the target sparse matrix
542  friend inline EnableIf_< UseAssign<MT2> >
543  multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclHermExpr& rhs )
544  {
546 
547  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
548  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
549 
550  multAssign( ~lhs, rhs.sm_ );
551  }
553  //**********************************************************************************************
554 
555  //**SMP assignment to dense matrices************************************************************
567  template< typename MT2 // Type of the target dense matrix
568  , bool SO2 > // Storage order of the target dense matrix
569  friend inline EnableIf_< UseSMPAssign<MT2> >
571  {
573 
574  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
575  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
576 
577  smpAssign( ~lhs, rhs.sm_ );
578  }
580  //**********************************************************************************************
581 
582  //**SMP assignment to sparse matrices***********************************************************
594  template< typename MT2 // Type of the target sparse matrix
595  , bool SO2 > // Storage order of the target sparse matrix
596  friend inline EnableIf_< UseSMPAssign<MT2> >
598  {
600 
601  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
602  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
603 
604  smpAssign( ~lhs, rhs.sm_ );
605  }
607  //**********************************************************************************************
608 
609  //**SMP addition assignment to dense matrices***************************************************
621  template< typename MT2 // Type of the target dense matrix
622  , bool SO2 > // Storage order of the target dense matrix
623  friend inline EnableIf_< UseSMPAssign<MT2> >
625  {
627 
628  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
629  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
630 
631  smpAddAssign( ~lhs, rhs.sm_ );
632  }
634  //**********************************************************************************************
635 
636  //**SMP addition assignment to sparse matrices**************************************************
648  template< typename MT2 // Type of the target sparse matrix
649  , bool SO2 > // Storage order of the target sparse matrix
650  friend inline EnableIf_< UseSMPAssign<MT2> >
652  {
654 
655  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
656  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
657 
658  smpAddAssign( ~lhs, rhs.sm_ );
659  }
661  //**********************************************************************************************
662 
663  //**SMP subtraction assignment to dense matrices************************************************
675  template< typename MT2 // Type of the target dense matrix
676  , bool SO2 > // Storage order of the target dense matrix
677  friend inline EnableIf_< UseSMPAssign<MT2> >
679  {
681 
682  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
683  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
684 
685  smpSubAssign( ~lhs, rhs.sm_ );
686  }
688  //**********************************************************************************************
689 
690  //**SMP subtraction assignment to sparse matrices***********************************************
702  template< typename MT2 // Type of the target sparse matrix
703  , bool SO2 > // Storage order of the target sparse matrix
704  friend inline EnableIf_< UseSMPAssign<MT2> >
706  {
708 
709  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
710  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
711 
712  smpSubAssign( ~lhs, rhs.sm_ );
713  }
715  //**********************************************************************************************
716 
717  //**SMP multiplication assignment to dense matrices*********************************************
730  template< typename MT2 // Type of the target dense matrix
731  , bool SO2 > // Storage order of the target dense matrix
732  friend inline EnableIf_< UseSMPAssign<MT2> >
734  {
736 
737  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
738  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
739 
740  smpMultAssign( ~lhs, rhs.sm_ );
741  }
743  //**********************************************************************************************
744 
745  //**SMP multiplication assignment to sparse matrices********************************************
758  template< typename MT2 // Type of the target sparse matrix
759  , bool SO2 > // Storage order of the target sparse matrix
760  friend inline EnableIf_< UseSMPAssign<MT2> >
762  {
764 
765  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
766  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
767 
768  smpMultAssign( ~lhs, rhs.sm_ );
769  }
771  //**********************************************************************************************
772 
773  //**Compile time checks*************************************************************************
779  //**********************************************************************************************
780 };
781 //*************************************************************************************************
782 
783 
784 
785 
786 //=================================================================================================
787 //
788 // GLOBAL FUNCTIONS
789 //
790 //=================================================================================================
791 
792 //*************************************************************************************************
811 template< typename MT // Type of the sparse matrix
812  , bool SO > // Storage order
815 {
817 
818  if( !isSquare( ~sm ) ) {
819  BLAZE_THROW_INVALID_ARGUMENT( "Invalid Hermitian matrix specification" );
820  }
821 
822  return SMatDeclHermExpr<MT,SO>( ~sm );
823 }
824 //*************************************************************************************************
825 
826 
827 //*************************************************************************************************
837 template< typename MT // Type of the sparse matrix
838  , bool SO > // Storage order
839 inline EnableIf_< IsHermitian<MT>, const MT& >
841 {
843 
844  return ~sm;
845 }
846 //*************************************************************************************************
847 
848 
849 
850 
851 //=================================================================================================
852 //
853 // GLOBAL RESTRUCTURING FUNCTIONS
854 //
855 //=================================================================================================
856 
857 //*************************************************************************************************
871 template< typename MT // Type of the left-hand side sparse matrix
872  , typename ST // Type of the right-hand side scalar value
873  , bool SO > // Storage order
874 inline const DisableIf_< IsHermitian<MT>, MultExprTrait_< DeclHermExprTrait_<MT>, ST > >
876 {
878 
879  if( !isSquare( ~sm ) ) {
880  BLAZE_THROW_INVALID_ARGUMENT( "Invalid Hermitian matrix specification" );
881  }
882 
883  return declherm( sm.leftOperand() ) * sm.rightOperand();
884 }
886 //*************************************************************************************************
887 
888 
889 
890 
891 //=================================================================================================
892 //
893 // ROWS SPECIALIZATIONS
894 //
895 //=================================================================================================
896 
897 //*************************************************************************************************
899 template< typename MT, bool SO >
900 struct Rows< SMatDeclHermExpr<MT,SO> > : public Rows<MT>
901 {};
903 //*************************************************************************************************
904 
905 
906 
907 
908 //=================================================================================================
909 //
910 // COLUMNS SPECIALIZATIONS
911 //
912 //=================================================================================================
913 
914 //*************************************************************************************************
916 template< typename MT, bool SO >
917 struct Columns< SMatDeclHermExpr<MT,SO> > : public Columns<MT>
918 {};
920 //*************************************************************************************************
921 
922 
923 
924 
925 //=================================================================================================
926 //
927 // ISSYMMETRIC SPECIALIZATIONS
928 //
929 //=================================================================================================
930 
931 //*************************************************************************************************
933 template< typename MT, bool SO >
934 struct IsSymmetric< SMatDeclHermExpr<MT,SO> >
935  : public BoolConstant< IsSymmetric<MT>::value >
936 {};
938 //*************************************************************************************************
939 
940 
941 
942 
943 //=================================================================================================
944 //
945 // ISHERMITIAN SPECIALIZATIONS
946 //
947 //=================================================================================================
948 
949 //*************************************************************************************************
951 template< typename MT, bool SO >
952 struct IsHermitian< SMatDeclHermExpr<MT,SO> >
953  : public TrueType
954 {};
956 //*************************************************************************************************
957 
958 
959 
960 
961 //=================================================================================================
962 //
963 // ISLOWER SPECIALIZATIONS
964 //
965 //=================================================================================================
966 
967 //*************************************************************************************************
969 template< typename MT, bool SO >
970 struct IsLower< SMatDeclHermExpr<MT,SO> >
971  : public BoolConstant< IsLower<MT>::value >
972 {};
974 //*************************************************************************************************
975 
976 
977 
978 
979 //=================================================================================================
980 //
981 // ISUNILOWER SPECIALIZATIONS
982 //
983 //=================================================================================================
984 
985 //*************************************************************************************************
987 template< typename MT, bool SO >
988 struct IsUniLower< SMatDeclHermExpr<MT,SO> >
989  : public BoolConstant< IsUniLower<MT>::value >
990 {};
992 //*************************************************************************************************
993 
994 
995 
996 
997 //=================================================================================================
998 //
999 // ISSTRICTLYLOWER SPECIALIZATIONS
1000 //
1001 //=================================================================================================
1002 
1003 //*************************************************************************************************
1005 template< typename MT, bool SO >
1006 struct IsStrictlyLower< SMatDeclHermExpr<MT,SO> >
1007  : public BoolConstant< IsStrictlyLower<MT>::value >
1008 {};
1010 //*************************************************************************************************
1011 
1012 
1013 
1014 
1015 //=================================================================================================
1016 //
1017 // ISUPPER SPECIALIZATIONS
1018 //
1019 //=================================================================================================
1020 
1021 //*************************************************************************************************
1023 template< typename MT, bool SO >
1024 struct IsUpper< SMatDeclHermExpr<MT,SO> >
1025  : public BoolConstant< IsUpper<MT>::value >
1026 {};
1028 //*************************************************************************************************
1029 
1030 
1031 
1032 
1033 //=================================================================================================
1034 //
1035 // ISUNIUPPER SPECIALIZATIONS
1036 //
1037 //=================================================================================================
1038 
1039 //*************************************************************************************************
1041 template< typename MT, bool SO >
1042 struct IsUniUpper< SMatDeclHermExpr<MT,SO> >
1043  : public BoolConstant< IsUniUpper<MT>::value >
1044 {};
1046 //*************************************************************************************************
1047 
1048 
1049 
1050 
1051 //=================================================================================================
1052 //
1053 // ISSTRICTLYUPPER SPECIALIZATIONS
1054 //
1055 //=================================================================================================
1056 
1057 //*************************************************************************************************
1059 template< typename MT, bool SO >
1060 struct IsStrictlyUpper< SMatDeclHermExpr<MT,SO> >
1061  : public BoolConstant< IsStrictlyUpper<MT>::value >
1062 {};
1064 //*************************************************************************************************
1065 
1066 
1067 
1068 
1069 //=================================================================================================
1070 //
1071 // EXPRESSION TRAIT SPECIALIZATIONS
1072 //
1073 //=================================================================================================
1074 
1075 //*************************************************************************************************
1077 template< typename MT, typename ST >
1078 struct SMatDeclHermExprTrait< SMatScalarMultExpr<MT,ST,false> >
1079 {
1080  public:
1081  //**********************************************************************************************
1083  , MultExprTrait_< DeclHermExprTrait_<MT>, ST >
1084  , INVALID_TYPE >;
1085  //**********************************************************************************************
1086 };
1088 //*************************************************************************************************
1089 
1090 
1091 //*************************************************************************************************
1093 template< typename MT, typename ST >
1094 struct TSMatDeclHermExprTrait< SMatScalarMultExpr<MT,ST,true> >
1095 {
1096  public:
1097  //**********************************************************************************************
1099  , MultExprTrait_< DeclHermExprTrait_<MT>, ST >
1100  , INVALID_TYPE >;
1101  //**********************************************************************************************
1102 };
1104 //*************************************************************************************************
1105 
1106 
1107 //*************************************************************************************************
1109 template< typename MT, bool SO, bool AF >
1110 struct SubmatrixExprTrait< SMatDeclHermExpr<MT,SO>, AF >
1111 {
1112  public:
1113  //**********************************************************************************************
1114  using Type = SubmatrixExprTrait_<const MT,AF>;
1115  //**********************************************************************************************
1116 };
1118 //*************************************************************************************************
1119 
1120 
1121 //*************************************************************************************************
1123 template< typename MT, bool SO >
1124 struct RowExprTrait< SMatDeclHermExpr<MT,SO> >
1125 {
1126  public:
1127  //**********************************************************************************************
1128  using Type = RowExprTrait_<const MT>;
1129  //**********************************************************************************************
1130 };
1132 //*************************************************************************************************
1133 
1134 
1135 //*************************************************************************************************
1137 template< typename MT, bool SO >
1138 struct ColumnExprTrait< SMatDeclHermExpr<MT,SO> >
1139 {
1140  public:
1141  //**********************************************************************************************
1142  using Type = ColumnExprTrait_<const MT>;
1143  //**********************************************************************************************
1144 };
1146 //*************************************************************************************************
1147 
1148 } // namespace blaze
1149 
1150 #endif
typename SubmatrixExprTrait< MT, AF >::Type SubmatrixExprTrait_
Auxiliary alias declaration for the SubmatrixExprTrait type trait.The SubmatrixExprTrait_ alias decla...
Definition: SubmatrixExprTrait.h:134
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for the DeclHermExprTrait class template.
Header file for auxiliary alias declarations.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatDeclHermExpr.h:274
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:492
Header file for basic type definitions.
Evaluation of the expression type of a sparse matrix declherm operation.Via this type trait it is pos...
Definition: TSMatDeclHermExprTrait.h:75
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseMatrix type trait.
#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:63
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the ColumnExprTrait class template.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDeclHermExpr.h:319
Header file for the IsColumnMajorMatrix type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:482
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatDeclHermExpr.h:167
Header file for the And class template.
If_< RequiresEvaluation< MT >, const ResultType, const SMatDeclHermExpr &> CompositeType
Data type for composite expression templates.
Definition: SMatDeclHermExpr.h:170
Header file for the TSMatDeclHermExprTrait class template.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
#define BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT(TYPE_TRAIT_NAME, MEMBER_NAME)
Macro for the creation of a type trait for compile time checks for member types.This macro creates th...
Definition: HasMember.h:182
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDeclHermExpr.h:165
SMatDeclHermExpr< MT, SO > This
Type of this SMatDeclHermExpr instance.
Definition: SMatDeclHermExpr.h:162
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDeclHermExpr.h:329
Header file for the Computation base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDeclHermExpr.h:254
Header file for the RequiresEvaluation type trait.
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > 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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDeclHermExpr.h:201
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDeclHermExpr.h:164
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
Constraint on the data type.
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
Operand sm_
Sparse matrix of the declherm expression.
Definition: SMatDeclHermExpr.h:336
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDeclHermExpr.h:216
DisableIf_< IsHermitian< MT >, const DMatDeclHermExpr< MT, SO > > declherm(const DenseMatrix< MT, SO > &dm)
Declares the given non-Hermitian dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:841
SMatDeclHermExpr(const MT &sm) noexcept
Constructor for the SMatDeclHermExpr class.
Definition: SMatDeclHermExpr.h:189
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Header file for the DisableIf class template.
typename RowExprTrait< MT >::Type RowExprTrait_
Auxiliary alias declaration for the RowExprTrait type trait.The RowExprTrait_ alias declaration provi...
Definition: RowExprTrait.h:134
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
Header file for the DeclHermExpr base class.
Header file for the If class template.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDeclHermExpr.h:307
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatDeclHermExpr.h:295
EnableIf_< IsDenseMatrix< MT1 > > 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
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
Header file for the IsLower type trait.
Evaluation of the expression type of a sparse matrix declherm operation.Via this type trait it is pos...
Definition: SMatDeclHermExprTrait.h:75
Header file for the SMatDeclHermExprTrait class template.
typename ColumnExprTrait< MT >::Type ColumnExprTrait_
Auxiliary alias declaration for the ColumnExprTrait type trait.The ColumnExprTrait_ alias declaration...
Definition: ColumnExprTrait.h:133
GetConstIterator< MT >::Type ConstIterator
Iterator over the elements of the dense matrix.
Definition: SMatDeclHermExpr.h:173
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatDeclHermExpr.h:244
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:106
Header file for all forward declarations for expression class templates.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDeclHermExpr.h:264
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatDeclHermExpr.h:285
Header file for the SubmatrixExprTrait class template.
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatDeclHermExpr.h:176
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Header file for the HasMember type traits.
Expression object for the explicit Hermitian declaration of sparse matrices.The SMatDeclHermExpr clas...
Definition: Forward.h:96
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
ElementType_< MT > ElementType
Resulting element type.
Definition: SMatDeclHermExpr.h:166
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
Header file for the IsRowMajorMatrix type trait.
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatDeclHermExpr.h:233
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Header file for the empty type.
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: SMatDeclHermExpr.h:163
Header file for the IsHermitian type trait.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:677
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Header file for the TrueType type/value trait base class.
Header file for the IsExpression type trait class.
Header file for the function trace functionality.