DMatDeclLowExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLLOWEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATDECLLOWEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
45 #include <blaze/math/Aliases.h>
51 #include <blaze/math/Exception.h>
72 #include <blaze/util/Assert.h>
73 #include <blaze/util/DisableIf.h>
74 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/InvalidType.h>
77 #include <blaze/util/mpl/And.h>
78 #include <blaze/util/mpl/If.h>
79 #include <blaze/util/mpl/Not.h>
80 #include <blaze/util/mpl/Or.h>
81 #include <blaze/util/TrueType.h>
82 #include <blaze/util/Types.h>
84 
85 
86 namespace blaze {
87 
88 //=================================================================================================
89 //
90 // CLASS DMATDECLLOWEXPR
91 //
92 //=================================================================================================
93 
94 //*************************************************************************************************
101 template< typename MT // Type of the dense matrix
102  , bool SO > // Storage order
104  : public DeclLowExpr< DenseMatrix< DMatDeclLowExpr<MT,SO>, SO > >
105  , public Declaration<MT>
106 {
107  private:
108  //**Type definitions****************************************************************************
109  using RT = ResultType_<MT>;
110  //**********************************************************************************************
111 
112  //**Serial evaluation strategy******************************************************************
114 
120  enum : bool { useAssign = RequiresEvaluation<MT>::value };
121 
123  template< typename MT2 >
125  struct UseAssign {
126  enum : bool { value = useAssign };
127  };
129  //**********************************************************************************************
130 
131  //**Parallel evaluation strategy****************************************************************
133 
138  template< typename MT2 >
139  struct UseSMPAssign {
140  enum : bool { value = MT2::smpAssignable && useAssign };
141  };
143  //**********************************************************************************************
144 
145  //**********************************************************************************************
147 
151  template< typename MT2 >
152  struct GetConstIterator {
154  struct Success { using Type = typename MT2::ConstIterator; };
155  struct Failure { using Type = INVALID_TYPE; };
156  using Type = typename If_< HasConstIterator<MT2>, Success, Failure >::Type;
157  };
159  //**********************************************************************************************
160 
161  public:
162  //**Type definitions****************************************************************************
169 
172 
174  using ConstIterator = typename GetConstIterator<MT>::Type;
175 
177  using Operand = If_< IsExpression<MT>, const MT, const MT& >;
178  //**********************************************************************************************
179 
180  //**Compilation flags***************************************************************************
182  enum : bool { simdEnabled = MT::simdEnabled };
183 
185  enum : bool { smpAssignable = MT::smpAssignable };
186  //**********************************************************************************************
187 
188  //**SIMD properties*****************************************************************************
190  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
191  //**********************************************************************************************
192 
193  //**Constructor*********************************************************************************
198  explicit inline DMatDeclLowExpr( const MT& dm ) noexcept
199  : dm_( dm ) // Dense matrix of the decllow expression
200  {
201  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
202  }
203  //**********************************************************************************************
204 
205  //**Access operator*****************************************************************************
212  inline ReturnType operator()( size_t i, size_t j ) const {
213  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
214  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
215  return dm_(i,j);
216  }
217  //**********************************************************************************************
218 
219  //**At function*********************************************************************************
227  inline ReturnType at( size_t i, size_t j ) const {
228  if( i >= dm_.rows() ) {
229  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
230  }
231  if( j >= dm_.columns() ) {
232  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
233  }
234  return (*this)(i,j);
235  }
236  //**********************************************************************************************
237 
238  //**Load function*******************************************************************************
245  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
246  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
247  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
248  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
249  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
250  return dm_.load(i,j);
251  }
252  //**********************************************************************************************
253 
254  //**Low-level data access***********************************************************************
259  inline const ElementType* data() const noexcept {
260  return dm_.data();
261  }
262  //**********************************************************************************************
263 
264  //**Begin function******************************************************************************
270  inline ConstIterator begin( size_t i ) const {
271  return ConstIterator( dm_.begin(i) );
272  }
273  //**********************************************************************************************
274 
275  //**End function********************************************************************************
281  inline ConstIterator end( size_t i ) const {
282  return ConstIterator( dm_.end(i) );
283  }
284  //**********************************************************************************************
285 
286  //**Rows function*******************************************************************************
291  inline size_t rows() const noexcept {
292  return dm_.rows();
293  }
294  //**********************************************************************************************
295 
296  //**Columns function****************************************************************************
301  inline size_t columns() const noexcept {
302  return dm_.columns();
303  }
304  //**********************************************************************************************
305 
306  //**Operand access******************************************************************************
311  inline Operand operand() const noexcept {
312  return dm_;
313  }
314  //**********************************************************************************************
315 
316  //**********************************************************************************************
322  template< typename T >
323  inline bool canAlias( const T* alias ) const noexcept {
324  return dm_.canAlias( alias );
325  }
326  //**********************************************************************************************
327 
328  //**********************************************************************************************
334  template< typename T >
335  inline bool isAliased( const T* alias ) const noexcept {
336  return dm_.isAliased( alias );
337  }
338  //**********************************************************************************************
339 
340  //**********************************************************************************************
345  inline bool isAligned() const noexcept {
346  return dm_.isAligned();
347  }
348  //**********************************************************************************************
349 
350  //**********************************************************************************************
355  inline bool canSMPAssign() const noexcept {
356  return dm_.canSMPAssign();
357  }
358  //**********************************************************************************************
359 
360  private:
361  //**Member variables****************************************************************************
363  //**********************************************************************************************
364 
365  //**Assignment to dense matrices****************************************************************
377  template< typename MT2 // Type of the target dense matrix
378  , bool SO2 > // Storage order of the target dense matrix
379  friend inline EnableIf_< UseAssign<MT2> >
380  assign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
381  {
383 
384  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
385  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
386 
387  assign( ~lhs, rhs.dm_ );
388  }
390  //**********************************************************************************************
391 
392  //**Assignment to sparse matrices***************************************************************
404  template< typename MT2 // Type of the target sparse matrix
405  , bool SO2 > // Storage order of the target dense matrix
406  friend inline EnableIf_< UseAssign<MT2> >
407  assign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
408  {
410 
411  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
412  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
413 
414  assign( ~lhs, rhs.dm_ );
415  }
417  //**********************************************************************************************
418 
419  //**Addition assignment to dense matrices*******************************************************
431  template< typename MT2 // Type of the target dense matrix
432  , bool SO2 > // Storage order of the target dense matrix
433  friend inline EnableIf_< UseAssign<MT2> >
434  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
435  {
437 
438  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
439  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
440 
441  addAssign( ~lhs, rhs.dm_ );
442  }
444  //**********************************************************************************************
445 
446  //**Addition assignment to sparse matrices******************************************************
458  template< typename MT2 // Type of the target sparse matrix
459  , bool SO2 > // Storage order of the target dense matrix
460  friend inline EnableIf_< UseAssign<MT2> >
461  addAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
462  {
464 
465  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
466  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
467 
468  addAssign( ~lhs, rhs.dm_ );
469  }
471  //**********************************************************************************************
472 
473  //**Subtraction assignment to dense matrices****************************************************
485  template< typename MT2 // Type of the target dense matrix
486  , bool SO2 > // Storage order of the target dense matrix
487  friend inline EnableIf_< UseAssign<MT2> >
488  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
489  {
491 
492  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
493  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
494 
495  subAssign( ~lhs, rhs.dm_ );
496  }
498  //**********************************************************************************************
499 
500  //**Subtraction assignment to sparse matrices***************************************************
512  template< typename MT2 // Type of the target sparse matrix
513  , bool SO2 > // Storage order of the target dense matrix
514  friend inline EnableIf_< UseAssign<MT2> >
515  subAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
516  {
518 
519  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
520  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
521 
522  subAssign( ~lhs, rhs.dm_ );
523  }
525  //**********************************************************************************************
526 
527  //**Schur product assignment to dense matrices**************************************************
539  template< typename MT2 // Type of the target dense matrix
540  , bool SO2 > // Storage order of the target dense matrix
541  friend inline EnableIf_< UseAssign<MT2> >
542  schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
543  {
545 
546  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
547  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
548 
549  schurAssign( ~lhs, rhs.dm_ );
550  }
552  //**********************************************************************************************
553 
554  //**Schur product assignment to sparse matrices*************************************************
566  template< typename MT2 // Type of the target sparse matrix
567  , bool SO2 > // Storage order of the target dense matrix
568  friend inline EnableIf_< UseAssign<MT2> >
569  schurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
570  {
572 
573  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
574  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
575 
576  schurAssign( ~lhs, rhs.dm_ );
577  }
579  //**********************************************************************************************
580 
581  //**Multiplication assignment to dense matrices*************************************************
593  template< typename MT2 // Type of the target dense matrix
594  , bool SO2 > // Storage order of the target dense matrix
595  friend inline EnableIf_< UseAssign<MT2> >
596  multAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
597  {
599 
600  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
601  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
602 
603  multAssign( ~lhs, rhs.dm_ );
604  }
606  //**********************************************************************************************
607 
608  //**Multiplication assignment to sparse matrices************************************************
620  template< typename MT2 // Type of the target sparse matrix
621  , bool SO2 > // Storage order of the target dense matrix
622  friend inline EnableIf_< UseAssign<MT2> >
623  multAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
624  {
626 
627  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
628  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
629 
630  multAssign( ~lhs, rhs.dm_ );
631  }
633  //**********************************************************************************************
634 
635  //**SMP assignment to dense matrices************************************************************
647  template< typename MT2 // Type of the target dense matrix
648  , bool SO2 > // Storage order of the target dense matrix
649  friend inline EnableIf_< UseSMPAssign<MT2> >
650  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
651  {
653 
654  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
655  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
656 
657  smpAssign( ~lhs, rhs.dm_ );
658  }
660  //**********************************************************************************************
661 
662  //**SMP assignment to sparse matrices***********************************************************
674  template< typename MT2 // Type of the target sparse matrix
675  , bool SO2 > // Storage order of the target dense matrix
676  friend inline EnableIf_< UseSMPAssign<MT2> >
677  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
678  {
680 
681  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
682  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
683 
684  smpAssign( ~lhs, rhs.dm_ );
685  }
687  //**********************************************************************************************
688 
689  //**SMP addition assignment to dense matrices***************************************************
701  template< typename MT2 // Type of the target dense matrix
702  , bool SO2 > // Storage order of the target dense matrix
703  friend inline EnableIf_< UseSMPAssign<MT2> >
704  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
705  {
707 
708  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
709  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
710 
711  smpAddAssign( ~lhs, rhs.dm_ );
712  }
714  //**********************************************************************************************
715 
716  //**SMP addition assignment to sparse matrices**************************************************
728  template< typename MT2 // Type of the target sparse matrix
729  , bool SO2 > // Storage order of the target dense matrix
730  friend inline EnableIf_< UseSMPAssign<MT2> >
731  smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
732  {
734 
735  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
736  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
737 
738  smpAddAssign( ~lhs, rhs.dm_ );
739  }
741  //**********************************************************************************************
742 
743  //**SMP subtraction assignment to dense matrices************************************************
755  template< typename MT2 // Type of the target dense matrix
756  , bool SO2 > // Storage order of the target dense matrix
757  friend inline EnableIf_< UseSMPAssign<MT2> >
758  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
759  {
761 
762  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
763  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
764 
765  smpSubAssign( ~lhs, rhs.dm_ );
766  }
768  //**********************************************************************************************
769 
770  //**SMP subtraction assignment to sparse matrices***********************************************
782  template< typename MT2 // Type of the target sparse matrix
783  , bool SO2 > // Storage order of the target dense matrix
784  friend inline EnableIf_< UseSMPAssign<MT2> >
785  smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
786  {
788 
789  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
790  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
791 
792  smpSubAssign( ~lhs, rhs.dm_ );
793  }
795  //**********************************************************************************************
796 
797  //**SMP Schur product assignment to dense matrices**********************************************
809  template< typename MT2 // Type of the target dense matrix
810  , bool SO2 > // Storage order of the target dense matrix
811  friend inline EnableIf_< UseSMPAssign<MT2> >
812  smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
813  {
815 
816  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
817  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
818 
819  smpSchurAssign( ~lhs, rhs.dm_ );
820  }
822  //**********************************************************************************************
823 
824  //**SMP Schur product assignment to sparse matrices*********************************************
836  template< typename MT2 // Type of the target sparse matrix
837  , bool SO2 > // Storage order of the target dense matrix
838  friend inline EnableIf_< UseSMPAssign<MT2> >
839  smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
840  {
842 
843  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
844  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
845 
846  smpSchurAssign( ~lhs, rhs.dm_ );
847  }
849  //**********************************************************************************************
850 
851  //**SMP multiplication assignment to dense matrices*********************************************
864  template< typename MT2 // Type of the target dense matrix
865  , bool SO2 > // Storage order of the target dense matrix
866  friend inline EnableIf_< UseSMPAssign<MT2> >
867  smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
868  {
870 
871  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
872  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
873 
874  smpMultAssign( ~lhs, rhs.dm_ );
875  }
877  //**********************************************************************************************
878 
879  //**SMP multiplication assignment to sparse matrices********************************************
892  template< typename MT2 // Type of the target sparse matrix
893  , bool SO2 > // Storage order of the target dense matrix
894  friend inline EnableIf_< UseSMPAssign<MT2> >
895  smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclLowExpr& rhs )
896  {
898 
899  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
900  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
901 
902  smpMultAssign( ~lhs, rhs.dm_ );
903  }
905  //**********************************************************************************************
906 
907  //**Compile time checks*************************************************************************
915  //**********************************************************************************************
916 };
917 //*************************************************************************************************
918 
919 
920 
921 
922 //=================================================================================================
923 //
924 // GLOBAL FUNCTIONS
925 //
926 //=================================================================================================
927 
928 //*************************************************************************************************
939 template< typename MT // Type of the dense matrix
940  , bool SO // Storage order
941  , typename = DisableIf_< Or< IsLower<MT>, IsUniUpper<MT> > > >
942 inline const DMatDeclLowExpr<MT,SO> decllow_backend( const DenseMatrix<MT,SO>& dm )
943 {
945 
946  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
947 
948  return DMatDeclLowExpr<MT,SO>( ~dm );
949 }
951 //*************************************************************************************************
952 
953 
954 //*************************************************************************************************
965 template< typename MT // Type of the dense matrix
966  , bool SO // Storage order
968 inline const IdentityMatrix<ElementType_<MT>,SO> decllow_backend( const DenseMatrix<MT,SO>& dm )
969 {
971 
972  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
973 
974  return IdentityMatrix<ElementType_<MT>,SO>( (~dm).rows() );
975 }
977 //*************************************************************************************************
978 
979 
980 //*************************************************************************************************
991 template< typename MT // Type of the dense matrix
992  , bool SO // Storage order
993  , typename = EnableIf_< IsLower<MT> > >
994 inline const MT& decllow_backend( const DenseMatrix<MT,SO>& dm )
995 {
997 
998  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
999 
1000  return ~dm;
1001 }
1003 //*************************************************************************************************
1004 
1005 
1006 //*************************************************************************************************
1024 template< typename MT // Type of the dense matrix
1025  , bool SO > // Storage order
1026 inline decltype(auto) decllow( const DenseMatrix<MT,SO>& dm )
1027 {
1029 
1030  if( !isSquare( ~dm ) ) {
1031  BLAZE_THROW_INVALID_ARGUMENT( "Invalid lower matrix specification" );
1032  }
1033 
1034  return decllow_backend( ~dm );
1035 }
1036 //*************************************************************************************************
1037 
1038 
1039 
1040 
1041 //=================================================================================================
1042 //
1043 // GLOBAL RESTRUCTURING FUNCTIONS
1044 //
1045 //=================================================================================================
1046 
1047 //*************************************************************************************************
1061 template< typename MT // Type of the left-hand side dense matrix
1062  , typename ST // Type of the right-hand side scalar value
1063  , bool SO // Storage order
1064  , typename = DisableIf_< IsLower<MT> > >
1065 inline decltype(auto) decllow( const DMatScalarMultExpr<MT,ST,SO>& dm )
1066 {
1068 
1069  if( !isSquare( ~dm ) ) {
1070  BLAZE_THROW_INVALID_ARGUMENT( "Invalid lower matrix specification" );
1071  }
1072 
1073  return decllow( dm.leftOperand() ) * dm.rightOperand();
1074 }
1076 //*************************************************************************************************
1077 
1078 
1079 
1080 
1081 //=================================================================================================
1082 //
1083 // SIZE SPECIALIZATIONS
1084 //
1085 //=================================================================================================
1086 
1087 //*************************************************************************************************
1089 template< typename MT, bool SO >
1090 struct Size< DMatDeclLowExpr<MT,SO>, 0UL >
1091  : public Size<MT,0UL>
1092 {};
1093 
1094 template< typename MT, bool SO >
1095 struct Size< DMatDeclLowExpr<MT,SO>, 1UL >
1096  : public Size<MT,1UL>
1097 {};
1099 //*************************************************************************************************
1100 
1101 
1102 
1103 
1104 //=================================================================================================
1105 //
1106 // HASCONSTDATAACCESS SPECIALIZATIONS
1107 //
1108 //=================================================================================================
1109 
1110 //*************************************************************************************************
1112 template< typename MT, bool SO >
1113 struct HasConstDataAccess< DMatDeclLowExpr<MT,SO> >
1114  : public HasConstDataAccess<MT>
1115 {};
1117 //*************************************************************************************************
1118 
1119 
1120 
1121 
1122 //=================================================================================================
1123 //
1124 // ISALIGNED SPECIALIZATIONS
1125 //
1126 //=================================================================================================
1127 
1128 //*************************************************************************************************
1130 template< typename MT, bool SO >
1131 struct IsAligned< DMatDeclLowExpr<MT,SO> >
1132  : public IsAligned<MT>
1133 {};
1135 //*************************************************************************************************
1136 
1137 
1138 
1139 
1140 //=================================================================================================
1141 //
1142 // ISSYMMETRIC SPECIALIZATIONS
1143 //
1144 //=================================================================================================
1145 
1146 //*************************************************************************************************
1148 template< typename MT, bool SO >
1149 struct IsSymmetric< DMatDeclLowExpr<MT,SO> >
1150  : public IsSymmetric<MT>
1151 {};
1153 //*************************************************************************************************
1154 
1155 
1156 
1157 
1158 //=================================================================================================
1159 //
1160 // ISHERMITIAN SPECIALIZATIONS
1161 //
1162 //=================================================================================================
1163 
1164 //*************************************************************************************************
1166 template< typename MT, bool SO >
1167 struct IsHermitian< DMatDeclLowExpr<MT,SO> >
1168  : public IsHermitian<MT>
1169 {};
1171 //*************************************************************************************************
1172 
1173 
1174 
1175 
1176 //=================================================================================================
1177 //
1178 // ISLOWER SPECIALIZATIONS
1179 //
1180 //=================================================================================================
1181 
1182 //*************************************************************************************************
1184 template< typename MT, bool SO >
1185 struct IsLower< DMatDeclLowExpr<MT,SO> >
1186  : public TrueType
1187 {};
1189 //*************************************************************************************************
1190 
1191 
1192 
1193 
1194 //=================================================================================================
1195 //
1196 // ISUNILOWER SPECIALIZATIONS
1197 //
1198 //=================================================================================================
1199 
1200 //*************************************************************************************************
1202 template< typename MT, bool SO >
1203 struct IsUniLower< DMatDeclLowExpr<MT,SO> >
1204  : public IsUniLower<MT>
1205 {};
1207 //*************************************************************************************************
1208 
1209 
1210 
1211 
1212 //=================================================================================================
1213 //
1214 // ISSTRICTLYLOWER SPECIALIZATIONS
1215 //
1216 //=================================================================================================
1217 
1218 //*************************************************************************************************
1220 template< typename MT, bool SO >
1221 struct IsStrictlyLower< DMatDeclLowExpr<MT,SO> >
1222  : public IsStrictlyLower<MT>
1223 {};
1225 //*************************************************************************************************
1226 
1227 
1228 
1229 
1230 //=================================================================================================
1231 //
1232 // ISUPPER SPECIALIZATIONS
1233 //
1234 //=================================================================================================
1235 
1236 //*************************************************************************************************
1238 template< typename MT, bool SO >
1239 struct IsUpper< DMatDeclLowExpr<MT,SO> >
1240  : public Or< IsSymmetric<MT>, IsHermitian<MT>, IsUpper<MT> >
1241 {};
1243 //*************************************************************************************************
1244 
1245 
1246 
1247 
1248 //=================================================================================================
1249 //
1250 // ISUNIUPPER SPECIALIZATIONS
1251 //
1252 //=================================================================================================
1253 
1254 //*************************************************************************************************
1256 template< typename MT, bool SO >
1257 struct IsUniUpper< DMatDeclLowExpr<MT,SO> >
1258  : public IsUniUpper<MT>
1259 {};
1261 //*************************************************************************************************
1262 
1263 
1264 
1265 
1266 //=================================================================================================
1267 //
1268 // ISSTRICTLYUPPER SPECIALIZATIONS
1269 //
1270 //=================================================================================================
1271 
1272 //*************************************************************************************************
1274 template< typename MT, bool SO >
1275 struct IsStrictlyUpper< DMatDeclLowExpr<MT,SO> >
1276  : public IsStrictlyUpper<MT>
1277 {};
1279 //*************************************************************************************************
1280 
1281 } // namespace blaze
1282 
1283 #endif
#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 auxiliary alias declarations.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclLowExpr.h:345
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for basic type definitions.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclLowExpr.h:301
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:164
#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
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Base class for all declaration expression templates.The Declaration class serves as a tag for all dec...
Definition: Declaration.h:70
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIUPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper unitriangular matrix type...
Definition: UniUpper.h:81
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:224
Header file for the And class template.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
#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
DeclLowTrait_< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclLowExpr.h:164
Expression object for the explicit lower declaration of dense matrices.The DMatDeclLowExpr class repr...
Definition: DMatDeclLowExpr.h:103
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclLowExpr.h:311
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
typename DeclLowTrait< MT >::Type DeclLowTrait_
Auxiliary alias declaration for the DeclLowTrait type trait.The DeclLowTrait_ alias declaration provi...
Definition: DeclLowTrait.h:156
Header file for the RequiresEvaluation type trait.
Constraint on the data type.
Header file for the SIMD 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:343
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:133
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclLowExpr.h:323
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for all forward declarations for sparse vectors and matrices.
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
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:71
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Efficient implementation of an identity matrix.The IdentityMatrix class template is the representati...
Definition: Forward.h:49
Header file for the DisableIf class template.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclLowExpr.h:355
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
ResultType_< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclLowExpr.h:109
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:102
Header file for the Or class template.
Expression object for dense matrix-scalar multiplications.The DMatScalarMultExpr class represents the...
Definition: DMatScalarMultExpr.h:107
Header file for the decllow trait.
#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
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclLowExpr.h:270
Header file for the DenseMatrix base class.
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1026
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a matrix/matrix multiplication expressio...
Definition: MatMatMultExpr.h:87
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclLowExpr.h:177
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DMatScalarMultExpr.h:564
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.
ElementType_< MT > ElementType
Resulting element type.
Definition: DMatDeclLowExpr.h:167
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclLowExpr.h:245
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Header file for the DeclLowExpr base class.
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclLowExpr.h:168
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Base class for all decllow expression templates.The DeclLowExpr class serves as a tag for all express...
Definition: DeclLowExpr.h:66
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
Header file for the HasConstDataAccess type trait.
Header file for the Declaration base class.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclLowExpr.h:212
Header file for run time assertion macros.
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:154
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclLowExpr.h:281
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclLowExpr.h:227
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclLowExpr.h:335
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
DMatDeclLowExpr(const MT &dm) noexcept
Constructor for the DMatDeclLowExpr class.
Definition: DMatDeclLowExpr.h:198
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclLowExpr.h:166
Header file for the HasMember type traits.
If_< RequiresEvaluation< MT >, const ResultType, const DMatDeclLowExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatDeclLowExpr.h:171
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
typename GetConstIterator< MT >::Type ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclLowExpr.h:174
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclLowExpr.h:291
Header file for the implementation of the base template of the LowerMatrix.
Compile time logical &#39;or&#39; evaluation.The Or alias declaration performs at compile time a logical &#39;or&#39;...
Definition: Or.h:76
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Operand dm_
Dense matrix of the decllow expression.
Definition: DMatDeclLowExpr.h:362
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
Constraint on the data type.
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:908
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarMultExpr.h:554
Header file for the Size type trait.
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclLowExpr.h:259
#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
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclLowExpr.h:165
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.